Fix linear gradient descent formulas