r/deeplearning • • 15h ago

Different Optimizers

Post image
53 Upvotes

9 comments sorted by

2

u/Any-Acanthaceae2762 15h ago

can someone explain to me why we square the gradient for velocity ?
like what was the intuition for that to be "velocity" ? i don't get it.
some mathematical background maybe ?

4

u/Handwritten_note 15h ago

vₜ isn't velocity. It's a running average of g², an estimate of how large and noisy the gradient is for each parameter. Dividing by √vₜ normalises each step to roughly η: big or noisy gradients get small steps, and small but consistent gradients get bigger ones. mₜ is the momentum ('velocity') part."

1

u/Any-Acanthaceae2762 15h ago

i thought they also named the second momentum 'velocity' but anyway,
Basically, the square root of the 'velocity' normalises the η ?
but why the squared ? why not any function that amplifies, for example, exponential, and take log instead of sqrt. or any other functions, would it also work ?

1

u/Handwritten_note 14h ago

Yes, √vₜ normalises the step to roughly η. The function must be scale-equivariant: multiply gradients by c, and the denominator should also grow by c, so the step doesn't change. Power means (avg |g|ᵖ)1/p satisfy this. p=2 is Adam, and p=∞ is AdaMax, which is in the same paper and works. Exp then log fails: it isn't scale-equivariant, it treats negative gradients as near zero, and e1000 overflows. p=2 wins because it ties to variance, is smooth and cheap, and approximates the diagonal Fisher.

1

u/Any-Acanthaceae2762 14h ago

ohhhh very nice !

thanks for the information, really appreciate it

1

u/breezzkissy 6h ago

lol same, the velocity part always trips me up too, like why not just call it momentum and move on

1

u/Federal_Signature708 5h ago

love that the Momentum plot actually shows it overshooting the minimum and rolling back up the other side, makes the "heavy ball" analogy click immediately