I’m new to coding/Python and Deep Learning/ML and finding these practice exercises incredibly difficult without prior knowledge. While I understand the concepts, I do not know how to translate it into code. Is it expected that I know all these functions and syntax?
Anyway, I’m trying to calculate the L2 loss function as loss = np.dot(yhat, y).
It returns the following (I have no idea what is correct and what is not):
Error: Wrong output
1 Tests passed
1 Tests failed
AssertionError Traceback (most recent call last)
in
4 print("L2 = " + str(L2(yhat, y)))
5
----> 6 L2_test(L2)
~/work/release/W2A1/public_tests.py in L2_test(target)
249 ]
250
→ 251 test(test_cases, target)
252
~/work/release/W2A1/test_utils.py in test(test_cases, target)
24 print(‘\033[92m’, success," Tests passed")
25 print(‘\033[91m’, len(test_cases) - success, " Tests failed")
—> 26 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))
AssertionError: Not all tests were passed for L2. Check your equations and avoid using global variables inside the function.