T RAINING
D EEP
N EURAL
N ETWORKS
WITH
P ARTIALLY
A DAPTIVE M OMENTUM
Anonymous authors
Paper under double-blind review
A BSTRACT
Adaptive gradient methods, which adopt historical gradient information to automatically adjust the learning rate, despite the nice property of fast convergence, have been observed to generalize worse than stochastic gradient descent (SGD) with momentum in training deep neural networks.
This leaves how to close the generalization gap of adaptive gradient methods an open problem.
In this work, we show that adaptive gradient methods such as Adam, Amsgrad, are sometimes “over adapted”.
We design a new algorithm, called Partially adaptive momentum estimation method , which uniﬁes the Adam/Amsgrad with SGD by introducing a partial adaptive parameter p , to achieve the best from both worlds.
We also prove the convergence rate of our proposed algorithm to a stationary point in the stochastic nonconvex optimization setting.
Experiments on standard benchmarks show that our proposed algorithm can maintain fast convergence rate as Adam/Amsgrad while generalizing as well as SGD in training deep neural networks.
These results would suggest practitioners pick up adaptive gradient methods once again for faster training of deep neural networks.
I NTRODUCTION
Stochastic gradient descent (SGD) is now one of the most dominant approaches for training deep neural networks (Goodfellow et al., 2016).
In each iteration, SGD only performs one parameter update on a mini-batch of training examples.
SGD is simple and has been proved to be efﬁcient, especially for tasks on large datasets.
In recent years, adaptive variants of SGD have emerged and shown their successes for their convenient automatic learning rate adjustment mechanism.
Adagrad (Duchi et al., 2011) is probably the ﬁrst along this line of research, and signiﬁcantly outperforms vanilla SGD in the sparse gradient scenario.
Despite the ﬁrst success, Adagrad was later found to demonstrate degraded performance especially in cases where the loss function is nonconvex or the gradient is dense.
Many variants of Adagrad, such as RMSprop (Hinton et al., 2012), Adam (Kingma & Ba, 2015), Adadelta (Zeiler, 2012), Nadam (Dozat, 2016), were then proposed to address these challenges by adopting exponential moving average rather than the arithmetic average used in
Adagrad.
This change largely mitigates the rapid decay of learning rate in Adagrad and hence makes this family of algorithms, especially Adam, particularly popular on various tasks.
Recently, it has also been observed (Reddi et al., 2018) that Adam does not converge in some settings where rarely encountered large gradient information quickly dies out due to the “short momery” problem of exponential moving average.
To address this issue, Amsgrad (Reddi et al., 2018) has been proposed to keep an extra “long term memory” variable to preserve the past gradient information and to correct the potential convergence issue in Adam.
There are also some other variants of adaptive gradient method such as SC-Adagrad / SC-RMSprop (Mukkamala & Hein, 2017), which derives logarithmic regret bounds for strongly convex functions.
On the other hand, people recently found that for largely over-parameterized neural networks, e.g., more complex modern convolutional neural network (CNN) architectures such as VGGNet (He et al., 2016), ResNet (He et al., 2016), Wide ResNet (Zagoruyko & Komodakis, 2016), DenseNet (Huang et al., 2017), training with Adam or its variants typically generalizes worse than SGD with momentum, even when the training performance is better.
In particular, people found that carefully-tuned SGD, combined with proper momentum, weight decay and appropriate learning rate decay schedules, can signiﬁcantly outperform adaptive gradient algorithms eventually (Wilson et al., 2017).
As a result, even though adaptive gradient methods are relatively easy to tune and converge faster at the early stage, recent advances in designing neural network structures are all reporting their performances by training their models with SGD-momentum (He et al., 2016; Zagoruyko &
Komodakis, 2016; Huang et al., 2017; Simonyan & Zisserman, 2014; Ren et al., 2015; Xie et al., 2017; Howard et al., 2017).
Different from SGD, which adopts a universal learning rate for all coordinates, the effective learning rate of adaptive gradient methods, i.e., the universal base learning rate divided by the second order moment term, is different for different coordinates.
Due to the normalization of the second order moment, some coordinates will have very large effective learning rates.
To alleviate this problem, one usually chooses a smaller base learning rate for adaptive gradient methods than SGD with momentum.
This makes the learning rate decay schedule less effective when applied to adaptive gradient methods, since a much smaller base learning rate will soon diminish after several rounds of decay.
We refer to the above phenomenon as the “small learning rate dilemma” (see more details in Section 3).
With all these observations, a natural question is:
Can we take the best from both Adam and SGD-momentum, i.e., design an algorithm that not only enjoys the fast convergence rate as Adam, but also generalizes as well as SGD-momentum?
In this paper, we answer this question afﬁrmatively.
We close the generalization gap of adaptive gradient methods by proposing a new algorithm, called p artially ada ptive m omentum estimation (Padam) method, which uniﬁes Adam/Amsgrad with SGD-momentum to achieve the best of both worlds, by a partially adaptive parameter.
The intuition behind our algorithm is: by controlling the degree of adaptiveness, the base learning rate in Padam does not need to be as small as other adaptive gradient methods.
Therefore, it can maintain a larger learning rate while preventing the gradient explosion.
We note that there exist several studies (Zaheer et al., 2018; Loshchilov &
Hutter, 2019; Luo et al., 2019) that also attempted to address the same research question.
In detail,
Yogi (Zaheer et al., 2018) studied the effect of adaptive denominator constant (cid:15) and minibatch size in the convergence of adaptive gradient methods.
AdamW (Loshchilov & Hutter, 2019) proposed to ﬁx the weight decay regularization in Adam by decoupling the weight decay from the gradient update and this improves the generalization performance of Adam.
AdaBound (Luo et al., 2019) applies dynamic bound of learning rate on Adam and make them smoothly converge to a constant ﬁnal step size as in SGD.
Our algorithm is very different from Yogi, AdamW and AdaBound.
Padam is built upon a simple modiﬁcation of Adam without extra complicated algorithmic design and it comes with a rigorous convergence guarantee in the nonconvex stochastic optimization setting.
We highlight the main contributions of our work as follows:
• We propose a novel and simple algorithm Padam with a partially adaptive parameter, which resolves the “small learning rate dilemma” for adaptive gradient methods and allows for faster convergence, hence closing the gap of generalization.
• We provide a convergence guarantee for Padam in nonconvex optimization.
Speciﬁcally, we prove that the convergence rate of Padam to a stationary point for stochastic nonconvex optimization is
[Equation]
where g 1 , . .
. , g T are the stochastic gradients and g 1: T,i =
[ g 1 ,i , g 2 ,i , . .
. , g T,i ] (cid:62) .
When the stochastic gradients are (cid:96) ∞ -bounded, (1.1) matches the convergence rate of SGD in terms of the rate of T .
• We also provide thorough experiments about our proposed Padam method on training modern deep neural architectures.
We empirically show that Padam achieves the fastest convergence speed while generalizing as well as SGD with momentum.
These results suggest that practitioners should pick up adaptive gradient methods once again for faster training of deep neural networks.
Last but not least, compared with the recent work on adaptive gradient methods, such as Yogi (Zaheer et al., 2018), AdamW (Loshchilov & Hutter, 2019), AdaBound (Luo et al., 2019), our proposed Padam achieves better generalization performance than these methods in our experiments.
1. A DDITIONAL RELATED WORK
Here we review additional related work that is not covered before.
Zhang et al.
(2017) proposed a normalized direction-preserving Adam (ND-Adam), which changes the adaptive terms from individual dimensions to the whole gradient vector.
Keskar & Socher (2017) proposed to improve the generalization performance by switching from Adam to SGD.
On the other hand, despite the great successes of adaptive gradient methods for training deep neural networks, the convergence guarantees for these algorithms are still understudied.
Most convergence analyses of adaptive gradient methods are restricted to online convex optimization (Duchi et al., 2011; Kingma & Ba, 2015;
Mukkamala & Hein, 2017; Reddi et al., 2018).
A few recent attempts have been made to analyze adaptive gradient methods for stochastic nonconvex optimization.
More speciﬁcally, Basu et al.
(2018) proved the convergence rate of RMSProp and Adam when using deterministic gradient rather than stochastic gradient.
Li & Orabona (2018) analyzed convergence rate of AdaGrad under both convex and nonconvex settings but did not consider more complicated Adam-type algorithms.
Ward et al.
(2018) also proved the convergence rate of AdaGrad under both convex and nonconvex settings without considering the effect of stochastic momentum.
Chen et al.
(2018) provided a convergence analysis for a class of Adam-type algorithms for nonconvex optimization.
Zou & Shen (2018) analyzed the convergence rate of AdaHB and AdaNAG, two modiﬁed version of AdaGrad with the use of momentum.
However, none of these results are directly applicable to Padam.
Our convergence analysis in Section 4 is quite general and implies the convergence rate of Adam/AMSGrad for nonconvex optimization.
In terms of learning rate decay schedule, Wu et al.
(2018) studied the learning rate schedule via short-horizon bias.
Xu et al.
; Davis et al.
(2019) analyzed the convergence of stochastic algorithms with geometric learning rate decay.
Ge et al. (2019) studied the learning rate schedule for quadratic functions. Notation: Scalars are denoted by lower case letters, vectors by lower case bold face letters, and matrices by upper case bold face letters.
For a vector x ∈ R d , we denote the (cid:96) 2 norm of x by (cid:107) x (cid:107) 2 = (cid:113)(cid:80) di =1 x 2 i , the (cid:96) ∞ norm of x by (cid:107) x (cid:107) ∞ =
max di =1 | x i | .
For a sequence of vectors { x j } tj =1 , we denote by x j,i the i -th element in x j .
We also denote x 1: t,i =
[ x 1 ,i , . . .
, x t,i ] (cid:62) .
With slightly abuse of notation, for two vectors a and b , we denote a 2 as the element-wise square, a p as the element-wise power operation, a / b as the element-wise division and max( a , b ) as the elementwise maximum.
We denote by diag( a ) a diagonal matrix with diagonal entries a 1 , . .
. , a d .
Given two sequences { a n } and { b n } , we write a n = O ( b n ) if there exists a positive constant C such that a n ≤ Cb n and a n = o ( b n ) if a n /b n → 0 as n → ∞ .
Notation (cid:101) O ( · ) hides logarithmic factors.
R EVIEW OF A DAPTIVE G RADIENT M ETHODS
Various adaptive gradient methods have been proposed in order to achieve better performance on various stochastic optimization tasks.
Adagrad (Duchi et al., 2011) is among the ﬁrst methods with adaptive learning rate for each individual dimension, which motivates the research on adaptive gradient methods in the machine learning community.
In detail, Adagrad 1 adopts the following update form:
[Equation]
where g t stands for the stochastic gradient ∇ f t ( x t ) , and α t = α/ √ t is the step size.
In this paper, we call α t base learning rate , which is the same for all coordinates of x t , and we call α t / √ v t,i effective learning rate for the i -th coordinate of x t , which varies across the coordinates.
Adagrad is proved to enjoy a huge gain in terms of convergence especially in sparse gradient situations.
Empirical studies also show a performance gain even for non-sparse gradient settings.
RMSprop (Hinton et al., 2012) follows the idea of adaptive learning rate and it changes the arithmetic averages used for v t in Adagrad to exponential moving averages.
Even though RMSprop is an empirical method with no theoretical guarantee, the outstanding empirical performance of RMSprop raised people’s interests in exponential moving average variants of Adagrad.
Adam (Kingma & Ba, 2015) 2 is the most popular exponential moving average variant of Adagrad.
It combines the idea of RMSprop and momentum acceleration, and takes the following update form:
[Equation]
Adam also requires α t = α/ √ t for the sake of convergence analysis.
In practice, any decaying step size or even constant step size works well for Adam.
Note that if we choose β 1 = 0 , Adam basically reduces to RMSprop.
Reddi et al.
identiﬁed a non-convergence issue in Adam.
Speciﬁcally,
Adam does not collect long-term memory of past gradients and therefore the effective learning rate could be increasing in some cases.
They proposed a modiﬁed algorithm namely Amsgrad.
More speciﬁcally, Amsgrad adopts an additional step to ensure the decay of the effective learning rate α t / √ (cid:98) v t , and its key update formula is as follows:
[Equation]
m t and v t are the same as Adam.
By introducing the (cid:98) v t term, Reddi et al.
(2018) corrected some mistakes in the original proof of Adam and proved an O (1 / √ T ) convergence rate of Amsgrad for convex optimization.
Note that all the theoretical guarantees on adaptive gradient methods (Adagrad,
Adam, Amsgrad) are only proved for convex functions.
T HE P ROPOSED A LGORITHM
In this section, we propose a new algorithm for bridging the generalization gap for adaptive gradient methods.
Speciﬁcally, we introduce a partial adaptive parameter p to control the level of adaptiveness of the optimization procedure.
The proposed algorithm is displayed in Algorithm 1.
input: initial point x 1 ∈ X ; step sizes { α t } ; adaptive parameters β 1 , β 2 , p ∈ (0 , 1 / 2] set m
= 0 , v 0 = 0 , (cid:98) v 0 =for t = 1 , . .
, T do g t = ∇ f ( x t , ξ t ) m t = β 1 m t − 1 + (1 − β 1 ) g t v t = β 2 v t − 1 + (1 − β 2 ) g 2 t (cid:98) v t = max( (cid:98)
[Equation]
t
[Equation] x t +1 = x t − α t · m t / v for
In Algorithm 1, g t denotes the stochastic gradient and (cid:98) v t can be seen as a moving average over the second order moment of the stochastic gradients.
As we can see from Algorithm 1, the key difference between Padam and Amsgrad (Reddi et al., 2018) is that: while m t is still the momentum as in Adam/Amsgrad, it is now “partially adapted” by the second order moment, i.e., [Equation]
(cid:98) v pt , where (cid:98) v t = max( (cid:98) v t − 1 , v t ) .
(Padam)
We call p ∈ [0 , 1 / 2] the partially adaptive parameter.
Note that 1 / 2 is the largest possible value for p and a larger p will result in non-convergence in the proof (see the proof details in the supplementary materials).
When p → 0 , Algorithm 1 reduces to SGD with momentum 3 and when p = 1 / 2 , Algorithm 1 is exactly Amsgrad.
Therefore, Padam indeed uniﬁes Amsgrad and SGD with momentum.
With the notations deﬁned above, we are able to formally explain the “small learning rate dilemma”. In order to make things clear, we ﬁrst emphasize the relationship between adaptiveness and learning rate decay.
We refer the actual learning rate applied to m t as the effective learning rate, i.e., α t / (cid:98) v pt .
Now suppose that a learning rate decay schedule is applied to α t .
If p is large, then at early stages, the effective learning rate α t / (cid:98) v pt,i could be fairly large for certain coordinates with small (cid:98) v t,i value 4 .
To prevent those coordinates from overshooting we need to enforce a smaller α t , and therefore the base learning rate must be set small (Keskar & Socher, 2017; Wilson et al., 2017).
As a result, after several rounds of decaying, the learning rates of the adaptive gradient methods are too small to make any signiﬁcant progress in the training process 5 .
We call this phenomenon “small learning rate dilemma”.
It is also easy to see that the larger p is, the more severe “small learning rate dilemma” is. This suggests that intuitively, we should consider using Padam with a proper adaptive parameter p , and choosing p < 1 / 2 can potentially make Padam suffer less from the “small learning rate dilemma” than Amsgrad, which justiﬁes the range of p in Algorithm 1. We will show in our experiments (Section 5) that Padam with p < 1 / 2 can adopt an equally large base learning rate as
SGD with momentum.
Note that even though in Algorithm 1, the choice of α t covers different choices of learning rate decay schedule, the main focus of this paper is not about ﬁnding the best learning rate decay schedule, but designing a new algorithm to control the adaptiveness for better empirical generalization result. In other words, our focus is not on α t , but on (cid:98) v t .
For this reason, we simply ﬁx the learning rate decay schedule for all methods in the experiments to provide a fair comparison for different methods.
[Figure]
Figure 1 shows the comparison of test error performances under the different partial adaptive parameter p for ResNet on both CIFAR10 and CIFAR-100 datasets.
We can observe that a larger p will lead to fast convergence at early stages and worse generalization performance later, while a smaller p behaves more like SGD with momentum: slow in early stages but ﬁnally catch up.
With a proper choice of p (e.g., 1 / 8 in this case), Padam can obtain the best of both worlds.
Note that besides Algorithm 1, our partially adaptive idea can also be applied to other adaptive gradient methods such as Adagrad, Adadelta, RMSprop, AdaMax (Kingma & Ba, 2015).
For the sake of conciseness, we do not list the partially adaptive versions for other adaptive gradient methods here.
We also would like to comment that Padam is totally different from the p -norm generalized version of Adam in Kingma & Ba (2015), which induces AdaMax method when p → ∞ .
In their case, p -norm is used to generalize 2 -norm of their current and past gradients while keeping the scale of adaptation unchanged.
In sharp contrast, we intentionally change (reduce) the scale of the adaptive term in Padam to get better generalization performance.
Finally, note that in Algorithm 1 we remove the bias correction step used in the original Adam paper following Reddi et al.
Nevertheless, our arguments and theory are applicable to the bias correction version as well.
C ONVERGENCE A NALYSIS OF THE P ROPOSED A LGORITHM
In this section, we establish the convergence theory of Algorithm 1 in the stochastic nonconvex optimization setting, i.e., we aim at solving the following stochastic nonconvex optimization problem
[Equation]
where ξ is a random variable satisfying certain distribution, f ( x ; ξ ) : R d → R is a L -smooth nonconvex function.
In the stochastic setting, one cannot directly access the full gradient of f ( x ) .
Instead, one can only get unbiased estimators of the gradient of f ( x ) , which is ∇ f ( x ; ξ ) .
This setting has been studied in Ghadimi & Lan (2013; 2016).
We ﬁrst introduce the following assumptions.
Assumption 4.1 (Bounded Gradient) .
f ( x ) =
E ξ f
x ; ξ ) has G ∞ -bounded stochastic gradient.
That is, for any ξ , we assume that (cid:107)∇ f ( x ; ξ ) (cid:107) ∞ ≤ G ∞ .
It is worth mentioning that Assumption 4.1 is slightly weaker than the (cid:96) 2 -boundedness assumption (cid:107)∇ f ( x ; ξ ) (cid:107) 2 ≤ G 2 used in Reddi et al.
; Chen et al.
Since (cid:107)∇ f ( x ; ξ ) (cid:107) ∞ ≤ (cid:107)∇ f ( x ; ξ ) (cid:107) 2 ≤ √ d (cid:107)∇ f ( x ; ξ ) (cid:107) ∞ , the (cid:96) 2 -boundedness assumption implies Assumption 4.1 with
G ∞ =
G 2 .
Meanwhile, G ∞ will be tighter than G 2 by a factor of √ d when each coordinate of ∇ f ( x ; ξ ) almost equals to each other.
Assumption 4.2 ( L -smooth) .
f ( x ) =
E ξ f
x ; ξ ) is L -smooth: for any x , y ∈ R d , it satisﬁed that
[Equation]
Assumption 4.2 is frequently used in analysis of gradient-based algorithms.
It is equivalent to the
L -gradient Lipschitz condition, which is often written as (cid:107)∇ f ( x ) − ∇ f ( y ) (cid:107) 2 ≤ L (cid:107) x − y (cid:107) 2 .
Next we provide the main convergence rate result for our proposed algorithm.
Theorem 4.3 (Padam) .
In Algorithm 1, suppose that p ∈ [0 , 1 / 2] , β 1 < β 2 p 2 and α t = α for t = 1 , . .
, T , under Assumptions 4.1 and 4.2, let ∆ f = f ( x 1 ) − inf x f ( x ) , for any q ∈ [max { 0 , 4 p − 1 } , 1] , the output x out of Algorithm 1 satisﬁes that
[Equation]
where
[Equation]
Remark 4.4.
From Theorem 4.3, we can see that M 1 and M 3 are independent of the number of iterations T and dimension d .
In addition, if (cid:107) (cid:98) v − 1 1 (cid:107) ∞
=
O (1) , it is easy to see that M 2 also has an upper bound that is independent of T and d .
The following corollary is a special case of Theorem 4.3 when p ∈ [0 , 1 / 4] and q = 0 .
Corollary 4.5.
Under the same conditions in Theorem 4.3, if p ∈ [0 , 1 / 4] , Padam’s output satisﬁes
[Equation]
where M 1 and M 2 and ∆ f are the same as in Theorem 4.3, and M (cid:48) 3 is deﬁned as follows:
[Equation]
Remark 4.6.
Corollary 4.5 simpliﬁes the result of Theorem 4.3 by choosing q = 0 under the condition p ∈ [0 , 1 / 4] .
We remark that this choice of q is optimal in an important special case studied in Duchi et al.
Reddi et al.
(2018): when the gradient vectors are sparse, we assume that (cid:80) di =1 (cid:107) g 1: T,i (cid:107)
(cid:28) √ dT .
Then for q > 0 , it follows that
[Equation]
(4.3) implies that the upper bound provided by (4.2) is strictly better than (4.1) with q > 0 .
Therefore when the gradient vectors are sparse, Padam achieves faster convergence when p ∈ [0 , 1 / 4] .
Remark 4.7.
We show the convergence rate under different choices of step size α .
If
[Equation]
then by (4.2), we have
[Equation]
Note that the convergence rate given by (4.4) is related to the sum of gradient norms (cid:80) di =1 (cid:107) g 1: [Equation] ,i (cid:107) 2 .
As we mentioned in Remark 4.6, when the stochastic gradients g 1: T,i , i = 1 , . .
, d are sparse, we have (cid:80) di =1 (cid:107) g 1: T,i (cid:107)
(cid:28) √ dT (Duchi et al.
More speciﬁcally, suppose (cid:80) di =1 (cid:107) g 1: T,i (cid:107) 2 =
O ( d s √ T ) for some 0 ≤ s ≤ 1 / 2 .
We have E [ (cid:107)∇ f ( x out ) (cid:107) 2 2 ]
= O (cid:0) d s/ 2 /T 1 / 2 + d/T (cid:1) .
When s = 1 / 2 , we have E [ (cid:107)∇ f ( x out ) (cid:107) 22 ]
= O (cid:0) d 1 / 4 / √ T + d/T (cid:1) , which matches the rate
O (1 / √ T ) achieved by nonconvex SGD (Ghadimi & Lan, 2016), considering the dependence of T .
It is worth noting that nonconvex SGD achieves O (max x ,ξ (cid:107)∇ f ( x , ; ξ ) (cid:107) 2 / √ T )
=
O ( (cid:112) d/T ) convergence rate under Assumption 4.1, thus the convergence rate of our algorithm is strictly better than that of SGD by a factor of d 1 / 4 when T is large.
Remark 4.8.
If we set α = 1 / √ T which is not related to (cid:80) di =1 (cid:107) g 1: T,i (cid:107) 2 , then (4.2) suggests that
[Equation]
When (cid:80) di =1 (cid:107) g 1: T,i (cid:107)
(cid:28) √ dT (Duchi et al., 2011; Reddi et al., 2018), we further have
[Equation]
which matches the convergence result in nonconvex SGD (Ghadimi & Lan, 2016) considering the dependence of T .
E XPERIMENTS
In this section, we empirically evaluate our proposed algorithm for training various modern deep learning models and test them on several standard benchmarks 6 .
We show that for nonconvex loss functions in deep learning, our proposed algorithm still enjoys a fast convergence rate, while its generalization performance is as good as SGD with momentum and much better than existing adaptive gradient methods such as Adam and Amsgrad.
All experiments are conducted on Amazon
AWS p3.8xlarge servers which come with Intel Xeon E5 CPU and 4 NVIDIA Tesla V100 GPUs (16G RAM per GPU).
All experiments are implemented in Pytorch version 0 .
4 . 1 within Python 3 . 6 . 4 .
[Figure]
We compare Padam against several state-of-the-art algorithms, including: (1) SGD-momentum, (2)
Adam (Kingma & Ba, 2015), (3) Amsgrad (Reddi et al., 2018), (4) AdamW (Loshchilov & Hutter, 2019) (5) Yogi (Zaheer et al., 2018) and (6) AdaBound (Luo et al., 2019) .
We use several popular datasets for image classiﬁcations and language modeling: CIFAR-10 (Krizhevsky & Hinton, 2009),
CIFAR-100 (Krizhevsky & Hinton, 2009), ImageNet dataset (ILSVRC2012)
(Deng et al., 2009) and
Penn Treebank dataset (Marcus et al., 1993).
We adopt three popular CNN architectures to evaluate the performance of our proposed algorithms on image classiﬁcation task: VGGNet-16 (Simonyan &
Zisserman, 2014), Residual Neural Network (ResNet-18) (He et al., 2016), Wide Residual Network (WRN-16-4) (Zagoruyko & Komodakis, 2016).
We test the language modeling task using 2-layer and 3-layer Long Short-Term Memory (LSTM) network (Hochreiter & Schmidhuber, 1997).
We test CIFAR-10, CIFAR-100 and Penn Treebank tasks for 200 epochs.
For all experiments, we use a ﬁxed multi-stage learning rate decaying scheme: we decay the learning rate by 0 .
1 at the 100 th and 150 th epochs.
We test ImageNet tasks for 100 epochs with similar multi-stage learning rate decaying scheme at the 30 th, 60 th and 80 th epochs.
We perform grid search on validation set to choose the best hyper-parameters for each algorithm.
Details about the datasets, CNN architectures and all the speciﬁc model parameters used in the following experiments can be found in the supplementary materials.
5. E XPERIMENTAL R ESULTS
[Figure] We compare our proposed algorithm with other baselines on training the aforementioned three modern CNN architectures for image classiﬁcation on the CIFAR-10, CIFARand also ImageNet datasets.
Due to the paper length limit, we leave all our experimental results regarding CIFAR-100 dataset and all test result tables in the supplementary materials.
Figure 2 plots the train loss and test error (top- 1 error) against training epochs on the CIFARdataset.
As we can see from the ﬁgure, at the early stage of the training process, (partially) adaptive gradient methods including Padam, make rapid progress lowing both the train loss and the test error, while SGD with momentum converges relatively slowly.
After the ﬁrst learning rate decaying at the 100 -th epoch, different algorithms start to behave differently.
SGD with momentum makes a huge drop while fully adaptive gradient methods (Adam and Amsgrad) start to generalize badly.
Padam, on the other hand, maintains relatively good generalization performance and also holds the lead over other algorithms.
After the second decaying at the 150 -th epoch, Adam and Amsgrad basically lose all the power of traversing through the parameter space due to the “small learning dilemma”, while the performance of SGD with momentum ﬁnally catches up with Padam.
AdamW, Yogi and AdaBound indeed improve the performance compared with original Adam but the performance is still worse than Padam.
[Figure]
Overall we can see that Padam achieves the best of both worlds (i.e., Adam and SGD with momentum): it maintains faster convergence rate while also generalizing as well as SGD with momentum in the end.
Figure 3 plots the Top1 and Top- 5 error against training epochs on the ImageNet dataset for both VGGNet and ResNet.
We can see that on ImageNet, all methods behave similarly as in our CIFARexperiments.
Padam method again obtains the best from both worlds by achieving the fastest convergence while generalizing as well as SGD with momentum.
Even though methods such as AdamW, Yogi and AdaBound have better performance than standard Adam, they still suffer from a big generalization gap on ImageNet dataset.
Note that we did not conduct WideResNet experiment on Imagenet dataset due to GPU memory limits.
We also perform experiments on the language modeling tasks to test our proposed algorithm on
Long Short-Term Memory (LSTM) network (Hochreiter & Schmidhuber, 1997), where adaptive gradient methods such as Adam are currently the mainstream optimizers for these tasks.
Figure for both 2-layer LSTM and 3-layer LSTM models.
We can observe that the differences on simpler 2-layer LSTM model is not very obvious but on more complicated 3-layer LSTM model, different algorithms have quite different optimizing behaviors.
Even though Adam, Amsgrad and AdamW have faster convergence in the early stages, Padam achieves the best ﬁnal test perplexity on this language modeling task for both of our experiments.
C ONCLUSIONS AND F UTURE W ORK
In this paper, we proposed Padam, which uniﬁes Adam/Amsgrad with SGD-momentum.
With an appropriate choice of the partially adaptive parameter, we show that Padam can achieve the best from both worlds, i.e., maintaining fast convergence rate while closing the generalization gap.
We also provide a theoretical analysis towards the convergence rate of Padam to a stationary point for stochastic nonconvex optimization.
While the empirical generalization performances achieved by Padam backup our hypothesis of “small learning rate dilemma”, it is still unclear how learning rate decay affects the performance of adaptive gradient methods in theory.
We leave it as an important future direction.
A P ROOF OF THE M AIN T HEORY
In this section, we provide a detailed version of proof of Theorem 4.3.
A. P ROOF OF T HEOREM 4.
Let x 0 = x 1 and
[Equation]
we have the following lemmas:
Lemma A.1.
Let z t be deﬁned in (A.1).
For t ≥ 2 , we have
[Equation]
A.2) and z
[Equation] [Equation]
For t = 1 , we have
[Equation]
Lemma A.2.
Let z t be deﬁned in (A.1).
For t ≥ 2 , we have
[Equation]
Lemma A.3.
Let z t be deﬁned in (A.1).
For t ≥ 2 , we have
[Equation]
Lemma A.4.
Let (cid:98) v t and m t be as deﬁned in Algorithm 1.
Then under Assumption 4.1, we have (cid:107)∇ f ( x ) (cid:107) ∞ ≤ G ∞ , (cid:107) (cid:98) v t (cid:107) ∞ ≤ G 2 ∞ and (cid:107) m t (cid:107) ∞ ≤ G ∞ .
Lemma A.5.
Suppose that f has G ∞ -bounded stochastic gradient.
Let β 1 , β 2 be the weight parameters, α t , t = 1 , . .
, T be the step sizes in Algorithm 1 and q ∈ [max { 4 p − 1 , 0 } , 1] .
We denote γ = β 1 /β 2 p 2 .
Suppose that α t = α and γ ≤ 1 , then under Assumption 4.1, we have the following two results:
[Equation]
and
T (cid:88)
[Equation]
Now we are ready to prove Theorem 4.3.
Proof of Theorem 4.3.
Since f is L -smooth, we have:
[Equation]
In the following, we bound I 1 , I
and I 3 separately.
Bounding term I 1 : When t = 1 , we have
[Equation]
For t ≥ 2 , we have
[Equation]
where the ﬁrst equality holds due to (A.3) in Lemma A.1.
For ∇ f
[Equation]
x
[Equation]
in (A.7), we have
[Equation]
The ﬁrst inequality holds because for a positive diagonal matrix A , we have x (cid:62)
Ay ≤ (cid:107) x (cid:107) ∞ · (cid:107) A (cid:107) 1 , 1 · (cid:107) y
(cid:107) ∞ .
The second inequality holds due to α t − 1 (cid:98) V − p t − 1 (cid:23) α t (cid:98) V − p t (cid:23) 0 .
Next we bound −∇ f ( x t )
[Equation]
α t (cid:98) V − p t g t .
We have
[Equation]
The ﬁrst inequality holds because for a positive diagonal matrix A , we have x (cid:62)
Ay ≤ (cid:107) x (cid:107) ∞ · (cid:107) A (cid:107) 1 , 1 · (cid:107) y
(cid:107) ∞ .
The second inequality holds due to α t − 1 (cid:98) V − p t − 1 (cid:23) α t (cid:98) V − p t
[Equation]
Substituting (A.8) and (A.9) into (A.7), we have ∇
[Equation]
(A.10)
Bounding term I 2 : For t ≥ 1 , we have
[Equation]
where the second inequality holds because of Lemma A.1 and Lemma A.2, the last inequality holds due to Young’s inequality.
Bounding term I 3 : For t ≥ 1 , we have
[Equation]
[Equation]
The ﬁrst inequality is obtained by introducing Lemma A.1.
For t = 1 , substituting (A.6), (A.11) and (A.12) into (A.5), taking expectation and rearranging terms, we have
[Equation]
where the last inequality holds because
[Equation]
For t ≥ 2 , substituting (A.10), (A.11) and (A.12) into (A.5), taking expectation and rearranging terms, we have
[Equation]
[Table]
[Equation]
14) where the equality holds because E [ g t ] = ∇ f ( x t ) conditioned on ∇ f ( x t ) and (cid:98) V − p t − 1 , the second inequality holds because of Lemma A.4.
Telescoping (A.14) for t = 2 to T and adding with (A.13), we have
[Equation]
[Equation]
By Lemma A.5, we have
T
[Equation] [Equation]
where γ = β 1 /β 2 p 2 .
We also have
T (cid:88)
[Equation]
Substituting (A.16) and (A.17) into (A.15), and rearranging (A.15), we have
[Equation]
) where the second inequality holds because α t = α .
Rearranging (A.18), we obtain
[Equation]
where { M i } 3 i =1 are deﬁned in Theorem 4.3.
This completes the proof.
A. P ROOF OF C OROLLARY 4.
Proof of Corollary 4.5.
From Theorem 4.3, let p ∈
[0 , 1 / 4] , we have q ∈ [0 , 1] .
Setting q = 0 , we have
[Equation]
where M 1 and M 2 are deﬁned in Theorem 4.3 and M (cid:48) 3 is deﬁned in Corollary 4.5.
This completes the proof.
B P ROOF OF T ECHNICAL L EMMAS B. P ROOF OF L EMMA A.
Proof.
By deﬁnition
[Equation]
we have
[Equation]
Then we have
[Equation]
The equities above are based on deﬁnition.
Then we have
[Equation]
The equalities above follow by combining the like terms
[Equation]
B. P ROOF OF L EMMA A.
Proof.
By Lemma A.1, we have
[Equation]
where the inequality holds because the term β 1 / (1 − β 1 ) is positive, and triangle inequality.
Considering that α t (cid:98) v − p t,j ≤ α t − 1 (cid:98) v − p t − 1 ,j , when p > 0 , we have (cid:13)(cid:13)(cid:13) I − ( α t
[Equation]
V − p t
[Equation] [Equation]
∞
[Equation]
∞ ≤ 1 .
With that fact, the term above can be bound as:
[Equation]
This completes the proof.
B. P ROOF OF L EMMA A.
Proof.
For term (cid:107)∇ f ( z t ) − ∇ f ( x t ) (cid:107) 2 , we have:
[Equation]
β
[Equation]
where the last inequality holds because the term β 1 / (1 − β 1 ) is positive.
B. P ROOF OF L EMMA A.
Proof of Lemma A.4.
Since f has G ∞ -bounded stochastic gradient, for any x and ξ , (cid:107)∇ f ( x ; ξ ) (cid:107) ∞ ≤ G ∞ .
Thus, we have
[Equation]
Next we bound (cid:107) m t (cid:107) ∞ .
We have (cid:107) m 0 (cid:107) = 0 ≤ G ∞ .
Suppose that (cid:107) m t (cid:107) ∞ ≤ G ∞ , then for m t +1 , we have
[Equation]
Thus, for any t ≥ 0 , we have (cid:107) m t (cid:107) ∞ ≤ G ∞ .
Finally we bound (cid:107) (cid:98) v t (cid:107) ∞ .
First we have (cid:107) v 0 (cid:107) ∞
=
(cid:107) (cid:98) v 0 (cid:107) ∞ = 0 ≤ G 2 ∞ .
Suppose that (cid:107) (cid:98) v t (cid:107) ∞ ≤ G 2 ∞ and (cid:107) v t (cid:107) ∞ ≤ G 2 ∞ .
Note that we have
[Equation]
and by deﬁnition, we have (cid:107) (cid:98) v t +1 (cid:107) ∞
=
max {(cid:107) (cid:98) v t (cid:107) ∞ , (cid:107) v t +1 (cid:107) ∞ } ≤ G 2 ∞ .
Thus, for any t ≥ 0 , we have (cid:107) (cid:98) v t (cid:107) ∞ ≤ G 2 ∞ .
B. P ROOF OF L EMMA A.
Proof.
Recall that (cid:98) v t,j , m t,j , g t,j denote the j -th coordinate of (cid:98) v t , m t and g t .
We have α 2 t E (cid:104) (cid:107) (cid:98) V − p t m t (cid:107) 22 (cid:105) =
α 2 t E (cid:20) d
[Equation]
i = m 2 t,i (cid:98) v 2 pt,i (cid:21) ≤ α 2 t
[Equation]
where the ﬁrst inequality holds because (cid:98) v t,i ≥ v t,i .
Next we have
[Equation]
where the ﬁrst inequality holds due to Cauchy inequality, the second inequality holds because | g j,i | ≤ G ∞ , the last inequality holds because (cid:80) tj =1 β t − j≤ (1 − β 1 ) − 1 .
Note that
[Equation]
g
[Equation]
|
[Equation]
−
[Equation]
(B.3) where the equality holds due to the deﬁnition of γ .
Substituting (B.2) and (B.3) into (B.1), we have
[Equation]
Telescoping (B.4) for t = 1 to T , we have
[Equation] [Equation]
Finally, we have
[Equation]
where the ﬁrst and second inequalities hold due to H¨older’s inequality.
Substituting (B.6) into (B.5)
[Equation]
we have
[Equation]
Speciﬁcally, taking β 1 = 0 , we have m t =
g t , then
[Equation]
,i (cid:107)(cid:19) 1 − q .
C E XPERIMENT D ETAILS C. D ATASETS
We use several popular datasets for image classiﬁcations.
• CIFAR-10 (Krizhevsky & Hinton, 2009): it consists of a training set of 50 , 000 32 ×color images from 10 classes, and also 10 , 000 test images.
• CIFAR-100 (Krizhevsky & Hinton, 2009): it is similar to CIFAR-10 but contains 100 image classes with 600 images for each.
• ImageNet dataset
(ILSVRC2012)
(Deng et al., 2009): ILSVRC2012 contains 1 .
28 million training images, and 50 k validation images over 1000 classes.
In addition, we adopt Penn Treebank (PTB) dataset (Marcus et al., 1993), which is widely used in
Natural Language Processing (NLP) research.
Note that word-level PTB dataset does not contain capital letters, numbers, and punctuation.
Models are evaluated based on the perplexity metric (lower is better).
C. A RCHITECTURES
VGGNet (Simonyan & Zisserman, 2014):
We use a modiﬁed VGG-16 architecture for this experiment.
The VGG-16 network uses only 3 × 3 convolutional layers stacked on top of each other for increasing depth and adopts max pooling to reduce volume size.
Finally, two fully-connected layers 7 are followed by a softmax classiﬁer.
ResNet (He et al., 2016): Residual Neural Network (ResNet) introduces a novel architecture with “skip connections” and features a heavy use of batch normalization.
Such skip connections are also known as gated units or gated recurrent units and have a strong similarity to recent successful elements applied in RNNs.
We use ResNet-18 for this experiment, which contains 2 blocks for each type of basic convolutional building blocks in He et al.
[Figure]
Wide ResNet (Zagoruyko & Komodakis, 2016):
Wide Residual Network further exploits the “skip connections” used in ResNet and in the meanwhile increases the width of residual networks.
In detail, we use the 16 layer Wide ResNet with 4 multipliers (WRN-16-4) in our experiments.
LSTM (Hochreiter & Schmidhuber, 1997): Long Short-Term Memory (LSTM) network is a special kind of Recurrent Neural Network (RNN), capable of learning long-term dependencies.
It was introduced by Hochreiter & Schmidhuber (1997), and was reﬁned and popularized in many followup work.
C. P ARAMETER S ETTINGS
We perform grid searches to choose the best hyper-parameters for all algorithms in both image classiﬁcation and language modeling tasks.
For the base learning rate, we do grid search over { 0 . 0001 , 0 .
1 , 1 , 10 , 100 } for all algorithms, and choose the partial adaptive parameter p from { 2 / 5 , 1 / 4 , 1 / 5 , 1 / 8 , 1 / 16 } and the second order moment parameter β 2 from { 0 . 9 , 0 . 99 , 0 . 999 } .
Speciﬁcally, in terms of image classiﬁcation experiments, for SGD with momentum, the base learning rate is set to be 0 .
1 with a momentum parameter of 0 .
For all adaptive gradient methods except Padam, we set the base learning rate as 0 .
For AdaBound, the ﬁnal learning rate is set to be 0 .
For Padam, the base learning rate is set to be 0 .
1 and the partially adaptive parameter p is set to be 1 / 8 due to its best empirical performance.
For Adam, Amsgrad, the momentum parameters are set to be β 1 = 0 .
9 , β 2 = 0 .
And for other adaptive gradient methods including Padam, we set β 1 = 0 .
9 , β 2 = 0 .
The weight decay factor is set to 5 × 10 −for all methods except AdamW which adopts a different weight decay scheme.
For AdamW, the normalized weight decay factor is set to 2 .
5 × 10 − 2 for CIFAR and 5 × 10 − 2 for ImageNet.
For
Yogi, (cid:15) is set as 10 − 3 as suggested in the original paper.
For AdaBound, the ﬁnal learning rate is set as 0 .
1 as suggested in Luo et al.
The minibatch sizes for CIFAR-10 and CIFARare set to be 128 and for ImageNet dataset we set it to be 256 .
Regarding the LSTM experiments, for SGD with momentum, the base learning rate is set to be 1 for 2-layer LSTM model and 10 for 3-layer LSTM.
The momentum parameter is set to be 0 .
9 for both models.
For all adaptive gradient methods except Padam and Yogi, we set the base learning rate as 0 .
For Yogi, we set the base learning rate as 0 .
01 for 2-layer LSTM model and 0 .
1 for 3-layer LSTM model.
For Padam, we set the base learning rate as 0 .
01 for 2-layer LSTM model and 1 for 3-layer LSTM model.
For all adaptive gradient methods, we set β 1 = 0 .
9 , β 2 = 0 .
In terms of algorithm speciﬁc parameters, for Padam, we set the partially adaptive parameter p as 0 .
4 for 2-layer LSTM model and 0 .
2 for 3-layer LSTM model.
For AdaBound, we set the ﬁnal learning rate as 10 for 2-layer LSTM model and 100 for 3-layer LSTM model.
For Yogi, (cid:15) is set as 10 − 3 as suggested in the original paper.
The weight decay factor is set to 1 .
2 × 10 − 6 for all methods except AdamW which adopts a different weight decay scheme.
For AdamW, the normalized weight decay factor is set to 4 × 10 − 4 .
The minibatch size is set to be 20 for all LSTM experiments.
D A DDITIONAL E XPERIMENTS
As a sanity check, we ﬁrst plot the max and min of (cid:98) v t across all the coordinates in Figure 5.
In detail, the maximum value of (cid:98) v t is around 0 .
04 in the end and the minimum value is around 3 × 10 − 8 , max { ( (cid:98) v t ) 1 / 8 i } − min { ( (cid:98) v t )
[Figure]
8 i } ≈ 0 .
We can see that the effective learning rates for different coordinates are quite different
[Figure]
[Figure] [Figure]
[Figure] [Figure]
Figure 6 plots the train loss and test error (top- 1 error) against training epochs on the CIFARdataset.
We can see that Padam achieves the best from both worlds by maintaining faster convergence rate while also generalizing as well as SGD with momentum in the end.
Tables 1 and 2 show the test accuracy of all algorithms on CIFAR-10 dataset and CIFAR-100 dataset respectively.
On CIFAR-10 dataset, methods such as Adam and Amsgrad have the lowest test accuracies.
Even though followup works such as AdamW, Yogi, AdaBound improve upon original
Adam, they still fall behind or barely match the performance of SGD with momentum.
In contrast,
Padam achieves the highest test accuracy in VGGNet and WideResNet for CIFAR-10, VGGNet and ResNet for CIFAR-100.
On the other two tasks (ResNet for CIFAR-10 and WideResNet for
CIFAR-100)
, Padam is also on a par with SGD with momentum at the ﬁnal epoch (differences less than 0 .
This suggests that practitioners should once again, use fast to converge partially adaptive gradient methods for training deep neural networks, without worrying about the generalization performances.
[Table]
Table 3 shows the ﬁnal test accuracy of all algorithms on ImageNet dataset.
Again, we can observe that Padam achieves the best test accuracy on VGGNet (both Top-1 and Top-5) and Top-1 accuracy on ResNet.
It stays very close to the best baseline of Top-1 accuracy on ResNet model.
Table 4 shows the ﬁnal test perplexity of all algorithms on the Penn Treebank dataset.
As we can observe from the table, Padam achieves the best (lowest) test perplexity on both 2-layer LSTM and 3-layer LSTM models.
[Table]
[Table] [Table]