Skip to content

Commit

Permalink
NNLM-Torch.py nn.functional to torch
Browse files Browse the repository at this point in the history
  • Loading branch information
us committed Feb 20, 2019
1 parent 06ca9dd commit 3765bb4
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 3765bb4

Please sign in to comment.