pub enum HyperparamSpace {
Discrete(Vec<HyperparamValue>),
Continuous {
min: f64,
max: f64,
},
LogUniform {
min: f64,
max: f64,
},
IntRange {
min: i64,
max: i64,
},
}Expand description
Hyperparameter space definition.
Variants§
Discrete(Vec<HyperparamValue>)
Discrete choices.
Continuous
Continuous range [min, max].
LogUniform
Log-uniform distribution [min, max].
IntRange
Integer range [min, max].
Implementations§
Source§impl HyperparamSpace
impl HyperparamSpace
Sourcepub fn discrete(values: Vec<HyperparamValue>) -> TrainResult<Self>
pub fn discrete(values: Vec<HyperparamValue>) -> TrainResult<Self>
Create a discrete choice space.
Sourcepub fn continuous(min: f64, max: f64) -> TrainResult<Self>
pub fn continuous(min: f64, max: f64) -> TrainResult<Self>
Create a continuous range space.
Sourcepub fn log_uniform(min: f64, max: f64) -> TrainResult<Self>
pub fn log_uniform(min: f64, max: f64) -> TrainResult<Self>
Create a log-uniform distribution space.
Sourcepub fn int_range(min: i64, max: i64) -> TrainResult<Self>
pub fn int_range(min: i64, max: i64) -> TrainResult<Self>
Create an integer range space.
Sourcepub fn sample(&self, rng: &mut StdRng) -> HyperparamValue
pub fn sample(&self, rng: &mut StdRng) -> HyperparamValue
Sample a value from this space.
Sourcepub fn grid_values(&self, num_samples: usize) -> Vec<HyperparamValue>
pub fn grid_values(&self, num_samples: usize) -> Vec<HyperparamValue>
Get all possible values for grid search (for discrete/int spaces).
Trait Implementations§
Source§impl Clone for HyperparamSpace
impl Clone for HyperparamSpace
Source§fn clone(&self) -> HyperparamSpace
fn clone(&self) -> HyperparamSpace
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 HyperparamSpace
impl RefUnwindSafe for HyperparamSpace
impl Send for HyperparamSpace
impl Sync for HyperparamSpace
impl Unpin for HyperparamSpace
impl UnwindSafe for HyperparamSpace
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> 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