25 #ifndef MULTILAYERNEURALNETSTESTS_HPP_
26 #define MULTILAYERNEURALNETSTESTS_HPP_
29 #include <gtest/gtest.h>
32 #define private public
33 #define protected public
37 namespace mic {
namespace neural_nets {
namespace unit_tests {
48 nn(
"simple_linear_network")
83 nn(
"simple_linear_network")
92 input_x = MAKE_MATRIX_PTR(
double, 2, 1);
93 target_y = MAKE_MATRIX_PTR(
double, 2, 1);
113 (*
nn.
layers[0]->p[
"W"]) << 0.15, .20, .25, .30;
114 (*
nn.
layers[0]->p[
"b"]) << .35, 0.35;
116 (*
nn.
layers[2]->p[
"W"]) << 0.4, .45, .5, .55;
119 (*input_x) << 0.05, 0.1;
120 (*target_y) << 0.01, 0.99;
124 (*ffpass1_lin1_y) << 0.3775, 0.3925;
126 (*ffpass1_sig1_y) << 0.59327, 0.596884;
128 (*ffpass1_lin2_y) << 1.10591, 1.22492;
130 (*ffpass1_sig2_y) << 0.751365, 0.772928;
134 (*ffpass1_dy) << 0.741365, -0.217072;
137 (*bwpass1_lin2_dW) << 0.082167, 0.0826676, -0.0226025, -0.0227402;
138 (*bwpass1_lin1_dW) << 0.000438568, 0.000877135, 0.000497713, 0.000995425;
141 (*bwpass1_lin2_pW_updated) << 0.358916, 0.408666, 0.511301, 0.56137;
142 (*bwpass1_lin1_pW_updated) << 0.149781, 0.199561, 0.249751, 0.299502;
mic::types::MatrixPtr< double > ffpass1_dy
mic::types::MatrixPtr< double > target_y
mic::types::MatrixPtr< double > ffpass1_sig1_y
std::vector< std::shared_ptr< mic::mlnn::Layer< eT > > > layers
mic::types::MatrixPtr< double > bwpass1_lin1_pW_updated
mic::mlnn::BackpropagationNeuralNetwork< double > nn
mic::types::MatrixPtr< double > ffpass1_lin1_y
mic::types::MatrixPtr< double > bwpass1_lin1_dW
mic::types::MatrixPtr< double > input_x
mic::types::MatrixPtr< double > bwpass1_lin2_dW
mic::types::MatrixPtr< double > ffpass1_sig2_y
mic::mlnn::BackpropagationNeuralNetwork< double > nn
void resizeBatch(size_t batch_size_)
Test Fixture - simple ff net with 2 layers.
Test Fixture - feed-forward net with 2 layers. A "formalized" example from a step-by-step tutorial: h...
void pushLayer(LayerType *layer_ptr_)
mic::types::MatrixPtr< double > bwpass1_lin2_pW_updated
Simple2LayerRegressionNN()
mic::types::MatrixPtr< double > ffpass1_lin2_y