Skip to content

Commit c802ca6

Browse files
authored
Update losses.py (#20523)
1 parent 660da94 commit c802ca6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: keras/src/losses/losses.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ class CategoricalCrossentropy(LossFunctionWrapper):
923923
924924
Standalone usage:
925925
926-
>>> y_true = [[0, 1, 0], [0, 0, 1]]
927-
>>> y_pred = [[0.05, 0.95, 0], [0.1, 0.8, 0.1]]
926+
>>> y_true = np.array([[0, 1, 0], [0, 0, 1]])
927+
>>> y_pred = np.array([[0.05, 0.95, 0], [0.1, 0.8, 0.1]])
928928
>>> # Using 'auto'/'sum_over_batch_size' reduction type.
929929
>>> cce = keras.losses.CategoricalCrossentropy()
930930
>>> cce(y_true, y_pred)

0 commit comments

Comments
 (0)