SELU

class dragon.vm.torch.nn.SELU(inplace=False)[source]

Apply the scaled exponential linear unit. [Klambauer et.al, 2017].

The SELU function is defined as:

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

Examples:

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

__init__

SELU.__init__(inplace=False)[source]

Create a SELU module.

Parameters:
  • inplace (bool, optional, default=False) Whether to do the operation in-place.