ŷ = w1·x + w2·z + b
L = (1/N)Σ(ŷ−y)²
w ← w − η·∇L
This is a "physics lens" on regression: the loss surface behaves like a bowl-shaped potential, and gradient descent is a ball rolling downhill under a force equal to −∇L, with learning rate η acting like a step size (or inverse friction).
- Data Points — number of samples (x, z, y) generated from a hidden linear function plus noise.
- Noise — standard deviation of random scatter added to the target, making the fit harder.
- Learning Rate — step size η in the weight update; too high overshoots and oscillates, too low converges slowly.
- Training / Pause — runs or freezes the gradient-descent updates so you can inspect the current plane.
Real-world use: this exact loop — predict, measure MSE loss, nudge weights opposite the gradient — trains everything from simple linear regressions to deep neural networks in production ML systems.