torchact.nn.ELU

class torchact.nn.ELU(alpha: float = 1.0, inplace: bool = False)[source]

Implementation of Exponential Linear Unit. https://arxiv.org/abs/1511.07289

Parameters
  • alpha (float) – the α value for the ELU. Default: 1.0

  • inplace (bool) – In-place operation. Default: False

Examples::
>>> import torch, torchact
>>> m = torchact.nn.ELU()
>>> input = torch.tensor([1.0, -2.0, 0.0, 3.0])
>>> output = m(input)
>>> print(output)
tensor([ 1.0000, -0.8647,  0.0000,  3.0000])