ELU#
- class brainstate.nn.ELU(alpha=1.0)#
Applies the Exponential Linear Unit (ELU) function, element-wise.
As described in the paper: Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs).
ELU is defined as:
\[\begin{split}\text{ELU}(x) = \begin{cases} x, & \text{ if } x > 0\\ \alpha * (\exp(x) - 1), & \text{ if } x \leq 0 \end{cases}\end{split}\]- Parameters:
alpha (
float) – The \(\alpha\) value for the ELU formulation. Default: 1.0Shape
-----
Input (-)
Output (-)
Examples
>>> import brainstate.nn as nn >>> import brainstate >>> m = nn.ELU() >>> x = brainstate.random.randn(2) >>> output = m(x)