Skip to content

Commit

Permalink
Update losses.py (#20523)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilakrayal authored Nov 20, 2024
1 parent 660da94 commit c802ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/src/losses/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ class CategoricalCrossentropy(LossFunctionWrapper):
Standalone usage:
>>> y_true = [[0, 1, 0], [0, 0, 1]]
>>> y_pred = [[0.05, 0.95, 0], [0.1, 0.8, 0.1]]
>>> y_true = np.array([[0, 1, 0], [0, 0, 1]])
>>> y_pred = np.array([[0.05, 0.95, 0], [0.1, 0.8, 0.1]])
>>> # Using 'auto'/'sum_over_batch_size' reduction type.
>>> cce = keras.losses.CategoricalCrossentropy()
>>> cce(y_true, y_pred)
Expand Down

0 comments on commit c802ca6

Please sign in to comment.