llSourcell / Make_a_neural_network

This is the code for the "Make a Neural Network" - Intro to Deep Learning #2 by Siraj Raval on Youtube
198 stars 214 forks source link

Why __sigmoid_derivative is x * (1 - x) #11

Open buffalozz opened 6 years ago

buffalozz commented 6 years ago

We are using __sigmoid as 1 / (1 + exp(-x)), and the derivative of that is obviously not x * (1 - x). Is there anything that I missed?

27nicolas commented 5 years ago

I had the same question. should derivative be rather : exp(x) / (exp(x)+1) ^2

keithlevet commented 5 years ago

You are getting confused between x and y. If y=sigmoid(x) then the derivative is y.(1-y)

27nicolas commented 5 years ago

if you plot these functions, y= 1 / (1 + exp(-x)) y = x * (1-x)

It becomes obvious than the second one is not the derivative of the first one.

keithlevet commented 5 years ago
      if you plot these functions,

y= 1 / (1 + exp(-x)) y = x * (1-x) It becomes obvious than the second one is not the derivative of the first one.

Nicolas. Please read carefully what I wrote. I did not say that y' = x * (1-x) I said that y' = y. (1-y)