AdamとAdamWを理解する
適応的な学習率と分離型weight decayを学びます
「AdamとAdamWを理解する」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDeep Learning Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Deep Learning Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
One Rate Per Weight
SGD uses a single learning rate for every parameter. Adam adapts the step size for each weight on its own, based on that weight's gradient history.
Two Moving Averages
Adam tracks two running averages: the mean of gradients and the mean of their squares. Together they form the first and second moments.
First Moment Is Momentum
The first moment is basically momentum, the smoothed average of recent gradients. It decides the overall direction each weight should move.
Second Moment Scales Steps
The second moment estimates each gradient's size. Adam divides by its square root, so noisy weights take smaller steps and quiet ones take larger.
The Betas
Two decay rates, the betas, control those averages, typically 0.9 and 0.999. They balance how much recent versus older gradients matter.
Bias Correction
The averages start at zero, so early steps look too small. Adam applies a bias correction to fix this so updates are sane from step one.
Use It in PyTorch
One line gives you Adam. The default learning rate of 0.001 works well across a huge range of models, which is why it is so popular.
opt = torch.optim.Adam(model.parameters(), lr=1e-3)Adam's Weight Decay Flaw
Classic Adam mixes weight decay into the gradient, where the adaptive scaling distorts it. The regularization ends up weaker than you intended.
AdamW Fixes It
AdamW decouples weight decay from the gradient step and applies it directly to the weights. The decay now works as a clean, predictable shrink.
opt = torch.optim.AdamW(model.parameters(), lr=1e-3, weight_decay=0.01)The Modern Default
For transformers and most large models, AdamW is the standard choice. Reach for it first whenever you want fast, reliable convergence.
Adaptive, With Caveats
Adam often trains faster than SGD, yet plain SGD with momentum can generalize better on vision tasks. Try both when accuracy really counts.
Quick Check
Pin down the Adam to AdamW difference.
Recap
Adam adapts a learning rate per weight using gradient mean and variance, while AdamW fixes its weight decay. AdamW is today's go-to optimizer. ⚙️
よくある質問
「AdamとAdamWを理解する」レッスンは無料ですか?
はい。「AdamとAdamWを理解する」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。
「AdamとAdamWを理解する」で何を学びますか?
適応的な学習率と分離型weight decayを学びます ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Deep Learning Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「AdamとAdamWを理解する」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このDeep Learning Academyレッスンでコードを書いて実行できますか?
はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- モメンタム付きSGD
- AdamとAdamWを理解する
- weight decayとL2正則化の違い
- 学習率スケジュールとウォームアップ