Mean and Sum Reductions of Training Loss

A training objective can sum or average losses across examples. The reduction changes gradient scale and batch-size dependence.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a short batch
  2. Trace one update

Trace a short batch

Losses 2, 1, and 3 give sum six and mean two. If every example is repeated and no other term changes, the sum doubles while the mean stays two. Weighted averaging determines how unequal batches combine.

Trace one update

If all example gradients are summed rather than averaged, a fixed learning rate may apply a larger step. See gradient descent updates.[1]

References

  1. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning ↩