Neural networks and training
Understand gradients, losses and stable optimization.
Train a small network and inspect validation curves rather than relying on training loss alone.
Interview questions
Choose a question to reveal its answer.
01EasyCoreWhat happens during forward propagation?
Answer
What happens during forward propagation?
Computes activations and output from input and current parameters.
Calculate class logits before measuring loss.
02EasyCoreHow does backpropagation calculate gradients?
Answer
How does backpropagation calculate gradients?
Applies chain rule to compute gradients of the loss with respect to parameters.
Propagate output error through differentiable layers.
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.
03EasyCoreVisualHow does gradient descent update model parameters?
Answer
How does gradient descent update model parameters?
Updates parameters opposite the gradient scaled by a learning rate.
Move a weight toward a lower quadratic loss.
04MediumHigh priorityHow does the learning rate affect convergence?
Answer
How does the learning rate affect convergence?
Controls the scale of parameter updates.
Reduce step size when loss oscillates.
05MediumHigh priorityWhy is ReLU widely used in neural networks?
Answer
Why is ReLU widely used in neural networks?
Activation equal to max of zero and its input.
Introduce nonlinearity while zeroing negative preactivations.
06MediumHow does softmax turn logits into probabilities?
Answer
How does softmax turn logits into probabilities?
Converts a vector of logits into positive probabilities summing to one.
Normalize scores for mutually exclusive classes.
07MediumWhy use cross-entropy for classification?
Answer
Why use cross-entropy for classification?
Loss that penalizes low probability assigned to the target distribution.
Train a multiclass classifier from logits with a numerically stable implementation.
08MediumHow does dropout behave during training and inference?
Answer
How does dropout behave during training and inference?
Randomly zeros activations during training and is usually disabled at inference.
Regularize a network by reducing co-adaptation.
09HardHow does batch normalization behave at inference?
Answer
How does batch normalization behave at inference?
Normalizes activations using batch statistics during training and typically running statistics at inference.
Stabilize activation scales across training steps.
10HardHow does Adam adapt its parameter updates?
Answer
How does Adam adapt its parameter updates?
Adaptive optimizer using running first and second moments of gradients.
Optimize neural weights with parameter-specific step scaling.
Priority and difficulty are editorial study recommendations.
Technical reference: Documentation / paper ↗
Try a few practice questions
Explore the questions before creating a free account.
1. For f(w)=w² at w=3, what is the gradient?
2. What does ReLU return for an input of -4?
3. What should normally happen to dropout during evaluation?
Gradient descent and optimization
Continue to the next set of interview questions.