Commit 274d1bca authored by Konstantinos Chatzilygeroudis's avatar Konstantinos Chatzilygeroudis
Browse files

Fix serialize tests and small bug

parent 3fbe5b20
......@@ -435,8 +435,6 @@ namespace limbo {
{
Eigen::VectorXd h_params;
archive.load(h_params, "kernel_params");
assert(h_params.size() == _kernel_function.h_params().size());
_kernel_function.set_h_params(h_params);
// should we save parameters of the mean function as well?
_samples.clear();
......@@ -447,6 +445,9 @@ namespace limbo {
_dim_in = _samples[0].size();
_kernel_function = KernelFunction(_dim_in);
assert(h_params.size() == _kernel_function.h_params().size());
_kernel_function.set_h_params(h_params);
_dim_out = _observations.cols();
_mean_function = MeanFunction(_dim_out);
......
......@@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(test_text_archive)
for (size_t i = 0; i < k; i++) {
Eigen::VectorXd s = tools::random_vector(3).array() * 4.0 - 2.0;
auto v1 = gp.query(s);
auto v2 = gp.query(s);
auto v2 = gp2.query(s);
BOOST_CHECK_CLOSE(std::get<0>(v1)[0], std::get<0>(v2)[0], 1e-10);
BOOST_CHECK_CLOSE(std::get<1>(v1), std::get<1>(v2), 1e-10);
}
......@@ -146,7 +146,7 @@ BOOST_AUTO_TEST_CASE(test_bin_archive)
for (size_t i = 0; i < k; i++) {
Eigen::VectorXd s = tools::random_vector(3).array() * 4.0 - 2.0;
auto v1 = gp.query(s);
auto v2 = gp.query(s);
auto v2 = gp2.query(s);
BOOST_CHECK_CLOSE(std::get<0>(v1)[0], std::get<0>(v2)[0], 1e-10);
BOOST_CHECK_CLOSE(std::get<1>(v1), std::get<1>(v2), 1e-10);
}
......
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