Trait RobustLoss

Source
pub trait RobustLoss: Clone {
    // Required methods
    fn loss(&self, r: f64) -> f64;
    fn weight(&self, r: f64) -> f64;
    fn weight_derivative(&self, r: f64) -> f64;
}
Expand description

Trait for robust loss functions

Required Methods§

Source

fn loss(&self, r: f64) -> f64

Compute the loss value for a residual

Source

fn weight(&self, r: f64) -> f64

Compute the weight (psi function derivative) for a residual Weight = psi(r) / r where psi is the derivative of the loss

Source

fn weight_derivative(&self, r: f64) -> f64

Compute the derivative of the weight function (for Hessian computation)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§