FlashSR_One-step_Versatile_Audio_Super-resolution / TorchJaekwon /Model /Activation /ActivationFunction.py
Download TorchJaekwon/Model/Activation/ActivationFunction.py from laion/FlashSR_One-step_Versatile_Audio_Super-resolution: direct link, hf CLI and curl.
- Browser
- Download file 355 Bytes
-
https://huggingface.co/laion/FlashSR_One-step_Versatile_Audio_Super-resolution/resolve/main/TorchJaekwon/Model/Activation/ActivationFunction.py
- Command line
-
hf download hf://laion/FlashSR_One-step_Versatile_Audio_Super-resolution/TorchJaekwon/Model/Activation/ActivationFunction.py
-
curl -L -o ActivationFunction.py https://huggingface.co/laion/FlashSR_One-step_Versatile_Audio_Super-resolution/resolve/main/TorchJaekwon/Model/Activation/ActivationFunction.py
355 Bytes
| import numpy as np | |
| import torch | |
| class ActivationFunction: | |
| def exponential_sigmoid(x: torch.Tensor) -> torch.Tensor: | |
| """Exponential sigmoid. | |
| Args: | |
| x: [torch.float32; [...]], input tensors. | |
| Returns: | |
| sigmoid outputs. | |
| """ | |
| return 2.0 * torch.sigmoid(x) ** np.log(10) + 1e-7 |