Open DarthRinzler opened 4 years ago
I thought the same thing at first, but this is not an error.
You'll notice when sigmoid_derivative() is called that the input is self.output and self.layer1, which from the forward feed portion of the object have already applied sigmoid.
May have helped to put a note in the sigmoid_derivative why this is the case.
The code defines the sigmoid_derivative as:
def sigmoid_derivative(x): return x * (1.0 - x)
But the actual sigmoid derivative is:
def sigmoid_derivative(x): return sigmoid(x) * (1.0 - sigmoid(x))