pub struct StochasticGD { /* private fields */ }Expand description
Stochastic Gradient Descent algorithm.
Uses basic momentum to control the learning rate.
Implementations§
Source§impl StochasticGD
impl StochasticGD
Sourcepub fn new(alpha: f64, mu: f64, iters: usize) -> StochasticGD
pub fn new(alpha: f64, mu: f64, iters: usize) -> StochasticGD
Construct a stochastic gradient descent algorithm.
Requires the learning rate, momentum rate and iteration count to be specified.
§Examples
use rusty_machine::learning::optim::grad_desc::StochasticGD;
let sgd = StochasticGD::new(0.1, 0.3, 5);Trait Implementations§
Source§impl Clone for StochasticGD
impl Clone for StochasticGD
Source§fn clone(&self) -> StochasticGD
fn clone(&self) -> StochasticGD
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 Debug for StochasticGD
impl Debug for StochasticGD
Source§impl Default for StochasticGD
The default Stochastic GD algorithm.
impl Default for StochasticGD
The default Stochastic GD algorithm.
The defaults are:
- alpha = 0.1
- mu = 0.1
- iters = 20
Source§fn default() -> StochasticGD
fn default() -> StochasticGD
Returns the “default value” for a type. Read more
Source§impl<M> OptimAlgorithm<M> for StochasticGD
impl<M> OptimAlgorithm<M> for StochasticGD
impl Copy for StochasticGD
Auto Trait Implementations§
impl Freeze for StochasticGD
impl RefUnwindSafe for StochasticGD
impl Send for StochasticGD
impl Sync for StochasticGD
impl Unpin for StochasticGD
impl UnwindSafe for StochasticGD
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