Skip to content
← All questions

What is the parameter update rule for gradient descent?

Gradient descent is an optimization algorithm used to minimize a cost function by iteratively updating the model parameters in the opposite direction of the gradient of the cost function with respect to those parameters.

Conditions

  • The cost function J must be differentiable with respect to the parameters θ\theta.
  • The learning rate α\alpha must be chosen appropriately to ensure convergence.

Reasoning, step by step

  1. Identify the current parameter value θi\theta_i.
  2. Calculate the partial derivative of the cost function JJ with respect to θi\theta_i: ∂J(θ)∂θi\frac{\partial J(\theta)}{\partial \theta_i}.
  3. Multiply the gradient by the learning rate α\alpha.
  4. Subtract this product from the current parameter value.
  5. The update rule is θi:=θi−α∂J(θ)∂θi\theta_i := \theta_i - \alpha \frac{\partial J(\theta)}{\partial \theta_i}.

Example

The video displays the general update rule on-screen as "θi:=θi−α∂J(θ)∂θi\theta_i := \theta_i - \alpha \frac{\partial J(\theta)}{\partial \theta_i}" and later shows the specific rules for two parameters in linear regression.

Common misconceptions

  • Assuming the update adds the gradient rather than subtracting it; gradient descent moves in the opposite direction of the gradient to minimize the cost function.
  • Forgetting the learning rate α\alpha, which controls the step size of the update.

Watch the explanation

Explore next

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.