Course 1: Week2 programming assignments

I am little bit confuse to solve this programming assignment from Ex-1 to Ex-4, Everytime I found an assertion Error like: AssertionError: Not all tests were passed for sigmoid. Check your equations and avoid using global variables inside the function.
can anybody could help me.

That means your sigmoid() function does not work correctly.

How familiar are you with Python programming?

1 Like

Yes, as Tom says, there must be something wrong with your implementation of sigmoid. It would help to see the full output that you get when you run that failing test. Just seeing the bad output value is probably a pretty good clue as to the nature of the error.

Note that the output of sigmoid should be between 0 and 1, right? Is your value bigger than that? E.g. 2.7xxxx? If so, then I think we know what went wrong. :nerd_face:


Thank you for helping me,
I found my mistake before your suggestion I wrote my code like this 1/(1+np.exp(x)) instead of this 1/(1+np.exp(-x)).

I know inheritance, multiple inheritance and multilevel inheritance

Those are general computer science concepts.

I’m referring to basic and practical Python programming. Are you comfortable with writing a simple program, do you understand how functions work, and do you understand execution and variable scope?

Those are vital skills for this course. If you have them, that’s great. If you don’t, then I recommend taking a Python tutorial course first.