Skip to content

Commit

Permalink
Merge pull request graykode#12 from us/update-py
Browse files Browse the repository at this point in the history
NNLM-Torch.py `nn.functional` to `torch`
  • Loading branch information
graykode authored Feb 20, 2019
2 parents 06ca9dd + 3765bb4 commit 6ec91d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 1-1.NNLM/NNLM-Torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self):

def forward(self, X):
input = X.view(-1, n_step * n_class) # [batch_size, n_step * n_class]
tanh = nn.functional.tanh(self.d + torch.mm(input, self.H)) # [batch_size, n_hidden]
tanh = torch.tanh(self.d + torch.mm(input, self.H)) # [batch_size, n_hidden]
output = self.b + torch.mm(input, self.W) + torch.mm(tanh, self.U) # [batch_size, n_class]
return output

Expand Down

0 comments on commit 6ec91d1

Please sign in to comment.