Adam:方向記憶加逐維步幅Adam combines direction and scale

IDL115 · CH03 · KP11 · 28/44
第一矩平滑方向,第二矩調整每個維度的尺度。 / The two moment estimates play different roles.

方向的記憶First moment

m 是梯度指數平均,從 m₀=0 開始。 / Initialize the first moment to zero.

mt=β1mt−1+(1−β1)gt(42)m_t=\beta_1m_{t-1}+(1-\beta_1)g_t\quad\text{(42)}

尺度的記憶Second raw moment

v 與權重同維度,從 v₀=0 開始。 / The second moment is a vector.

vt=β2vt−1+(1−β2)(gt⊙gt)(43)v_t=\beta_2v_{t-1}+(1-\beta_2)(g_t\odot g_t)\quad\text{(43)}

最終更新Update

先偏差修正,再逐維相除。 / Correct bias, then divide elementwise.

wt=wt−1−ηm^tv^t+ε(46)w_t=w_{t-1}-\eta\frac{\hat m_t}{\sqrt{\hat v_t}+\varepsilon}\quad\text{(46)}