On Tuesday, June 27, 2017, Steve D'Aprano <steve+pyt...@pearwood.info> wrote:
> On Wed, 28 Jun 2017 02:23 am, Sam Chats wrote: > > > > https://medium.com/technology-invention-and-more/how-to- > build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 > > > The derivative of the sigmoid curve given is completely wrong. > > def __sigmoid(self, x): > return 1 / (1 + exp(-x)) > > def __sigmoid_derivative(self, x): > return x * (1 - x) > > > Should be: > > def __sigmoid_derivative(self, x): > return exp(x) / (1 + exp(x))**2 > > > > http://mathworld.wolfram.com/SigmoidFunction.html > > Actually, it's not stated clearly but x is not the same in each function. The return value of sigmoid is the input of sigmoid_derivative. The article that you linked confirms that this identity holds. -- https://mail.python.org/mailman/listinfo/python-list