#[non_exhaustive]pub enum ParamRange {
IntRange {
start: i64,
end: i64,
step: i64,
},
FloatRange {
start: f64,
end: f64,
step: f64,
},
Values(Vec<ParamValue>),
}Expand description
Defines the search space for a single strategy parameter.
| Constructor | Compatible with | Typical use |
|---|---|---|
int_range(start, end, step) | GridSearch + BayesianSearch | Integer period with explicit grid step |
float_range(start, end, step) | GridSearch + BayesianSearch | Float multiplier with explicit grid step |
int_bounds(start, end) | GridSearch (step=1) + BayesianSearch | Integer period, let Bayesian sample freely |
float_bounds(start, end) | BayesianSearch only | Continuous float range |
Values(vec) | GridSearch + BayesianSearch | Explicit list of values |
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IntRange
Inclusive integer range with a step size.
Fields
FloatRange
Inclusive float range with a step size.
Fields
Values(Vec<ParamValue>)
Explicit list of values.
Implementations§
Source§impl ParamRange
impl ParamRange
Sourcepub fn int_range(start: i64, end: i64, step: i64) -> Self
pub fn int_range(start: i64, end: i64, step: i64) -> Self
Stepped integer range — compatible with both GridSearch and BayesianSearch.
Sourcepub fn float_range(start: f64, end: f64, step: f64) -> Self
pub fn float_range(start: f64, end: f64, step: f64) -> Self
Stepped float range — compatible with both GridSearch and BayesianSearch.
Sourcepub fn int_bounds(start: i64, end: i64) -> Self
pub fn int_bounds(start: i64, end: i64) -> Self
Continuous integer bounds for BayesianSearch.
Equivalent to int_range(start, end, 1). Also usable with GridSearch
(enumerates every integer in [start, end]), but prefer int_range with a
wider step when the grid would be very large.
Sourcepub fn float_bounds(start: f64, end: f64) -> Self
pub fn float_bounds(start: f64, end: f64) -> Self
Continuous float bounds — BayesianSearch only.
A step of 0.0 intentionally makes GridSearch return an error, giving
a clear signal when the wrong optimiser is used with this range type.
Trait Implementations§
Source§impl Clone for ParamRange
impl Clone for ParamRange
Source§fn clone(&self) -> ParamRange
fn clone(&self) -> ParamRange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParamRange
impl RefUnwindSafe for ParamRange
impl Send for ParamRange
impl Sync for ParamRange
impl Unpin for ParamRange
impl UnsafeUnpin for ParamRange
impl UnwindSafe for ParamRange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more