mirror of
https://github.com/vishpat/candle-coursera-ml.git
synced 2026-01-03 19:42:56 +00:00
Fix the cov function
This commit is contained in:
@@ -39,7 +39,7 @@ fn cov(data: &Tensor, device: &Device) -> Result<Tensor> {
|
|||||||
let cov = centered
|
let cov = centered
|
||||||
.transpose(D::Minus1, D::Minus2)?
|
.transpose(D::Minus1, D::Minus2)?
|
||||||
.matmul(¢ered)?
|
.matmul(¢ered)?
|
||||||
.broadcast_div(&Tensor::new(m as f32, device)?)?;
|
.broadcast_div(&Tensor::new((m - 1) as f32, device)?)?;
|
||||||
|
|
||||||
Ok(cov)
|
Ok(cov)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user