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): params is a list of (W, b) pairs. Apply X @ W + b for each layer, with ReLU after every layer except the last. Return the final output (the logits).
checks
  • 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
python sleeps until you press run

Press Run & check. Your code runs first, then the hidden checks on the left.