Skip to content

Commit

Permalink
Make it clearer that losses reduce along the batch dimension (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcarp authored Dec 15, 2024
1 parent 3ea573f commit 616e513
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/api/losses/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ A loss is a callable with arguments `loss_fn(y_true, y_pred, sample_weight=None)
by the corresponding value of `sample_weight`. (Note on`dN-1`: all loss
functions reduce by 1 dimension, usually `axis=-1`.)

By default, loss functions return one scalar loss value per input sample, e.g.
By default, loss functions return one scalar loss value for each input sample
in the batch dimension, e.g.

```
>>> from keras import ops
Expand Down

0 comments on commit 616e513

Please sign in to comment.