Activations#
Non-linear activations, available both as stateful layer modules and as pure functions for flexible composition.
Element-wise Layers#
Non-linear activation layers that operate element-wise on input tensors. Includes rectified linear units (ReLU and variants), sigmoid functions, hyperbolic tangent, softmax for probability distributions, and specialized activations for specific architectures (SELU, GELU, SiLU, Mish). These introduce non-linearity enabling networks to learn complex patterns.
Thresholds each element of the input Tensor. |
|
Applies the rectified linear unit function element-wise. |
|
Applies the randomized leaky rectified liner unit function, element-wise. |
|
Applies the HardTanh function element-wise. |
|
Applies the element-wise function. |
|
Applies the element-wise function. |
|
Applies the Hardsigmoid function element-wise. |
|
Applies the Hyperbolic Tangent (Tanh) function element-wise. |
|
Applies the Sigmoid Linear Unit (SiLU) function, element-wise. |
|
Applies the Mish function, element-wise. |
|
Applies the Hardswish function, element-wise. |
|
Applies the Exponential Linear Unit (ELU) function, element-wise. |
|
Applies the element-wise function. |
|
Applied element-wise. |
|
Applies the gated linear unit function. |
|
Applies the Gaussian Error Linear Units function. |
|
Applies the Hard Shrinkage (Hardshrink) function element-wise. |
|
Applies the element-wise function. |
|
Applies the element-wise function. |
|
Applies the Softplus function element-wise. |
|
Applies the soft shrinkage function elementwise. |
|
Applies the element-wise function. |
|
Applies the element-wise function. |
|
Applies the element-wise function. |
|
Applies the Softmin function to an n-dimensional input Tensor. |
|
Applies the Softmax function to an n-dimensional input Tensor. |
|
Applies SoftMax over features to each spatial location. |
|
Applies the \(\log(\text{Softmax}(x))\) function to an n-dimensional input Tensor. |
|
A placeholder identity operator that is argument-insensitive. |
|
Bitwise addition for the spiking inputs. |
Functional Activations#
Functional (non-module) activation functions for flexible composition. These are
pure functions that can be used directly in update() methods or combined with
JAX transformations. Provides the same activations as the layer-based equivalents
but without state or module overhead.
Hyperbolic tangent activation function. |
|
Rectified Linear Unit activation function. |
|
Squareplus activation function. |
|
Softplus activation function. |
|
Soft-sign activation function. |
|
Sigmoid activation function. |
|
SiLU (Sigmoid Linear Unit) activation function. |
|
SiLU (Sigmoid Linear Unit) activation function. |
|
Log-sigmoid activation function. |
|
Exponential Linear Unit activation function. |
|
Leaky Rectified Linear Unit activation function. |
|
Hard hyperbolic tangent activation function. |
|
Continuously-differentiable Exponential Linear Unit activation. |
|
Scaled Exponential Linear Unit activation. |
|
Gaussian Error Linear Unit activation function. |
|
Gated Linear Unit activation function. |
|
Log-Softmax function. |
|
Softmax activation function. |
|
Standardize (normalize) an array. |
|
One-hot encode the given indices. |
|
Rectified Linear Unit 6 activation function. |
|
Hard Sigmoid activation function. |
|
Hard SiLU (Swish) activation function. |
|
Hard SiLU (Swish) activation function. |
|
Hard shrinkage activation function. |
|
Randomized Leaky Rectified Linear Unit activation function. |
|
Mish activation function. |
|
Soft shrinkage activation function. |
|
Parametric Rectified Linear Unit activation function. |
|
Tanh shrink activation function. |
|
Softmin activation function. |
|
Sparse plus activation function. |
|
Sparse sigmoid activation function. |