OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Public Attributes | List of all members
sspace::qloguniform Class Reference

#include <types.hpp>

Inheritance diagram for sspace::qloguniform:
sspace::loguniform sspace::uniform sspace::param_t

Public Member Functions

 qloguniform (std::string n, double lower, double upper, double q)
 
double sample ()
 
- Public Member Functions inherited from sspace::loguniform
 loguniform (std::string n, double lower, double upper)
 
 loguniform (std::string n, double lower, double upper, pt t)
 
- Public Member Functions inherited from sspace::uniform
 uniform (std::string n, double lower, double upper)
 
 uniform (std::string n, double lower, double upper, pt type)
 
- Public Member Functions inherited from sspace::param_t
 param_t (std::string n, pt t)
 
virtual ~param_t ()
 
virtual pt get_type ()
 
virtual std::string get_name ()
 

Public Attributes

double m_q
 
- Public Attributes inherited from sspace::uniform
double m_lower
 
double m_upper
 

Additional Inherited Members

- Protected Attributes inherited from sspace::uniform
std::random_device rd
 
std::mt19937 generator
 
std::uniform_real_distribution< double > dist
 

Detailed Description

qloguniform parameters are like loguniform parameters except that they are clipped above and below, and vary in fixed increments.

This is suitable for discrete-valued parameters with respect to which the objective function is smooth, and gets smoother with the size of the value.

Constructor & Destructor Documentation

◆ qloguniform()

sspace::qloguniform::qloguniform ( std::string  n,
double  lower,
double  upper,
double  q 
)

The constructor

Parameters
nthe name of this parameter
lowerthe lower bound; must be strictly positive
upperthe upper bound; must be strictly positive
qthe 'quantisation'; as a double
Exceptions
invalid_argumenton negative or zero-valued bounds

Member Function Documentation

◆ sample()

double sspace::qloguniform::sample ( )
virtual

Overloads the sample method from loguniform to quantise it;

\[ v = \text{clip}\bigg( \text{round}\big(\text{loguniform}(\text{low},\text{high}) \big)\bigg) \]

Returns
a double-precision floating point value sampled from a quantised loguniform distribution.

Reimplemented from sspace::loguniform.


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