src/mlpack/tests/ann_layer_test.cpp
/**
 * Test that the functions that can modify and access the parameters of the
 * GRU layer work.
 */
Test that the functions that can modify and access the parameters of the
GRU layer work.
Test that the functions that can modify and access the parameters of the GRU layer work .
BOOST_AUTO_TEST_CASE(GRULayerParametersTest)
{
  GRU<> layer1(1, 2, 3);
  GRU<> layer2(1, 2, 4);
  BOOST_REQUIRE_EQUAL(layer1.InSize(), 1);
  BOOST_REQUIRE_EQUAL(layer1.OutSize(), 2);
  BOOST_REQUIRE_EQUAL(layer1.Rho(), 3);
  layer1.Rho() = 4;
  BOOST_REQUIRE_EQUAL(layer1.InSize(), layer2.InSize());
  BOOST_REQUIRE_EQUAL(layer2.OutSize(), layer2.OutSize());
  BOOST_REQUIRE_EQUAL(layer1.Rho(), layer2.Rho());
}
BOOST_AUTO_TEST_CASE ( GRULayerParametersTest ) { GRU < > layer1 ( 1 , 2 , 3 ) ; GRU < > layer2 ( 1 , 2 , 4 ) ; BOOST_REQUIRE_EQUAL ( layer1 . InSize ( ) , 1 ) ; BOOST_REQUIRE_EQUAL ( layer1 . OutSize ( ) , 2 ) ; BOOST_REQUIRE_EQUAL ( layer1 . Rho ( ) , 3 ) ; layer1 . Rho ( ) = 4 ; BOOST_REQUIRE_EQUAL ( layer1 . InSize ( ) , layer2 . InSize ( ) ) ; BOOST_REQUIRE_EQUAL ( layer2 . OutSize ( ) , layer2 . OutSize ( ) ) ; BOOST_REQUIRE_EQUAL ( layer1 . Rho ( ) , layer2 . Rho ( ) ) ; }
Test that the functions that can modify and access the parameters of the
 GRU layer work.
Test that the functions that can modify and access the parameters of the GRU layer work .
// Parameter order : inSize, outSize, rho. // Make sure we can get the parameters successfully. // Now modify the parameters to match the second layer. // Now ensure all the results are the same.