Machine Learning Basics

In gradient descent, the gradient of the loss ∂L/∂w at weight w = 2.0 is 0.5 and the learning rate is 0.1. What is the weight after one update?

  1. A1.5
  2. B1.95
  3. C2.05
Show answer and explanation

Answer: B. 1.95

Gradient descent moves the weight in the direction that decreases the loss, that is, opposite to the gradient, updating w ← w − η × ∂L/∂w (η is the learning rate). Here w = 2.0 − 0.1 × 0.5 = 1.95. A learning rate that is too large overshoots the valley of the loss and oscillates or diverges, while one that is too small makes training progress very slowly. In practice, stochastic gradient descent (SGD), which repeats updates with gradients computed on part of the data (a mini-batch), and improved versions such as Adam are used.

  • A. This subtracts the gradient 0.5 directly, forgetting to multiply by the learning rate.
  • B. Correct. 2.0 − 0.1 × 0.5 = 1.95.
  • C. This adds the gradient, moving the weight in the direction that increases the loss.
Practice this topic Back to topic

Related calculators

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Machine Learning Basics questions

  1. When the derivative dy/dx of y = (2x + 1)² at x = 1 is found by the chain rule with u = 2x + 1 and y = u², which value is correct?
  2. In a neural network with many stacked layers, which of the following is the reason that using the sigmoid function as the activation function makes the layers near the input hard to train?
  3. A model is trained on 10,000 training samples with a mini-batch size (batch size) of 50. How many weight updates are there in one epoch?
  4. How many trainable parameters does a fully connected layer with 64 inputs and 32 outputs (one bias per output) have?
  5. A 28×28 single-channel image is convolved with a 5×5 filter (stride 1, no padding), followed by 2×2 max pooling (stride 2). What are the height and width of the output?