Trait rusty_machine::learning::toolkit::cost_fn::CostFunc
[−]
[src]
pub trait CostFunc<T> { fn cost(outputs: &T, targets: &T) -> f64; fn grad_cost(outputs: &T, targets: &T) -> T; }
Trait for cost functions in models.
Required Methods
fn cost(outputs: &T, targets: &T) -> f64
The cost function.
fn grad_cost(outputs: &T, targets: &T) -> T
The gradient of the cost function.
Implementors
impl CostFunc<Matrix<f64>> for MeanSqError
impl CostFunc<Vector<f64>> for MeanSqError
impl CostFunc<Matrix<f64>> for CrossEntropyError
impl CostFunc<Vector<f64>> for CrossEntropyError