5 hidden checks
Implement the forward pass of an MLP with any number of layers.
relu(z): element-wise .count_params(sizes): for layer sizes like[784, 128, 10], the total number of weights and biases.mlp_forward(X, params):paramsis a list of(W, b)pairs. ApplyX @ W + bfor each layer, with ReLU after every layer except the last. Return the final output (the logits).
- relunot run
- count_paramsnot run
- mlp_forward matches a hand computationnot run
- no ReLU on the last layernot run
- works for a deep network on a batchnot run