NumPy allowed · plain Python earns 10 bonus points
Overcome degradation and vanishing gradients in deep networks by learning residual mapping functions F(x) + x.
Implement resnet_residual_block(...):\n1. Layer 1: h1 = relu(w1 * x) elementwise.\n2. Layer 2: h2 = w2 * h1 elementwise.\n3. Shortcut: res = shortcut_weight * x if shortcut_weight is not None else x.\n4. Output: relu(h2 + res) elementwise. Round each element to 4 decimal places.
resnet_residual_block(x: list[list[float]], w1: float, w2: float, shortcut_weight: float | None = None) -> list[list[float]]