梯度下降

沿坡向下滾動找到最小值——機器學習的核心引擎

梯度下降透過反覆沿最陡下坡方向邁步來找到函數的最小值。梯度(導數)告訴你哪個方向是「下坡」,學習率控制每步的大小。

圖形顯示 f(x) = x⁴ − 3x² + 2,它有兩個谷(局部最小值)。從某個點出發,演算法沿坡一步步向下,直到抵達谷底。這正是神經網路的學習方式——在損失曲面上「向下滾動」。

試著問 AI 「從 x = 2 開始下降」「學習率過大會發生什麼?」

什麼是梯度下降?
一種最佳化演算法,透過迭代找到函數的最小值:x_{n+1} = x_n − α · f'(x_n),其中 α 是學習率。每一步都沿梯度的反方向(向下坡)移動。
什麼是學習率?
學習率 α 控制步長。太小:收斂緩慢,需要很多步。太大:會越過最小值並可能發散。找到合適的學習率是機器學習中的關鍵挑戰。
局部最小值和全局最小值有什麼區別?
局部最小值是比其周圍低的谷,但可能不是絕對最低點。全局最小值是整體最低點。梯度下降可能會陷入局部最小值——它只能看到局部坡度。
這在機器學習中如何應用?
神經網路有一個「損失函數」來衡量預測誤差。梯度下降調整模型參數以最小化損失——字面意義上是在高維曲面上向下滾動。你使用的每一個 AI 模型都是用這種方式訓練的。
What can it graph?
It can plot explicit, implicit, and parametric functions, add points and geometry, and animate sliders on the same graph.
Can I use voice or a photo?
Yes. You can talk to the tutor, upload a worksheet or handwritten problem, and let the graph update from that input.
Will it explain the steps?
Yes. The AI explains what it is drawing and why, so you see the answer on the graph instead of getting only a final number.