Struct rusty_machine::learning::optim::grad_desc::StochasticGD
source · [−]pub struct StochasticGD { /* private fields */ }
Expand description
Stochastic Gradient Descent algorithm.
Uses basic momentum to control the learning rate.
Implementations
sourceimpl 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.
With Nesterov momentum by default.
Examples
use rusty_machine::learning::optim::grad_desc::StochasticGD;
let sgd = StochasticGD::new(0.1, 0.3, 5);
Trait Implementations
sourceimpl Clone for StochasticGD
impl Clone for StochasticGD
sourcefn clone(&self) -> StochasticGD
fn clone(&self) -> StochasticGD
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for StochasticGD
impl Debug for StochasticGD
sourceimpl Default for StochasticGD
impl Default for StochasticGD
The default Stochastic GD algorithm.
The defaults are:
- alpha = 0.1
- mu = 0.1
- iters = 20
sourcefn default() -> StochasticGD
fn default() -> StochasticGD
Returns the “default value” for a type. Read more
sourceimpl<M> OptimAlgorithm<M> for StochasticGDwhere
M: Optimizable<Inputs = Matrix<f64>, Targets = Matrix<f64>>,
impl<M> OptimAlgorithm<M> for StochasticGDwhere
M: Optimizable<Inputs = Matrix<f64>, Targets = Matrix<f64>>,
impl Copy for StochasticGD
Auto Trait Implementations
impl RefUnwindSafe for StochasticGD
impl Send for StochasticGD
impl Sync for StochasticGD
impl Unpin for StochasticGD
impl UnwindSafe for StochasticGD
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more