22 template<
typename AReal>
23 void TReference<AReal>::Sigmoid(TMatrixT<AReal> & B,
24 const TMatrixT<AReal> & A)
30 for (
size_t i = 0; i < m; i++) {
31 for (
size_t j = 0; j < n; j++) {
32 AReal sig = 1.0 / (1.0 + std::exp(-A(i,j)));
38 template<
typename AReal>
39 void TReference<AReal>::Softmax(TMatrixT<AReal> & B,
40 const TMatrixT<AReal> & A)
46 for (
size_t i = 0; i < m; i++) {
48 for (
size_t j = 0; j < n; j++) {
51 for (
size_t j = 0; j < n; j++) {
52 B(i,j) = exp(A(i,j)) / sum;