corrected tests
This commit is contained in:
@@ -4903,15 +4903,22 @@ TEST_CASE("MeanPoolingTestCase", "[ANNLayerTest]")
|
||||
CheckMatrices(output1, result1, 1e-1);
|
||||
CheckMatrices(output2, result2, 1e-1);
|
||||
|
||||
output1.reshape(8, 1);
|
||||
output2.reshape(6, 1);
|
||||
arma::mat prev_delta1, prev_delta2;
|
||||
prev_delta1 << 3.6000 << -0.9000 << arma::endr
|
||||
<< 3.6000 << -0.9000 << arma::endr
|
||||
<< 3.6000 << -0.9000 << arma::endr
|
||||
<< 3.6000 << -0.9000 << arma::endr;
|
||||
|
||||
prev_delta2 << 3.6000 << -0.9000 << arma::endr
|
||||
<< 3.6000 << -0.9000 << arma::endr
|
||||
<< 3.6000 << -0.9000 << arma::endr;
|
||||
arma::mat delta1, delta2;
|
||||
delta1.set_size(8, 1);
|
||||
delta2.set_size(6, 1);
|
||||
module1.Backward(input, output1, delta1);
|
||||
REQUIRE(arma::accu(delta1) == 25.5);
|
||||
module2.Backward(input, output2, delta2);
|
||||
REQUIRE(arma::accu(delta2) == 19.5);
|
||||
module1.Backward(input, prev_delta1, delta1);
|
||||
REQUIRE(arma::accu(delta1) == 10.8);
|
||||
module2.Backward(input, prev_delta2, delta2);
|
||||
REQUIRE(arma::accu(delta2) == 8.1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user