Commit c1460ee3 authored by Federico Allocati's avatar Federico Allocati
Browse files

Added stats Kernel and Mean Hyperparameters

parent 0c0344e4
......@@ -8,7 +8,9 @@
#include <limbo/stat/aggregated_observations.hpp>
#include <limbo/stat/observations.hpp>
#include <limbo/stat/gp_acquisitions.hpp>
#include <limbo/stat/gp_kernel_hparams.hpp>
#include <limbo/stat/gp_likelihood.hpp>
#include <limbo/stat/gp_mean_hparams.hpp>
#include <limbo/stat/gp_prediction_differences.hpp>
#include <limbo/stat/samples.hpp>
......
#ifndef LIMBO_STAT_GP_KERNEL_HPARAMS_HPP
#define LIMBO_STAT_GP_KERNEL_HPARAMS_HPP
#include <cmath>
#include <limbo/stat/stat_base.hpp>
namespace limbo {
namespace stat {
template <typename Params>
struct GPKernelHParams : public StatBase<Params> {
template <typename BO, typename AggregatorFunction>
void operator()(const BO& bo, const AggregatorFunction& afun, bool blacklisted)
{
if (!bo.stats_enabled() || bo.observations().empty())
return;
this->_create_log_file(bo, "gp_kernel_hparams.dat");
if (bo.total_iterations() == 0)
std::cout << "#iteration gp_kernel_hparams" << std::endl;
(*this->_log_file) << bo.total_iterations() << " " << bo.model().kernel_function().h_params().transpose() << std::endl;
}
};
}
}
#endif
#ifndef LIMBO_STAT_GP_MEAN_HPARAMS_HPP
#define LIMBO_STAT_GP_MEAN_HPARAMS_HPP
#include <cmath>
#include <limbo/stat/stat_base.hpp>
namespace limbo {
namespace stat {
template <typename Params>
struct GPMeanHParams : public StatBase<Params> {
template <typename BO, typename AggregatorFunction>
void operator()(const BO& bo, const AggregatorFunction& afun, bool blacklisted)
{
if (!bo.stats_enabled() || bo.observations().empty())
return;
this->_create_log_file(bo, "gp_mean_hparams.dat");
if (bo.total_iterations() == 0)
std::cout << "#iteration gp_mean_hparams" << std::endl;
(*this->_log_file) << bo.total_iterations() << " " << bo.model().mean_function().h_params().transpose() << std::endl;
}
};
}
}
#endif
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