Skip to content

Commit 203ec05

Browse files
authored
Fix boolean conversion in Gaussian NLL loss example
1 parent 529583f commit 203ec05

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

machine_learning/loss_functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# ruff: noqa: RUF002 -- ambiguous-unicode-character-docstring
2+
13
import numpy as np
24

35

@@ -327,7 +329,7 @@ def gaussian_negative_log_likelihood_loss(
327329
>>> expectation = np.array([0.8, 2.1, 2.9, 4.2, 5.2])
328330
>>> variance = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
329331
>>> loss = gaussian_negative_log_likelihood_loss(true_labels, expectation, variance)
330-
>>> np.isclose(loss, -0.60621)
332+
>>> bool(np.isclose(loss, -0.60621))
331333
True
332334
333335
>>> true_labels = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

0 commit comments

Comments
 (0)