Commit d78cd81c by Konstantinos Chatzilygeroudis Committed by GitHub

### Merge pull request #279 from resibots/observations

`Fixes #278`
parents 4b8ede53 363bbc22
 ... @@ -408,14 +408,31 @@ namespace limbo { ... @@ -408,14 +408,31 @@ namespace limbo { void set_log_loo_cv(double log_loo_cv) { _log_loo_cv = log_loo_cv; } void set_log_loo_cv(double log_loo_cv) { _log_loo_cv = log_loo_cv; } /// LLT matrix (from Cholesky decomposition) /// LLT matrix (from Cholesky decomposition) //const Eigen::LLT& llt() const { return _llt; } const Eigen::MatrixXd& matrixL() const { return _matrixL; } const Eigen::MatrixXd& matrixL() const { return _matrixL; } const Eigen::MatrixXd& alpha() const { return _alpha; } const Eigen::MatrixXd& alpha() const { return _alpha; } /// return the list of samples that have been tested so far /// return the list of samples const std::vector& samples() const { return _samples; } const std::vector& samples() const { return _samples; } /// return the list of observations std::vector observations() const { std::vector observations; for (int i = 0; i < _observations.rows(); i++) { observations.push_back(_observations.row(i)); } return observations; } /// return the observations (in matrix form) /// (NxD), where N is the number of points and D is the dimension output const Eigen::MatrixXd& observations_matrix() const { return _observations; } bool inv_kernel_computed() { return _inv_kernel_updated; } bool inv_kernel_computed() { return _inv_kernel_updated; } /// save the parameters and the data for the GP to the archive (text or binary) /// save the parameters and the data for the GP to the archive (text or binary) ... ...
 ... @@ -265,13 +265,32 @@ namespace limbo { ... @@ -265,13 +265,32 @@ namespace limbo { }); }); } } /// return the list of samples that have been tested so far /// return the list of samples const std::vector& samples() const const std::vector& samples() const { { assert(_gp_models.size()); assert(_gp_models.size()); return _gp_models[0].samples(); return _gp_models[0].samples(); } } /// return the list of observations const std::vector& observations() const { return _observations; } /// return the observations (in matrix form) /// (NxD), where N is the number of points and D is the dimension output Eigen::MatrixXd observations_matrix() const { assert(_dim_out > 0); Eigen::MatrixXd observations(_observations.size(), _dim_out); for (int i = 0; i < _observations.size(); i++) { observations.row(i) = _observations[i]; } return observations; } /// return the mean observation /// return the mean observation Eigen::VectorXd mean_observation() const Eigen::VectorXd mean_observation() const { { ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!