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

Added Blacklisted Samples Stat

parent 61d51f94
......@@ -4,6 +4,7 @@
#include <limbo/stat/best_aggregated_observations.hpp>
#include <limbo/stat/best_observations.hpp>
#include <limbo/stat/best_samples.hpp>
#include <limbo/stat/bl_samples.hpp>
#include <limbo/stat/aggregated_observations.hpp>
#include <limbo/stat/observations.hpp>
#include <limbo/stat/samples.hpp>
......
#ifndef LIMBO_STAT_BL_SAMPLES_HPP
#define LIMBO_STAT_BL_SAMPLES_HPP
#include <limbo/stat/stat_base.hpp>
namespace limbo {
namespace stat {
template <typename Params>
struct BlSamples : public StatBase<Params> {
template <typename BO, typename AggregatorFunction>
void operator()(const BO& bo, const AggregatorFunction&, bool blacklisted)
{
if (!bo.stats_enabled() || bo.bl_samples().empty())
return;
this->_create_log_file(bo, "bl_samples.dat");
if (bo.total_iterations() == 0) {
std::cout << "#iteration bl_sample" << std::endl;
for (size_t i = 0; i < bo.bl_samples().size() -1; i++)
(*this->_log_file) << "-1 " << bo.bl_samples()[i].transpose() << std::endl;
}
if (blacklisted)
(*this->_log_file) << bo.total_iterations() << " " << bo.bl_samples().back().transpose() << std::endl;
}
};
}
}
#endif
......@@ -25,7 +25,7 @@ def create(bld):
acquisitions = ['UCB', 'GP_UCB']
optimizers = ['RandomPoint', 'GridSearch', 'Cmaes']
inits = ['NoInit', 'RandomSampling', 'RandomSamplingGrid', 'GridSampling']
stats = ['Samples', 'Observations', 'AggregatedObservations', 'BestSamples', 'BestObservations', 'BestAggregatedObservations']
stats = ['Samples', 'Observations', 'AggregatedObservations', 'BestSamples', 'BestObservations', 'BestAggregatedObservations', 'BlSamples']
stops = ['MaxIterations', 'MaxPredictedValue']
stats = 'typedef boost::fusion::vector<' + ', '.join(['stat::' + stat + '<Params>' for stat in stats]) + '> stats_t;\n'
......
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