Commit 484f2cfd authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Fix for test kernel

parent 18dc4a2c
...@@ -29,8 +29,9 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD) ...@@ -29,8 +29,9 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
kernel::SquaredExpARD<Params> se(2); kernel::SquaredExpARD<Params> se(2);
Eigen::VectorXd hp(se.h_params_size()); Eigen::VectorXd hp(se.h_params_size());
hp(0) = 0; //exp(0)=1 // kernel does not expect in log space anymore
hp(1) = 0; hp(0) = 1;
hp(1) = 1;
se.set_h_params(hp); se.set_h_params(hp);
...@@ -40,9 +41,9 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD) ...@@ -40,9 +41,9 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
Eigen::VectorXd v2 = make_v2(0, 1); Eigen::VectorXd v2 = make_v2(0, 1);
double s1 = se(v1, v2); double s1 = se(v1, v2);
BOOST_CHECK(std::abs(s1 - exp(-0.5 * (v1.transpose() * v2)[0])) < 1e-5); BOOST_CHECK(std::abs(s1 - std::exp(-0.5 * (v1.transpose() * v2)[0])) < 1e-5);
hp(0) = 1; hp(0) = std::exp(1);
se.set_h_params(hp); se.set_h_params(hp);
double s2 = se(v1, v2); double s2 = se(v1, v2);
BOOST_CHECK(s1 < s2); BOOST_CHECK(s1 < s2);
...@@ -50,8 +51,8 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD) ...@@ -50,8 +51,8 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
Params::kernel_squared_exp_ard::set_k(1); Params::kernel_squared_exp_ard::set_k(1);
se = kernel::SquaredExpARD<Params>(2); se = kernel::SquaredExpARD<Params>(2);
hp = Eigen::VectorXd(se.h_params_size()); hp = Eigen::VectorXd(se.h_params_size());
hp(0) = 0; hp(0) = 1;
hp(1) = 0; hp(1) = 1;
hp(2) = 0; hp(2) = 0;
hp(3) = 0; hp(3) = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment