Quiz 2

⚙️ Optimizers Comparison

136 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# ⚙️ Optimizers Comparison ## 1. 🎯 Learning Objectives - Compare update rules of SGD, Momentum, RMSprop, Adam - Choose appropriate optimizer and learning rate - Diagnose optimization issues ## 2.

⚙️ Optimizers Comparison

1. 🎯 Learning Objectives

  • Compare update rules of SGD, Momentum, RMSprop, Adam
  • Choose appropriate optimizer and learning rate
  • Diagnose optimization issues

2. 📖 Core Content

3.1 Update Rules Summary

OptimizerUpdate RuleKey Hyperparameters
SGDθ = θ - η·gη (learning rate)
SGD+Momentumv=γv+ηg; θ=θ-vη, γ=0.9
NAGv=γv+η·∇f(θ-γv); θ=θ-vη, γ=0.9
AdaGradθ=θ-(η/√(G+ε))·gη=0.01, ε=1e-8
RMSpropθ=θ-(η/√(v+ε))·g; v=βv+(1-β)g²η=0.001, β=0.9
Adamm=β₁m+(1-β₁)g; v=β₂v+(1-β₂)g²; θ=θ-η·m̂/√(v̂+ε)η=0.001, β₁=0.9, β₂=0.999

3.2 When to Use Each

ScenarioRecommended OptimizerWhy
Simple convex problemSGDWorks well, fewer hyperparameters
Deep neural networkAdamAdaptive LR, works out-of-box
Computer visionSGD+MomentumOften generalizes better than Adam
NLP tasksAdamHandles sparse gradients well
Learning rate tuningAdamLess sensitive to LR choice
Sparse featuresAdaGradPer-parameter adaptive LR

3.3 Learning Rate Scheduling

Step decay: Reduce LR by factor γ every k epochs Cosine annealing: τ_t = τ_min + 0.5(τ_max-τ_min)(1+cos(tπ/T)) Warmup: Gradually increase LR from 0 to target over first few epochs Join Discord PreviousTransformer Deep DiveNextBatch Norm Details
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.