1. Home
  2. Explore
  3. Mathematics
  4. Gradient Descent

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Gradient Descent

  • 54Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Optimization Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is Gradient Descent used for?

Tap to flipClick to flipspace

It is an optimization algorithm used to find parameter values that minimize a loss function.

Or swipe the card

54 cards

  1. What is Gradient Descent used for?

    It is an optimization algorithm used to find parameter values that minimize a loss function.

  2. What parameters are optimized when fitting a line with linear regression?

    The intercept and the slope.

  3. What does a fitted regression line allow you to do?

    Use an input value to predict an output value.

  4. What loss function is used in the linear-regression example?

    The sum of the squared residuals.

  5. What is a residual?

    The difference between an observed value and its predicted value.

  6. What is the sum of squared residuals called in machine-learning terminology?

    A type of loss function.

  7. What does Gradient Descent do when it is far from the optimal solution?

    It takes relatively large steps.

  8. What does Gradient Descent do when it is close to the optimal solution?

    It takes smaller, baby steps.

  9. Why is Gradient Descent more efficient than trying many parameter values manually?

    It performs relatively few calculations far from the optimum and increasingly fine-grained calculations near it.

  10. What is the first step when applying Gradient Descent to a parameter?

    Choose an initial, often random, value for the parameter.

  11. In the one-parameter example, what slope value is fixed while Gradient Descent estimates the intercept?

    The least-squares slope estimate, 0.640.640.64.

  12. What initial intercept is used in the one-parameter example?

    The intercept is initialized at 000.

  13. For a data point with weight 0.50.50.5, what predicted height results when the intercept is 000 and the slope is 0.640.640.64?

    0.320.320.32.

  14. For the first data point, whose observed height is 1.41.41.4 and predicted height is 0.320.320.32, what is the residual?

    Approximately 1.11.11.1.

  15. What are the residuals for the second and third data points in the example?

    Approximately 0.40.40.4 and 1.31.31.3, respectively.

  16. What is the initial sum of squared residuals in the intercept example?

    3.13.13.1.

  17. What does plotting the sum of squared residuals against the intercept show?

    It shows a loss curve whose minimum corresponds to the intercept producing the best fit.

  18. Why might evaluating intercept values at fixed intervals fail to find the exact optimum?

    The best intercept may lie between the tested values.

  19. What mathematical quantity indicates the direction and steepness of the loss curve?

    The derivative of the loss function with respect to the parameter.

  20. How is the derivative of a squared residual calculated?

    Using the chain rule: move the square to the front and multiply by the derivative of the expression inside the parentheses.

  21. When differentiating with respect to the intercept, what happens to terms that do not contain the intercept?

    Their derivatives are zero.

  22. How does least squares find the minimum of a differentiable loss curve?

    It solves for the point where the derivative, or slope, equals zero.

  23. Why is Gradient Descent useful when solving derivative-equals-zero equations is difficult or impossible?

    It can find a minimum by taking iterative steps without explicitly solving for where the derivative equals zero.

  24. What derivative value is obtained at intercept 000 in the example?

    −5.7-5.7−5.7.

  25. What happens to the derivative as the parameter approaches its optimal value?

    The derivative approaches zero.

  26. How is the Gradient Descent step size calculated?

    Step size equals the derivative multiplied by the learning rate.

  27. What is the learning rate?

    A small number that scales the derivative to determine the size of each update.

  28. What is the parameter-update rule used in the example?

    New parameter === old parameter −-− step size.

  29. With derivative −5.7-5.7−5.7, learning rate 0.10.10.1, and old intercept 000, what is the new intercept?

    0.570.570.57.

  30. In the next update, what derivative, step size, and intercept are obtained after the intercept reaches 0.570.570.57?

    The derivative is approximately −2.3-2.3−2.3, the step size is −0.23-0.23−0.23, and the new intercept is approximately 0.80.80.8.

  31. What sequence of intercept estimates is obtained as Gradient Descent approaches the minimum?

    Approximately 0.570.570.57, 0.80.80.8, 0.890.890.89, 0.920.920.92, 0.940.940.94, and 0.950.950.95.

  32. What intercept does Gradient Descent estimate after six steps?

    0.950.950.95.

  33. What are the two stopping conditions described for Gradient Descent?

    Stop when the step size is sufficiently small or when the maximum number of steps is reached.

  34. What practical minimum step-size threshold is given in the example?

    A step size of approximately 0.0010.0010.001 or smaller.

  35. If the slope is 0.0090.0090.009 and the learning rate is 0.10.10.1, should Gradient Descent stop under the stated threshold?

    Yes. The step size is 0.00090.00090.0009, which is smaller than 0.0010.0010.001.

  36. What practical maximum number of steps is mentioned?

    At least 100010001000 steps, depending on the implementation.

  37. How does Gradient Descent optimize both the intercept and slope of a line?

    It computes one derivative for the intercept and another for the slope, then updates both parameters using their respective step sizes.

  38. What does a three-dimensional loss graph represent in the two-parameter example?

    It represents the sum of squared residuals for different combinations of intercept and slope values.

  39. When differentiating with respect to the intercept, how is the slope treated?

    The slope is treated as a constant, so its derivative is zero.

  40. When differentiating with respect to the slope, how is the intercept treated?

    The intercept is treated as a constant, so its derivative is zero.

  41. When differentiating with respect to the slope, why does the weight appear in each derivative term?

    Because the slope is multiplied by the corresponding data point's weight in the line equation.

  42. What is a gradient?

    A collection of two or more derivatives, or partial derivatives, of the same function.

  43. Why is the algorithm called Gradient Descent?

    It uses the gradient to move downhill toward the lowest point of the loss function.

  44. What initial parameter values are used in the two-parameter example?

    The intercept starts at 000 and the slope starts at 111.

  45. What learning rate is used in the two-parameter example?

    0.010.010.01.

  46. Why can Gradient Descent be sensitive to the learning rate?

    An unsuitable learning rate can cause updates to be too large or prevent the algorithm from reaching the correct minimum.

  47. What strategy can determine a reasonable learning rate automatically?

    Start with a relatively large learning rate and reduce it after each step.

  48. What best-fitting line is obtained in the two-parameter example?

    The line with intercept 0.950.950.95 and slope 0.640.640.64.

  49. How does Gradient Descent change when a model has more than two parameters?

    Take one derivative for each parameter; the remaining optimization procedure stays the same.

  50. Does Gradient Descent require the sum of squared residuals as its loss function?

    No. The sum of squared residuals is only one possible loss function.

  51. What are the general steps of Gradient Descent?

    1. Differentiate the loss function with respect to every parameter. 2. Choose initial parameter values. 3. Evaluate the derivatives at those values. 4. Calculate step sizes. 5. Update the parameters. Repeat steps 333–555 until the steps are very small or the step limit is reached.
  52. What problem does Stochastic Gradient Descent address?

    It reduces the computational time required when the data set is very large.

  53. How does Stochastic Gradient Descent differ from standard Gradient Descent?

    It uses a randomly selected subset of the data at each step instead of the full data set.

  54. Why does using a subset of data make Stochastic Gradient Descent faster?

    Fewer data points are used to calculate the derivatives of the loss function at each step.

Card 1 of 54
Card 1 of 54

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent