|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| loguniform (std::string n, double lower, double upper) | |
| loguniform (std::string n, double lower, double upper, pt t) | |
| double | sample () |
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 () |
Additional Inherited Members | |
Public Attributes inherited from sspace::uniform | |
| double | m_lower |
| double | m_upper |
Protected Attributes inherited from sspace::uniform | |
| std::random_device | rd |
| std::mt19937 | generator |
| std::uniform_real_distribution< double > | dist |
loguniform parameters are drawn such that they follow a log-uniform (reciprocal) distribution.
The variable value is drawn from within the closed range of the upper and lower bound, such that the logarithm of the return value is uniformly distributed.
| sspace::loguniform::loguniform | ( | std::string | n, |
| double | lower, | ||
| double | upper | ||
| ) |
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 |
| sspace::loguniform::loguniform | ( | std::string | n, |
| double | lower, | ||
| double | upper, | ||
| pt | t | ||
| ) |
Using the same polymorphic constructor pattern as the vanilla uniform type, this should be called by classes inheriting this one.
|
virtual |
Overloads the sample method from uniform such that a value is returned according to \( v = \exp \bigg(\text{uniform}\big(\log (l),\log(u)\big)\bigg)\)
Reimplemented from sspace::uniform.
Reimplemented in sspace::qloguniform.
1.8.13