add Mish() support

This commit is contained in:
Glenn Jocher 2020-04-26 16:31:21 -07:00
parent 18d4ebfd12
commit a0a3bab9e6
1 changed files with 2 additions and 2 deletions

View File

@ -115,9 +115,9 @@ class MemoryEfficientSwish(nn.Module):
class Swish(nn.Module):
def forward(self, x):
return x.mul_(torch.sigmoid(x))
return x.mul(torch.sigmoid(x))
class Mish(nn.Module): # https://github.com/digantamisra98/Mish
def forward(self, x):
return x.mul_(F.softplus(x).tanh())
return x.mul(F.softplus(x).tanh())