It was proposed as a differentiable, bounded activation function.
Because it saturates for large inputs, it suffers from the vanishing gradient problem.
The output range is
(the maximum and minimum occur at , and the output approaches 0 as ).
Activation Functions
Updated:
It was proposed as a differentiable, bounded activation function.
Because it saturates for large inputs, it suffers from the vanishing gradient problem.
The output range is
(the maximum and minimum occur at , and the output approaches 0 as ).
# PyTorch
import torch
import torch.nn as nn
class NN(nn.Module):
def __init__(self):
super().__init__()
def resech(self, x):
return x * (1 / torch.cosh(x))
def forward(self, x):
x = self.resech(x)
return x