ELU

class dragon.vm.torch.nn.ELU(
  alpha=1.0,
  inplace=False
)[source]

Apply the exponential linear unit. [Clevert et.al, 2015].

The ELU function is defined as:

\[\text{ELU}(x) = \begin{cases} x, & \text{ if } x \geq 0 \\ \alpha * (\exp(x) - 1), & \text{ otherwise } \end{cases} \]

Examples:

m = torch.nn.ELU()
x = torch.randn(2, 3)
y = m(x)

__init__

ELU.__init__(
  alpha=1.0,
  inplace=False
)[source]

Create a ELU module.

Parameters:
  • alpha (float, optional, default=1.) – The value to \(\alpha\).
  • inplace (bool, optional, default=False) – Whether to do the operation in-place.