Permalink
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) |
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.