Trait Optimizable

Source
pub trait Optimizable {
    type Inputs;
    type Targets;

    // Required method
    fn compute_grad(
        &self,
        params: &[f64],
        inputs: &Self::Inputs,
        targets: &Self::Targets,
    ) -> (f64, Vec<f64>);
}
Expand description

Trait for models which can be gradient-optimized.

Required Associated Types§

Source

type Inputs

The input data type to the model.

Source

type Targets

The target data type to the model.

Required Methods§

Source

fn compute_grad( &self, params: &[f64], inputs: &Self::Inputs, targets: &Self::Targets, ) -> (f64, Vec<f64>)

Compute the gradient for the model.

Implementors§

Source§

impl Optimizable for LinRegressor

Source§

impl Optimizable for BaseLogisticRegressor

Computing the gradient of the underlying Logistic Regression model.

The gradient is given by

XT(h(Xb) - y) / m

where h is the sigmoid function and b the underlying model parameters.

Source§

impl<'a, T: Criterion> Optimizable for BaseNeuralNet<'a, T>

Compute the gradient of the Neural Network using the back propagation algorithm.