DiSMEC++
dismec::HyperParameters Class Reference

This class represents a set of hyper-parameters. More...

#include <hyperparams.h>

Public Types

using hyper_param_t = HyperParameterBase::hyper_param_t
 

Public Member Functions

void set (const std::string &name, long value)
 Sets a hyper-parameter with the given name and value. More...
 
void set (const std::string &name, double value)
 
hyper_param_t get (const std::string &name) const
 Gets the hyper-parameter with the given name, or throws if it does not exist. More...
 
void apply (HyperParameterBase &target) const
 

Private Attributes

std::unordered_map< std::string, hyper_param_tm_Values
 

Detailed Description

This class represents a set of hyper-parameters.

Definition at line 241 of file hyperparams.h.

Member Typedef Documentation

◆ hyper_param_t

Member Function Documentation

◆ apply()

void HyperParameters::apply ( HyperParameterBase target) const

Applies the hyper-parameter values to target. It is valid to call this if not all hyper-parameters in target are part of this hyper-parameter set, but an error if additional parameters are present.

Definition at line 50 of file hyperparams.cpp.

References m_Values, dismec::HyperParameterBase::set_hyper_parameter(), and dismec::types::visit().

Referenced by dismec::CascadeTraining::make_minimizer(), dismec::DiSMECTraining::make_minimizer(), and TEST_CASE().

◆ get()

auto HyperParameters::get ( const std::string &  name) const

Gets the hyper-parameter with the given name, or throws if it does not exist.

Definition at line 46 of file hyperparams.cpp.

Referenced by dismec::CascadeTraining::CascadeTraining(), dismec::DiSMECTraining::DiSMECTraining(), and TEST_CASE().

◆ set() [1/2]

void HyperParameters::set ( const std::string &  name,
double  value 
)

Definition at line 42 of file hyperparams.cpp.

References m_Values.

◆ set() [2/2]

void HyperParameters::set ( const std::string &  name,
long  value 
)

Sets a hyper-parameter with the given name and value.

Definition at line 38 of file hyperparams.cpp.

References m_Values.

Referenced by TEST_CASE().

Member Data Documentation

◆ m_Values

std::unordered_map<std::string, hyper_param_t> dismec::HyperParameters::m_Values
private

Definition at line 257 of file hyperparams.h.

Referenced by apply(), and set().


The documentation for this class was generated from the following files: