SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::datadriven::DiscreteParameter Class Reference

concrete class for hyperparameter with discrete values More...

#include <DiscreteParameter.hpp>

Inheritance diagram for sgpp::datadriven::DiscreteParameter:
sgpp::datadriven::HyperParameter

Public Member Functions

 DiscreteParameter ()=default
 Default Constructor.
 
 DiscreteParameter (int nBits, std::string &&name, int minv, int maxv)
 Constructor with custom number of bits.
 
 DiscreteParameter (std::string &&name, int minv, int maxv)
 Normal constructor, number of bits calculated automatically.
 
int getNOptions ()
 Retrieve the number of options for this parameter.
 
int getValue ()
 Retrieve the current value of the hyperparameter.
 
void setBO (int option)
 adjust the current value of the hyperparameter according to the (normalized) input
 
void setHarmonica () override
 adjust the current value of the hyperparameter according to the bit configuration by harmonica
 
- Public Member Functions inherited from sgpp::datadriven::HyperParameter
 HyperParameter ()
 Default constructor for implicit use by data structures.
 
 HyperParameter (size_t nBits, std::string &name)
 Normal constructor.
 
void makeConfigBits (std::vector< ConfigurationBit * > &configBits)
 Connects parameter to bit representation in harmonica.
 
virtual ~HyperParameter ()=default
 Default Destructor.
 

Protected Attributes

int maxv
 maximum value of the hyperparameter during optimization
 
int minv
 minimum value of the hyperparameter during optimization
 
int value = 0
 current value of the hyperparameter
 
- Protected Attributes inherited from sgpp::datadriven::HyperParameter
std::vector< ConfigurationBitbits
 associated configuration bits for harmonica
 
std::string name
 name of the hyperparameter
 
size_t nBits
 number of bits for harmonica
 

Detailed Description

concrete class for hyperparameter with discrete values

Constructor & Destructor Documentation

◆ DiscreteParameter() [1/3]

sgpp::datadriven::DiscreteParameter::DiscreteParameter ( )
default

Default Constructor.

◆ DiscreteParameter() [2/3]

sgpp::datadriven::DiscreteParameter::DiscreteParameter ( std::string &&  name,
int  minv,
int  maxv 
)

Normal constructor, number of bits calculated automatically.

Parameters
namename of the hyperparameter
minvminimum value of the hyperparameter during optimization
maxvmaximum value of the hyperparameter during optimization

References maxv, minv, and sgpp::datadriven::HyperParameter::nBits.

◆ DiscreteParameter() [3/3]

sgpp::datadriven::DiscreteParameter::DiscreteParameter ( int  nBits,
std::string &&  name,
int  minv,
int  maxv 
)
inline

Constructor with custom number of bits.

Parameters
nBitsnumber of bits for representation in harmonica
namename of the hyperparameter
minvminimum value of the hyperparameter during optimization
maxvmaximum value of the hyperparameter during optimization

Member Function Documentation

◆ getNOptions()

int sgpp::datadriven::DiscreteParameter::getNOptions ( )

Retrieve the number of options for this parameter.

Returns

References maxv, and minv.

◆ getValue()

int sgpp::datadriven::DiscreteParameter::getValue ( )

Retrieve the current value of the hyperparameter.

Returns
value of the hyperparameter

References value.

◆ setBO()

void sgpp::datadriven::DiscreteParameter::setBO ( int  option)

adjust the current value of the hyperparameter according to the (normalized) input

Parameters
optionvalue of the parameter from 0

References minv, and value.

◆ setHarmonica()

void sgpp::datadriven::DiscreteParameter::setHarmonica ( )
overridevirtual

adjust the current value of the hyperparameter according to the bit configuration by harmonica

Implements sgpp::datadriven::HyperParameter.

References sgpp::datadriven::HyperParameter::bits, m, maxv, minv, and value.

Member Data Documentation

◆ maxv

int sgpp::datadriven::DiscreteParameter::maxv
protected

maximum value of the hyperparameter during optimization

Referenced by DiscreteParameter(), getNOptions(), and setHarmonica().

◆ minv

int sgpp::datadriven::DiscreteParameter::minv
protected

minimum value of the hyperparameter during optimization

Referenced by DiscreteParameter(), getNOptions(), setBO(), and setHarmonica().

◆ value

int sgpp::datadriven::DiscreteParameter::value = 0
protected

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