We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
nn.functional
torch
1 parent 06ca9dd commit 3765bb4Copy full SHA for 3765bb4
1-1.NNLM/NNLM-Torch.py
@@ -46,7 +46,7 @@ def __init__(self):
46
47
def forward(self, X):
48
input = X.view(-1, n_step * n_class) # [batch_size, n_step * n_class]
49
- 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]
50
output = self.b + torch.mm(input, self.W) + torch.mm(tanh, self.U) # [batch_size, n_class]
51
return output
52
0 commit comments