0Pricing
Deep Learning Academy · レッスン

モメンタム付きSGD

更新を平滑化してノイズを乗り越えます

「モメンタム付きSGD」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDeep Learning Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Deep Learning Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Plain SGD Forgets

Vanilla SGD steps using only the current gradient. Every update starts from scratch, so a noisy slope makes it wobble and crawl toward the minimum.

Borrow Some Inertia

Momentum gives SGD memory. It keeps a running average of past gradients and rolls in that direction, like a ball gathering speed downhill.

The Velocity Vector

Momentum tracks a velocity that blends the old velocity with the new gradient. The weights then move by that smoothed velocity each step.

v = beta * v + grad
w = w - lr * v

The Beta Knob

The momentum coefficient beta sets how much past steps count. A common value is 0.9, meaning most of the velocity carries over.

Smooths Out Noise

Because momentum averages many gradients, random noise in any single batch mostly cancels. The path to the minimum becomes smoother and steadier.

Rolls Past Small Bumps

Built-up speed lets the optimizer coast through tiny dips and flat spots that would stall plain SGD. The ball does not stop at every pebble.

Turn It On in PyTorch

You do not code this by hand. Just pass momentum to the built-in SGD optimizer and PyTorch tracks the velocity for you.

opt = torch.optim.SGD(model.parameters(), lr=0.01, momentum=0.9)

Nesterov Looks Ahead

A sharper variant, Nesterov momentum, peeks at where the velocity is heading before measuring the gradient. It often converges a touch faster.

opt = torch.optim.SGD(model.parameters(), lr=0.01, momentum=0.9, nesterov=True)

Mind the Overshoot

Too much speed can carry you past the valley floor. If loss bounces or diverges, lower the learning rate or trim momentum a little.

Why It Still Matters

Even with fancy optimizers around, SGD with momentum remains a strong baseline and often generalizes beautifully on vision models.

A Faster Descent

The payoff is real: momentum usually reaches a good minimum in fewer epochs than plain SGD, with less zig-zagging along the way.

Quick Check

Make sure momentum's role is clear.

Recap

Momentum gives SGD a velocity that blends past gradients, smoothing noise and coasting past small bumps. Set momentum near 0.9 for a faster, steadier descent. 🏂

よくある質問

「モメンタム付きSGD」レッスンは無料ですか?

はい。「モメンタム付きSGD」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。

「モメンタム付きSGD」で何を学びますか?

更新を平滑化してノイズを乗り越えます ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Deep Learning Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。

「モメンタム付きSGD」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このDeep Learning Academyレッスンでコードを書いて実行できますか?

はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. モメンタム付きSGD
  2. AdamとAdamWを理解する
  3. weight decayとL2正則化の違い
  4. 学習率スケジュールとウォームアップ
← Deep Learning Academyに戻る