Commit 563621a1 authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Fix SquaredExpARD kernel for eigen and test kernel

parent 6d681454
......@@ -116,7 +116,7 @@ namespace limbo {
grad.head(_input_dim) = (x1 - x2).cwiseQuotient(_ell).array().square() * k;
for (size_t j = 0; j < (unsigned int)Params::kernel_squared_exp_ard::k(); ++j) {
Eigen::MatrixXd G = -(x1 - x2).transpose() * _A.col(j) * (x1 - x2) * k;
Eigen::VectorXd G = -((x1 - x2).transpose() * _A.col(j))(0) * (x1 - x2) * k;
grad.segment((j + 1) * _input_dim, _input_dim) = G;
}
......
......@@ -199,8 +199,6 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
kernel::SquaredExpARD<Params> se(2);
Eigen::VectorXd hp = Eigen::VectorXd::Zero(se.h_params_size());
hp(0) = 0;
hp(1) = 0;
se.set_h_params(hp);
......@@ -220,10 +218,6 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
Params::kernel_squared_exp_ard::set_k(1);
se = kernel::SquaredExpARD<Params>(2);
hp = Eigen::VectorXd::Zero(se.h_params_size());
hp(0) = 0;
hp(1) = 0;
hp(2) = -std::numeric_limits<double>::max();
hp(3) = -std::numeric_limits<double>::max();
se.set_h_params(hp);
BOOST_CHECK(s1 == se(v1, v2));
......
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