Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Mayr
limbo
Commits
274d1bca
Commit
274d1bca
authored
Dec 14, 2017
by
Konstantinos Chatzilygeroudis
Browse files
Fix serialize tests and small bug
parent
3fbe5b20
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/limbo/model/gp.hpp
View file @
274d1bca
...
...
@@ -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
);
...
...
src/tests/test_serialize.cpp
View file @
274d1bca
...
...
@@ -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
=
gp
2
.
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
=
gp
2
.
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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment