Skip to content
Physical AI
All experiments

ELU activation versus ReLU

The shape of the ELU activation used in Asimov's actor and critic, how α sets its negative saturation, and how its gradient differs from ReLU's.

Loading simulation…

What it demonstrates

The shape of the ELU activation used in Asimov's actor and critic, how α sets its negative saturation, and how its gradient differs from ReLU's.

How it works

Both functions and (optionally) their derivatives are plotted analytically. The probe reads off values at one input.

Adjustable parameters

  • α (0.1–2)
  • Probe input x (−4 to 3)
  • Show ReLU
  • Show derivatives

Known limitations

  • Menlo documents that ELU is used; the α value is not stated on the reviewed pages (PyTorch's default is 1.0).

Equations

ELUα(x)={xx>0α (ex−1)x≤0\mathrm{ELU}_\alpha(x) = \begin{cases} x & x > 0 \\ \alpha\,(e^{x}-1) & x \le 0 \end{cases}
ELUα′(x)={1x>0αexx≤0\mathrm{ELU}'_\alpha(x) = \begin{cases} 1 & x > 0 \\ \alpha e^{x} & x \le 0 \end{cases}
ReLU(x)=max⁡(0,x)\mathrm{ReLU}(x) = \max(0, x)

Core update rule

const elu = (x: number, a = 1) => (x > 0 ? x : a * Math.expm1(x));

Explained in Chapter 8: Locomotion Policy