Skip to content
Snippets Groups Projects
Commit e7563d14 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: Fixed unit-tests

parent 5bec42e9
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test) ...@@ -91,7 +91,7 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test)
} }
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Construction_Test) { BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Construction_Test) {
BOOST_CHECK_NO_THROW(MSE_SUM mse_sum); BOOST_CHECK_NO_THROW(ErrorSum mse_sum);
} }
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Add_Error_Function_Test) { BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Add_Error_Function_Test) {
...@@ -107,12 +107,12 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test) ...@@ -107,12 +107,12 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test)
ErrorFunction *f = new MSE(&network, &dataSet); ErrorFunction *f = new MSE(&network, &dataSet);
MSE_SUM mse_sum; ErrorSum mse_sum;
BOOST_CHECK_NO_THROW(mse_sum.add_error_function(f)); BOOST_CHECK_NO_THROW(mse_sum.add_error_function(f));
} }
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Eval_Test) { BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Eval_Test) {
MSE_SUM mse_sum; ErrorSum mse_sum;
double weights[1] = {0}; double weights[1] = {0};
Neuron *n1 = new NeuronLinear(1, 1); Neuron *n1 = new NeuronLinear(1, 1);
...@@ -146,7 +146,7 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test) ...@@ -146,7 +146,7 @@ BOOST_AUTO_TEST_SUITE(ErrorFunctions_test)
} }
BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Get_Dimension_test) { BOOST_AUTO_TEST_CASE(ErrorFunction_MSE_SUM_Get_Dimension_test) {
MSE_SUM mse_sum; ErrorSum mse_sum;
BOOST_CHECK_EQUAL(0, mse_sum.get_dimension()); BOOST_CHECK_EQUAL(0, mse_sum.get_dimension());
Neuron *n1 = new NeuronLinear(1, 1); Neuron *n1 = new NeuronLinear(1, 1);
......
...@@ -44,11 +44,11 @@ BOOST_AUTO_TEST_SUITE(neuronLinear_test) ...@@ -44,11 +44,11 @@ BOOST_AUTO_TEST_SUITE(neuronLinear_test)
NeuronLinear neuron(5.0, 3.0); NeuronLinear neuron(5.0, 3.0);
//Test of correct output of activation_function_get_derivative method //Test of correct output of activation_function_get_derivative method
BOOST_CHECK_EQUAL(3.0, neuron.activation_function_get_derivative()); BOOST_CHECK_EQUAL(3.0, neuron.activation_function_eval_derivative());
//Tests of correct outputs of activation_function_get_partial_derivative method //Tests of correct outputs of activation_function_get_partial_derivative method
BOOST_CHECK_EQUAL(1.0, neuron.activation_function_get_partial_derivative(0)); BOOST_CHECK_EQUAL(1.0, neuron.activation_function_eval_partial_derivative(0));
BOOST_CHECK_EQUAL(0.0, neuron.activation_function_get_partial_derivative(1)); BOOST_CHECK_EQUAL(0.0, neuron.activation_function_eval_partial_derivative(1));
BOOST_CHECK_EQUAL(0.0, neuron.activation_function_get_partial_derivative(10000)); BOOST_CHECK_EQUAL(0.0, neuron.activation_function_eval_partial_derivative(10000));
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
...@@ -44,11 +44,11 @@ BOOST_AUTO_TEST_SUITE(neuronLogistic_test) ...@@ -44,11 +44,11 @@ BOOST_AUTO_TEST_SUITE(neuronLogistic_test)
NeuronLogistic neuron(3.0, 2.0); NeuronLogistic neuron(3.0, 2.0);
//Test of correct output of activation_function_get_derivative method //Test of correct output of activation_function_get_derivative method
BOOST_CHECK_CLOSE(0.00447566759338, neuron.activation_function_get_derivative(), 0.00001); BOOST_CHECK_CLOSE(0.00447566759338, neuron.activation_function_eval_derivative(), 0.00001);
//Tests of correct outputs of activation_function_get_partial_derivative method //Tests of correct outputs of activation_function_get_partial_derivative method
BOOST_CHECK_CLOSE(-0.0036025788498, neuron.activation_function_get_partial_derivative(0), 0.00001); BOOST_CHECK_CLOSE(-0.0036025788498, neuron.activation_function_eval_partial_derivative(0), 0.00001);
BOOST_CHECK_CLOSE(-0.0044756675933, neuron.activation_function_get_partial_derivative(1), 0.00001); BOOST_CHECK_CLOSE(-0.0044756675933, neuron.activation_function_eval_partial_derivative(1), 0.00001);
BOOST_CHECK_EQUAL(0.0, neuron.activation_function_get_partial_derivative(10000)); BOOST_CHECK_EQUAL(0.0, neuron.activation_function_eval_partial_derivative(10000));
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
...@@ -42,10 +42,10 @@ BOOST_AUTO_TEST_SUITE(neuronTanh_test) ...@@ -42,10 +42,10 @@ BOOST_AUTO_TEST_SUITE(neuronTanh_test)
NeuronTanh neuron(2.0); NeuronTanh neuron(2.0);
//Test of correct output of activation_function_get_derivative method //Test of correct output of activation_function_get_derivative method
BOOST_CHECK_CLOSE(-0.0706508248531644, neuron.activation_function_get_derivative(), 0.00001); BOOST_CHECK_CLOSE(-0.0706508248531644, neuron.activation_function_eval_derivative(), 0.00001);
//Tests of correct outputs of activation_function_get_partial_derivative method //Tests of correct outputs of activation_function_get_partial_derivative method
BOOST_CHECK_CLOSE(-0.0706508248531644, neuron.activation_function_get_partial_derivative(0), 0.00001); BOOST_CHECK_CLOSE(-0.0706508248531644, neuron.activation_function_eval_partial_derivative(0), 0.00001);
BOOST_CHECK_EQUAL(0.0, neuron.activation_function_get_partial_derivative(10000)); BOOST_CHECK_EQUAL(0.0, neuron.activation_function_eval_partial_derivative(10000));
} }
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment