Struct linfa_ftrl::FtrlParams
source · [−]Implementations
sourceimpl<F: Float, R: Rng> FtrlParams<F, R>
impl<F: Float, R: Rng> FtrlParams<F, R>
sourcepub fn new(alpha: F, beta: F, l1_ratio: F, l2_ratio: F, rng: R) -> Self
pub fn new(alpha: F, beta: F, l1_ratio: F, l2_ratio: F, rng: R) -> Self
Create new hyperparameters with pre-defined values
sourcepub fn default_with_rng(rng: R) -> Self
pub fn default_with_rng(rng: R) -> Self
Create new hyperparameters with pre-defined random number generator
sourcepub fn alpha(self, alpha: F) -> Self
pub fn alpha(self, alpha: F) -> Self
Set the learning rate.
Defaults to 0.005 if not set
alpha must be positive and finite
sourcepub fn beta(self, beta: F) -> Self
pub fn beta(self, beta: F) -> Self
Set the beta parameter.
Defaults to 0.0 if not set
beta must be positive and finite
sourcepub fn l1_ratio(self, l1_ratio: F) -> Self
pub fn l1_ratio(self, l1_ratio: F) -> Self
Set l1_ratio parameter. Controls how the parameter
Defaults to 0.5 if not set
l1_ratio must be between 0.0 and 1.0.
Trait Implementations
sourceimpl<F: Clone + Float, R: Clone + Rng> Clone for FtrlParams<F, R>
impl<F: Clone + Float, R: Clone + Rng> Clone for FtrlParams<F, R>
sourcefn clone(&self) -> FtrlParams<F, R>
fn clone(&self) -> FtrlParams<F, R>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'de, F: Float, R: Rng> Deserialize<'de> for FtrlParams<F, R> where
F: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, F: Float, R: Rng> Deserialize<'de> for FtrlParams<F, R> where
F: Deserialize<'de>,
R: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<F: Float, R: Rng> ParamGuard for FtrlParams<F, R>
impl<F: Float, R: Rng> ParamGuard for FtrlParams<F, R>
sourceimpl<F: PartialEq + Float, R: PartialEq + Rng> PartialEq<FtrlParams<F, R>> for FtrlParams<F, R>
impl<F: PartialEq + Float, R: PartialEq + Rng> PartialEq<FtrlParams<F, R>> for FtrlParams<F, R>
sourcefn eq(&self, other: &FtrlParams<F, R>) -> bool
fn eq(&self, other: &FtrlParams<F, R>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &FtrlParams<F, R>) -> bool
fn ne(&self, other: &FtrlParams<F, R>) -> bool
This method tests for !=.
impl<F: Float, R: Rng> StructuralPartialEq for FtrlParams<F, R>
Auto Trait Implementations
impl<F, R> RefUnwindSafe for FtrlParams<F, R> where
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<F, R> Send for FtrlParams<F, R> where
R: Send,
impl<F, R> Sync for FtrlParams<F, R> where
R: Sync,
impl<F, R> Unpin for FtrlParams<F, R> where
R: Unpin,
impl<F, R> UnwindSafe for FtrlParams<F, R> where
F: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more