一階與二階:資訊與成本First and second order: information and cost

IDL115 · CH03 · KP01 · 2/44
一階看坡度,二階再看坡度如何改變。 / First order uses slopes; second order also uses curvature.

一階方法First-order methods

GD、SGD、Adam 用梯度決定更新。 / GD, SGD and Adam use first derivatives.

g=∇L(w)\boldsymbol g=\nabla\mathcal L(\boldsymbol w)

二階方法Second-order methods

Newton 法解線性系統;通常不直接計算矩陣反矩陣。 / Newton methods solve a linear system.

HΔw=−g,H=∇2LH\Delta\boldsymbol w=-\boldsymbol g,\quad H=\nabla^2\mathcal L

規模差異Scaling

d 個參數:梯度有 d 個元素;稠密 Hessian 有 d² 個元素。 / A dense Hessian has d² entries.