Vanishing Gradients vs. Residual Connections (2D)

This is the 2D companion to the 3D residual-connections lab. Instead of an orbiting 3D layer stack, it runs a real forward and backward pass through two small multi-layer networks side by side — one plain, one with identity skip connections — using the same random weights and the same input. Watch the per-layer gradient-norm curve: the plain network's line collapses toward zero as it approaches the input layers (the vanishing-gradient problem that made very deep networks untrainable before 2015), while the residual network's line stays close to 1 all the way through, because its extra identity path guarantees the gradient a way back that never depends on the layer's weights shrinking it.