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 MeanSqErrorimpl CostFunc<Vector<f64>> for MeanSqErrorimpl CostFunc<Matrix<f64>> for CrossEntropyErrorimpl CostFunc<Vector<f64>> for CrossEntropyError