# Programming assignment (Week 2)

**URL:** <https://community.deeplearning.ai/t/programming-assignment-week-2/276864>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [February 19, 2023, 2:04pm UTC](https://community.deeplearning.ai/t/programming-assignment-week-2/276864 "2023-02-19T14:04:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![QUY\_LE\_MINH](https://avatars.discourse-cdn.com/v4/letter/q/85e7bf/32.png) [@QUY\_LE\_MINH](https://community.deeplearning.ai/u/QUY_LE_MINH)\
**Post date:** [February 19, 2023, 2:04pm UTC](https://community.deeplearning.ai/t/programming-assignment-week-2/276864/1 "2023-02-19T14:04:38Z")

</div>

In update\_parameters\_with\_adam function, after carefully checking, I’m still not sure why I get uncorrected here. The expected value and my output difference is very small. Please help me. (image below)

_{moderator edit - solution code removed}_

 ![image](https://global.discourse-cdn.com/dlai/original/3X/b/5/b525a0a39ca376e543da7b590de9df181142b615.png)  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/1/a/1a68fda1113499fdbebddbdbac4e66a98fbf98b3.png)

---

<div class="post-metadata">

**Author:** ![Kic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/kic/32/76339_2.png) [@Kic](https://community.deeplearning.ai/u/Kic)\
**Post date:** [February 19, 2023, 2:29pm UTC](https://community.deeplearning.ai/t/programming-assignment-week-2/276864/2 "2023-02-19T14:29:35Z")

</div>

Hi @QUY_LE_MINH ,

As you screenshot didn’t cover the entire line of code for the parameters update, I am guessing there is a closing parenthesis being misplaced at the function call np.sqrt(). Please check the formula, epsilon is outside of the square root.

---

<div class="post-metadata">

**Author:** ![QUY\_LE\_MINH](https://avatars.discourse-cdn.com/v4/letter/q/85e7bf/32.png) [@QUY\_LE\_MINH](https://community.deeplearning.ai/u/QUY_LE_MINH)\
**Post date:** [February 19, 2023, 2:43pm UTC](https://community.deeplearning.ai/t/programming-assignment-week-2/276864/3 "2023-02-19T14:43:52Z")

</div>

Hi,

Sorry for that inconvenience. Here is my full loc:

_{moderator edit - solution code removed}_

I think that the epsilon is not the issue.

---

<div class="post-metadata">

**Author:** ![Kic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/kic/32/76339_2.png) [@Kic](https://community.deeplearning.ai/u/Kic)\
**Post date:** [February 19, 2023, 3:11pm UTC](https://community.deeplearning.ai/t/programming-assignment-week-2/276864/4 "2023-02-19T15:11:56Z")

</div>

Hi @QUY_LE_MINH ,

That is exactually what I pointed out to you. Your code showed that the np.sqrt() call included epsilon. If you check the formula, epsilon is placed outside of the square root. In other word, epsilon should only be added after the square root of {s\_corrected}\_{dw^{[l]}}
