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
531bda13
Commit
531bda13
authored
Jul 08, 2016
by
Konstantinos Chatzilygeroudis
Browse files
Fix kernel test again
parent
78156c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tests/test_kernel.cpp
View file @
531bda13
...
...
@@ -29,9 +29,8 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
kernel
::
SquaredExpARD
<
Params
>
se
(
2
);
Eigen
::
VectorXd
hp
(
se
.
h_params_size
());
// kernel does not expect in log space anymore
hp
(
0
)
=
1
;
hp
(
1
)
=
1
;
hp
(
0
)
=
0
;
hp
(
1
)
=
0
;
se
.
set_h_params
(
hp
);
...
...
@@ -43,7 +42,7 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
BOOST_CHECK
(
std
::
abs
(
s1
-
std
::
exp
(
-
0.5
*
(
v1
.
transpose
()
*
v2
)[
0
]))
<
1e-5
);
hp
(
0
)
=
std
::
exp
(
1
)
;
hp
(
0
)
=
1
;
se
.
set_h_params
(
hp
);
double
s2
=
se
(
v1
,
v2
);
BOOST_CHECK
(
s1
<
s2
);
...
...
@@ -51,10 +50,10 @@ BOOST_AUTO_TEST_CASE(test_kernel_SE_ARD)
Params
::
kernel_squared_exp_ard
::
set_k
(
1
);
se
=
kernel
::
SquaredExpARD
<
Params
>
(
2
);
hp
=
Eigen
::
VectorXd
(
se
.
h_params_size
());
hp
(
0
)
=
1
;
hp
(
1
)
=
1
;
hp
(
2
)
=
0
;
hp
(
3
)
=
0
;
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
));
...
...
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