Learning Rate (Easy AI Tutorial)
What Is Learning Rate?
The learning rate is one of the most important hyperparameters in machine learning. It determines the magnitude of parameter adjustments during each update and is usually set in the range (0, 1).
The learning rate tells the model how fast it should learn during training, balancing the speed of progress against stability.
Core Roles
1. Controls parameter adjustment: determines the step size of each update 2. Affects learning speed: balances progress speed and stability 3. Key hyperparameter: directly influences training effectiveness
Intuitive Analogies
Studying and Reviewing
The learning rate is like how much you adjust your study method after solving problems:- Large learning rate (0.1): big adjustments each time—fast progress, but you may go off track
- Small learning rate (0.0001): tiny adjustments each time—stable, but slow progress
- Large turns: the car changes direction quickly, but may sway
- Fine adjustments: smooth driving, but slow to react on sharp curves
- A lot of salt: the flavor changes noticeably, but it can easily become too salty and hard to fix
- A little salt: steady improvement, but requires many tries
Driving and Steering
The learning rate is like how much you turn the steering wheel while driving:Seasoning While Cooking
The learning rate is like how much salt you add when seasoning:Too Large vs. Too Small
| Dimension | Learning Rate Too Large | Learning Rate Too Small | |-----------|------------------------|--------------------------| | Convergence speed | Fast (initially) | Slow | | Stability | Unstable, may oscillate | Stable | | Optimal solution | May miss the optimum | Can reach it, but very slowly |
Adjustment Strategies
1. Fixed learning rate: use the same learning rate throughout training 2. Learning rate decay: gradually reduce it as training progresses 3. Adaptive learning rate: optimizers like Adam and AdamW adjust automatically based on gradients
Typical Learning Rate Settings
| Optimizer | Typical Learning Rate Range | |-----------|------------------------------| | SGD | 0.01 - 0.1 | | Adam | 0.0001 - 0.001 | | AdamW | 0.0001 - 0.001 |
--- Source: Easy AI Tutorial