We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Easy
End-to-End
Two-Layer MLP
Build a simple two-layer feedforward neural network (MLP).
The forward pass computes:
- Hidden layer: $h = \text{ReLU}(x \cdot W_1 + b_1)$
- Output layer: $y = h \cdot W_2 + b_2$
Input:
-
x: input tensor of shape(batch, in_features) -
W1: weight matrix of shape(in_features, hidden) -
b1: bias vector of shape(hidden,) -
W2: weight matrix of shape(hidden, out_features) -
b2: bias vector of shape(out_features,)
Output: Tensor of shape (batch, out_features)
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.