Skip to content

Commit d46dddc

Browse files
committed
removed the redundant paren from kl_diverengence function
1 parent 23ac809 commit d46dddc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/machine_learning/loss_function/kl_divergence_loss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn kld_loss(actual: &[f64], predicted: &[f64]) -> f64 {
1616
let loss: f64 = actual
1717
.iter()
1818
.zip(predicted.iter())
19-
.map(|(&a, &p)| ((a + eps) * ((a + eps) / (p + eps)).ln()))
19+
.map(|(&a, &p)| (a + eps) * ((a + eps) / (p + eps)).ln())
2020
.sum();
2121
loss
2222
}

0 commit comments

Comments
 (0)