arXiv(opens in a new tab)cs.LGAug 2016Cited by 60 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:1608.03983

SGDR: Stochastic Gradient Descent with Warm Restarts

Ilya Loshchilov, Frank Hutter

ABSTRACT

Restart techniques are common in gradient-free optimization to deal with multimodal functions. Partial warm restarts are also gaining popularity in gradient-based optimization to improve the rate of convergence in accelerated gradient schemes to deal with ill-conditioned functions. In this paper, we propose a simple warm restart technique for stochastic gradient descent to improve its anytime performance when training deep neural networks. We empirically study its performance on the CIFAR-10 and CIFAR-100 datasets, where we demonstrate new state-of-the-art results at 3.14% and 16.21%, respectively. We also demonstrate its advantages on a dataset of EEG recordings and on a downsampled version of the ImageNet dataset. Our source code is available at https://github.com/loshchil/SGDR

1 INTRODUCTION

Deep neural networks (DNNs) are currently the best-performing method for many classification problems, such as object recognition from images (Krizhevsky et al., 2012a; Donahue et al., 2014) or speech recognition from audio data (Deng et al., 2013). Their training on large datasets (where DNNs perform particularly well) is the main computational bottleneck: it often requires several days, even on high-performance GPUs, and any speedups would be of substantial value.

The training of a DNN with nn free parameters can be formulated as the problem of minimizing a function f:Rn→Rf: \mathbb{R}^n \to \mathbb{R}. The commonly used procedure to optimize ff is to iteratively adjust xt∈Rn\boldsymbol{x}_t \in \mathbb{R}^n (the parameter vector at time step tt) using gradient information ∇ft(xt)\nabla f_t(\boldsymbol{x}_t) obtained on a relatively small tt-th batch of bb datapoints. The Stochastic Gradient Descent (SGD) procedure then becomes an extension of the Gradient Descent (GD) to stochastic optimization of ff as follows:

xt+1=xt−ηt∇ft(xt),(1)\boldsymbol{x}_{t+1}=\boldsymbol{x}_{t}-\eta_{t}\nabla f_{t}(\boldsymbol{x}_{t}), \tag{1}

where ηt\eta_{t} is a learning rate. One would like to consider second-order information

xt+1=xt−ηtHt−1∇ft(xt),(2)\boldsymbol{x}_{t+1}=\boldsymbol{x}_{t}-\eta_{t}\boldsymbol{H}_{t}^{-1}\nabla f_{t}(\boldsymbol{x}_{t}), \tag{2}

but this is often infeasible since the computation and storage of the inverse Hessian Ht−1\pmb{H}_{t}^{-1} is intractable for large n. The usual way to deal with this problem by using limited-memory quasi-Newton methods such as L-BFGS (Liu & Nocedal, 1989) is not currently in favor in deep learning, not the least due to (i) the stochasticity of ∇ft(xt)\nabla f_{t}(\pmb{x}_{t}), (ii) ill-conditioning of f and (iii) the presence of saddle points as a result of the hierarchical geometric structure of the parameter space (Fukumizu & Amari, 2000). Despite some recent progress in understanding and addressing the latter problems (Bordes et al., 2009; Dauphin et al., 2014; Choromanska et al., 2014; Dauphin et al., 2015), state-of-the-art optimization techniques attempt to approximate the inverse Hessian in a reduced way, e.g., by considering only its diagonal to achieve adaptive learning rates. AdaDelta (Zeiler, 2012) and Adam (Kingma & Ba, 2014) are notable examples of such methods.

Figure

Figure 1: Alternative schedule schemes of learning rate ηt\eta_t over batch index tt: default schemes with η0=0.1\eta_0 = 0.1 (blue line) and η0=0.05\eta_0 = 0.05 (red line) as used by Zagoruyko & Komodakis (2016); warm restarts simulated every T0=50T_0 = 50 (green line), T0=100T_0 = 100 (black line) and T0=200T_0 = 200 (grey line) epochs with ηt\eta_t decaying during ii-th run from ηmaxi=0.05\eta_{max}^i = 0.05 to ηmini=0\eta_{min}^i = 0 according to eq. (5); warm restarts starting from epoch T0=1T_0 = 1 (dark green line) and T0=10T_0 = 10 (magenta line) with doubling ( Tmult=2T_{mult} = 2) periods TiT_i at every new warm restart.

Intriguingly enough, the current state-of-the-art results on CIFAR-10, CIFAR-100, SVHN, ImageNet, PASCAL VOC and MS COCO datasets were obtained by Residual Neural Networks (He et al., 2015; Huang et al., 2016c; He et al., 2016; Zagoruyko & Komodakis, 2016) trained without the use of advanced methods such as AdaDelta and Adam. Instead, they simply use SGD with momentum 1^{1}:

νt+1=μtνt−ηt∇ft(xt),(3)\begin{array}{r}{\pmb{\nu}_{t+1}=\mu_{t}\pmb{\nu}_{t}-\eta_{t}\nabla f_{t}(\pmb{x}_{t}),}\end{array} \tag{3} xt+1=xt+vt+1,(4)\boldsymbol{x}_{t+1}=\boldsymbol{x}_{t}+\boldsymbol{v}_{t+1}, \tag{4}

where vtv_t is a velocity vector initially set to θ\theta, ηt\eta_t is a decreasing learning rate and μt\mu_t is a momentum rate which defines the trade-off between the current and past observations of ∇ft(xt)\nabla f_t(\boldsymbol{x}_t). The main difficulty in training a DNN is then associated with the scheduling of the learning rate and the amount of L2 weight decay regularization employed. A common learning rate schedule is to use a constant learning rate and divide it by a fixed constant in (approximately) regular intervals. The blue line in Figure 1 shows an example of such a schedule, as used by Zagoruyko & Komodakis (2016) to obtain the state-of-the-art results on CIFAR-10, CIFAR-100 and SVHN datasets.

In this paper, we propose to periodically simulate warm restarts of SGD, where in each restart the learning rate is initialized to some value and is scheduled to decrease. Four different instantiations of this new learning rate schedule are visualized in Figure 1. Our empirical results suggest that SGD with warm restarts requires 2×2 \times to 4×4 \times fewer epochs than the currently-used learning rate schedule schemes to achieve comparable or even better results. Furthermore, combining the networks obtained right before restarts in an ensemble following the approach proposed by Huang et al. (2016a) improves our results further to 3.14% for CIFAR-10 and 16.21% for CIFAR-100. We also demonstrate its advantages on a dataset of EEG recordings and on a downsampled version of the ImageNet dataset.

1^{1}More specifically, they employ Nesterov’s momentum (Nesterov, 1983; 2013)

References (28)

Cited by (60)