I have an Assertion Error in the Practice Programming assignment: Week 2

I am having an Assertion Error in Exercise 2

I have added this code within the space
s = math.exp(x)

Hi @janageeth, is it that related with the sigmoid function? (you should include the number of exercise you are working on).

If it is the sigmoid exercise you are not correctly calculating it, please check the formula.

1 Like

This is the code, Exercise 2 in the Optional Programming Assignment: Python Basics with NumPy

Sorry, but that code is wrong. As Alberto already mentioned, you are supposed to be translating the mathematical formula for the sigmoid function into python code. The formula is given in the instructions. Hint: it is more complicated than e^x, which is what you have implemented. You need e^x as part of the solution, but the point is that is not the whole formula.

I get it now, sorry.

I should have implemented the sigmoid function, instead it’s just an exponential function