From bb936f758a92f6b905aa3c3566e64648cc59cd8d Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 17 Nov 2019 12:21:59 -0800 Subject: [PATCH] updates --- models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models.py b/models.py index d352e873..ff3138af 100755 --- a/models.py +++ b/models.py @@ -118,16 +118,15 @@ class Swish(nn.Module): super(Swish, self).__init__() def forward(self, x): - return x * torch.sigmoid(x) + return x.mul_(torch.sigmoid(x)) class Mish(nn.Module): # https://github.com/digantamisra98/Mish - # Applies the mish function element-wise: mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + exp(x))) def __init__(self): super().__init__() def forward(self, x): - return x * torch.tanh(F.softplus(x)) + return x.mul_(F.softplus(x).tanh()) class YOLOLayer(nn.Module):