10 #include <gtest/gtest.h> 13 TEST(PolynomialNetworkTest, TestGetOutput)
19 auto inputWeights = std::vector<std::vector<double>>(I+1, std::vector<double>(H));
20 auto outputWeights = std::vector<std::vector<double>>(H, std::vector<double>(O));
21 inputWeights[0][0] = 1.0;
22 inputWeights[0][1] = 1.0;
23 inputWeights[0][2] = 1.0;
24 inputWeights[1][0] = 1.0;
25 inputWeights[1][1] = 1.0;
26 inputWeights[1][2] = 1.0;
27 inputWeights[2][0] = 1.0;
28 inputWeights[2][1] = 1.0;
29 inputWeights[2][2] = 1.0;
31 outputWeights[0][0] = 1.0;
32 outputWeights[1][0] = 1.0;
33 outputWeights[2][0] = 1.0;
37 std::vector<double> input{4.0, 5.0};
39 std::vector<double> out = pol.
getOutput(input);
40 double actualOutput = out[0];
41 std::vector<double> hidden = std::vector<double>(H, 0.0);
43 double expectedOutput = 1.0 + 10.0 + 100.0;
44 EXPECT_DOUBLE_EQ(expectedOutput, actualOutput);
void initializeWeights(std::vector< std::vector< double >> inputWeights, std::vector< std::vector< double >> outputWeights)
TEST(PolynomialNetworkTest, TestGetOutput)
std::vector< double > getOutput(std::vector< double > input) override