Lecture 2: Logistic Regression, Artificial Neuron, MLP
Logistic Regression = One Neuron
Binary Cross-Entropy Loss
The loss is convex in
Gradient Descent
Back-propagation
Purpose
Compute the gradient of the loss with respect to every parameter (
Order: Forward → Backward → Update
① Forward: input → loss. Compute the prediction and the loss, and cache the intermediate values (
② Backward: loss → input. Apply the chain rule in reverse, reusing the cached values.
③ Update: apply gradient descent with these gradients.
Why forward first?
Every factor in the backward pass (
MLP
① Forward:
② Backward:
Output layer error, then
: Hidden layer: pass the error back through
, then compute :
Why output layer first?
The hidden-layer gradient reuses
③ Update: batch gradient descent. Sum the gradients over all
Terminology
| Term | Meaning |
|---|---|
| Batch | a subset of the training set |
| Iteration | one batch passed forward and backward |
| Epoch | the whole dataset passed forward and backward once |