Title: SNAPSHOT ENSEMBLES: TRAIN 1, GET M FOR FREE

Abstract: Ensembles of neural networks are known to be much more robust and accurate than individual networks. However, training multiple deep networks for model averaging is computationally expensive. In this paper, we propose a method to obtain the seemingly contradictory goal of ensembling multiple neural networks at no additional training cost. We achieve this goal by training a single neural network, converging to several local minima along its optimization path and saving the model parameters. To obtain repeated rapid convergence, we leverage recent work on cyclic learning rate schedules. The resulting technique, which we refer to as Snapshot Ensembling, is simple, yet surprisingly effective. We show in a series of experiments that our approach is compatible with diverse network architectures and learning tasks. It consistently yields lower error rates than state-of-the-art single models at no additional training cost, and compares favorably with traditional network ensembles. On CIFAR-10 and CIFAR-100 our DenseNet Snapshot Ensembles obtain error rates of 3.4% and 17.4% respectively.

1. INTRODUCTION:

Stochastic Gradient Descent (SGD) (Bottou, 2010) and its accelerated variants (Kingma & Ba, 2014; Duchi et al., 2011) have become the de-facto approaches for optimizing deep neural networks. The popularity of SGD can be attributed to its ability to avoid and even escape spurious saddle-points and local minima (Dauphin et al., 2014) . Although avoiding these spurious solutions is generally considered positive, in this paper we argue that these local minima contain useful information that may in fact improve model performance.

Although deep networks typically never converge to a global minimum, there is a notion of "good" and "bad" local minima with respect to generalization. Keskar et al. (2016) argue that local minima with flat basins tend to generalize better. SGD tends to avoid sharper local minima because gradients are computed from small mini-batches and are therefore inexact (Keskar et al., 2016) . If the learningrate is sufficiently large, the intrinsic random motion across gradient steps prevents the optimizer from reaching any of the sharp basins along its optimization path. However, if the learning rate is small, the model tends to converge into the closest local minimum. These two very different behaviors of SGD are typically exploited in different phases of optimization (He et al., 2016a) . Initially the learning rate is kept high to move into the general vicinity of a flat local minimum. Once this search has reached a stage in which no further progress is made, the learning rate is dropped (once or twice), triggering a descent, and ultimately convergence, to the final local minimum.

It is well established (Kawaguchi, 2016) that the number of possible local minima grows exponentially with the number of parameters-of which modern neural networks can have millions. It is therefore not surprising that two identical architectures optimized with different initializations or minibatch orderings will converge to different solutions. Although different local minima often have very similar error rates, the corresponding neural networks tend to make different mistakes. This diversity can be exploited through ensembling, in which multiple neural networks are trained from different initializations and then combined with majority voting or averaging (Caruana et al., 2004) . Ensembling often leads to drastic reductions in error rates. In fact, most high profile competitions, e.g. Imagenet (Deng et al., 2009) or Kaggle1 , are won by ensembles of deep learning architectures.

Despite its obvious advantages, the use of ensembling for deep networks is not nearly as widespread as it is for other algorithms. One likely reason for this lack of adaptation may be the cost of learning multiple neural networks. Training deep networks can last for weeks, even on high performance hardware with GPU acceleration. As the training cost for ensembles increases linearly, ensembles can quickly becomes uneconomical for most researchers without access to industrial scale computational resources.

In this paper we focus on the seemingly-contradictory goal of learning an ensemble of multiple neural networks without incurring any additional training costs. We achieve this goal with a training method that is simple and straight-forward to implement. Our approach leverages the non-convex nature of neural networks and the ability of SGD to converge to and escape from local minima on demand. Instead of training M neural networks independently from scratch, we let SGD converge M times to local minima along its optimization path. Each time the model converges, we save the weights and add the corresponding network to our ensemble. We then restart the optimization with a large learning rate to escape the current local minimum. More specifically, we adopt the cycling procedure suggested by Loshchilov & Hutter (2016) , in which the learning rate is abruptly raised and then quickly lowered to follow a cosine function. Because our final ensemble consists of snapshots of the optimization path, we refer to our approach as Snapshot Ensembling. Figure 1 presents a high-level overview of this method.

In contrast to traditional ensembles, the training time for the entire ensemble is identical to the time required to train a single traditional model. During testing time, one can evaluate and average the last (and therefore most accurate) m out of M models. Our approach is naturally compatible with other methods to improve the accuracy, such as data augmentation, stochastic depth (Huang et al., 2016b) , or batch normalization (Ioffe & Szegedy, 2015) . In fact, Snapshot Ensembles can even be ensembled, if for example parallel resources are available during training. In this case, an ensemble of K Snapshot Ensembles yields K × M models at K times the training cost.

We evaluate the efficacy of Snapshot Ensembles on three state-of-the-art deep learning architectures for object recognition: ResNet (He et al., 2016b) , Wide-ResNet (Zagoruyko & Komodakis, 2016) , and DenseNet (Huang et al., 2016a) . We show across four different data sets that Snapshot Ensembles almost always reduce error without increasing training costs. For example, on CIFAR-10 and CIFAR-100, Snapshot Ensembles obtains error rates of 3.44% and 17.41% respectively.

2. RELATED WORK:

Neural network ensembles have been widely studied and applied in machine learning (Hansen & Salamon, 1990; Krogh et al., 1995) . However, most of these prior studies focus on improving the generalization performance, while few of them address the cost of training ensembles.

As an alternative to traditional ensembles, so-called "implicit" ensembles have high efficiency during both training and testing (Srivastava et al., 2014; Wan et al., 2013; Huang et al., 2016b; Singh et al., 2016; Krueger et al., 2016) . The Dropout (Srivastava et al., 2014) technique creates an ensemble out of a single model by "dropping" -or zeroing -random sets of hidden nodes during each mini-batch. At test time, no nodes are dropped, and each node is scaled by the probability of surviving during training. Srivastava et al. claim that Dropout reduces overfitting by preventing the co-adaptation of nodes. An alternative explanation is that this mechanism creates an exponential number of networks with shared weights during training, which are then implicitly ensembled at test time. DropConnect (Wan et al., 2013) (Huang et al., 2016b) randomly drops layers during training to create an implicit ensemble of networks with varying depth at test time. Finally, Swapout (Singh et al., 2016) is a stochastic training method that generalizes Dropout and Stochastic Depth. From the perspective of model ensembling, Swapout creates diversified network structures for model averaging. Our proposed method similarly trains only a single model; however, the resulting ensemble is "explicit" in that the models do not share weights. Furthermore, our method can be used in conjunction with any of these implicit ensembling techniques.

Several recent publications focus on reducing the test time cost of ensembles, by transferring the "knowledge" of cumbersome ensembles into a single model (Bucilu et al., 2006; Hinton et al., 2015) . Hinton et al. (2015) propose to use an ensemble of multiple networks as the target of a single (smaller) network. Our proposed method is complementary to these works as we aim to reduce the training cost of ensembles rather than the test-time cost.

Perhaps most similar to our work is that of Swann & Allinson (1998) and Xie et al. (2013) , who explore creating ensembles from slices of the learning trajectory. Xie et al. introduce the horizontal and vertical ensembling method, which combines the output of networks within a range of training epochs. More recently, Jean et al. (2014) and Sennrich et al. (2016) show improvement by ensembling the intermediate stages of model training. Laine & Aila (2016) propose a temporal ensembling method for semi-supervised learning, which achieves consensus among models trained with different regularization and augmentation conditions for better generalization performance. Finally, Moghimi et al. (2016) show that boosting can be applied to convolutional neural networks to create strong ensembles. Our work differs from these prior works in that we force the model to visit multiple local minima, and we take snapshots only when the model reaches a minimum. We believe this key insight allows us to leverage more power from our ensembles.

Our work is inspired by the recent findings of Loshchilov & Hutter (2016) and Smith (2016) , who show that cyclic learning rates can be effective for training convolutional neural networks. The authors show that each cycle produces models which are (almost) competitive to those learned with traditional learning rate schedules while requiring a fraction of training iterations. Although model performance temporarily suffers when the learning rate cycle is restarted, the performance eventually surpasses the previous cycle after annealing the learning rate. The authors suggest that cycling perturbs the parameters of a converged model, which allows the model to find a better local minimum. We build upon these recent findings by (1) showing that there is significant diversity in the local minima visited during each cycle and (2) exploiting this diversity using ensembles. We are not concerned with speeding up or improving the training of a single model; rather, our goal is to extract an ensemble of classifiers while following the optimization path of the final model.

3. SNAPSHOT ENSEMBLING:

Snapshot Ensembling produces an ensemble of accurate and diverse models from a single training process. At the heart of Snapshot Ensembling is an optimization process which visits several local minima before converging to a final solution. We take model snapshots at these various minima, and average their predictions at test time.

Ensembles work best if the individual models (1) have low test error and (2) do not overlap in the set of examples they misclassify. Along most of the optimization path, the weight assignments of a neural network tend not to correspond to low test error. In fact, it is commonly observed that the validation error drops significantly only after the learning rate has been reduced, which is typically done after several hundred epochs. Our approach is inspired by the observation that training neural networks for fewer epochs and dropping the learning rate earlier has minor impact on the final test error (Loshchilov & Hutter, 2016) . This seems to suggest that local minima along the optimization path become promising (in terms of generalization error) after only a few epochs. Cyclic Cosine Annealing. To converge to multiple local minima, we follow a cyclic annealing schedule as proposed by Loshchilov & Hutter (2016) . We lower the learning rate at a very fast pace, encouraging the model to converge towards its first local minimum after as few as 50 epochs. The optimization is then continued at a larger learning rate, which perturbs the model and dislodges it from the minimum. We repeat this process several times to obtain multiple convergences. Formally, the learning rate α has the form:

EQUATION

)

where t is the iteration number, T is the total number of training iterations, and f is a monotonically decreasing function. In other words, we split the training process into M cycles, each of which starts with a large learning rate, which is annealed to a smaller learning rate. The large learning rate α = f (0) provides the model enough energy to escape from a critical point, while the small learning rate α = f ( T /M ) drives the model to a well behaved local minimum. In our experiments, we set f to be the shifted cosine function proposed by Loshchilov & Hutter (2016) :

EQUATION

where α 0 is the initial learning rate. Intuitively, this function anneals the learning rate from its initial value α 0 to f ( T /M ) ≈ 0 over the course of a cycle. Following (Loshchilov & Hutter, 2016) , we update the learning rate at each iteration rather than at every epoch. This improves the convergence of short cycles, even when a large initial learning rate is used. Snapshot Ensembling. Figure 2 depicts the training process using cyclic and traditional learning rate schedules. At the end of each training cycle, it is apparent that the model reaches a local minimum with respect to the training loss. Thus, before raising the learning rate, we take a "snapshot" of the model weights (indicated as vertical dashed black lines). After training M cycles, we have M model snapshots, f 1 . . . f M , each of which will be used in the final ensemble. It is important to highlight that the total training time of the M snapshots is the same as training a model with a standard schedule (indicated in blue). In some cases, the standard learning rate schedule achieves lower training loss than the cyclic schedule; however, as we will show in the next section, the benefits of ensembling outweigh this difference.

Ensembling at Test Time. The ensemble prediction at test time is the average of the last m (m ≤ M ) model's softmax outputs. Let x be a test sample and let h i (x) be the softmax score of snapshot i. The output of the ensemble is a simple average of the last m models:

h Ensemble = 1 m m-1 0 h M -i (x)

. We always ensemble the last m models, as these models tend to have the lowest test error. 

4. EXPERIMENTS:

We demonstrate the effectiveness of Snapshot Ensembles on several benchmark datasets, comparing with competitive baselines. We run all experiments with Torch 7 (Collobert et al., 2011) 2 .

4.1. DATASETS:

CIFAR. The two CIFAR datasets (Krizhevsky & Hinton, 2009) consist of colored natural images sized at 32×32 pixels. CIFAR-10 (C10) and CIFAR-100 (C100) images are drawn from 10 and 100 classes, respectively. For each dataset, there are 50,000 training images and 10,000 images reserved for testing. We use a standard data augmentation scheme (Lin et al., 2013; Romero et al., 2014; Lee et al., 2015; Springenberg et al., 2014; Srivastava et al., 2015; Huang et al., 2016b; Larsson et al., 2016) , in which the images are zero-padded with 4 pixels on each side, randomly cropped to produce 32×32 images, and horizontally mirrored with probability 0.5. SVHN. The Street View House Numbers (SVHN) dataset (Netzer et al., 2011) contains 32 × 32 colored digit images from Google Street View, with one class for each digit. There are 73,257 images in the training set and 26,032 images in the test set. Following common practice (Sermanet et al., 2012; Goodfellow et al., 2013; Huang et al., 2016a) , we withhold 6,000 training images for validation, and train on the remaining images without data augmentation. Tiny ImageNet. The Tiny ImageNet dataset3 consists of a subset of ImageNet images (Deng et al., 2009) . There are 200 classes, each of which has 500 training images and 50 validation images. Each image is resized to 64 × 64 and augmented with random crops, horizontal mirroring, and RGB intensity scaling (Krizhevsky et al., 2012) .

ImageNet. The ILSVRC 2012 classification dataset (Deng et al., 2009) consists of 1000 images classes, with a total of 1.2 million training images and 50,000 validation images. We adopt the same data augmentation scheme as in (He et al., 2016a; Huang et al., 2016a) and apply a 224 × 224 center crop to images at test time.

4.2. TRAINING SETTING:



Architectures.:

We test several state-of-the-art architectures, including residual networks (ResNet) (He et al., 2016a) , Wide ResNet (Zagoruyko & Komodakis, 2016) and DenseNet (Huang et al., 2016a) . For ResNet, we use the original 110-layer network introduced by He et al. (2016a) . Wide-ResNet is a 32-layer ResNet with 4 times as many convolutional features per layer as a standard ResNet. For DenseNet, our large model follows the same setup as (Huang et al., 2016a) , with depth L = 100 and growth rate k = 24. In addition, we also evaluate our method on a small DenseNet, with depth L = 40 and k = 12. To adapt all these networks to Tiny ImageNet, we add a stride of 2 to the first layer of the models, which downsamples the images to 32 × 32. For ImageNet, we test the 50-layer ResNet proposed in (He et al., 2016a) . We use a mini batch size of 64. 4Baselines. Snapshot Ensembles incur the training cost of a single model; therefore, we compare with baselines that require the same amount of training. First, we compare against a Single Model trained with a standard learning rate schedule, dropping the learning rate from 0.1 to 0.01 halfway through training, and then to 0.001 when training is at 75%. Additionally, to compare against implicit ensembling methods, we test against a single model trained with Dropout. This baseline uses the same learning rate as above, and drops nodes during training with a probability of 0.2.

We then test the Snapshot Ensemble algorithm trained with the cyclic cosine learning rate as described in (2). We test models with the max learning rate α 0 set to 0.1 and 0.2. In both cases, we divide the training process into learning rate cycles. Model snapshots are taken after each learning rate cycle. Additionally, we train a Snapshot Ensemble with a non-cyclic learning rate schedule. This NoCycle Snapshot Ensemble, which uses the same schedule as the Single Model and Dropout baselines, is meant to highlight the impact of cyclic learning rates for our method. To accurately compare with the cyclic Snapshot Ensembles, we take the same number of snapshots equally spaced throughout the training process. Finally, we compare against SingleCycle Ensembles, a Snapshot Ensemble variant in which the network is re-initialized at the beginning of every cosine learning rate cycle, rather than using the parameters from the previous optimization cycle. This baseline essentially creates a traditional ensemble, yet each network only has 1/M of the typical training time. This variant is meant to highlight the tradeoff between model diversity and model convergence. Though SingleCycle Ensembles should in theory explore more of the parameter space, the models do not benefit from the optimization of previous cycles. 

4.3. SNAPSHOT ENSEMBLE RESULTS:



Method:

Val. Error (%) (Huang et al., 2016a) . Our method has the most success on CIFAR-100 and Tiny ImageNet, which is likely due to the complexity of these datasets. The softmax outputs for these datasets are high dimensional due to the large number of classes, making it unlikely that any two models make the same predictions. Snapshot Ensembling is also capable of improving the competitive baselines for CIFAR-10 and SVHN as well, reducing error by 1% and 0.4% respectively with the Wide ResNet architecture.

The NoCycle Snapshot Ensemble generally has little effect on performance, and in some instances even increases the test error. This highlights the need for a cyclic learning rate for useful ensembling.

The SingleCycle Ensemble has similarly mixed performance. In some cases, e.g., DenseNet-40 on CIFAR-100, the SingleCycle Ensemble is competitive with Snapshot Ensembles. However, as the model size increases to 100 layers, it does not perform as well. This is because it is difficult to train a large model from scratch in only a few epochs. These results demonstrate that Snapshot Ensembles tend to work best when utilizing information from previous cycles. Effectively, Snapshot Ensembles strike a balance between model diversity and optimization. Ensemble Size. In some applications, it may be beneficial to vary the size of the ensemble dynamically at test time depending on available resources. Figure 3 displays the performance of DenseNet-40 on the CIFAR-100 dataset as the effective ensemble size, m, is varied. Each ensemble consists of snapshots from later cycles, as these snapshots have received the most training and therefore have likely converged to better minima. Although ensembling more models generally gives better performance, we observe significant drops in error when the second and third models are added to the ensemble. In most cases, an ensemble of two models outperforms the baseline model.

Restart Learning Rate. The effect of the restart learning rate can be observed in Figure 3 . The left two plots show performance when using a restart learning rate of α 0 = 0.1 at the beginning of each cycle, and the right two plots show α 0 = 0.2. In most cases, ensembles with the larger restart learning rate perform better, presumably because the strong perturbation in between cycles increases the diversity of local minima.

Varying Number of Cycles. Given a fixed training budget, there is a trade-off between the number of learning rate cycles and their length. Therefore, we investigate how the number of cycles M affects the ensemble performance, given a fixed training budget. We train a 40-layer DenseNet on the CIFAR-100 dataset with an initial learning rate of α 0 = 0.2. We fix the total training budget B = 300 epochs, and vary the value of M ∈ {2, 4, 6, 8, 10}. As shown in Table 3 , our method is relatively robust with respect to different values of M . At the extremes, M = 2 and M = 10, we find a slight degradation in performance, as the cycles are either too few or too short. In practice, we find that setting M to be 4 ∼ 8 works reasonably well.

Varying Training Budget. The left and middle panels of Figure 4 show the performance of Snapshot Ensembles and SingleCycle Ensembles as a function of training budget (where the number of cycles is fixed at M = 6). We train a 40-layer DenseNet on CIFAR-10 and CIFAR-100, with an initial learning rate of α 0 = 0.1, varying the total number of training epochs from 60 to 300. We observe that both Snapshot Ensembles and SingleCycle Ensembles become more accurate as training budget increases. However, we note that as training budget decreases, Snapshot Ensembles still yield competitive results, while the performance of the SingleCycle Ensembles degrades rapidly. These results highlight the improvements that Snapshot Ensembles obtain when the budget is low. If the budget is high, then the SingleCycle baseline approaches true ensembles and outperforms Snapshot ensembles eventually.

Comparison with True Ensembles. We compare Snapshot Ensembles with the traditional ensembling method. The right panel of Figure 4 shows the test error rates of DenseNet-40 on CIFAR-100. The true ensemble method averages models that are trained with 300 full epochs, each with different weight initializations. Given the same number of models at test time, the error rate of the true ensemble can be seen as a lower bound of our method. Our method achieves performance that is comparable with ensembling of 2 independent models, but with the training cost of one model.

4.4. DIVERSITY OF MODEL ENSEMBLES:

Parameter Space. We hypothesize that the cyclic learning rate schedule creates snapshots which are not only accurate but also diverse with respect to model predictions. We qualitatively measure this diversity by visualizing the local minima that models converge to. To do so, we linearly interpolate snapshot models, as described by Goodfellow et al. (2014) . Let J (θ) be the test error of a model using parameters θ. Given θ 1 and θ 2 -the parameters from models 1 and 2 respectively -we can compute the loss for a convex combination of model parameters: J (λ (θ 1 ) + (1 -λ) (θ 2 )), where λ is a mixing coefficient. Setting λ to 1 results in a parameters that are entirely θ 1 while setting λ to 0 gives the parameters θ 2 . By sweeping the values of λ, we can examine a linear slice of the parameter space. Two models that converge to a similar minimum will have smooth parameter interpolations, whereas models that converge to different minima will likely have a non-convex interpolation, with a spike in error when λ is between 0 and 1. non-cyclic learning rate schedules. Firstly, all of the cyclic snapshots achieve roughly the same error as the final cyclical model, as the error is similar for λ = 0 and λ = 1. Additionally, it appears that most snapshots do not lie in the same minimum as the final model. Thus the snapshots are likely to misclassify different samples. Conversely, the first three snapshots achieve much higher error than the final model. This can be observed by the sharp minima around λ = 1, which suggests that mixing in any amount of the snapshot parameters will worsen performance. While the final two snapshots achieve low error, the figures suggests that they lie in the same minimum as the final model, and therefore likely add limited diversity to the ensemble. Activation space. To further explore the diversity of models, we compute the pairwise correlation of softmax outputs for every pair of snapshots. Figure 6 displays the average correlation for both cyclic snapshots and non-cyclical snapshots. Firstly, there are large correlations between the last 3 snapshots of the non-cyclic training schedule (right). These snapshots are taken after dropping the learning rate, suggesting that each snapshot has converged to the same minimum. Though there is more diversity amongst the earlier snapshots, these snapshots have much higher error rates and are therefore not ideal for ensembling. Conversely, there is less correlation between all cyclic snapshots (left). Because all snapshots have similar accuracy (as can be seen in Figure 5 ), these differences in predictions can be exploited to create effective ensembles.

5. DISCUSSION:

We introduce Snapshot Ensembling, a simple method to obtain ensembles of neural networks without any additional training cost. Our method exploits the ability of SGD to converge to and escape from local minima as the learning rate is lowered, which allows the model to visit several weight assignments that lead to increasingly accurate predictions over the course of training. We harness this power with the cyclical learning rate schedule proposed by Loshchilov & Hutter (2016) , saving model snapshots at each point of convergence. We show in several experiments that all snapshots are accurate, yet produce different predictions from one another, and therefore are well suited for test-time ensembles. Ensembles of these snapshots significantly improve the state-of-the-art on CIFAR-10, CIFAR-100 and SVHN. Future work will explore combining Snapshot Ensembles with traditional ensembles. In particular, we will investigate how to balance growing an ensemble with new models (with random initializations) and refining existing models with further training cycles under a fixed training budget.

:

www.kaggle.com

Code to reproduce results is available at https://github.com/gaohuang/SnapshotEnsemble

https://tiny-imagenet.herokuapp.com

Exceptions: ResNet-110 and Wide-ResNet are trained with batch size 128 on Tiny ImageNet. The Ima-geNet model is trained with batch size 256.

Figures and Tables:

Figure 1: Left: Illustration of SGD optimization with a typical learning rate schedule. The model converges to a minimum at the end of training. Right: Illustration of Snapshot Ensembling. The model undergoes several learning rate annealing cycles, converging to and escaping from multiple local minima. We take a snapshot at each minimum for test-time ensembling.

Figure 2: Training loss of 100-layer DenseNet on CI-FAR10 using standard learning rate (blue) and M = 6 cosine annealing cycles (red). The intermediate models, denoted by the dotted lines, form an ensemble at the end of training.

Figure 3: DenseNet-100 Snapshot Ensemble performance on CIFAR-10 and CIFAR-100 with restart learning rate α0 = 0.1 (left two) and α0 = 0.2 (right two). Each ensemble is trained with M = 6 annealing cycles (50 epochs per each).

Training Budget. On CIFAR datasets, the training budget is B = 300 epochs for DenseNet-40 and DenseNet-100, and B = 200 for ResNet and Wide ResNet models. Snapshot variants are trained with M = 6 cycles of B/M = 50 epochs for DenseNets, and M = 5 cycles of B/M = 40 epochs for ResNets/Wide ResNets. SVHN models are trained with a budget of B = 40 epochs (5 cycles of 8 epochs). For Tiny ImageNet, we use a training budget of B = 150 (6 cycles of 25 epochs). Finally, ImageNet is trained with a budget of B = 90 epochs, and we trained 2 Snapshot variants: one with M = 2 cycles and one with M = 3.

Figure 4: Snapshot Ensembles under different training budgets on (Left) CIFAR-10 and (Middle) CIFAR-100. Right: Comparison of Snapshot Ensembles with true ensembles.

Figure 5: Interpolations in parameter space between the final model (sixth snapshot) and all intermediate snapshots. λ = 0 represents an intermediate snapshot model, while λ = 1 represents the final model. Left: A Snapshot Ensemble, with cosine annealing cycles (α0 = 0.2 every B/M = 50 epochs). Right: A NoCycle Snapshot Ensemble, (two learning rate drops, snapshots every 50 epochs).

Figure 5 displays interpolations between the final model of DenseNet-40 (sixth snapshot) and all intermediate snapshots. The left two plots show Snapshot Ensemble models trained with a cyclic learning rate, while the right two plots show NoCycle Snapshot models. λ = 0 represents a model which is entirely snapshot parameters, while λ = 1 represents a model which is entirely the parameters of the final model. From this figure, it is clear that there are differences between cyclic and

Figure 6: Pairwise correlation of softmax outputs between any two snapshots for DenseNet-100. Left: A Snapshot Ensemble, with cosine annealing cycles (restart with α0 = 0.2 every 50 epochs). Right: A NoCycle Snapshot Ensemble, (two learning rate drops, snapshots every 50 epochs).

uses a similar trick to create ensembles at test time by dropping connections (weights) during training instead of nodes. The recently proposed Stochastic Depth technique

Table content: <table/>

Error rates (%) on CIFAR-10 and CIFAR-100 datasets. All methods in the same group are trained for the same number of iterations. Results of our method are colored in blue, and the best result for each network/dataset pair are bolded.

Table content: <table><tr><td/><td>Method</td><td>C10</td><td>C100</td><td colspan="2">SVHN Tiny ImageNet</td></tr><tr><td/><td>Single model</td><td>5.52</td><td>28.02</td><td>1.96</td><td>46.50</td></tr><tr><td/><td>NoCycle Snapshot Ensemble</td><td>5.49</td><td>26.97</td><td>1.78</td><td>43.69</td></tr><tr><td>ResNet-110</td><td>SingleCycle Ensembles</td><td>6.66</td><td>24.54</td><td>1.74</td><td>42.60</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.1)</td><td>5.73</td><td>25.55</td><td>1.63</td><td>40.54</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.2)</td><td>5.32</td><td>24.19</td><td>1.66</td><td>39.40</td></tr><tr><td/><td>Single model</td><td>5.43</td><td>23.55</td><td>1.90</td><td>39.63</td></tr><tr><td/><td>Dropout</td><td>4.68</td><td>22.82</td><td>1.81</td><td>36.58</td></tr><tr><td>Wide-ResNet-32</td><td>NoCycle Snapshot Ensemble SingleCycle Ensembles</td><td>5.18 5.95</td><td>22.81 21.38</td><td>1.81 1.65</td><td>38.64 35.53</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.1)</td><td>4.41</td><td>21.26</td><td>1.64</td><td>35.45</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.2)</td><td>4.73</td><td>21.56</td><td>1.51</td><td>32.90</td></tr><tr><td/><td>Single model</td><td colspan="2">5.24  *  24.42  *</td><td>1.77</td><td>39.09</td></tr><tr><td/><td>Dropout</td><td>6.08</td><td>25.79</td><td>1.79  *</td><td>39.68</td></tr><tr><td>DenseNet-40</td><td>NoCycle Snapshot Ensemble SingleCycle Ensembles</td><td>5.20 5.43</td><td>24.63 22.51</td><td>1.80 1.87</td><td>38.51 38.00</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.1)</td><td>4.99</td><td>23.34</td><td>1.64</td><td>37.25</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.2)</td><td>4.84</td><td>21.93</td><td>1.73</td><td>36.61</td></tr><tr><td/><td>Single model</td><td colspan="2">3.74  *  19.25  *</td><td>-</td><td>-</td></tr><tr><td/><td>Dropout</td><td>3.65</td><td>18.77</td><td>-</td><td>-</td></tr><tr><td>DenseNet-100</td><td>NoCycle Snapshot Ensemble SingleCycle Ensembles</td><td>3.80 4.52</td><td>19.30 18.38</td><td>-</td><td>-</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.1)</td><td>3.57</td><td>18.12</td><td>-</td><td>-</td></tr><tr><td/><td>Snapshot Ensemble (α0 = 0.2)</td><td>3.44</td><td>17.41</td><td>-</td><td>-</td></tr></table>

Snapshot Ensemble results on ImageNet. The Snapshot Ensemble with M = 2 achieves 23.33% validation error, outperforming the single model baseline with 24.01% validation error. It appears that 2 cycles is the optimal choice for the ImageNet dataset. Provided with the limited total training budget B = 90 epochs, we hypothesize that allocating fewer than B/2 = 45 epochs per training cycle is insufficient for the model to converge on such a large dataset.

Table content: <table><tr><td colspan="2">M Test Error (%)</td></tr><tr><td>2</td><td>22.92</td></tr><tr><td>4</td><td>22.07</td></tr><tr><td>6</td><td>21.93</td></tr><tr><td>8</td><td>21.89</td></tr><tr><td>10</td><td>22.16</td></tr><tr><td colspan="2">Table 3: Error rates of</td></tr><tr><td colspan="2">a DenseNet-40 Snapshot</td></tr><tr><td colspan="2">Ensemble on CIFAR-100,</td></tr><tr><td colspan="2">varying M -the number of</td></tr><tr><td colspan="2">models (cycles) used in the</td></tr><tr><td>ensemble.</td><td/></tr></table>

Peer review (iclr2017):
The work presented in this paper proposes a method to get an ensemble of neural networks at no extra training cost (i.e., at the cost of training a single network), by saving snapshots of the network during training. Network is trained using a cyclic (cosine) learning rate schedule; the snapshots are obtained when the learning rate is at the lowest points of the cycles. Using these snapshot ensembles, they show gains in performance over a single network on the image classification task on a variety of datasets. Positives: 1. The work should be easy to adopt and re-produce, given the simple techinque and the experimental details in the paper. 2. Well written paper, with clear description of the method and thorough experiments. Suggestions for improvement / other comments: 1. While it is fair to compare against other techniques assuming a fixed computational budget, for a clear perspective, thorough comaprisons with *true ensembles* (i.e., ensembles of networks trained independently) should be provided. Specificially, Table 4 should be augmented with results from *true ensembles*. 2. Comparison with true ensembles is only provided for DenseNet-40 on CIFAR100 in Figure 4. The proposed snapshot ensemble achieves approximately 66% of the improvement of *true ensemble* over the single baseline model. This is not reflected accurately in the authors* claim in the abstract: *[snapshot ensembles] **almost match[es]** the results of far more expensive independently trained [true ensembles].* 3. As mentioned before: to understand the diversity of snapshot ensembles, it would help to the diversity against different ensembling technique, e.g. (1) *true ensembles*, (2) ensembles from dropout as described by Gal et. al, 2016 (Dropout as a Bayesian Approximation).