|
PineForge HPO 1.11.0
Native hyperparameter optimization for PineForge strategies
|
Public Member Functions | |
| bool | constant (self) |
| float | decode (self, int ordinal) |
| int | ordinal (self, float value) |
| Any | normalise (self, Any value) |
| Moves | neighbours (self, Any value, float|None fraction=None, float|None ratio=None) |
| Any | rank (self, Any value) |
| list | sort_values (self, Any values) |
Public Attributes | |
| rule | |
| low | |
| step | |
| kind | |
| high | |
| choices | |
Static Public Attributes | |
| str | name |
| str | kind |
| str | rule |
| Any | low = None |
| Any | high = None |
| Any | step = None |
| bool | log = False |
| tuple | choices = () |
| int | last = None |
One search dimension of the recorded space, with its neighbour rule. ``rule`` names how a value moves: ``step`` (integer lattice), ``ratio_rounded`` (log integer), ``ordinal`` (stepped real), ``fraction`` (continuous real), ``ratio`` (log real), ``other_value`` (boolean), ``other_choices`` (categorical) or ``constant`` (exactly one legal value, no neighbours). ``last`` is the last lattice ordinal of a stepped real.
Definition at line 207 of file neighbourhood.py.
| bool pineforge_hpo.neighbourhood.Dimension.constant | ( | self | ) |
Definition at line 228 of file neighbourhood.py.
| float pineforge_hpo.neighbourhood.Dimension.decode | ( | self, | |
| int | ordinal | ||
| ) |
Value of a stepped real at ``ordinal``: one fused multiply-add. The last ordinal snaps to ``high`` when the product is above it (the study spec lets it exceed ``high`` by one representable step).
Definition at line 231 of file neighbourhood.py.
References pineforge::hpo::IntegerDimension.high(), pineforge::hpo::RealDimension.high(), pineforge_hpo.neighbourhood.Dimension.high, pineforge_hpo.study_spec.ParameterSpec.high, pineforge_hpo.neighbourhood.Dimension.last, pineforge::hpo::IntegerDimension.low(), pineforge::hpo::RealDimension.low(), pineforge_hpo.neighbourhood.Dimension.low, pineforge_hpo.study_spec.ParameterSpec.low, pineforge::hpo::IntegerDimension.step(), pineforge::hpo::RealDimension.step(), pineforge_hpo.neighbourhood.Dimension.step, and pineforge_hpo.study_spec.ParameterSpec.step.
Referenced by pineforge_hpo.neighbourhood.Dimension.neighbours().
| Moves pineforge_hpo.neighbourhood.Dimension.neighbours | ( | self, | |
| Any | value, | ||
| float | None | fraction = None, |
||
| float | None | ratio = None |
||
| ) |
The values one move away from ``value`` and the moves that were dropped. ``value`` must be a normalised value of this dimension. Order: lower first; a categorical keeps its declared order. A rule that needs ``fraction`` or ``ratio`` raises ValueError when it is None. No log, exp or pow function is called: log integers use exact rational arithmetic, log reals use one binary64 multiplication or division.
Definition at line 285 of file neighbourhood.py.
References pineforge_hpo.neighbourhood.Dimension.decode(), pineforge::hpo::IntegerDimension.high(), pineforge::hpo::RealDimension.high(), pineforge_hpo.neighbourhood.Dimension.high, pineforge_hpo.study_spec.ParameterSpec.high, pineforge_hpo.neighbourhood.Dimension.last, pineforge::hpo::IntegerDimension.low(), pineforge::hpo::RealDimension.low(), pineforge_hpo.neighbourhood.Dimension.low, pineforge_hpo.study_spec.ParameterSpec.low, pineforge_hpo.neighbourhood.Dimension.ordinal(), pineforge_hpo.neighbourhood.Dimension.rule, pineforge::hpo::IntegerDimension.step(), pineforge::hpo::RealDimension.step(), pineforge_hpo.neighbourhood.Dimension.step, and pineforge_hpo.study_spec.ParameterSpec.step.
| Any pineforge_hpo.neighbourhood.Dimension.normalise | ( | self, | |
| Any | value | ||
| ) |
The value as this dimension holds it; ValueError when it does not fit. The checks are those of the continuation loader for one parameter. A stepped real within four units in the last place of a lattice point is taken as that point, and -0.0 is taken as 0.0.
Definition at line 246 of file neighbourhood.py.
| int pineforge_hpo.neighbourhood.Dimension.ordinal | ( | self, | |
| float | value | ||
| ) |
Nearest lattice ordinal of a stepped-real value (continuation.py:228).
Definition at line 242 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.neighbours().
| Any pineforge_hpo.neighbourhood.Dimension.rank | ( | self, | |
| Any | value | ||
| ) |
A sortable position of a value inside this dimension's own order.
Definition at line 346 of file neighbourhood.py.
References pineforge_hpo._rows.RowsError.kind, pineforge_hpo.neighbourhood.Dimension.kind, pineforge_hpo.study_spec.ParameterSpec.kind, pineforge_hpo.study_spec.ObjectiveSpec.kind, and pineforge_hpo.study_spec.SamplerSpec.kind.
Referenced by pineforge_hpo.neighbourhood.Dimension.sort_values().
| list pineforge_hpo.neighbourhood.Dimension.sort_values | ( | self, | |
| Any | values | ||
| ) |
The values in this dimension's order: ascending, or declared order.
Definition at line 357 of file neighbourhood.py.
References pineforge_hpo.neighbourhood.Dimension.rank(), and pineforge_hpo.neighbourhood.Study.rank().
|
static |
Definition at line 224 of file neighbourhood.py.
| pineforge_hpo.neighbourhood.Dimension.choices |
Definition at line 351 of file neighbourhood.py.
|
static |
Definition at line 221 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
| pineforge_hpo.neighbourhood.Dimension.high |
Definition at line 324 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
|
static |
Definition at line 218 of file neighbourhood.py.
Referenced by pineforge_hpo._rows.RowsError.__reduce__(), and pineforge_hpo.neighbourhood.Dimension.rank().
| pineforge_hpo.neighbourhood.Dimension.kind |
Definition at line 253 of file neighbourhood.py.
Referenced by pineforge_hpo._rows.RowsError.__reduce__(), and pineforge_hpo.neighbourhood.Dimension.rank().
|
static |
Definition at line 225 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
|
static |
Definition at line 223 of file neighbourhood.py.
|
static |
Definition at line 220 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
| pineforge_hpo.neighbourhood.Dimension.low |
Definition at line 244 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
|
static |
Definition at line 217 of file neighbourhood.py.
|
static |
Definition at line 219 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.neighbours().
| pineforge_hpo.neighbourhood.Dimension.rule |
Definition at line 229 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.neighbours().
|
static |
Definition at line 222 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().
| pineforge_hpo.neighbourhood.Dimension.step |
Definition at line 244 of file neighbourhood.py.
Referenced by pineforge_hpo.neighbourhood.Dimension.decode(), and pineforge_hpo.neighbourhood.Dimension.neighbours().