mirror of
https://github.com/vishpat/candle-coursera-ml.git
synced 2025-12-22 22:19:58 +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
|
||||
.transpose(D::Minus1, D::Minus2)?
|
||||
.matmul(¢ered)?
|
||||
.broadcast_div(&Tensor::new(m as f32, device)?)?;
|
||||
.broadcast_div(&Tensor::new((m - 1) as f32, device)?)?;
|
||||
|
||||
Ok(cov)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user