NumPy allowed · plain Python earns 10 bonus points
Compute the fundamental affine transformation for a fully connected (dense) neural network layer across a mini-batch.
Implement dense_forward(x, w, b) which computes the forward pass of a linear layer: y = x @ w + b. Given x of shape (N, D_in), weight matrix w of shape (D_in, D_out), and bias vector b of length D_out, return the output matrix of shape (N, D_out) where each element is rounded to 4 decimal places.
dense_forward(x: list[list[float]], w: list[list[float]], b: list[float]) -> list[list[float]]