Skip to content
Permalink
master
Go to file
1 contributor

Users who have contributed to this file

11 lines (8 sloc) 239 Bytes
import torch
from torch import nn
class Swish(nn.Module):
def __init__(self):
super().__init__()
self.sigmoid = nn.Sigmoid()
def forward(self, x: torch.Tensor) -> torch.Tensor:
return x * self.sigmoid(x)