What it does
A residual connection carries the input of a block around it and adds it to the block’s output. If the block learns nothing useful, the sum still equals the input, so stacking more blocks cannot easily make the network worse. Gradients also flow straight through the addition, which made networks with dozens or hundreds of layers trainable. Both tensors must have the same shape; when a block changes the channel count or resolution, the shortcut gets its own 1 × 1 convolution or pooling. In ONNX it is a plain Add whose two inputs come from different depths.
Formula
y = x + F(x)Shapes and parameters
- Shapes
- Two tensors of the same shape (or broadcastable) in, the same shape out.
- Parameters
- None for the addition. A projection shortcut, when present, is a 1 × 1 convolution counted separately.
- Used for
- ResNet and MobileNet V2 blocks, every transformer layer (around attention and around the feed-forward block), U-Net variants, DnCNN’s global residual.
In WeightSpace
Read-only in WeightSpace today. In the low-light enhancer the illumination estimate is added back to the input image in the same way, after the edited output logits.
Where it appears
- Generate a frame between two photosPractical-RIFE 4.25455.7M params
- Translate a Chinese sentenceHelsinki-NLP OPUS-MT41111M params
- Separate a person from the backgroundPP-HumanSeg391.5M params
- Track fingertips in a photoMediaPipe Hand Landmarker352.0M params
- Find a caption that fits a photoTinyCLIP ViT-8M/163323M params
- Classify text with your labelsXtremeDistil zero-shot2913M params
- Ask a question about a tableGoogle TAPAS Tiny284.5M params
- Estimate depth from a photoDepth Anything V2 Small2825M params
- Change how a voice speakstiny-voca274.5M params
- Name the emotion in a sentenceALBERT Base v2 Emotion2712M params
- Rerank search resultsMS MARCO TinyBERT-L2274.4M params
- Segment an object by clickingSlimSAM269.7M params
- Track body joints in a photoMediaPipe BlazePose264.3M params
- Transcribe a short English recordingWav2Vec2 Base 960h2694M params
- Find beats and downbeatsBeat This! Small253.2M params
- Find an answer in a passageDistilBERT SQuAD2365M params
- Dream up an empty roomNanoDreamer2025M params
- Find the most relevant answerall-MiniLM-L6-v22023M params
- Find video shot changesTransNetV2187.6M params
- Track a subject between framesOpenCV VitTrack18174K params
- Forecast a time seriesGranite TinyTimeMixer R216805K params
- Fill a gap in ChineseBERT Base Chinese14102M params
- Read a facial expressionOpenCV Zoo MobileFaceNet141.2M params
- Remove background noiseGTCRN1348K params
- Read a phrase aloudKokoro 82M1281M params
- Track motion between two framesRAFT-Small10990K params
- Find what stands out in a photoU²-Net-p91.1M params
- Cut out a portraitMODNet66.5M params
- Detect speech in a recordingSilero VAD6545K params
- Restore punctuation in a transcriptEdge-Punct-Casing67.4M params
- Turn a photo into a mosaicFast Neural Style Mosaic51.7M params
- Detect objects in a photoNanoDet-Plus4942K params
- Recognize sounds in a recordingYAMNet44.0M params
- Locate faces and facial landmarksYuNet253K params
- Brighten a low-light photoSCI (CVPR 2022)1264 params