Natural Language Processing · free preview
Gradient Descent on the Cross-Entropy Loss
The cross-entropy loss from conditional maximum likelihood, its clean gradient for logistic regression, and stochastic gradient descent in action.
1. Gradient Descent on the Cross-Entropy Loss
Gradient Descent on the Cross-Entropy Loss
2. Following the gradient downhill
Following the gradient downhill
3. Training a tiny sentiment classifier
Training a tiny sentiment classifier
4. One term of the cross-entropy loss
A classifier outputs and the gold label is . Compute the cross-entropy loss and round to three decimals.
5. The logistic gradient on one weight
During training, a document has feature value , the model outputs , and the gold label is . Compute and round to three decimals.
6. One SGD step
A weight starts at , the document's feature is , the model outputs , the gold label is , and the learning rate is . After the SGD update , what is the new ? Round to three decimals.
7. Comparing gradient magnitudes
Both documents have the same feature value and gold label . Document A gets and document B gets . Which weight update has the larger magnitude, and why?
8. Convexity, learning rates, and hyperparameters
Which statement about training logistic regression with gradient descent is correct?
Practice this interactively
Free account · instant grading · spaced review that schedules itself.
Start this course for free