Week 2Assignment: Python Basics with Numpy

I had created the above code in the part as required but getting the following error in output
~/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 basic_sigmoid. Check your equations and avoid using global variables inside the function.

Please suggest how to correct this.

You should not publish solutions here its against the rules. In your case here dont use the variable t , just perform operations direclty on variable x.

Hi Gent,
I will not publish any code from next time onwards. Initially i used x in the function but the error was same. It seems there is something missing/required in the s variable.

Yeah its probably that you might be using s variable upwards somewhere as a global variable, you should remove that s, so only the function’s instance can be returned at return.

s is not used anywhere else in the code. It is just used in 1 line. That’s why I had pasted the whole code in the question to clear any doubts for this. its related something with the sigmoid calculation which is needed on the s left side.