Struct optimization::GradientDescent [] [src]

pub struct GradientDescent<T> {
    // some fields omitted
}

A simple Gradient Descent optimizer.

Methods

impl GradientDescent<ArmijoLineSearch>

fn new() -> GradientDescent<ArmijoLineSearch>

Creates a new GradientDescent optimizer using the following defaults:

  • line_search = ArmijoLineSearch(0.5, 1.0, 0.5)
  • gradient_tolerance = 1e-4
  • max_iterations = None

impl<T: LineSearch> GradientDescent<T>

Specifies the line search method to use.

fn gradient_tolerance(self, gradient_tolerance: f64) -> Self

Adjusts the gradient tolerance which is used as abort criterion to decide whether we reached a plateau.

fn max_iterations(self, max_iterations: Option<u64>) -> Self

Adjusts the number of maximally run iterations. A value of None instructs the optimizer to ignore the nubmer of iterations.

Trait Implementations

impl<F: Function1, S: LineSearch> Minimizer<F> for GradientDescent<S>

type Solution = Solution

fn minimize(&self, function: &F, initial_position: Vec<f64>) -> Solution