Write one_step(w, x, y, lr) that runs one full training step for the
model pred = w * x and returns the updated w, rounded to 2
decimals:
- forward:
pred = w * x - gradient:
2 * (pred - y) * x - update:
w - lr * grad
Write one_step(w, x, y, lr) that runs one full training step for the
model pred = w * x and returns the updated w, rounded to 2
decimals:
pred = w * x2 * (pred - y) * xw - lr * grad