formulas for this cell:
I have written the same exact code for the formulas, but still i am getting different answers, is there anything wrong in my code?or wrong in the assertion? Please help
{Moderator Edit: Solution Code Removed}
my output:
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]]
output error:
AssertionError Traceback (most recent call last)
<ipython-input-49-99ca62433443> in <module>
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']
expected values:
Expected values:
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]]