Skip to content

Commit af0b28a

Browse files
committed
Fix comment errors in NNLM.py
1 parent f97cef9 commit af0b28a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: 1-1.NNLM/NNLM.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
" self.b = nn.Parameter(torch.ones(n_class))\n",
3636
"\n",
3737
" def forward(self, X):\n",
38-
" X = self.C(X) # X : [batch_size, n_step, n_class]\n",
39-
" X = X.view(-1, n_step * m) # [batch_size, n_step * n_class]\n",
38+
" X = self.C(X) # X : [batch_size, n_step, m]\n",
39+
" X = X.view(-1, n_step * m) # [batch_size, n_step * m]\n",
4040
" tanh = torch.tanh(self.d + self.H(X)) # [batch_size, n_hidden]\n",
4141
" output = self.b + self.W(X) + self.U(tanh) # [batch_size, n_class]\n",
4242
" return output\n",

Diff for: 1-1.NNLM/NNLM.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def __init__(self):
3030
self.b = nn.Parameter(torch.ones(n_class))
3131

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

0 commit comments

Comments
 (0)