Skip to content

Commit

Permalink
Merge pull request #63 from secsilm/master
Browse files Browse the repository at this point in the history
Fix comment errors in NNLM
  • Loading branch information
graykode authored May 2, 2021
2 parents f97cef9 + af0b28a commit 8ec1aeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 1-1.NNLM/NNLM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
" self.b = nn.Parameter(torch.ones(n_class))\n",
"\n",
" def forward(self, X):\n",
" X = self.C(X) # X : [batch_size, n_step, n_class]\n",
" X = X.view(-1, n_step * m) # [batch_size, n_step * n_class]\n",
" X = self.C(X) # X : [batch_size, n_step, m]\n",
" X = X.view(-1, n_step * m) # [batch_size, n_step * m]\n",
" tanh = torch.tanh(self.d + self.H(X)) # [batch_size, n_hidden]\n",
" output = self.b + self.W(X) + self.U(tanh) # [batch_size, n_class]\n",
" return output\n",
Expand Down
4 changes: 2 additions & 2 deletions 1-1.NNLM/NNLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def __init__(self):
self.b = nn.Parameter(torch.ones(n_class))

def forward(self, X):
X = self.C(X) # X : [batch_size, n_step, n_class]
X = X.view(-1, n_step * m) # [batch_size, n_step * n_class]
X = self.C(X) # X : [batch_size, n_step, m]
X = X.view(-1, n_step * m) # [batch_size, n_step * m]
tanh = torch.tanh(self.d + self.H(X)) # [batch_size, n_hidden]
output = self.b + self.W(X) + self.U(tanh) # [batch_size, n_class]
return output
Expand Down

0 comments on commit 8ec1aeb

Please sign in to comment.