fn do_Eq5pt3(Yi_star: &[f64], eYi: &[f64], sigInv_vec: &[f64]) -> f64 {
    assert_eq!(Yi_star.len(), eYi.len());
    let Yi_star_minus_eYi = ewise::sub(&Yi_star, &eYi);
    assert_eq!(Yi_star_minus_eYi.len(), sigInv_vec.len());
    // TODO this (and the orig way can be -inf on the test set.

    -0.5 * (0..Yi_star_minus_eYi.len())
        .map(|i| unsafe {
            let a = Yi_star_minus_eYi.get_unchecked(i);
            a * sigInv_vec.get_unchecked(i) * a
        })
        .sum::<f64>()
}
// WARNING...this hack only works because we are are using diagonal networks...in this
// case sigInv is a matrix with elems on the diagonal and zeros everywhere else.  This
// means that Yi_star_minus_eYi and sigInv as vectors and just to elementwise
// multiplication!
WARNING...this hack only works because we are are using diagonal networks...in this
case sigInv is a matrix with elems on the diagonal and zeros everywhere else.  This
means that Yi_star_minus_eYi and sigInv as vectors and just to elementwise
multiplication!
WARNING ... this hack only works because we are are using diagonal networks ... in this case sigInv is a matrix with elems on the diagonal and zeros everywhere else . This means that Yi_star_minus_eYi and sigInv as vectors and just to elementwise multiplication!
fn do_Eq5pt3(Yi_star: &[f64], eYi: &[f64], sigInv_vec: &[f64]) -> f64 {
    assert_eq!(Yi_star.len(), eYi.len());
    let Yi_star_minus_eYi = ewise::sub(&Yi_star, &eYi);
    assert_eq!(Yi_star_minus_eYi.len(), sigInv_vec.len());
    // TODO this (and the orig way can be -inf on the test set.
    -0.5 * (0..Yi_star_minus_eYi.len())
        .map(|i| unsafe {
            let a = Yi_star_minus_eYi.get_unchecked(i);
            a * sigInv_vec.get_unchecked(i) * a
        })
        .sum::<f64>()
}
fn do_Eq5pt3 ( Yi_star : & [ f64 ] , eYi : & [ f64 ] , sigInv_vec : & [ f64 ] ) -> f64 { assert_eq ! ( Yi_star len ( ) eYi len ( ) ) ; let Yi_star_minus_eYi = ewise :: sub ( & Yi_star , & eYi ) ; assert_eq ! ( Yi_star_minus_eYi len ( ) sigInv_vec len ( ) ) ; // TODO this (and the orig way can be -inf on the test set. - 0.5 * ( 0 .. Yi_star_minus_eYi . len ( ) ) . map ( | i | unsafe { let a = Yi_star_minus_eYi . get_unchecked ( i ) ; a * sigInv_vec . get_unchecked ( i ) * a } ) . sum :: < f64 > ( ) }
WARNING...this hack only works because we are are using diagonal networks...in this
case sigInv is a matrix with elems on the diagonal and zeros everywhere else.
WARNING ... this hack only works because we are are using diagonal networks ... in this case sigInv is a matrix with elems on the diagonal and zeros everywhere else .
Yi_star
&[f64]
eYi
&[f64]
sigInv_vec
&[f64]