|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
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 |
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.
| sspace::qloguniform::qloguniform | ( | std::string | n, |
| double | lower, | ||
| double | upper, | ||
| double | q | ||
| ) |
The constructor
| n | the name of this parameter |
| lower | the lower bound; must be strictly positive |
| upper | the upper bound; must be strictly positive |
| q | the 'quantisation'; as a double |
| invalid_argument | on negative or zero-valued bounds |
|
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) \]
Reimplemented from sspace::loguniform.
1.8.13