利用二阶矩和幅值扩展AdamW
Extending AdamW by Leveraging Its Second Moment and Magnitude
摘要:
最近的工作[4]分析了Adam在二次可微函数的最优解邻域中的局部收敛性。研究发现,学习率必须足够小,以确保最优解的局部稳定性。上述收敛结果也适用于AdamW。在这项工作中,我们提出了一种新的自适应优化方法,通过扩展AdamW在两个方面的目的是放松对小学习率的局部稳定性的要求,我们称之为Aida。首先,我们考虑跟踪梯度幅度的p次幂的二阶矩r_t。当p=2时,r_t约化为AdamW的v_t。假设{m_t}是AdamW的一阶矩。已知AdamW(或Adam)的更新方向m_{t+1} /(v_{t+1} + N)^0.5(或m_{t+1} /(v_{t+1} ^0.5+ N))可以被分解为符号向量符号(m_{t+1})逐元素乘以幅度向量|m_{t+1}|/(v_{t+1} + ε)≥ 0.5(或|m_{t+1}|/(v_{t+1} ^0.5+ μ))。Aida被设计为以以下形式计算幅度的q次幂:|m_{t+1}| ^q/(r_{t+1} + ε)^(q/p)(或|m_{t+1}| ^q/((r_{t+1})^(q/p)+n)),当(p,q)=(2,1)时,其简化为AdamW的公式。假设原点0是一个二次可微函数的局部最优解。从理论上证明了当q>1和p>1时,Aida中原点0只有在重量衰减不为零时才是局部稳定的。进行实验以解决十个玩具优化问题并训练Transformer和Swin-Transformer用于两个深度学习(DL)任务。实证研究表明,在许多场景下(包括两个DL任务),Aida与特定的设置(p,q)不等于(2,1)优于设置(p,q)=(2,1)的AdamW。
英文摘要:
Recent work [4] analyses the local convergence of Adam in a neighbourhood of an optimal solution for a twice-differentiable function. It is found that the learning rate has to be sufficiently small to ensure local stability of the optimal solution. The above convergence results also hold for AdamW. In this work, we propose a new adaptive optimisation method by extending AdamW in two aspects with the purpose to relax the requirement on small learning rate for local stability, which we refer to as Aida. Firstly, we consider tracking the 2nd moment r_t of the pth power of the gradient-magnitudes. r_t reduces to v_t of AdamW when p=2. Suppose {m_t} is the first moment of AdamW. It is known that the update direction m_{t+1}/(v_{t+1}+epsilon)^0.5 (or m_{t+1}/(v_{t+1}^0.5+epsilon) of AdamW (or Adam) can be decomposed as the sign vector sign(m_{t+1}) multiplied elementwise by a vector of magnitudes |m_{t+1}|/(v_{t+1}+epsilon)^0.5 (or |m_{t+1}|/(v_{t+1}^0.5+epsilon)). Aida is designed to compute the qth power of the magnitude in the form of |m_{t+1}|^q/(r_{t+1}+epsilon)^(q/p) (or |m_{t+1}|^q/((r_{t+1})^(q/p)+epsilon)), which reduces to that of AdamW when (p,q)=(2,1). Suppose the origin 0 is a local optimal solution of a twice-differentiable function. It is found theoretically that when q>1 and p>1 in Aida, the origin 0 is locally stable only when the weight-decay is non-zero. Experiments are conducted for solving ten toy optimisation problems and training Transformer and Swin-Transformer for two deep learning (DL) tasks. The empirical study demonstrates that in a number of scenarios (including the two DL tasks), Aida with particular setups of (p,q) not equal to (2,1) outperforms the setup (p,q)=(2,1) of AdamW.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。