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

No tanh on state.s in 'bottom_data_is' #7

Closed
arryon opened this issue Sep 23, 2016 · 2 comments
Closed

No tanh on state.s in 'bottom_data_is' #7

arryon opened this issue Sep 23, 2016 · 2 comments

Comments

@arryon
Copy link

arryon commented Sep 23, 2016

In L95 of lstm.py, as far as I can see you are omitting to apply tanh() to the new cell state before multiplying it with the squashed o(t).

As referenced in the article you mention in your readme in the last equation on page 20, and in this excellent tutorial page I found (https://colah.github.io/posts/2015-08-Understanding-LSTMs/), you have to apply tanh() to your new cell state before you multiply it with o(t). I don't see you doing that in your code, so unless this is being corrected somewhere else I failed to notice, it should be corrected.

Otherwise, this is an excellent resource, thanks a lot :)

@arryon arryon changed the title No tanh on state.c in 'bottom_data_is' No tanh on state.s in 'bottom_data_is' Sep 23, 2016
@nicodjimenez
Copy link
Owner

The tanh function is applied in line 90.

@lcdevelop
Copy link

image
hi, sorry to bother you again
I read this line in your code: self.state.h = self.state.s * self.state.o
but when I found in the paper and the picture, it saids may be like this:
self.state.h = np.tanh(self.state.s) * self.state.o
would you tell me which one is right?

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

3 participants