elu

dragon.nn.elu(
  inputs,
  alpha=1.0,
  inplace=False,
  **kwargs
)[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:

x = dragon.constant([-1., 0., 1.])
print(dragon.nn.elu(x))
Parameters:
  • inputs (dragon.Tensor) The input tensor.
  • alpha (float, optional, default=1.0) The value to \(\alpha\).
  • inplace (bool, optional, default=False) Call in-place or return a new tensor.
Returns:

dragon.Tensor The output tensor.