The building blocks of ResNets, which consists of layers connected by a skip connection and the layers in between.
These residual blocks mitigate the Vanishing Gradient Problem by having Skip Connections which adds input from a shallow layer to a deeper layer. This makes the gradients of the deeper layers have a higher value and do not vanish to zero before the gradient of the shallow layer does.

Examples
Our “network” will consist of just one residual block for simplicity. We define our residual block function as: where:
- is the input to the block,
- and are parameters of the function (similar to weights in a convolution layer),
- and the residual block’s output is .
We use the mean squared error (MSE) as our loss function: where is the true value we’re trying to predict. Optimisation with Gradient Descent We will optimise the parameters and using gradient descent. We need to calculate the gradients of with respect to and , and then update and in the direction of the steepest decrease of .
Calculate the Gradients:
- Gradient of with respect to :
- Gradient of with respect to :
This example illustrates how residual blocks help mitigate the Vanishing Gradient Problem by adding the input to the gradients of early layers. We also see that the network is minimising the loss function with regard to instead of .