Skip to content

Commit 444a9f7

Browse files
committed
updates
1 parent e66323e commit 444a9f7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ def forward(self, x):
120120
return x * torch.sigmoid(x)
121121

122122

123+
class Mish(nn.Module): # https://github.com/digantamisra98/Mish
124+
# Applies the mish function element-wise: mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + exp(x)))
125+
def __init__(self):
126+
super().__init__()
127+
128+
def forward(self, x):
129+
return x * torch.tanh(F.softplus(x))
130+
131+
123132
class YOLOLayer(nn.Module):
124133
def __init__(self, anchors, nc, img_size, yolo_index, arc):
125134
super(YOLOLayer, self).__init__()

0 commit comments

Comments
 (0)