Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derivative of the activation function. #2

Open
rmarchesini opened this issue Nov 23, 2017 · 0 comments
Open

Derivative of the activation function. #2

rmarchesini opened this issue Nov 23, 2017 · 0 comments

Comments

@rmarchesini
Copy link

rmarchesini commented Nov 23, 2017

Hi, my name is Ramiro, I was checking the code and I have a doubt.
When you update the parameters, related to the input layer and the hidden layer (W1,b1), you calculate the derivative of the activation function, I think that it is done in this line (ann.py file):
dZ = pY_T.dot(self.W2.T) * (1 - Z*Z) # tanh
In the particular case of the tanh I think that (1 - Z*Z) is the derivate, if this is correct so why we use Z. Recall what is stored in Z:
Z = np.tanh(X.dot(self.W1) + self.b1)
I think that we should use only X.dot(self.W1) + self.b1 to evaluate the the derivative, which is the same that use np.arctanh(Z). So the result should be (1 - np.arctanh(Z)*np.arctanh(Z)).
I'm probably wrong, just want to know why.

Thanks!
R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant