Implement a simple multi-layer neural network entirely from scratch (no deep learning frameworks). You must write: (1) a forward pass computing pre-activations z = X·W + b, applying an activation function (e.g., sigmoid), and computing a scalar loss (e.g., MSE); (2) a backward pass applying the chain rule to derive…