勾配は上り坂を指す——だから逆方向に進む
傾きを使って重みを改善します
「勾配は上り坂を指す——だから逆方向に進む」はCoddyKit上の無料Deep Learning Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはDeep Learning Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Deep Learning Academyコースには全4レッスンが含まれています。
このレッスンの一部はまだ翻訳されておらず、英語で表示されています。
Reading the Slope
To walk downhill you first need to know which way is down. The gradient is the tool that tells you the slope of the loss at your current spot.
Gradient Points Uphill
Here is the surprise: the gradient points in the direction where loss increases fastest. It shows you the steepest way up, not down.
So Step the Other Way
Since the gradient aims uphill, you move in the opposite direction to go down. Subtracting the gradient takes you toward lower loss.
w = w - gradThe Update Rule
This one line is the heart of training. You scale the gradient by a small step size, then subtract it from each weight. Repeat and loss drops.
w = w - lr * gradGradient Is a Vector
With many weights, the gradient is a whole vector: one slope per weight. Each weight gets nudged by its own piece of that vector.
Magnitude Means Steepness
A large gradient value means the loss is very steep in that direction, so that weight needs a bigger correction. Small values mean you are nearly flat there.
Where Gradient Is Zero
At the very bottom of a valley the slope flattens and the gradient becomes zero. With nothing to subtract, the weights stop moving. You have converged.
One Step at a Time
You almost never reach the bottom in one jump. Each step only improves things a little, so descent is a long series of tiny downhill moves.
Following the Negative Gradient
The path you trace by always heading along the negative gradient is the route of steepest descent. It is the greedy shortcut toward lower loss.
step = -gradWhy Subtraction Works
Subtracting moves you against the increase, so loss must fall for a small enough step. That simple sign flip is what turns a slope into progress.
Toward Automatic Gradients
You will rarely compute these slopes by hand. PyTorch's autograd finds the gradient for you, but the rule stays the same: subtract it to descend.
Quick Check
Which direction does the gradient point?
Recap
The gradient points uphill toward higher loss, so you subtract a scaled version of it to step down. Repeat that update and the model rolls toward the valley. ⬇️
よくある質問
「勾配は上り坂を指す——だから逆方向に進む」レッスンは無料ですか?
はい。「勾配は上り坂を指す——だから逆方向に進む」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Deep Learning Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Deep Learning Academyコースには全4レッスンが含まれています。
「勾配は上り坂を指す——だから逆方向に進む」で何を学びますか?
傾きを使って重みを改善します ブラウザで直接実行するハンズオンコードでDeep Learning Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Deep Learning Academyを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのDeep Learning Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。
「勾配は上り坂を指す——だから逆方向に進む」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このDeep Learning Academyレッスンでコードを書いて実行できますか?
はい。すべてのDeep Learning Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 損失を下るべき地形として捉える
- 勾配は上り坂を指す——だから逆方向に進む
- 学習率:大きすぎず小さすぎず、ちょうどよく
- Pythonで関数を手作業で最小化する