Study the paper
Deep Residual Learning for Image Recognition
Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.
Mathematical Formulation and Shortcut Connections
Projection Shortcut Connection
Projection Shortcut Connection
Source equation
This equation defines a residual block with a projection shortcut connection. When the input dimension of differs from the output dimension of the residual function , a linear projection matrix is applied to the input to match the dimensions before addition.
Sources
S3.E2
𝐲=ℱ(𝐱,{Wi})+Ws𝐱.𝐲ℱ𝐱subscript𝑊𝑖subscript𝑊𝑠𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}. (2)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}.Sources
S3.E2
𝐲=ℱ(𝐱,{Wi})+Ws𝐱.𝐲ℱ𝐱subscript𝑊𝑖subscript𝑊𝑠𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}. (2)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}.Illustrative Toy Calculation
Let us consider a simple 1D-to-2D projection shortcut:
- Input vector:
- Residual mapping output:
- Projection matrix:
Step 1: Compute the projection shortcut
Step 2: Add the residual mapping output
Sources
S3.E2
𝐲=ℱ(𝐱,{Wi})+Ws𝐱.𝐲ℱ𝐱subscript𝑊𝑖subscript𝑊𝑠𝐱\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}. (2)
\mathbf{y}=\mathcal{F}(\mathbf{x},\{W_{i}\})+W_{s}\mathbf{x}.- Output vector of the residual block · [D_{out}]
- Input vector to the residual block · [D_{in}]
- Residual mapping function to be learned · Function mapping [D_{in}] to [D_{out}]
- Set of weights associated with the residual layers · Set of matrices
- Linear projection matrix used to match dimensions · [D_{out}, D_{in}]