Functions and operators

ReLU⁡(x)=max⁡(0,x)\operatorname{ReLU}(x) = \max(0, x) ReLU

The rectified linear unit: keeps positive inputs, replaces negative ones with 0.

In ML papers

ReLU⁡(x)=max⁡(0,x)\operatorname{ReLU}(x) = \max(0, x), applied elementwise to vectors. It is the default activation in many networks: cheap, and its gradient is 1 for positive inputs, which helps deep networks train. Its relatives GELU and SiLU are smooth versions used in Transformers.

How to type it

LaTeXShows
\operatorname{ReLU}(x)ReLU⁡(x)\operatorname{ReLU}(x)

A worked example

ReLU⁡(−1,2,0.5)=(0,2,0.5)\operatorname{ReLU}(-1, 2, 0.5) = (0, 2, 0.5)

The derivative is 0 for negative inputs and 1 for positive ones.

Related

max⁡(0,x)\max(0, x)Max and mintanh⁡(x)\tanh(x)Hyperbolic tangentσ(z)\sigma(z)Sigma (lowercase)f(x)={xx>00otherwisef(x) = \begin{cases} x & x > 0 \\ 0 & \text{otherwise} \end{cases}Cases (piecewise)

Decode this example →