pub struct RandomSampler { /* private fields */ }Expand description
The simplest possible Sampler: every parameter is drawn independently
and uniformly (or log-uniformly / categorically) from its distribution, with
no learning from prior trials. It is the right baseline to validate the
whole Trial/TrialContext/Study plumbing against, and the reference
every adaptive sampler is compared to.
Implementations§
Source§impl RandomSampler
impl RandomSampler
Sourcepub fn new() -> RandomSampler
pub fn new() -> RandomSampler
A random sampler seeded from OS entropy (non-deterministic across runs).
Sourcepub fn seeded(seed: u64) -> RandomSampler
pub fn seeded(seed: u64) -> RandomSampler
A random sampler with a fixed seed — reproducible across runs, which is what tests and benchmarks want.
Trait Implementations§
Source§impl Default for RandomSampler
impl Default for RandomSampler
Source§fn default() -> RandomSampler
fn default() -> RandomSampler
Returns the “default value” for a type. Read more
Source§impl Sampler for RandomSampler
impl Sampler for RandomSampler
fn suggest( &mut self, _study_state: &StudyState, _trial: &Trial, _param_name: &str, distribution: &Distribution, ) -> Value
Auto Trait Implementations§
impl Freeze for RandomSampler
impl RefUnwindSafe for RandomSampler
impl Send for RandomSampler
impl Sync for RandomSampler
impl Unpin for RandomSampler
impl UnsafeUnpin for RandomSampler
impl UnwindSafe for RandomSampler
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