Struct rusty_machine::learning::optim::grad_desc::StochasticGD [] [src]

pub struct StochasticGD {
    // some fields omitted
}

Stochastic Gradient Descent algorithm.

Uses basic momentum to control the learning rate.

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 Debug for StochasticGD
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for StochasticGD
[src]

impl Clone for StochasticGD
[src]

fn clone(&self) -> StochasticGD

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for StochasticGD
[src]

The default Stochastic GD algorithm.

The defaults are:

fn default() -> StochasticGD

Returns the "default value" for a type. Read more

impl<M> OptimAlgorithm<M> for StochasticGD where M: Optimizable<Inputs=Matrix<f64>, Targets=Matrix<f64>>
[src]

fn optimize(&self, model: &M, start: &[f64], inputs: &M::Inputs, targets: &M::Targets) -> Vec<f64>

Return the optimized parameter using gradient optimization. Read more