Gradient

Trait Gradient 

Source
pub trait Gradient<R: RealScalar>: CostFunction<R> {
    // Required method
    fn gradient_into(&mut self, params: &[R], grad_out: RowMut<'_, R>);

    // Provided methods
    fn allocate_gradient(&self) -> Row<R> { ... }
    fn cost_and_gradient_into(
        &mut self,
        params: &[R],
        grad_out: RowMut<'_, R>,
    ) -> R { ... }
}
Expand description

A trait for gradients.

Required Methods§

Source

fn gradient_into(&mut self, params: &[R], grad_out: RowMut<'_, R>)

Calculates the gradient for the given parameters.

Provided Methods§

Source

fn allocate_gradient(&self) -> Row<R>

Source

fn cost_and_gradient_into(&mut self, params: &[R], grad_out: RowMut<'_, R>) -> R

Calculates the cost and gradient for the given parameters.

Implementors§