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
bd207cc2
Commit
bd207cc2
authored
Oct 17, 2016
by
Antoine Cully
Browse files
extension to the add_sample function and the Kernel object
parent
c44ab834
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/limbo/model/gp.hpp
View file @
bd207cc2
...
...
@@ -83,8 +83,10 @@ namespace limbo {
assert
(
observations
.
size
()
!=
0
);
assert
(
samples
.
size
()
==
observations
.
size
());
_dim_in
=
samples
[
0
].
size
();
_kernel_function
=
KernelFunction
(
_dim_in
);
// the cost of building a functor should be relatively low
if
(
_dim_in
!=
samples
[
0
].
size
())
{
_dim_in
=
samples
[
0
].
size
();
_kernel_function
=
KernelFunction
(
_dim_in
);
// the cost of building a functor should be relatively low
}
if
(
_dim_out
!=
observations
[
0
].
size
())
{
_dim_out
=
observations
[
0
].
size
();
...
...
@@ -117,11 +119,14 @@ namespace limbo {
void
add_sample
(
const
Eigen
::
VectorXd
&
sample
,
const
Eigen
::
VectorXd
&
observation
,
double
noise
)
{
if
(
_samples
.
empty
())
{
if
(
_dim_in
!=
sample
.
size
())
{
_dim_in
=
sample
.
size
();
_kernel_function
=
KernelFunction
(
_dim_in
);
// the cost of building a functor should be relatively low
_dim_out
=
observation
.
size
();
_mean_function
=
MeanFunction
(
_dim_out
);
// the cost of building a functor should be relatively low
}
if
(
_dim_out
!=
observation
.
size
())
{
_dim_out
=
observation
.
size
();
_mean_function
=
MeanFunction
(
_dim_out
);
// the cost of building a functor should be relatively low
}
}
else
{
assert
(
sample
.
size
()
==
_dim_in
);
...
...
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