LiSHT is an activation function that mitigates the vanishing gradient problem by multiplying the output of the Tanh function by the input.
The output range is
Activation Functions
Updated:
LiSHT is an activation function that mitigates the vanishing gradient problem by multiplying the output of the Tanh function by the input.
The output range is
# PyTorch
import torch
import torch.nn as nn
class NN(nn.Module):
def __init__(self):
super().__init__()
def lisht(self, x):
return x * torch.tanh(x)
def forward(self, x):
x = self.lisht(x)
return x