Study the paper
Deep Residual Learning for Image Recognition
Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.
Mathematical Formulation and Shortcut Connections
Identity Shortcut Connection
Identity Shortcut Connection
Source equation
This equation defines the fundamental identity shortcut connection in Deep Residual Learning. Instead of forcing stacked layers to directly fit a desired underlying mapping, the network is reformulated to let these layers fit a residual mapping . The original input is added directly to the output of the residual function via a shortcut connection.
Sources
S3.E1
𝐲=ℱ(𝐱,{Wi})+𝐱.𝐲ℱ𝐱subscript𝑊𝑖𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}. (1)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}.Sources
S3.E1
𝐲=ℱ(𝐱,{Wi})+𝐱.𝐲ℱ𝐱subscript𝑊𝑖𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}. (1)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}.The identity shortcut connection adds no extra parameters or computational complexity to the network. It allows gradients to flow directly back through the shortcut connection, mitigating the vanishing gradient problem in extremely deep networks.
Sources
S3.E1
𝐲=ℱ(𝐱,{Wi})+𝐱.𝐲ℱ𝐱subscript𝑊𝑖𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}. (1)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}.Illustrative Toy Calculation
Let us consider a simple 1D case where:
- Input
- Weights represent a single scaling factor
- The residual function is a simple linear transformation:
Applying the identity shortcut connection:
Sources
S3.E1
𝐲=ℱ(𝐱,{Wi})+𝐱.𝐲ℱ𝐱subscript𝑊𝑖𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}. (1)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+\mathbf{x}.- Output vector of the residual block · Vector of dimension D
- Input vector to the residual block · Vector of dimension D
- Residual mapping function to be learned · Function mapping R^D to R^D
- Set of weights associated with the layers in the residual block · Set of weight matrices