Spaces:
Running on Zero
Running on Zero
Download Modules/GeneralLayers/Swish.py from coolcoder613/MassivelyMultilingualTTS: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/coolcoder613/MassivelyMultilingualTTS/resolve/main/Modules/GeneralLayers/Swish.py
- Command line
-
hf download hf://spaces/coolcoder613/MassivelyMultilingualTTS/Modules/GeneralLayers/Swish.py
-
curl -L -o Swish.py https://huggingface.co/spaces/coolcoder613/MassivelyMultilingualTTS/resolve/main/Modules/GeneralLayers/Swish.py
469 Bytes
| # Copyright 2020 Johns Hopkins University (Shinji Watanabe) | |
| # Northwestern Polytechnical University (Pengcheng Guo) | |
| # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | |
| # Adapted by Florian Lux 2021 | |
| import torch | |
| class Swish(torch.nn.Module): | |
| """ | |
| Construct a Swish activation function for Conformer. | |
| """ | |
| def forward(self, x): | |
| """ | |
| Return Swish activation function. | |
| """ | |
| return x * torch.sigmoid(x) | |