Struct rusty_machine::learning::optim::grad_desc::StochasticGD
[−]
[src]
pub struct StochasticGD {
pub alpha: f64,
pub mu: f64,
pub iters: usize,
}Stochastic Gradient Descent algorithm.
Uses basic momentum to control the learning rate.
Fields
alpha: f64
Controls the momentum of the descent
mu: f64
The square root of the raw learning rate.
iters: usize
The number of passes through the data.
Methods
impl StochasticGD[src]
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
impl Default for StochasticGD[src]
fn default() -> StochasticGD
Constructs a stochastic gradient descent algorithm with default settings.
Uses 5 iterations, momentum of 0.1 and rate of 0.3.