Week 2 Numpy Programming Exercise

Test cases are failing for basic_sigmoid and sigmoid even though I am doing the right code.

Hi @Shehneel_Khan ,

Welcome to the community. I noticed you posted your query to the general discussion forum, which is not the right place for assignment discussion. You will get a faster response if you posted your in the correct Forum. If you have a closer look, there is a Discussion Forum for each course.
Assuming you are referring to DLS course1, I am not aware of any issues with the test cases. If you believe your code is correct, please attach any error messages you have to help the mentors in diagnosing the problem.

I moved the thread for you to DLS Course 1, by using the little “edit pencil” on the title.

My guess is that you are just not seeing what the bug is in your code. The most common mistake is just to define sigmoid as math.exp(x). That is incorrect, since that is just the code for e^x. The formula for sigmoid is a trifle more complicated than that, right?

The other common mistake is you get a message about the test function not being defined. If that is the case, then you need to do “Cell → Run All Above” first and then rerun your test cell.