pub struct StochasticGradientDescent { /* private fields */ }
Expand description
Provides stochastic Gradient Descent optimization.
Implementations§
Source§impl StochasticGradientDescent
impl StochasticGradientDescent
Sourcepub fn new() -> StochasticGradientDescent
pub fn new() -> StochasticGradientDescent
Creates a new StochasticGradientDescent
optimizer using the following defaults:
step_width
=0.01
mini_batch
=1
max_iterations
=1000
The used random number generator is randomly seeded.
Sourcepub fn seed(&mut self, seed: u64) -> &mut Self
pub fn seed(&mut self, seed: u64) -> &mut Self
Seeds the random number generator using the supplied seed
.
This is useful to create re-producable results.
Sourcepub fn max_iterations(&mut self, max_iterations: Option<u64>) -> &mut Self
pub fn max_iterations(&mut self, max_iterations: Option<u64>) -> &mut Self
Adjusts the number of maximally run iterations. A value of None
instructs the
optimizer to ignore the nubmer of iterations.
Sourcepub fn mini_batch(&mut self, mini_batch: usize) -> &mut Self
pub fn mini_batch(&mut self, mini_batch: usize) -> &mut Self
Adjusts the mini batch size, i.e., how many terms are considered in one step at most.
Sourcepub fn step_width(&mut self, step_width: f64) -> &mut Self
pub fn step_width(&mut self, step_width: f64) -> &mut Self
Adjusts the step size applied for each mini batch.
Trait Implementations§
Source§impl Default for StochasticGradientDescent
impl Default for StochasticGradientDescent
Source§impl<F: Summation1> Minimizer<F> for StochasticGradientDescent
impl<F: Summation1> Minimizer<F> for StochasticGradientDescent
Auto Trait Implementations§
impl Freeze for StochasticGradientDescent
impl RefUnwindSafe for StochasticGradientDescent
impl Send for StochasticGradientDescent
impl Sync for StochasticGradientDescent
impl Unpin for StochasticGradientDescent
impl UnwindSafe for StochasticGradientDescent
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