



Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!




In many applications, either coming from Machine Learning or other optimiza- tion tasks, we are presented with the issue of solving a maximization/minimization problem in very high dimensional spaces. While methods like SGD and its reduced variance modifications have been de- veloped, it is argued that in sparse problems these methods are suboptimal, due to the lack of discrimination of the incoming data. Here we present two of the most used methods at the present time for stochastic optimization, AdaGrad [1] and ADAM [2]. Their main advantage is their adap- tive learning rate, that takes into account the geometry of the incoming data, which leads to an increase in performances over very sparse problems, where taking different stepsizes accordingly to the information brought by the data is essential. What the authors report in their original paper about AdaGrad is that ”informally, our procedures associate frequently occurring features with low learning rates and infrequent features with high learning rates”. This is desiderable to rapidly converge to optimal points, by accelerating over sparse directions, while staying accurate and not overshooting over frequently occur- ring ones.
Both the methods start from the same idea, being ADAM an incorporation of AdaGrad with another stochastic descent algorithm called RMSProp: they gather first order information during the iterations to make an approximate second order normalization of the learning rate, different for every coordinate.
Notation
Let’s first introduce some notation: we want to minimize the expected value of the sum of some loss functions ft, given at time t, by finding its minimum θ∗. Formally we define the regret for the sequence of selected points during the
iterations as
R(T ) =
t=
ft(θt) − f (θ∗)
This definition has been introduced as a framework for convergence analysis in [4] and is used in all the methods’ original papers. We also write the gradients of the function at every step as
∇θ ft(θt) := gt
Finally, we denote with g1:t the matrix having as columns the gradients from time 1 to t. With g1:t,i we indicate its i-th row, i.e. the row vector of the i-th entry of every gradient.
Description of the Methods
As outlined, the two algorithms perform a normalization using approximated second order informations. They do so in slightly different ways:
∑t τ =1 gτ^ g T τ and then updating the current point θt+1 = θt − α G − 1 / 2 t gt To lighten calculation in high dimensional problems the methods actually exploits only the diagonal matrix diag(Gt)−^1 /^2. Moreover, to assure in- vertibility, for the implementation we add a diagonal correction δ 1 (with δ > 0 and 1 identity matrix). This leads to the update:
θt+1 = θt − α (δ 1 + diag(Gt))−^1 /^2 gt
Since in the pseudocode we will only work with the diagonal, we call st the vector of the diagonal entries of diag(Gt).
mt := β 1 mt− 1 + (1 − β 1 )gt
vt := β 2 vt− 1 + (1 − β 2 )g t^2 where g^2 t is the elementwise square and β 1 , β 2 ∈ [0, 1) are two constants determining the speed of the exponential decay of moments away in time. Then the two moments are corrected to obtain unbiasdness and used to perform the update: mˆt = mt/(1 − βt 1 ) ˆvt = vt/(1 − βt 2 )
Here are the two pseudocodes for the methods:
Algorithm 1: AdaGrad. Computes the cumulative correlation matrix and normalizes the learning rate using the diagonal Input: α initial learning rate, δ > 0. Initialize x 1 = 0 1 Receive gt = ∇ft(θt), gradient of objective ft in current point θt 2 Update g1:t = [g1:t gt], st,i = ||g1:t,i|| 2 3 Call Ht = δ 1 + diag(st) (diag(st) is the matrix with diagonal equal to st and other entries 0) 4 Update current point
θt+1 = θt − α H t− 1 /^2 gt
Note that every coordinate i has its own collection of previous gradient val- ues, and has normalization equal to the norm ||g1:t,i|| 2. This leads to a personal- ized learning rate for every coordinate, and resembles the intuitive meaning we gave in the introduction of ”capturing” the frequency and information carried for every coordinate. ADAM behaves similarly, assigning to every single coordinate two dedicated moment estimates:
Algorithm 2: ADAM. Computes exponentially decaying moments es- timaes, the correct their bias and performs the update. Authors suggest the following defualt values for the parameters: α = 0.001, β 1 = 0.9, β 2 = 0.999, = 10−^8. All operations on vectors are elementwise. Input: α initial learning rate, β 1 , β 2 , and θ 0 starting point. Initialize m 0 = v 0 = t = 0 1 Receive gt = ∇ft(θt), gradient of objective ft in current point θt 2 Update moment estimates: mt = β 1 mt− 1 + (1 − β 1 )gt vt = β 2 vt− 1 + (1 − β 2 )g^2 t m ˆt = mt/(1 − β 1 t) ˆvt = vt/(1 − β 2 t) 3 Update current point
θt+1 = θt − α mˆt/(
ˆvt + )
Even though a result about the convergence of ADAM has been reported [2] in the original paper, some issues in the proof have been found. Despite the effort put into adjusting it, a recent publication [5] theoretically proved that the method fails in converging even with univariate convex problems. In the mentioned paper the authors argue that the non convergence comes from the form of exponential decrease presented in ADAM, and present experimen- tal setting to back up their statement. They then proceed proposing a new method, called AMSGrad, that preserves the exponential decrease and prac- tical benefits of ADAM and RMSProp, while asuring convergence. The from of the moments update is much similar to ADAM, but assures a slower exponential decrease by normalization (see [5] for more details)
Algorithm 3: AMSGrad. Modification of ADAM and RMSProp, that showed empirical improvements and has theoretically justified conver- gence Input: {αt}Tt=1, {β 1 t}Tt=1, β 2. Initialize x 0 , m 0 = v 0 = ˆv 0 = 0 1 Receive gt = ∇ft(θt), gradient of objective ft in current point θt 2 Update moment estimates: mt = β 1 mt− 1 + (1 − β 1 )gt vt = β 2 vt− 1 + (1 − β 2 )g^2 t ˆvt = max ˆvt− 1 , vt 3 Update current point
θt+1 = θt − αt mˆt/
ˆvt
In the experiments section we present a classic logisitic regression setting with:
l(y) :=
m
∑^ m
i=
yi log(ti) + (1 − yi) log(1 − ti)
ti = σ((w · xi))
where w is the vector of weights to be stochastically optimized, and xi the i-th sample vector
References
[1] Duchi J, Hazan E, Singer Y Adaptive Subgradient Methods for Online Learning and Stochastic Optimization, Journal of Machine Learning Re- search 12/2011, 2121-
[2] Kingma D.P, Lei Ba J ADAM: a Method for Stochastic Optimization, Con- ference Paper at ICLR 2015
[3] Ruder S, An Overview of Gradient Descent Optimization Algorithms
[4] Zinkevich M, Online convex programming and generalized infinitesimal gra- dient ascent, 2003
[5] Sashank J.R, Satyen K, Sanjiv K, On the Convergence of ADAM and Be- yond, Conference Paper at ICLR 2018