SAM:先找附近最壞,再降低它SAM minimizes the worst nearby loss

IDL115 · CH03 · KP13 · 32/44
普通訓練看當前點;SAM 多看半徑 ρ 內的鄰居。 / SAM also evaluates a parameter neighborhood.

鄰域最大損失Worst nearby loss

p 指定範數,ρ 指定擾動半徑。 / The norm and radius define the neighborhood.

LSAM(w)=max⁡∥ϵ∥p≤ρL(w+ϵ)(48)\mathcal L_{\mathrm{SAM}}(w)=\max_{\|\epsilon\|_p\le\rho}\mathcal L(w+\epsilon)\quad\text{(48)}

外層最小化Outer minimization

可加權重正則項;純 min-max 則不含該項。 / Weight regularization is optional here.

min⁡w{LSAM(w)+λ∥w∥22}(47),(49)\min_w\{\mathcal L_{\mathrm{SAM}}(w)+\lambda\|w\|_2^2\}\quad\text{(47),(49)}

兩層角色Two roles

內層擾動讓損失變大,外層更新讓最壞損失變小。 / The inner and outer problems act in opposite directions.