       error.getData(), error.getRows());
 
   gemm(fin, delta, _w, -learning_rate, 1.0f, true, false);
-  // _dw = ~const_cast<mat&>(fin) * delta;
 
 }
 

void Softmax::backPropagate(mat& error, const mat& fin, const mat& fout, float learning_rate) {

  mat error_times_fout = error & fout;
  mat sum = rowSum(error_times_fout);

  mat sum_times_fout = sum & fout;
  mat delta = error_times_fout - sum_times_fout;

  // Ignore last column, which is the bias
  size_t traceLength = delta.getCols() - 1;

}

void Sigmoid::feedForward(mat& fout, const mat& fin) {
  fout = ext::sigmoid(fin * _w);
  fillLastColumnWith(fout, (float) 1.0);
}

