Skip to content

Commit f7c9ad8

Browse files
committed
Add Swish activation
1 parent 82ce668 commit f7c9ad8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pytorch_toolbelt/modules/activations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ def forward(self, x):
2525
return hard_sigmoid(x, inplace=self.inplace)
2626

2727

28+
class Swish(nn.Module):
29+
def __init__(self, inplace=False):
30+
super(Swish, self).__init__()
31+
32+
def forward(self, x):
33+
return swish(x)
34+
35+
2836
class HardSwish(nn.Module):
2937
def __init__(self, inplace=False):
3038
super(HardSwish, self).__init__()

0 commit comments

Comments
 (0)