Loss Functions Explorer
Understand how models measure and learn from their mistakes
Your Progress
0 / 5 completed←
Previous Module
Overfitting vs Underfitting
What is a Loss Function?
A loss function (or cost function) measures how wrong your model's predictions are. It's the compass that guides learning - telling the model which direction to adjust its weights to make better predictions.
🎯 The Learning Cycle
1
Model Makes Prediction
Forward pass through the network
Predicted: 7.2, Actual: 5.0
2
Calculate Loss
Measure prediction error using loss function
MSE = (7.2 - 5.0)² = 4.84
3
Compute Gradients
Find which direction reduces loss
Backpropagation calculates ∂Loss/∂weights
4
Update Weights
Adjust parameters to reduce loss
weight = weight - learning_rate × gradient
📊 Why Loss Functions Matter
🎯
Define Success
Quantifies what "good predictions" mean for your task
🧭
Guide Learning
Tells optimizer which direction to update weights
⚖️
Balance Trade-offs
Different losses emphasize different types of errors
📈
Track Progress
Monitor training by watching loss decrease over time
🔑 Key Properties
Non-negative
Loss ≥ 0, with 0 meaning perfect predictions
Differentiable
Must be able to calculate gradients for backpropagation
Task-appropriate
Different problems need different loss functions