QUESTION 2 OF 10

How does backpropagation calculate gradients?

Reveal the answer and explore the explanation.

02
EasyCore

How does backpropagation calculate gradients?

Answer
Answer

Applies chain rule to compute gradients of the loss with respect to parameters.

Practical example

Propagate output error through differentiable layers.

PythonRelated concept example
import torch
x = torch.tensor(3., requires_grad=True)
loss = x**2
loss.backward()
print(x.grad)  # tensor(6.)

Automatic differentiation applies the chain rule.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As