Repository navigation
Module 06
Level: Beginner–Intermediate
Status: Planned — navigation and lesson specifications
This module is a self-contained learning unit within the larger Deep Learning curriculum. Its purpose is to build understanding from motivation and prerequisites through mathematical reasoning, implementation and critical evaluation.
A learning algorithm needs a numerical objective that measures disagreement between predictions and targets. Empirical risk minimization averages this objective over observed examples, and gradient-based optimization adjusts parameters to reduce it. The choice of loss encodes assumptions about the task and error structure.
Distinguish regression and classification losses. Derive a small MSE or cross-entropy example, then study batch, stochastic and mini-batch gradient descent. Interpret learning rate, gradient scale, objective curvature and validation behaviour.
By the end of this module, a reader should be able to define its central objects, explain the motivation behind its main methods, interpret the governing equations, work through a small example, and identify assumptions and limitations. The goal is understanding the mechanism—not memorizing a list of terms.
- Select a loss for a task and output distribution.
- Derive MSE and cross-entropy.
- Explain empirical risk minimization.
- Module-06-Lesson-Map
- Module-06-Important-Lessons
- Module-06-Numericals-and-Exercises
- Module-06-Implementation-Roadmap
- Module-06-Research-Extensions
- Module-06-loss-functions-gradient-descent-empirical-risk-minimization
Each page below isolates a specific concept or closely related group of concepts. The page isolates a specific concept or closely related group of concepts for focused study.
- Module-06A-Loss-Functions-for-Regression-and-Classification —
- Module-06B-Empirical-Risk-and-Probabilistic-Objectives —
- Module-06C-Gradient-Descent-and-Learning-Rate —
- Module-06-Lesson-01
- Module-06-Lesson-02
- Module-06-Lesson-03
- Module-06-Lesson-04
- Module-06-Lesson-05
- Module-06-Lesson-06
- Module-06-Lesson-07
- Module-06-Lesson-08
- Module-06-Lesson-09
- Study the lessons in prerequisite order.
- Write a notation sheet and derive central equations.
- Solve at least one hand-worked example per major mechanism.
- Implement core operations where appropriate.
- Verify outputs and gradients.
- Complete conceptual and coding exercises.
- Record limitations and research extensions.
- Conceptual understanding
- Mathematical derivations
- Worked numerical examples
- NumPy implementation (where applicable)
- PyTorch implementation (where applicable)
- Tests and numerical verification
- Experiments and interpretation
- Revision and self-assessment
Learning is framed as empirical risk minimization: choose parameters that minimize average loss on observed examples. Loss functions encode the task and the optimization objective; gradient descent supplies an iterative method for reducing that objective.
Empirical risk: $$ \hat R(\theta)=\frac1N\sum_{i=1}^{N}\ell(f_\theta(x_i),y_i). $$
Gradient descent: $$ \theta_{t+1}=\theta_t-\eta\nabla_\theta\hat R(\theta_t). $$
Binary cross-entropy for a logit z and label y: $$ \ell(z,y)=-y\log\sigma(z)-(1-y)\log(1-\sigma(z)). $$
For squared error
flowchart TD
A[Training examples] --> B[Model predictions]
B --> C[Task loss]
C --> D[Average empirical risk]
D --> E[Gradient computation]
E --> F[Parameter update]
F --> B
Compare MSE, MAE, binary cross-entropy and categorical cross-entropy on small hand-computable examples. Plot loss against a scalar parameter and verify the gradient numerically.
The loss function is not the same as the evaluation metric. Learning rate controls step size, not model capacity. A lower training loss does not guarantee better generalization. Class imbalance may require weighting, resampling or a task-specific objective.
Explore robust losses, focal loss, label smoothing, calibration-aware objectives, distributionally robust optimization and bilevel optimization.
- Reproduce the smallest mathematical example by hand.
- Implement the central operation using NumPy.
- Implement the same operation using PyTorch.
- Compare outputs and gradients with numerical tolerances.
- Change one assumption or hyperparameter and document what changes.
- Record environment, random seed, data split, compute budget and limitations.
- Explain the motivation and assumptions without notes.
- Derive the principal equations and define every symbol.
- Complete at least one worked numerical example.
- Trace tensor shapes through the computation.
- Implement and test the central mechanism.
- Explain at least two failure modes.
- Read one primary paper and summarize its contribution and limitations.
Content status: This page now contains a technical chapter and a practical learning specification. The linked lesson pages provide focused subtopic treatment; experiments are not claimed complete until their result logs are added.
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths · ❓ Question bank · 📖 Glossary · 📚 References · ✏️ Contributing
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths
❓ Question bank · 📖 Glossary · 📚 References
Jump to module:
01 02 03 04 05 06 07 08 09 10 11 12
13 14 15 16 17 18 19 20 21 22 23 24