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

hidden state index at t=1 during backprop #9

Open
mattiasospetti opened this issue Dec 7, 2023 · 0 comments
Open

hidden state index at t=1 during backprop #9

mattiasospetti opened this issue Dec 7, 2023 · 0 comments

Comments

@mattiasospetti
Copy link

During packpropagation, at t=2, when he calculates the gradient of the h, he writes this:

h_weight_grad += hiddens[1,:][:,np.newaxis] @ h2_grad

Taking into account the hidden state at t=1. But later, when he backprops at t=1, he writes:

h_weight_grad += hiddens[1,:][:,np.newaxis] @ h1_grad

It's not clear to me why he uses the t=1 hidden state again: shouldn't it be hiddens[0,:] since that gradient is sensitive to the previous hidden state?

Thanks in advance to whomever may help me.

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