# Pastebin rUCrBFWF template template void Softmax::Forward( const InputType&& input, OutputType&& output) { arma::mat maxInput = arma::repmat(arma::max(input), input.n_rows, 1); arma::mat expInput = arma::exp(maxInput - input); // We will normalize the values to get probability. double sumExpInput = arma::sum(expInput); output = expInput/sumExpInput; } template template void Softmax::Backward( const arma::Mat&& input, arma::Mat&& gy, arma::Mat&& g) { // How should I compute here? }