MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / computeOutput

Method computeOutput

src/RaceNet/Network.cpp:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32Matrix<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
42void Network::learn(std::vector<double> expectedOutput) {
43 Y = Matrix<double>({expectedOutput}); // row matrix

Callers 1

InferMethod · 0.80

Calls 3

applyFunctionMethod · 0.80
addMethod · 0.80
dotMethod · 0.80

Tested by

no test coverage detected