Residual Block Forward Pass
~12 mincode completion
Implement residual_block(X, W1, b1, W2, b2) returning Y with shape .
Where this shows up
~12 min
••••••••••••••••
8 employers weight this skill
4 frontier labs, 2 big tech firms, 1 autonomy company, 1 enterprise vendor. Top match scores 93.
Python
import numpy as np
def residual_block(X, W1, b1, W2, b2):
"""
Forward pass of a dense residual block.
Args:
X: inputs, shape (n, d)
W1: first weights, shape (d, h)
b1: first bias, shape (h,)
W2: second weights, shape (h, d)
b2: second bias, shape (d,)
Returns:
array of shape (n, d): ReLU(X + F(X))
"""
# YOUR CODE HERE
pass