Skip to content

Commit

Permalink
Fix bug in RNN where hprev always referred to start. Change so that h…
Browse files Browse the repository at this point in the history
…prev refers to output of previous cell
  • Loading branch information
Norman Yu authored and Norman Yu committed Sep 15, 2022
1 parent 2f5e8d7 commit bf38625
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions makemore.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def forward(self, idx, targets=None):
for i in range(t):
xt = emb[:, i, :] # (b, n_embd)
ht = self.cell(xt, hprev) # (b, n_embd2)
hprev = ht
hiddens.append(ht)

# decode the outputs
Expand Down

0 comments on commit bf38625

Please sign in to comment.