Week 2 Adam optimization Implementation

Hello,

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

Looking expected solution:
W1 =
[[ 1.63937725 -0.62327448 -0.54308727]
[-1.0578897 0.85032154 -2.31657668]]
W2 =
[[ 0.33400549 -0.23563857]
[ 1.47715417 -2.04561842]
[-0.33729882 -0.36908457]]
b1 =
[[ 1.72995096]
[-0.7762447 ]]
b2 =
[[ 1.14852557]
[-1.08492339]
[-0.15740527]]

and my results:
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]]

The errors is sometime less than 10e-4 ?!
Passed all other tests prior to that cell.
Very weird.

can I have someone review my code please.

Thank you.

One common mistake is placing Epsilon inside the square root.

2 Likes

Saved the day, thank you.

1 Like