6 #ifndef DISMEC_STATISTICS_H
7 #define DISMEC_STATISTICS_H
9 #include <unordered_map>
16 #include <nlohmann/json_fwd.hpp>
48 std::unique_ptr<stats::Statistics>
Stat;
50 std::unordered_map<std::string, StatData>
m_Merged;
59 void add_accu(
const std::string& key,
thread_id_t thread,
const std::shared_ptr<stats::StatisticsCollection>& accumulator);
virtual void start_label(label_id_t label)=0
virtual void record_result(const DenseRealVector &weights, const solvers::MinimizationResult &result)=0
virtual ~ResultStatsGatherer()
virtual void start_training(const DenseRealVector &init_weights)=0
void add_accu(const std::string &key, thread_id_t thread, const std::shared_ptr< stats::StatisticsCollection > &accumulator)
void setup_postproc(thread_id_t thread, stats::Tracked &objective)
std::unique_ptr< nlohmann::json > m_Config
void setup_minimizer(thread_id_t thread, stats::Tracked &minimizer)
NOTE: these functions will be called concurrently.
std::shared_ptr< stats::StatisticsCollection > collection_ptr_t
void setup_initializer(thread_id_t thread, stats::Tracked &initializer)
nlohmann::json to_json() const
std::vector< std::unordered_map< std::string, collection_ptr_t > > m_PerThreadCollections
void setup_objective(thread_id_t thread, stats::Tracked &objective)
std::unordered_map< std::string, StatData > m_Merged
TrainingStatsGatherer(std::string source, std::string target_file)
std::unique_ptr< ResultStatsGatherer > create_results_gatherer(thread_id_t thread, const std::shared_ptr< const TrainingSpec > &spec)
Strong typedef for an int to signify a label id.
Strong typedef for an int to signify a thread id.
A base class to be used for all types that implement some for of statistics tracking.
Main namespace in which all types, classes, and functions are defined.
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.
stats::StatisticMetaData Meta
std::unique_ptr< stats::Statistics > Stat