What it does
ReLU is the simplest useful nonlinearity: below zero the output is zero, above zero it equals the input. It is cheap, its gradient does not shrink for positive inputs, and it makes many units exactly zero, so each input switches on a different subset of the network. Without a nonlinearity like this, a stack of dense layers would collapse into a single linear map. ReLU6 additionally caps the output at 6, which mobile networks use so activations stay in a predictable range. A unit whose input stays negative for every example outputs zero forever, a failure called a dead unit.
Formula
ReLU(x) = max(0, x)ReLU6(x) = min(max(0, x), 6)Shapes and parameters
- Shapes
- Any shape in, the same shape out; applied element by element.
- Parameters
- None. An activation is a fixed function applied to every element, so it adds no parameters.
- Used for
- Hidden layers of MLPs and CNNs, every game NPC brain in WeightSpace, MobileNet (as ReLU6).
In WeightSpace
No parameters of its own. In the game NPC brains every hidden unit is a dense row followed by ReLU, and edits often work by moving a row’s bias across zero so the unit switches on or off for certain inputs.
Where it appears
- Find what stands out in a photoU²-Net-p1121.1M params
- Track motion between two framesRAFT-Small111990K params
- Track body joints in a photoMediaPipe BlazePose1084.3M params
- Separate a person from the backgroundPP-HumanSeg601.5M params
- Cut out a portraitMODNet526.5M params
- Track fingertips in a photoMediaPipe Hand Landmarker322.0M params
- Identify houseplantsMobileNet V127219K params
- Recognize sounds in a recordingYAMNet274.0M params
- Label a photo with ImageNetSqueezeNet 1.1261.2M params
- Find beats and downbeatsBeat This! Small253.2M params
- Clean noise from a photoKAIR Color DnCNN19668K params
- Estimate depth from a photoDepth Anything V2 Small1725M params
- Locate faces and facial landmarksYuNet1553K params
- Read a facial expressionOpenCV Zoo MobileFaceNet151.2M params
- Track a subject between framesOpenCV VitTrack14174K params
- Change how a voice speakstiny-voca124.5M params
- Find text regions on an imagePP-OCRv5 Mobile Detection121.2M params
- Segment an object by clickingSlimSAM129.7M params
- Find video shot changesTransNetV2117.6M params
- Detect speech in a recordingSilero VAD10545K params
- Turn a photo into a mosaicFast Neural Style Mosaic101.7M params
- Track the pitch of a soundCREPE Tiny7487K params
- Recognize 18 spoken wordsSpeech Commands 18w51.5M params
- Recognize voice commandsSpeech Commands51.4M params
- Land a rocket on the moonDI-engine LunarLander DQN446K params
- Generate a tiny imageCIFAR-10 Conditional GAN312M params
- Restore punctuation in a transcriptEdge-Punct-Casing37.4M params
- Transcribe music into notesSpotify Basic Pitch336K params
- Upscale a low-resolution photoESPCN360K params
- Balance a swinging pendulumDI-engine Pendulum DDPG24.5K params
- Brighten a low-light photoSCI (CVPR 2022)2264 params
- Classify the tone of a film reviewTensorFlow IMDB CNN22.7M params
- Drive a car out of a valleyStable Baselines3 DQN267K params
- Estimate a vintage car’s fuel economyAuto MPG MLP2257 params
- Find rows and cells in a tablePaddleOCR SLANet+21.9M params
- Push a puck onto a targetWeightSpace Puck Policy2794 params
- Recognize a handwritten digitMNIST CNN26.0K params
- Spot unusual sensor readingsWeightSpace NAB Predictor2745 params
- Dream up an empty roomNanoDreamer125M params
- Fox navigationWeightSpace navigation policy137 params
- Hide and seek seekerWeightSpace seeker policy131 params
- Home occupancyWeightSpace occupancy model129 params
- Read a phrase aloudKokoro 82M181M params
- Signal Run guardWeightSpace guard policy124 params
- Support ticket routerWeightSpace ticket router167 params
- Yard truck policyWeightSpace drive policy158 params