# Help! Optimization methods

**URL:** <https://community.deeplearning.ai/t/help-optimization-methods/458161>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [September 29, 2023, 9:50am UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161 "2023-09-29T09:50:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jingni\_Huang](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jingni\_Huang](https://community.deeplearning.ai/u/Jingni_Huang)\
**Post date:** [September 29, 2023, 9:50am UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161/1 "2023-09-29T09:50:30Z")

</div>

Please see the Error:

## W1 = [[1.63942888 -0.61624001 -0.54303153] [-1.05781906 0.85024927 -2.31663159]] W2 = [[0.33400701 -0.23919264] [1.47721313 -2.04655625] [-0.33719642 -0.36907981]] b1 = [[1.73008524] [-0.77629952]] b2 = [[1.14819595] [-1.08492045] [-0.15735887]]

AssertionError Traceback (most recent call last)  
 in   
7 print(f"b2 = \n{parameters[‘b2’]}")  
8  
----\> 9 update\_parameters\_with\_adam\_test(update\_parameters\_with\_adam)

~/work/release/W2A1/public\_tests.py in update\_parameters\_with\_adam\_test(target)  
280 assert type(parameters[key]) == np.ndarray, f"Wrong type for parameters[‘{key}’]. Expected np.ndarray"  
281 assert parameters[key].shape == parametersi[key].shape, f"Wrong shape for parameters[‘{key}’]. The update must keep the dimensions of parameters inputs"  
 → 282 assert np.allclose(parameters[key][0], expected\_parameters[key]), f"Wrong values. Check you formulas for parameters[‘{key}’]"  
283 #print(f"{key}: \n {str(parameters[key])}")  
284

AssertionError: Wrong values. Check you formulas for parameters[‘W1’]

---

<div class="post-metadata">

**Author:** ![Deepti\_Prasad](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/deepti_prasad/32/165831_2.png) [@Deepti\_Prasad](https://community.deeplearning.ai/u/Deepti_Prasad)\
**Post date:** [September 29, 2023, 11:05am UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161/2 "2023-09-29T11:05:15Z")

</div>

Check you update parameters for the grader cell

make sure you recalled with the right function for parameter W1.

---

<div class="post-metadata">

**Author:** ![Jingni\_Huang](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jingni\_Huang](https://community.deeplearning.ai/u/Jingni_Huang)\
**Post date:** [September 29, 2023, 1:18pm UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161/3 "2023-09-29T13:18:32Z")

</div>

Hallo

It’s week 2, Optimization methods.

---

<div class="post-metadata">

**Author:** ![saifkhanengr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/saifkhanengr/32/152858_2.png) [@saifkhanengr](https://community.deeplearning.ai/u/saifkhanengr)\
**Post date:** [September 29, 2023, 2:46pm UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161/4 "2023-09-29T14:46:10Z")

</div>

One more thing, `epsilon ` is not under the square root.

---

<div class="post-metadata">

**Author:** ![Jingni\_Huang](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Jingni\_Huang](https://community.deeplearning.ai/u/Jingni_Huang)\
**Post date:** [September 29, 2023, 3:17pm UTC](https://community.deeplearning.ai/t/help-optimization-methods/458161/5 "2023-09-29T15:17:58Z")

</div>

I finally, I found the solution.

The final parameter formula is missing a bracket, which makes me almost blind. . .
