fn check_derivate<T: Copy>(cost: &impl Cost<T>, prediction: f64, truth: T) -> f64 {
        let derivate = cost.outer_derivative(&prediction, truth);
        let approx = approx_derivate(cost, prediction, truth);
        println!("derivation: {}, approximation: {}", derivate, approx);
        (derivate - approx).abs()
    }
// Returns absolute difference between derivate and approximation
Returns absolute difference between derivate and approximation
Returns absolute difference between derivate and approximation
fn check_derivate<T: Copy>(cost: &impl Cost<T>, prediction: f64, truth: T) -> f64 {
        let derivate = cost.outer_derivative(&prediction, truth);
        let approx = approx_derivate(cost, prediction, truth);
        println!("derivation: {}, approximation: {}", derivate, approx);
        (derivate - approx).abs()
    }
fn check_derivate < T : Copy > ( cost : & impl Cost < T > , prediction : f64 , truth : T ) -> f64 { let derivate = cost . outer_derivative ( & prediction , truth ) ; let approx = approx_derivate ( cost , prediction , truth ) ; println ! ( " " derivate approx ) ; ( derivate - approx ) . abs ( ) }
Returns absolute difference between derivate and approximation
Returns absolute difference between derivate and approximation
cost
&impl Cost<T>
prediction
f64
truth
T
cost
&impl Cost<T>
prediction
f64
truth
T