Trait StochasticGradientFunction

Source
pub trait StochasticGradientFunction {
    // Required methods
    fn compute_gradient(
        &mut self,
        x: &ArrayView1<'_, f64>,
        batch_data: &[f64],
    ) -> Array1<f64>;
    fn compute_value(
        &mut self,
        x: &ArrayView1<'_, f64>,
        batch_data: &[f64],
    ) -> f64;
}
Expand description

Stochastic gradient function trait

Required Methods§

Source

fn compute_gradient( &mut self, x: &ArrayView1<'_, f64>, batch_data: &[f64], ) -> Array1<f64>

Compute gradient on a batch of data

Source

fn compute_value(&mut self, x: &ArrayView1<'_, f64>, batch_data: &[f64]) -> f64

Compute function value on a batch of data

Implementors§