Python Basics Numpy error

Does anyone know why I am receiving this error?

I found the issue - not using the correct sigmoid formula

s = 1/(1 + np.exp(x))

or

s = 1/(1 + math.exp(x)) for scalar only.

I was literally taking np.exp(x) for sigmoid - which was the issue.

2 Likes

Great! Glad to hear that you found the issue under your own power. That was going to be my guess, since your sigmoid(1) value came out to be e. :nerd_face:

Yup! Getting the right formula is really important. Especially when you get through the rest of the course.

Thanks, Paul, for the acknowledgment!

Thanks Phuc! Appreciate your feedback. I look forward to receiving your guidance.

1 Like