Week 2 - Exercise 3 - sigmoid

Hy everyone
I am stuck on this question.
I need some help,.

Moderator edit: code removed.


Hi, @Cristiano_Ranieri. I do not recognize this version of the notebook, and it does not seem to correlate with any of the recent versions that I have seen. For example, the “signature” of the function takes z as an argument, not x. The test cell is also foreign to me. You should follow the “Get Latest Version” procedure on the FAQ Thread to verify. It’s the very first FAQ.

I think that function is from the Numpy Tutorial assignment that is the first one in Week 2 (before Logistic Regression). The code looks correct to me: it does define s as far as I can see. So one theory is that the mistake is you had just typed that code and then ran the test cell without clicking “Shift - Enter” to execute the actual function cell. Just typing code and then calling the function again runs the old code. You can easily demonstrate this to yourself: take a function that works and purposely add an error to it (e.g. add +2 to the answer) and then call it again from the test cell and it still works, right? Then click “Shift-Enter” on the function cell to get the new broken code loaded. Now run the test again. Kaboom!

I guess maybe the other theory is that you really typed capital S in the line that has the sigmoid formula. I can’t really tell for sure: it looks like lowercase s to me, but maybe I need to clean my glasses. :nerd_face: Python is a case-sensitive language, of course.

Thanks, @paulinpaloalto. The ungraded assignment completely slipped my mind.