| 30 | } |
| 31 | |
| 32 | Matrix<double> Network::computeOutput(std::vector<double> input) { |
| 33 | H[0] = Matrix<double>({input}); // row matrix |
| 34 | |
| 35 | for (int i = 1; i < hiddenLayersCount + 2; i++) { |
| 36 | H[i] = H[i - 1].dot(W[i - 1]).add(B[i - 1]).applyFunction(sigmoid); |
| 37 | } |
| 38 | |
| 39 | return H[hiddenLayersCount + 1]; |
| 40 | } |
| 41 | |
| 42 | void Network::learn(std::vector<double> expectedOutput) { |
| 43 | Y = Matrix<double>({expectedOutput}); // row matrix |
no test coverage detected