# Gradient Descent with Momentum (formula)

**URL:** <https://community.deeplearning.ai/t/gradient-descent-with-momentum-formula/230105>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [November 13, 2022, 9:29am UTC](https://community.deeplearning.ai/t/gradient-descent-with-momentum-formula/230105 "2022-11-13T09:29:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zheneliz147](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@zheneliz147](https://community.deeplearning.ai/u/zheneliz147)\
**Post date:** [November 13, 2022, 9:29am UTC](https://community.deeplearning.ai/t/gradient-descent-with-momentum-formula/230105/1 "2022-11-13T09:29:58Z")

</div>

Could you help me to understand it,please? In videos it was said that we calculate Vdw as Vdw=beta\*Vdw+(1-beta)\*dW. Why we use here Vdw and not Vdw-1? Also, if we initialize it with zeros, than the first term will be zero at any layer and it won’t affect on the value of Vdw.

Thank you for your help in advance!

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [November 13, 2022, 4:10pm UTC](https://community.deeplearning.ai/t/gradient-descent-with-momentum-formula/230105/2 "2022-11-13T16:10:31Z")

</div>

This is a variation on the idea of an EWA (exponentially weighted average). Not exactly the same, but the same “flavor”. Notice that Vdw is only zero on the first iteration. They could have done the analog of the “bias correction” method for EWAs to change this, but decided not to.

---

<div class="post-metadata">

**Author:** ![davidg](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@davidg](https://community.deeplearning.ai/u/davidg)\
**Post date:** [November 13, 2022, 4:59pm UTC](https://community.deeplearning.ai/t/gradient-descent-with-momentum-formula/230105/3 "2022-11-13T16:59:37Z")

</div>

I think the formula as you stated it lacks some notational clarity, I would write it as

VdW\_{t} = beta \* VdW\_{t-1} + (1 - beta) \* dW\_{t}

(Note the indices on VdW and dW). In other words, even if VdW is initialised to 0, its contribution will only vanish on the first iteration, and VdW\_{1} = (1 - beta) \* dW\_{1}.  
VdW\_{t-1} != 0 for all t \>= 1
