#[non_exhaustive]pub struct EpsilonGreedyConfig {
pub epsilon: f64,
pub decay: f64,
pub min_epsilon: f64,
}Available on crate feature
bandit only.Expand description
Configuration for EpsilonGreedy.
§Examples
use rill_ml::bandit::EpsilonGreedyConfig;
let mut config = EpsilonGreedyConfig::default();
config.epsilon = 0.1;
config.decay = 0.999;
config.min_epsilon = 0.01;
assert!((config.epsilon - 0.1).abs() < 1e-12);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.epsilon: f64Initial exploration probability. Must be in [0, 1].
0.0 means pure exploitation, 1.0 means pure exploration.
decay: f64Exponential decay factor applied to epsilon after each update.
Set to 1.0 for no decay (fixed epsilon). Must be in (0, 1].
After each update, epsilon becomes max(min_epsilon, epsilon * decay).
min_epsilon: f64Lower bound for epsilon after decay. Must be in [0, epsilon].
Implementations§
Trait Implementations§
Source§impl Clone for EpsilonGreedyConfig
impl Clone for EpsilonGreedyConfig
Source§fn clone(&self) -> EpsilonGreedyConfig
fn clone(&self) -> EpsilonGreedyConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EpsilonGreedyConfig
impl Debug for EpsilonGreedyConfig
Source§impl Default for EpsilonGreedyConfig
impl Default for EpsilonGreedyConfig
Source§impl PartialEq for EpsilonGreedyConfig
impl PartialEq for EpsilonGreedyConfig
impl StructuralPartialEq for EpsilonGreedyConfig
Auto Trait Implementations§
impl Freeze for EpsilonGreedyConfig
impl RefUnwindSafe for EpsilonGreedyConfig
impl Send for EpsilonGreedyConfig
impl Sync for EpsilonGreedyConfig
impl Unpin for EpsilonGreedyConfig
impl UnsafeUnpin for EpsilonGreedyConfig
impl UnwindSafe for EpsilonGreedyConfig
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