File size: 355 Bytes
dfd1909
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np
import torch

class ActivationFunction:
    @staticmethod
    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