Pretty stuck, any pointers?
{moderator edit - solution code removed}
t_x = np.array([[9, 2, 5, 0, 0],
[7, 5, 0, 0 ,0]])
print("softmax(x) = " + str(softmax(t_x)))
β
softmax_test(softmax)
softmax(x) = [[5.06442745e+02 4.61816006e-01 9.27582244e+00 6.25000000e-02
6.25000000e-02]
[9.13860965e+01 1.23677633e+01 8.33333333e-02 8.33333333e-02
8.33333333e-02]]
Error: Wrong output
2 Tests passed
1 Tests failed
AssertionError Traceback (most recent call last)
in
3 print("softmax(x) = " + str(softmax(t_x)))
4
----> 5 softmax_test(softmax)
~/work/release/W2A1/public_tests.py in softmax_test(target)
195 ]
196
β 197 test(test_cases, target)
198
199 def L1_test(target):
~/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 softmax. Check your equations and avoid using global variables inside the function.