From a29be893dc22d44844bd9f4f37800cd7d5fee512 Mon Sep 17 00:00:00 2001 From: Sourabh Varshney Date: Wed, 21 Mar 2018 16:30:54 +0530 Subject: [PATCH] Modified tests for ann_layer_test --- src/mlpack/tests/ann_layer_test.cpp | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/mlpack/tests/ann_layer_test.cpp b/src/mlpack/tests/ann_layer_test.cpp index 04552fe775..cca248348e 100644 --- a/src/mlpack/tests/ann_layer_test.cpp +++ b/src/mlpack/tests/ann_layer_test.cpp @@ -239,8 +239,7 @@ BOOST_AUTO_TEST_CASE(GradientAddLayerTest) input = arma::randu(10, 1); target = arma::mat("1"); - model = new FFN, NguyenWidrowInitialization>( - input, target); + model = new FFN, NguyenWidrowInitialization>(); model->Add >(); model->Add >(10); model->Add >(); @@ -460,8 +459,7 @@ BOOST_AUTO_TEST_CASE(GradientLinearLayerTest) input = arma::randu(10, 1); target = arma::mat("1"); - model = new FFN, NguyenWidrowInitialization>( - input, target); + model = new FFN, NguyenWidrowInitialization>(); model->Add >(); model->Add >(10, 2); model->Add >(); @@ -543,8 +541,7 @@ BOOST_AUTO_TEST_CASE(GradientLinearNoBiasLayerTest) input = arma::randu(10, 1); target = arma::mat("1"); - model = new FFN, NguyenWidrowInitialization>( - input, target); + model = new FFN, NguyenWidrowInitialization>(); model->Add >(); model->Add >(10, 2); model->Add >(); @@ -749,7 +746,7 @@ BOOST_AUTO_TEST_CASE(LSTMRrhoTest) // Create model with user defined rho parameter. RNN, RandomInitialization> modelA( - input, target, rho, false, NegativeLogLikelihood<>(), init); + rho, false, NegativeLogLikelihood<>(), init); modelA.Add >(); modelA.Add >(1, 10); @@ -759,7 +756,7 @@ BOOST_AUTO_TEST_CASE(LSTMRrhoTest) // Create model without user defined rho parameter. RNN > modelB( - input, target, rho, false, NegativeLogLikelihood<>(), init); + rho, false, NegativeLogLikelihood<>(), init); modelB.Add >(); modelB.Add >(1, 10); @@ -788,7 +785,7 @@ BOOST_AUTO_TEST_CASE(GradientLSTMLayerTest) target.ones(1, 1, 5); const size_t rho = 5; - model = new RNN >(input, target, rho); + model = new RNN >(rho); model->Add >(); model->Add >(1, 10); model->Add >(10, 3, rho); @@ -829,7 +826,7 @@ BOOST_AUTO_TEST_CASE(FastLSTMRrhoTest) // Create model with user defined rho parameter. RNN, RandomInitialization> modelA( - input, target, rho, false, NegativeLogLikelihood<>(), init); + rho, false, NegativeLogLikelihood<>(), init); modelA.Add >(); modelA.Add >(1, 10); @@ -839,7 +836,7 @@ BOOST_AUTO_TEST_CASE(FastLSTMRrhoTest) // Create model without user defined rho parameter. RNN > modelB( - input, target, rho, false, NegativeLogLikelihood<>(), init); + rho, false, NegativeLogLikelihood<>(), init); modelB.Add >(); modelB.Add >(1, 10); @@ -868,7 +865,7 @@ BOOST_AUTO_TEST_CASE(GradientFastLSTMLayerTest) target = arma::ones(1, 1, 5); const size_t rho = 5; - model = new RNN >(input, target, rho); + model = new RNN >(rho); model->Add >(); model->Add >(1, 10); model->Add >(10, 3, rho); @@ -915,7 +912,7 @@ BOOST_AUTO_TEST_CASE(GradientGRULayerTest) target = arma::ones(1, 1, 5); const size_t rho = 5; - model = new RNN >(input, target, rho); + model = new RNN >(rho); model->Add >(); model->Add >(1, 10); model->Add >(10, 3, rho); @@ -1047,8 +1044,7 @@ BOOST_AUTO_TEST_CASE(GradientConcatLayerTest) input = arma::randu(10, 1); target = arma::mat("1"); - model = new FFN, NguyenWidrowInitialization>( - input, target); + model = new FFN, NguyenWidrowInitialization>(); model->Add >(); concat = new Concat<>(); @@ -1411,8 +1407,7 @@ BOOST_AUTO_TEST_CASE(GradientBatchNormLayerTest) arma::mat target; target.ones(1, 256); - model = new FFN, NguyenWidrowInitialization>( - input, target); + model = new FFN, NguyenWidrowInitialization>(); model->Add >(); model->Add >(10); model->Add >(10, 2);