pub struct CategoricalParam<T: Clone> { /* private fields */ }Expand description
A categorical parameter that selects from a list of choices.
The generic type T is the element type of the choices vector.
The sampler picks an index and the corresponding element is returned.
§Examples
use optimizer::Trial;
use optimizer::parameter::{CategoricalParam, Parameter};
let mut trial = Trial::new(0);
let opt = CategoricalParam::new(vec!["sgd", "adam", "rmsprop"])
.name("optimizer")
.suggest(&mut trial)
.unwrap();Implementations§
Source§impl<T: Clone> CategoricalParam<T>
impl<T: Clone> CategoricalParam<T>
Trait Implementations§
Source§impl<T: Clone + Clone> Clone for CategoricalParam<T>
impl<T: Clone + Clone> Clone for CategoricalParam<T>
Source§fn clone(&self) -> CategoricalParam<T>
fn clone(&self) -> CategoricalParam<T>
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 moreSource§impl<T: Clone + Debug> Parameter for CategoricalParam<T>
impl<T: Clone + Debug> Parameter for CategoricalParam<T>
Source§fn distribution(&self) -> Distribution
fn distribution(&self) -> Distribution
Return the distribution that this parameter samples from.
Source§fn cast_param_value(&self, param_value: &ParamValue) -> Result<T>
fn cast_param_value(&self, param_value: &ParamValue) -> Result<T>
Convert a raw
ParamValue into the typed value. Read moreAuto Trait Implementations§
impl<T> Freeze for CategoricalParam<T>
impl<T> RefUnwindSafe for CategoricalParam<T>where
T: RefUnwindSafe,
impl<T> Send for CategoricalParam<T>where
T: Send,
impl<T> Sync for CategoricalParam<T>where
T: Sync,
impl<T> Unpin for CategoricalParam<T>where
T: Unpin,
impl<T> UnsafeUnpin for CategoricalParam<T>
impl<T> UnwindSafe for CategoricalParam<T>where
T: UnwindSafe,
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