Skip to content

Commit 66f0ca9

Browse files
authored
Update loss_functions.py
1 parent d654b33 commit 66f0ca9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

machine_learning/loss_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ def sparse_categorical_cross_entropy(
167167
168168
>>> true_labels = np.array([0, 1, 2])
169169
>>> pred_probs = np.array([[0.9, 0.1, 0.0], [0.2, 0.7, 0.1], [0.0, 0.1, 0.9]])
170-
>>> sparse_categorical_cross_entropy(true_labels, pred_probs)
170+
>>> float(sparse_categorical_cross_entropy(true_labels, pred_probs))
171171
0.567395975254385
172172
173173
>>> true_labels = np.array([1, 2])
174174
>>> pred_probs = np.array([[0.05, 0.95, 0], [0.1, 0.8, 0.1]])
175-
>>> sparse_categorical_cross_entropy(true_labels, pred_probs)
175+
>>> float(sparse_categorical_cross_entropy(true_labels, pred_probs))
176176
2.353878387381596
177177
178178
>>> true_labels = np.array([1, 5])

0 commit comments

Comments
 (0)