Commit b2116d70 authored by Antoine Cully's avatar Antoine Cully
Browse files

merge the recompute_mean_internal, with the initial recompute function

parent c50f29fa
......@@ -228,22 +228,17 @@ namespace limbo {
int nb_samples() const { return _samples.size(); }
/// recomputes the GP
void recompute(bool update_obs_mean = true)
void recompute(bool update_obs_mean = true, bool update_full_kernel = true)
{
assert(!_samples.empty());
if (update_obs_mean)
this->_compute_obs_mean();
this->_compute_full_kernel();
}
/// recomputes the internal variable related to the mean object without recomputing the kernel
void recompute_mean_internal()
{
assert(!_samples.empty());
this->_compute_obs_mean();
this->_compute_alpha();
if (update_full_kernel)
this->_compute_full_kernel();
else
this->_compute_alpha();
}
/// return the likelihood (do not compute it!)
......
......@@ -65,7 +65,7 @@ namespace limbo {
auto params = optimizer(optimization, gp.mean_function().h_params(), false);
gp.mean_function().set_h_params(params);
gp.set_lik(opt::eval(optimization, params));
gp.recompute_mean_internal();
gp.recompute(true, false);
}
protected:
......@@ -87,7 +87,7 @@ namespace limbo {
GP gp(this->_original_gp);
gp.mean_function().set_h_params(params);
gp.recompute_mean_internal();
gp.recompute(true, false);
size_t n = gp.obs_mean().rows();
......
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