Problem with coding assignment

I was solving the seventh module and added all the required cases and solved accordingly, yet it showed 1 test case failed alongwith this error

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)
223 ]
224
β†’ 225 test(test_cases, target)
226
227

~/work/release/W2A1/test_utils.py in test(test_cases, target)
24 print(β€˜\033[92m’, success," Tests passed\033[0m")
25 print(β€˜\033[91m’, len(test_cases) - success, " Tests failed\033[0m")
β€”> 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.

I would be obliged to get some help regarding this issue on test case

Hi @7anmay

The softmax test function checks for 3 different areas of the output generated by your code; these include its data type, shape, and matching output. It looks like there is problem with your code. Could you check the formula against your code. The comment line provided helpful hints, so take a look carefully.

After editing your code, remember to rerun you code from start.

It might also help if we could see the output of the whole test that you got. Note that there is a numeric output that should be shown before it calls softmax_test, which is where things fail. Seeing the numeric output you got would probably be a pretty good clue about the nature of the mistake in your code. :nerd_face:

For example here’s what I see with correct code for that section:

softmax(x) = [[9.80897665e-01 8.94462891e-04 1.79657674e-02 1.21052389e-04
  1.21052389e-04]
 [8.78679856e-01 1.18916387e-01 8.01252314e-04 8.01252314e-04
  8.01252314e-04]]
 All tests passed.