What it does
Leaky ReLU multiplies negative inputs by a small constant, often 0.01 or 0.2, instead of zeroing them. A unit that is pushed below zero still passes a weak signal and gradient, which avoids dead units and helps adversarial training in GAN discriminators. PReLU learns the negative slope per channel. ELU bends smoothly toward a constant −α for very negative inputs, which keeps mean activations closer to zero.
Formula
LeakyReLU(x) = x if x ≥ 0, otherwise α·xPReLU(x) = x if x ≥ 0, otherwise ac·x (ac learned per channel)ELU(x) = x if x ≥ 0, otherwise α·(ex − 1)Shapes and parameters
- Shapes
- Any shape in, the same shape out. PReLU’s slope tensor broadcasts over channels.
- Parameters
- None for Leaky ReLU and ELU. PReLU has one learned slope per channel: 64 for a 64-channel layer.
- Used for
- GAN discriminators, some face and detection networks (often as PReLU), super-resolution models.
In WeightSpace
Read-only in WeightSpace today: there is nothing learned inside it. When an edit moves a bias in the layer before it, this function decides how much of that shift reaches the next layer, so its shape explains why some edits flip an answer and others barely move it.
Where it appears
- Generate a frame between two photosPractical-RIFE 4.25535.7M params
- Detect objects in a photoNanoDet-Plus48942K params
- Read a facial expressionOpenCV Zoo MobileFaceNet331.2M params
- Read a phrase aloudKokoro 82M2881M params
- Track fingertips in a photoMediaPipe Hand Landmarker262.0M params
- Dream up an empty roomNanoDreamer2125M params
- Remove background noiseGTCRN1548K params