# Pastebin Ttb9MeK5 template template void Softmax::Forward( const InputType&& input, OutputType&& output) { // This is how I am computing forward pass for softmax layer on mlpack 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? }