Everything a neural network can learn beyond a straight line comes from φ, the activation function.
This index collects them: the formula, how the curve behaves, and a plot of it and its derivative. It's organised by family, from the classics every framework ships to learned and experimental functions from the research literature. A use-case guide explains which ones get picked for which jobs, and why.
Passes the input through unchanged. It's the right output for regression and appears inside residual paths. A network built only from identity activations collapses into a single linear map.
Fires 1 or 0, like the original perceptron. Its derivative is zero almost everywhere, so plain gradient descent can't train it; spiking and binary networks use surrogate gradients instead.
Binarises activations to ±1. Binary neural networks use it in the forward pass so multiplications become bit operations, and train through it with a straight-through estimator.
Squashes any input into (0, 1), so it reads as a probability. It saturates for large |x| and its gradient peaks at 0.25, which made deep sigmoid networks hard to train. Still the standard choice for binary outputs and LSTM/GRU gates.
A rescaled sigmoid (tanh x = 2σ(2x) − 1) that is zero-centred but saturating: its gradient peaks at 1 at x = 0 and vanishes for large |x|. Used for the LSTM/GRU candidate state, PPO hidden layers, GAN generator outputs and physics-informed networks.
Shaped like tanh but approaches its limits polynomially rather than exponentially, so it saturates more gently and keeps a usable gradient further from zero.
A tanh-like curve with polynomial tails: it saturates more slowly than tanh, so gradients survive further from the origin. Studied as a tanh replacement in deep feed-forward nets.
A piecewise-linear stand-in for the sigmoid. It's cheap and quantisation-friendly, which is why MobileNetV3 uses it in squeeze-and-excitation blocks. Some libraries use a slope of 0.2 instead of 1/6.
Clips to [−1, 1] with slope 1 in between. The gradient is exactly zero outside the linear zone; binary networks use its derivative as the straight-through estimator.
The logarithm of the sigmoid, computed stably. It mostly appears inside losses (binary cross-entropy, word2vec negative sampling) rather than as a hidden-layer activation.
An asymmetric sigmoid: it leaves 0 slowly and approaches 1 quickly. It's the natural link for discrete-time survival models with proportional hazards, and for rare-event binary outcomes.
Inverse square root unit: tanh-shaped, but needs only a square root instead of exponentials, which is cheaper on some hardware. α sets the bounds ±1/√α (α = 1 plotted).
(−1/√α, 1/√α)
smooth
monotonic
bounded
Carlile et al., 2017
Rectifiers (ReLU family)
13
Identity for positive inputs, something cheaper or flatter for negative ones. The default hidden-layer choice since about 2011.
Zero for negative inputs, identity for positive ones. It's cheap, doesn't saturate for x > 0 and produces sparse activations, which made deep networks practical. A unit that only ever sees negative inputs stops learning: a 'dead' ReLU.
Gives negative inputs a small slope α (0.01 by default) so units never fully die. GAN discriminators and graph attention networks typically use α = 0.2.
f(x) =xif x ≥ 0ax, a ~ U(1/8, 1/3) in trainingif x < 0
A leaky ReLU whose negative slope is sampled at random during training, which adds a little regularising noise. At test time the slope is fixed to the mean, (l + u)/2 ≈ 0.23, which is what's plotted.
ReLU capped at 6. The bounded range keeps activations representable in low-precision fixed-point arithmetic, which is why mobile networks such as MobileNetV2 adopted it.
Passes values only above a threshold θ (θ = 1 plotted). It was introduced for zero-bias autoencoders, where it gives sparse codes without learned biases.
Rectifies both signs, so it discards the sign but keeps the magnitude. Early multi-stage vision systems used absolute-value rectification of filter responses.
Concatenates ReLU(x) and ReLU(−x), doubling the channels so no information is thrown away. It was motivated by the observation that early CNN filters tend to learn negated pairs.
A smooth ReLU: always positive and differentiable everywhere. Common as an output for quantities that must be positive (variances, rates), and the inner function of Mish.
Identity for positive inputs and a smooth exponential that saturates at −α for negative ones (α = 1 plotted). The negative outputs push mean activations toward zero, which speeds up learning.
A scaled ELU (λ ≈ 1.0507, α ≈ 1.6733) whose constants make activations converge to zero mean and unit variance across layers, given LeCun-normal initialisation: 'self-normalising' networks that don't need batch norm.
Zeroes inputs inside [−λ, λ] and passes the rest unchanged (λ = 0.5 plotted). This is hard thresholding, as used in wavelet denoising and sparse coding.
Soft thresholding: zero inside [−λ, λ], and larger values move toward zero by λ. It's the proximal operator of the L1 norm, which is why it appears in unrolled sparse-coding networks such as LISTA.
Turns a vector of logits into a probability distribution. With two classes it reduces to the sigmoid of the logit difference, which is what's plotted against x = z₁ − z₂ for temperatures T = 0.5, 1 and 2. Lower T gives a sharper distribution.
x ∈ [−4, 4] · dashed: f′(x) · log p₁ for two classes, x = z₁ − z₂
f(z)i = zi − log Σj ezj
Log of softmax, computed in one numerically stable step with log-sum-exp. It's paired with negative log-likelihood loss; most cross-entropy implementations use it internally.
x ∈ [−4, 4] · dashed: f′(x) · p₁ for two classes, x = z₁ − z₂
sparsemax(z) = argminp ∈ Δ ‖p − z‖²
The Euclidean projection of the logits onto the probability simplex. Unlike softmax it can output exact zeros, which gives sparse, more interpretable attention. For two classes it's a hard sigmoid.
x ∈ [−4, 4] · dashed: f′(x) · p₁ for two classes, x = z₁ − z₂
argmaxp ∈ Δpᵀz + Hα(p), α = 1.5
Sits between softmax (α = 1) and sparsemax (α = 2): smooth near ties, but it can still assign exact zeros. Used for sparse attention in sequence-to-sequence models.
Maps to strictly positive values. Used as an output for rates and scale parameters (a Poisson intensity, a standard deviation); its unbounded growth makes it unstable in hidden layers.
Weights each input by the probability that a standard normal variable falls below it. It's smooth and dips slightly below zero (minimum ≈ −0.17 near x = −0.75). The default in BERT, GPT-2/3 and most Transformers before GLU variants took over.
The fast approximation used in the original BERT and GPT-2 code. It's visually indistinguishable from exact GELU; pick whichever the pretrained weights you load were trained with.
The input multiplied by its own sigmoid. Smooth and non-monotonic, with a minimum of about −0.28 at x ≈ −1.28. Used in EfficientNet, the YOLO family and most diffusion-model U-Nets.
Smooth and non-monotonic, unbounded above and bounded below (minimum ≈ −0.31). Very similar to Swish with a slightly deeper negative lobe. Used in the YOLOv4 backbone.
Smooth ReLU: replaces ReLU's corner with a quadratic patch of width 2β (β = 1 plotted). Proposed to make recommender-system predictions more reproducible between training runs.
Squared ReLU with a learnable scale and bias (initialised to s ≈ 0.894, b ≈ −0.447) that keep the output distribution normalised. Cheaper than GELU with similar accuracy in MetaFormer models.
[b, ∞)
smooth
monotonic
Yu et al., 2022 (MetaFormer baselines)
Gated linear units
6
Two projections, one gating the other. GLU variants are plotted with both halves tied to the same input, i.e. x · g(x).
Splits a projection into a value half a and a gate half b and multiplies a by σ(b), so the network controls how much information flows. Introduced for convolutional language models.
The gate without any nonlinearity: just the elementwise product of two projections. It was surprisingly competitive in Transformer feed-forward experiments, which suggests the multiplication matters more than the exact gate.
The feed-forward activation of LLaMA, PaLM, Mistral and most open LLMs. Because it needs three weight matrices instead of two, the hidden size is usually cut to about 2/3 to keep the parameter count equal.
A leaky ReLU whose negative slope α is learned, usually one per channel and initialised to 0.25. It was used in the first network reported to beat human-level accuracy on ImageNet.
ELU with two learned positive parameters: a sets the saturation level and b the scale. Tying them as a/b keeps the function differentiable at 0. Plotted with a = 1 and b = 0.5, 1, 2.
f(x) =tr + ar(x − tr)if x ≥ trxif tl < x < trtl + al(x − tl)if x ≤ tl
Three linear pieces with four learnable parameters (two thresholds, two outer slopes), so it can learn both convex and non-convex shapes. Inspired by psychophysical laws such as Weber–Fechner.
Adaptive piecewise linear unit: a ReLU plus a sum of learned hinge functions, so each neuron learns its own piecewise-linear shape. Plotted with one hinge (a = 0.5, b = 1).
Outputs the maximum of k learned linear functions, so it can approximate any convex function; ReLU and leaky ReLU are special cases. It costs k times the parameters. Plotted with three example pieces.
'Activate or not': a smooth maximum of p₁x and p₂x with learnable p₁, p₂ and switching factor β. With p₁ = 1 and p₂ = 0 it's exactly Swish; Meta-ACON predicts β from the input.
x ∈ [−4, 4] · dashed: f′(x) · example coefficients
f(x) = P(x) / (1 + |Σkbkxk|)
A learnable rational function (a ratio of polynomials) whose denominator can't reach zero. It can closely approximate standard activations or learn new shapes. Plotted with example coefficients.
One parameter α moves continuously between logarithmic (α < 0), linear (α = 0) and exponential (α > 0) behaviour, so a neuron can learn to compute sums, products or exponentials.
depends on α
smooth
monotonic
Godfrey & Gashler, 2015
Adaptive rectifiers
64
ReLU-shaped functions with trainable slopes, thresholds or saturation levels. Plots use example or initial parameter values.
ReLU with a learned vertical shift b, which lets outputs go negative and pushes the mean toward zero. (The horizontal shift is absorbed by the preceding bias.)
x ∈ [−4, 4] · dashed: f′(x) · a_t = 2, b = 0.5 (example)
f(x) = HardTanh(at(x − b))
HardTanh whose slope a<sub>t</sub> grows on a schedule over training epochs while the offset b is learned, gradually turning it into a sign function for binary networks.
x ∈ [−4, 4] · dashed: f′(x) · a = 0.25, b = 0 (example)
f(x) =(1 + σ(b))xif x ≥ 0C(a)xif x < 0
ReLU whose positive slope is amplified by a learned sigmoid gate and whose negative slope is a learned value clipped to [0.01, 0.99]. One pair of parameters per layer.
Interpolates between the identity (a = 0) and a smooth rectifier (a = 1) with a trainable a ∈ [−1, 1]. Being able to become the identity lets a layer effectively be skipped.
Linear for positive inputs and a/(1 − bx)-damped for negative ones, using the Heaviside step H. With a = 0.2, b = 10 it resembles ReLU; with a = 5, b = 0.1 a linear map.
Simple piecewise linear and adaptive function with symmetric hinges: hinges at ±b<sub>s</sub> with separate trainable slopes on each side. Seven hinges usually worked well.
Wraps any activation f in four trainable parameters that scale and shift it horizontally and vertically, which covers many published adaptive functions as special cases. Plotted for f = tanh.
Gives any activation g a trainable slope a per neuron, often with a fixed scale factor n to speed up training. Developed for physics-informed networks. Plotted with n·a = 2.
Mixes the identity and any activation g through a trainable angle a, so a unit can move continuously between linear and nonlinear. Plotted for g = ReLU.
x ∈ [−4, 4] · dashed: f′(x) · g = ReLU, c = 2, a₁ = 0.1, a₂ = 0.05 (example)
f(x) = a₀ g(x) + Σjaj c sin(jcx)
A base activation plus trainable high-frequency sine terms, which helps physics-informed networks escape poor minima. A special case of Deep Kronecker networks.
A periodic activation for coordinate-based networks. With ω₀ = 30 and a matching initialisation, SIRENs represent images, audio and signed distance fields in fine detail, and their derivatives are SIRENs too. Plotted with ω₀ = 1.
A decaying oscillation whose Fourier transform is a box: an ideal low-pass filter in function form. Studied as an activation for function approximation.
The identity plus a periodic ripple, which gives networks an inductive bias toward periodic signals while staying monotonic. BigVGAN uses a version with learnable a for audio synthesis. Plotted with a = 1.
x ∈ [−6, 6] · dashed: f′(x) · a = 0.2, b = 2; outer pieces joined continuously
f(x) =a(x − b) + σ(b)if x ≥ bσ(x)if −b < x < ba(x + b) + σ(−b)if x ≤ −b
A sigmoid in the middle with straight lines of slope a outside ±b, so the gradient never vanishes. The slope a should be larger than the sigmoid's own slope at b.
f(x) =1if x ≥ a/2−(2/a³)x³ + (3/2a)x + ½if |x| < a/20if x ≤ −a/2
A cubic sigmoid that is exactly 0 below −a/2 and exactly 1 above a/2, so it can switch paths off completely. Used for conditional computation in differentiable tree ensembles.
A base-√2 relative of NewSigmoid that saturates at ±1/4. The survey notes the original paper's formula appears to contain a typo; this is the survey's corrected form.
The Gumbel CDF used as a sigmoid: asymmetric, leaving 0 quickly and approaching 1 slowly (the mirror image of cloglog). Used in networks for financial time-series forecasting.
A family that uses one function for positive inputs and another for negative ones, mixing the bipolar sigmoid σ₂(x) = 2σ(x) − 1, tanh, zero and a linear piece. Three of the proposed pairs are plotted.
Identity for positive inputs and a scaled, shifted softplus for negative ones, with parameters chosen so the function is continuous and differentiable at zero and negative outputs pull the mean toward zero.
A symmetric (even) variant of GELU: negative inputs give positive outputs, mirroring the positive side. Its authors report more symmetrically distributed weights.
The derivative of SiLU used as an activation: a sigmoid-like curve that overshoots to about 1.1 and dips to about −0.1. Proposed for reinforcement-learning value networks.
f(x) =x − (1 − 1/d)if x ≥ 1(1/d)|x|dif 0 ≤ x < 1−(1/d)|x|dif −1 ≤ x < 0−x − (1 − 1/d)if x < −1
The odd counterpart of EPLAF, as printed in the survey: a power curve near zero (negated for negative inputs) joined to straight lines. With these outer pieces both sides end up rising linearly.
A signed logarithm that compresses large values in both directions. Proposed early as the LAF and later as symlog, which DreamerV3 uses to squash rewards and values.
x ∈ [−2, 2] · dashed: f′(x) · a = 1, b = 0.5, c = 1, d = 1 (example values)
f(x) = a h(x/c + b) − a h(b), h from r(x) = x³(x⁵ − 2x⁴ + 2)
Scaled polynomial constant unit: linear for negative inputs, a high-order polynomial in the middle and constant beyond d. Designed for self-normalising networks.
Found by an evolutionary search: steep near zero, flattening a little, then growing exponentially. Its finders report it beating ReLU and tanh in LSTMs.
Tanh with the negative side scaled down (a = 0.25), the saturating analogue of a leaky ReLU. A broad NLP comparison later found it unusually stable across tasks.
Used in a neural dependency parser to model three-way interactions between word, part-of-speech and label features directly. Unbounded and fast-growing, so it needs careful scaling.
(−∞, ∞)
smooth
monotonic
Chen & Manning, 2014
No function matches those filters.
A–Z index
Every catalogued function on one page. Click a name to jump to its card.
Most functions come from the survey by Kunc & Kléma (2024), which collects about 400 activation functions. These 52 entries from it have no card because they can't be drawn as one fixed curve of one input:
Function
Why it isn't plotted
β-softmax
vector function with a randomly sampled exponent
Softsign randomised leaky ReLU (S-RReLU)
as written it has a pole at x = −1 and a randomly sampled slope
Noisy ReLU (NReLU)
stochastic: adds Gaussian noise scaled to the input
Spatial context-aware activation (SCAA)
uses a depth-wise convolution over the feature map
Randomly translational ReLU (RT-ReLU)
stochastic shift during training; plain ReLU at test time
DualReLU
takes two inputs
Orthogonal permutation linear unit (OPLU)
acts on pairs of neurons
Elastic ReLU (EReLU)
stochastic slope during training
Average biased ReLU (ABReLU)
threshold computed from the data
DualELU
takes two inputs
Elastic adaptively parametric compounded unit (EACU)
stochastic slope plus trainable parameters
Lipschitz ReLU (L-ReLU)
slope chosen from a data-dependent Lipschitz constant
Linear quadratic activation (LinQ)
the survey's printed pieces do not join, and the intended form is unclear
Rand softplus (RSP)
mixing weight set by the input noise level
Knowledge discovery activation (KDAC)
multi-part adaptive definition with clipped interpolation
k-winners-take-all (k-WTA)
vector function: keeps the k largest entries
Volatility-based activation (VBAF)
takes a window of inputs
Hybrid chaotic activation (HCAF)
recursive, chaotic definition
Fusion of chaotic activation (FCAF)
recursive, chaotic definition
Cascade chaotic activation (CCAF)
recursive, chaotic definition
Funnel PReLU (FunPReLU)
uses a spatial (3×3) condition
Randomly translational PReLU (RT-PReLU)
stochastic shift during training
Probabilistic activation (ProbAct)
stochastic: adds sampled noise
Adaptive offset activation (AOAF)
offset computed from the mean input
Dynamic leaky ReLU (DLReLU)
slope set from the previous epoch's error
Dynamic ReLU (DReLU)
threshold computed per batch
Dual parametric family (DPAF)
a recipe for transforming any activation
Fully parameterised activation (FPAF)
a recipe combining any two activations
Elastic PReLU (EPReLU)
stochastic slope during training
Elastic ELU (EELU)
stochastic slope during training
Tuned softmax (tsoftmax)
vector function
Generalised Lehmer softmax (glsoftmax)
vector function with data-dependent normalisation
Generalised power softmax (gpsoftmax)
vector function with data-dependent normalisation
Noisy activation functions
stochastic noise injected in the saturated regime
Fractional softplus, tanh, SiLU, GELU and ALU
defined by fractional derivatives without a closed form
Fractional leaky / parametric ReLU and ELU
complex-valued for negative inputs as written
Global-local neuron (GLN)
the local component is not fully specified
Multi-bias activation (MBA)
vector output with one channel per bias
Trapezoid-shaped activation (TSAF) and TSAFPlus
the printed signs do not give the described trapezoid
Multi-bin trainable linear unit (MTLU)
a general multi-segment recipe
Continuous piecewise nonlinear (CPN)
a general multi-segment recipe
Look-up table unit (LuTU)
a learned table of points
Average of a pool of activations (APAF)
normalised using minimum and maximum over the data
Deep Kronecker networks (DKNN)
a framework (its rowdy special case is shown)
Randomised Padé activation unit (RPAU)
stochastic coefficients during training
Orthogonal Padé activation unit (OPAU)
depends on the chosen orthogonal basis
Spline interpolating activations (SAF)
a learned spline through knots
MeLUPlus
the survey gives only one smoothed component
Variable activation function (VAF)
a small subnetwork
Flexible activation bag (FAB)
a subnetwork chooses and parameterises activations
Dynamic parameter ReLU (DY-ReLU)
parameters predicted from the input by a hyperfunction
SAVE-inspired activations
a list of variations without separate definitions
How to read a card
The plot
The solid line is the function and the dashed line is its derivative, computed numerically from the same formula. The x-range is printed in the corner; the y-axis is scaled to fit and clipped at ±6. Where a function has parameters, the card plots the stated defaults or several values (see the legend). Vector functions such as softmax are plotted for two classes, and gated units with both inputs tied to x.
The tags
Smooth means differentiable everywhere (no kinks). Monotonic means never decreasing (or never increasing). Bounded means the output stays in a finite interval in both directions. A torch.nn tag means PyTorch ships it as a module. Chosen for links to the use cases where it's a typical pick.
Sources
Each card names the paper usually credited with the function. Cards marked "via Kunc & Kléma, 2024" were collected from the survey Three Decades of Activations: every one of their implementations was checked numerically against the survey's own formula. Where the survey's formula has an evident typo, the card says how it was corrected. Descriptions are our own.
About
The Nonlinearity Index is a growing catalogue of activation functions for deep learning: the formula, how each curve behaves, and a plot of it and its derivative, organised by family and paired with a guide to which functions get chosen for which tasks. It is built as part of the open ActivationFWorks project and grows in batches toward ≈400 functions.
Corrections to formulas, citations or use-case claims are welcome: open an issue or pull request on GitHub.