Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- md/train/-oUhJJILWHb/-oUhJJILWHb.md +197 -0
- md/train/1-j4VLSHApJ/1-j4VLSHApJ.md +256 -0
- md/train/9CPc4EIr2t1/9CPc4EIr2t1.md +294 -0
- md/train/B1eksh4KvH/B1eksh4KvH.md +258 -0
- md/train/B1g5sA4twr/B1g5sA4twr.md +442 -0
- md/train/B1l08oAct7/B1l08oAct7.md +0 -0
- md/train/B1n8LexRZ/B1n8LexRZ.md +438 -0
- md/train/BJ5UeU9xx/BJ5UeU9xx.md +236 -0
- md/train/BJlahxHYDS/BJlahxHYDS.md +567 -0
- md/train/BJuysoFeg/BJuysoFeg.md +240 -0
- md/train/BJxH22EKPS/BJxH22EKPS.md +390 -0
- md/train/BJxpIJHKwB/BJxpIJHKwB.md +417 -0
- md/train/BklIxyHKDr/BklIxyHKDr.md +466 -0
- md/train/By4HsfWAZ/By4HsfWAZ.md +313 -0
- md/train/ByJWeR1AW/ByJWeR1AW.md +288 -0
- md/train/Byg9A24tvB/Byg9A24tvB.md +515 -0
- md/train/BygFVAEKDH/BygFVAEKDH.md +376 -0
- md/train/BygZK2VYvB/BygZK2VYvB.md +316 -0
- md/train/ByxkijC5FQ/ByxkijC5FQ.md +379 -0
- md/train/E4PK0rg2eP/E4PK0rg2eP.md +328 -0
- md/train/EsA9Nr9JHvy/EsA9Nr9JHvy.md +0 -0
- md/train/GY6-6sTvGaf/GY6-6sTvGaf.md +437 -0
- md/train/H1K6Tb-AZ/H1K6Tb-AZ.md +199 -0
- md/train/H1edIiA9KQ/H1edIiA9KQ.md +288 -0
- md/train/H1ltQ3R9KQ/H1ltQ3R9KQ.md +300 -0
- md/train/HJC2SzZCW/HJC2SzZCW.md +533 -0
- md/train/HJe4Cp4KwH/HJe4Cp4KwH.md +273 -0
- md/train/HJeO7RNKPr/HJeO7RNKPr.md +479 -0
- md/train/HJxyZkBKDr/HJxyZkBKDr.md +307 -0
- md/train/HWX5j6Bv_ih/HWX5j6Bv_ih.md +394 -0
- md/train/HkezXnA9YX/HkezXnA9YX.md +306 -0
- md/train/HkgHk3RctX/HkgHk3RctX.md +286 -0
- md/train/HkzRQhR9YX/HkzRQhR9YX.md +497 -0
- md/train/HkzSQhCcK7/HkzSQhCcK7.md +322 -0
- md/train/HyEtjoCqFX/HyEtjoCqFX.md +499 -0
- md/train/HygUOoC5KX/HygUOoC5KX.md +0 -0
- md/train/LSFCEb3GYU7/LSFCEb3GYU7.md +509 -0
- md/train/LU687itn08w/LU687itn08w.md +342 -0
- md/train/LVWcGZr-8h/LVWcGZr-8h.md +322 -0
- md/train/MNVjrDpu6Yo/MNVjrDpu6Yo.md +285 -0
- md/train/N9oPAFcuYWX/N9oPAFcuYWX.md +0 -0
- md/train/QYjO70ACDK/QYjO70ACDK.md +278 -0
- md/train/QkRbdiiEjM/QkRbdiiEjM.md +416 -0
- md/train/QpT9Q_NNfQL/QpT9Q_NNfQL.md +454 -0
- md/train/RHY_9ZVcTa_/RHY_9ZVcTa_.md +467 -0
- md/train/RYcgfqmAOHh/RYcgfqmAOHh.md +0 -0
- md/train/S1lyyANYwr/S1lyyANYwr.md +718 -0
- md/train/S1x1IkHtPr/S1x1IkHtPr.md +346 -0
- md/train/SJDJNzWAZ/SJDJNzWAZ.md +229 -0
- md/train/SJTQLdqlg/SJTQLdqlg.md +246 -0
md/train/-oUhJJILWHb/-oUhJJILWHb.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Learning Debiased Representation via Disentangled Feature Augmentation
|
| 2 |
+
|
| 3 |
+
Jungsoo Lee\*1,2 Eungyeup $\mathbf { K i m } ^ { * 1 , 2 }$ Juyoung Lee2 Jihyeon Lee1 Jaegul Choo1
|
| 4 |
+
|
| 5 |
+
1KAIST AI, 2Kakao Enterprise, South Korea 1{bebeto, eykim94, gina3833, jchoo}@kaist.ac.kr, 2{bebeto.lee, josh.ey, michael.jy}@kakaoenterprise.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Image classification models tend to make decisions based on peripheral attributes of data items that have strong correlation with a target variable (i.e., dataset bias). These biased models suffer from the poor generalization capability when evaluated on unbiased datasets. Existing approaches for debiasing often identify and emphasize those samples with no such correlation (i.e., bias-conflicting) without defining the bias type in advance. However, such bias-conflicting samples are significantly scarce in biased datasets, limiting the debiasing capability of these approaches. This paper first presents an empirical analysis revealing that training with “diverse” bias-conflicting samples beyond a given training set is crucial for debiasing as well as the generalization capability. Based on this observation, we propose a novel feature-level data augmentation technique in order to synthesize diverse bias-conflicting samples. To this end, our method learns the disentangled representation of (1) the intrinsic attributes (i.e., those inherently defining a certain class) and (2) bias attributes (i.e., peripheral attributes causing the bias), from a large number of bias-aligned samples, the bias attributes of which have strong correlation with the target variable. Using the disentangled representation, we synthesize bias-conflicting samples that contain the diverse intrinsic attributes of bias-aligned samples by swapping their latent features. By utilizing these diversified bias-conflicting features during the training, our approach achieves superior classification accuracy and debiasing results against the existing baselines on synthetic and real-world datasets.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Despite the recent advancement of deep neural networks, they often rely overly on the correlation between peripheral attributes and labels, referred to as dataset bias [1], especially when such strong bias is found in a given dataset. A majority of samples in the biased dataset exhibit visual attributes that are not innate but frequently co-occur with target labels (i.e., bias attributes). For example, most of the bird images in the training dataset may contain the background as the blue sky, while the birds may still be found in different places. Thus, the model trained with such a biased dataset is likely to learn the bias attributes more than intrinsic attributes, the innate visual attributes that inherently define a certain class, e.g., the wings of birds. This causes the model to learn shortcuts for classification [2], failing to generalize on the images with no such correlations (e.g., birds on grounds or grass) during the test phase. Throughout the paper, bias-aligned samples correspond to data items containing a strong correlation between bias attributes and labels (e.g., birds in the sky), while bias-conflicting samples indicate the other cases that are rarely found (e.g., birds on grounds).
|
| 14 |
+
|
| 15 |
+
To tackle such a task, previous studies often define a specific bias type (e.g., color and texture) in advance [3, 4, 5, 6, 7, 8, 9, 10], which enables them to design a debiasing network tailored for the predefined bias type. For example, Bahng et al. [6] leverage BagNet [11], which has limited size of receptive fields, to focus on learning color and texture. However, defining a bias type in advance 1) limits the capability of debiasing in other bias types and 2) requires expensive labor to manually identify the bias type. To handle such an issue, a recent approach [12] defines a bias based on an intuitive observation that the bias attributes are often easier to learn than the intrinsic attributes for neural networks. In this regard, they re-weight bias-conflicting samples while de-emphasizing the bias-aligned ones. However, we point out that the reason behind the limited generalization capability of existing debiasing approaches lies in the significant scarcity of bias-conflicting samples compared to the bias-aligned ones in a given training set. In other words, it is challenging to learn the debiased representation from these scarce bias-conflicting samples because the models are prone to memorize (thus being overfitted to) these samples, failing to learn the intrinsic attributes. Therefore, we claim that a neural network can learn properly debiased representation when these data items are diversified during training.
|
| 16 |
+
|
| 17 |
+
We conduct a brief experiment to demonstrate the importance of diversity in debiasing. Diversity in our work indicates the different valid realization of intrinsic attributes in a certain class (e.g., thick, narrow, tilted, and scribbled digit shapes in MNIST [13]). Our observation is that training a model with diverse bias-conflicting samples beyond a given training set is crucial for learning debiased representation (Section 3.2). In this regard, synthesizing bias-conflicting samples is one of the straightforward approaches to increase the diversity of such samples. In fact, a large amount of bias-aligned samples in a given training set already contain diverse intrinsic attributes, which can work as informative sources for increasing the diversity. However, as bias and intrinsic attributes are highly entangled in their embedding space, it is difficult to extract the intrinsic ones from these bias-aligned samples. Therefore, disentangling these correlations enables to synthesize diversified bias-conflicting samples that originate from bias-aligned samples.
|
| 18 |
+
|
| 19 |
+
In this paper, we propose a novel feature augmentation approach via disentangled representation for debiasing. We first train two different encoders to embed images into the disentangled representation of their intrinsic and bias attributes. With the disentangled representation, we randomly swap the latent vectors extracted from different images, most of which are bias-aligned samples in our training set. These swapped features thus contain both bias and intrinsic attributes without the correlation between them, which, in turn, can work as augmented bias-conflicting samples in our training. These features include intrinsic features of bias-aligned ones, increasing the diversity of a given training set, especially for bias-conflicting data items. Furthermore, to enhance the quality of diversified features, we propose a scheduling strategy of feature augmentation which enables to utilize the representation disentangled to a certain degree. In summary, the main contributions of our work include:
|
| 20 |
+
|
| 21 |
+
• Through our preliminary experiment, we reveal that increasing the diversity of biasconflicting samples is crucial for debiasing.
|
| 22 |
+
• Based on such an observation, we propose a novel feature augmentation method via disentangled representation for diversifying the bias-conflicting samples.
|
| 23 |
+
• We achieve the state-of-the-art performances in two synthetic datasets (i.e., Colored MNIST and Corrupted CIFAR-10) and one real-world dataset (i.e., Biased FFHQ) against existing baselines.
|
| 24 |
+
|
| 25 |
+
# 2 Related Work
|
| 26 |
+
|
| 27 |
+
Debiasing predefined bias Several existing approaches mitigate the bias by pre-defining a certain bias type, either explicitly [3, 4, 5] or implicitly [6, 7, 8, 9, 10, 14]. For example, Bahng et al. [6] and Wang et al. [7] design a color- and texture-oriented network to adversarially learn a debiased model against the biased one. However, as these methods still require a specific bias type such as texture in advance, they lack the general applicability to the datasets where the bias types are demanding to recognize.
|
| 28 |
+
|
| 29 |
+
Instead of defining certain types of bias, recent approaches [12, 15, 16] rely on the straightforward assumption that networks are prone to exploit the bias when it acts as a shortcut [2], i.e., easy to learn in the early training phase. Nam et al. [12] emphasize the bias-conflicting samples during training by using generalized cross-entropy loss [17]. Darlow et al. [15] and Huang et al. [16] presume that high gradient of latent vectors accounts for the shortcuts that model learns. In the line with the recent studies, we tackle debiasing without pre-defining a certain bias type.
|
| 30 |
+
|
| 31 |
+
Table 1: The classification accuracy on the unbiased test sets. The diversity ratio indicates the ratio of bias-conflicting samples in the dataset pooled for each experiment. The sampling ratio refers to the ratio of bias-conflicting samples included in each mini-batch. We report the averaged accuracy over three independent trials with the standard deviation. In both datasets, we observe that the bias can be mitigated with diverse bias-conflicting samples even with a small sampling ratio. Bold and underlined values indicate the best and second best accuracy, respectively.
|
| 32 |
+
|
| 33 |
+
<table><tr><td>Dataset</td><td>Diversity ratio</td><td>Sampling ratio</td><td>Accuracy (%)</td></tr><tr><td rowspan="4">Colored MNIST</td><td>5%</td><td>50%</td><td>83.77±2.03</td></tr><tr><td>1%</td><td>50%</td><td>67.19±1.99</td></tr><tr><td>5%</td><td>1%</td><td>77.97±6.00</td></tr><tr><td>1%</td><td>1%</td><td>49.91±4.22</td></tr><tr><td rowspan="4">Corrupted CIFAR-10</td><td>5%</td><td>50%</td><td>46.99±0.82</td></tr><tr><td>1%</td><td>50%</td><td>33.08±0.80</td></tr><tr><td>5%</td><td>1%</td><td>36.66±0.55</td></tr><tr><td>1%</td><td>1%</td><td>23.98±0.00</td></tr></table>
|
| 34 |
+
|
| 35 |
+
Data augmentation for debiasing Geirhos et al. [10] mitigate the texture bias by utilizing additional training images with their styles being transferred by adaptive instance normalization (AdaIN) [18]. Minderer et al. [19] train an image-to-image translation network for removing shortcut cues in the self-supervised task. However, such image-level data augmentation is limited to resolving the predefined texture bias which can not be adopted to other general types of bias.
|
| 36 |
+
|
| 37 |
+
One alternative is to exploit the latent space for data augmentation. For example, Darlow et al. [15] adversarially perturb the latent vectors corresponding to the high gradients to generate the samples against bias. Zhou et al. [20] mix the style of different source domains by AdaIN [18] to increase the domain generalization ability. Despite the effectiveness of the augmentation in the latent space, the strong unwanted correlation between bias attributes and labels prevents from obtaining the desirable intrinsic features. We resolve this issue by leveraging the disentangled representation in debiasing, which is widely used in image-to-image translation task [21, 22, 23]. To the best of our knowledge, no previous work in debiasing leverage this disentangled representation for the purpose of feature augmentation. For the rest of the paper, we elaborate how we perform the feature augmentation based on the disentangled representation.
|
| 38 |
+
|
| 39 |
+
# 3 Importance of Diversity in Debiasing
|
| 40 |
+
|
| 41 |
+
This section describes the details of a toy-set experiment in which we observe the importance of diversity in learning debiased representation. In Section 3.1, we first introduce the two synthetic datasets, Colored MNIST and Corrupted CIFAR-10, that we utilize for the observation. Then, we elaborate the results of the experiments in Section 3.2.
|
| 42 |
+
|
| 43 |
+
# 3.1 Dataset
|
| 44 |
+
|
| 45 |
+
Colored MNIST is a modified MNIST dataset [13] with the color bias. We select ten distinct colors and inject each color on the foreground of each digit to create color bias. By adjusting the number of bias-conflicting data samples in the training set, we obtain four different datasets with the ratio of bias-conflicting samples of $0 . 5 \%$ , $1 \%$ , $2 \%$ , and $5 \%$ .
|
| 46 |
+
|
| 47 |
+
Corrupted CIFAR-10 has ten different types of texture bias applied in CIFAR-10 [24] dataset, constructed by following the design protocol of Hendrycks and Dietterich [25]. Each class is highly correlated with a certain texture (e.g., frost and brightness). Corrupted CIFAR-10 also has four different datasets with their correlation ratios as in Colored MNIST.
|
| 48 |
+
|
| 49 |
+
# 3.2 Increasing diversity outperforms oversampling
|
| 50 |
+
|
| 51 |
+
To confirm the significance of diversity of bias-conflicting samples in debiasing, we train four different settings: oversampling bias-conflicting samples by $50 \%$ in each mini-batch (i.e., 128 from a batch size of 256), from the pool of i) $5 \%$ dataset and ii) $1 \%$ dataset, sampling bias-conflicting samples by $1 \%$ in each mini-batch (i.e., 2 from a batch size of 256) from the pool of iii) $5 \%$ dataset and iv) $1 \%$ dataset. Oversampling provides the same amount of bias-conflicting samples as the aligned ones to the model in every training step. Bias-conflicting images sampled from the pool of $5 \%$ dataset have more diverse appearances of bias-conflicting samples compared to those from $1 \%$ dataset.
|
| 52 |
+
|
| 53 |
+
Table 1 shows the image classification accuracy of each setting validated on the unbiased test images. Apparently, oversampling diverse bias-conflicting samples (first row) outperforms the other three methods. Similarly, sampling a small amount of bias-conflicting samples with the least diversity (fourth row) shows the lowest classification accuracy. The interesting finding is that sampling fewer but diverse conflicting samples in each mini-batch (third row) outperforms oversampling bias-conflicting samples with limited diversity (second row). These results lead to the conclusion that the diversity of bias-conflicting samples is a more crucial factor for learning debiased representation than the ratio of sampling in the training. As the diversity is limited (the latter case), the model can be easily overfitted to the given bias-conflicting samples, thus less likely to learn the generalized intrinsic attributes. With the Colored MNIST as an example, the shape of digits may vary. To be more specific, the digit shape may be thick, narrow, tilted, scribbled, and etc. If the bias-conflicting samples do not include certain visual facets (e.g., not including scribbled digit images) due to the limited number of samples, the model may imperfectly learn the intrinsic attributes of digit shapes. On the other hand, in the former case (third row), the model can learn multiple facets of intrinsic attributes when they are sampled from the diverse pool of datasets, resulting in learning intrinsic attributes even without oversampling the bias-conflicting images.
|
| 54 |
+
|
| 55 |
+
# 4 Debiasing via disentangled feature augmentation
|
| 56 |
+
|
| 57 |
+
Motivated by such an observation in Section 3.2, we propose a feature-level augmentation strategy for synthesizing additional bias-conflicting samples, as illustrated in Fig. 1. First, we train the two separate encoders which embed an image into disentangled latent vectors corresponding to the intrinsic and bias attributes, respectively (Section 4.1). Swapping these feature vectors among training samples enables to augment the bias-conflicting samples which no more contain a correlation between two attributes (Section 4.2). To further enhance the effectiveness, we schedule the feature augmentation after the representation is disentangled at a certain degree (Section 4.3).
|
| 58 |
+
|
| 59 |
+
# 4.1 Learning disentangled representation
|
| 60 |
+
|
| 61 |
+
In contrast to the bias-conflicting samples, a large amount of bias-aligned images have diverse appearances of their intrinsic attributes. By leveraging these attributes for augmentation, we can naturally obtain the diversified bias-conflicting samples containing the diverse intrinsic attributes. However, it remains challenging in that these attributes are strongly correlated with the bias attributes in the bias-aligned samples. Therefore, we propose to design two encoders with their linear classifiers to extract the disentangled latent vectors from the input images.
|
| 62 |
+
|
| 63 |
+
As shown in Fig. 1, encoders $E _ { i }$ and $E _ { b }$ embed an image $x$ into intrinsic feature vectors $z _ { i } = E _ { i } ( x )$ and bias feature vectors $z _ { b } = E _ { b } ( x )$ , respectively. Afterward, linear classifiers $C _ { i }$ and $C _ { b }$ take the concatenated vector $z = [ z _ { i } ; z _ { b } ]$ as input to predict the target label $y$ . To train $E _ { i }$ and $C _ { i }$ as intrinsic feature extractor and $E _ { b }$ and $C _ { b }$ as bias extractor, we utilize the relative difficulty score of each data sample, proposed in the previous work of Nam et al. [12]. More specifically, we train $E _ { b }$ and $C _ { b }$ to be overfitted to the bias attributes by utilizing the generalized cross entropy (GCE) [17], while $E _ { i }$ and $C _ { i }$ are trained with the cross entropy (CE) loss. Then, the samples with high CE loss from $C _ { b }$ can be regarded as the bias-conflicting samples compared to the samples with low CE loss. In this regard, we obtain the relative difficulty score of each data sample as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
W ( z ) = \frac { C E ( C _ { b } ( z ) , y ) } { C E ( C _ { i } ( z ) , y ) + C E ( C _ { b } ( z ) , y ) } .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
As bias-conflicting samples obtain high values of $W$ , we emphasize the loss of these samples for
|
| 70 |
+
|
| 71 |
+
training $E _ { i }$ and $C _ { i }$ , enforcing them to learn the intrinsic attributes. Therefore, the objective function for disentanglement can be written as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
L _ { \mathrm { d i s } } = W ( z ) C E ( C _ { i } ( z ) , y ) + \lambda _ { \mathrm { d i s } } G C E ( C _ { b } ( z ) , y ) .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
To ensure that $C _ { i }$ and $C _ { b }$ predicts target labels mainly based on $z _ { i }$ and $z _ { b }$ , respectively, the loss
|
| 78 |
+
|
| 79 |
+
$C _ { i }$ is not backpropagated to $E _ { b }$ , and vice versa.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 1: The overview of our proposed debiasing approach. $( E _ { i } , C _ { i } )$ and $( E _ { b } , C _ { b } )$ are pairs of an encoder and a linear classifier trained to learn the disentangled representation of intrinsic attributes and bias attributes, respectively. With the disentangled features $z _ { i }$ and $z _ { b }$ , the feature augmentation is performed by swapping these latent vectors among different training samples, after certain iterations of training. $R$ refers to the re-weighting algorithm which implicitly differentiates bias-aligned samples and bias-conflicting samples. Each color indicates the different data samples.
|
| 83 |
+
|
| 84 |
+
# Algorithm 1 Debiasing with disentangled feature augmentation
|
| 85 |
+
|
| 86 |
+
Input: image $x$ , label $y$ , iteration $t$ , augment iteration $t _ { \mathrm { s w a p } }$
|
| 87 |
+
Initialize two networks $( E _ { i } , C _ { i } )$ , $( E _ { b } , C _ { b } )$
|
| 88 |
+
while not converged do Extract $z _ { i } , z _ { b }$ from $E _ { i } ( x )$ , $E _ { b } ( x )$ Concatenate $\boldsymbol { z } = [ z _ { i } ; z _ { b } ]$ Update $( E _ { i } , C _ { i } )$ , $( E _ { b } , C _ { b } )$ with $L _ { \mathrm { d i s } } = W ( z ) C E ( C _ { i } ( z ) , y ) + G C E ( C _ { b } ( z ) , y )$ if $t > t _ { \mathrm { s w a p } }$ : Randomly permute $\boldsymbol { z } = [ z _ { i } , z _ { b } ]$ into $z _ { \mathrm { s w a p } } = [ z _ { i } ; \tilde { z _ { b } } ]$ Calculate Ls $\ L _ { \mathrm { v a p } } = W ( z ) C E ( C _ { i } ( z _ { \mathrm { s w a p } } ) , \dot { y } ) + G C E ( C _ { b } ( z _ { \mathrm { s w a p } } ) , \tilde { y }$ ) Update $( E _ { i } , C _ { i } ^ { \dot { \mathbf { \alpha } } } )$ , $( E _ { b } , C _ { b } )$ with $L _ { \mathrm { t o t a l } } = L _ { \mathrm { d i s } } + \lambda _ { \mathrm { s w a p } } L _ { \mathrm { s w a p } }$
|
| 89 |
+
end
|
| 90 |
+
|
| 91 |
+
# 4.2 Feature swapping for augmentation
|
| 92 |
+
|
| 93 |
+
While such an architecture disentangles the intrinsic features and bias features, $E _ { i }$ and $C _ { i }$ are still mainly trained with an excessively small amount of bias-conflicting samples. Therefore, $E _ { i }$ and $C _ { i }$ fail to fully acquire the intrinsic representation of a target class. To promote further improvement in learning intrinsic feature vectors, we diversify the bias-conflicting samples by swapping the disentangled latent vectors among the training sets. In other words, we randomly permute the intrinsic features and bias features in each mini-batch and obtain $z _ { \mathrm { s w a p } } ~ = ~ [ z _ { i } ; \tilde { z _ { b } } ]$ where $\tilde { z _ { b } }$ denotes the randomly permuted bias attributes of $z _ { b }$ . As the intrinsic and bias attributes in ${ z _ { \mathrm { s w a p } } }$ are obtained from two different images, they certainly have less correlation compared to $\boldsymbol { z } = [ z _ { i } ; \dot { z _ { b } } ]$ where both are from the same image. Since the biased dataset is mostly composed of bias-aligned samples, these vectors are likely from the bias-aligned samples, highly diversified compared to the bias-conflicting ones. Then, $z _ { \mathrm { s w a p } } = [ z _ { i } ; \tilde { z _ { b } } ]$ act as augmented bias-conflicting latent vectors with diversity inherited from the bias-aligned samples. Along with $L _ { \mathrm { d i s } }$ , we add the following loss function to train two neural networks with the augmented features
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
L _ { \mathrm { s w a p } } = W ( z ) C E ( C _ { i } ( z _ { \mathrm { s w a p } } ) , y ) + \lambda _ { \mathrm { s w a p } _ { b } } G C E ( C _ { b } ( z _ { \mathrm { s w a p } } ) , \tilde { y } ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\tilde { y }$ denotes target labels for permute bias attributes $\tilde { z }$ . Thus, total loss function is described as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
L _ { \mathrm { t o t a l } } = L _ { \mathrm { d i s } } + \lambda _ { \mathrm { s w a p } } L _ { \mathrm { s w a p } }
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\lambda _ { \mathrm { s w a p } }$ is adjusted for weighting the importance of the feature augmentation.
|
| 106 |
+
|
| 107 |
+
# 4.3 Scheduling the feature augmentation
|
| 108 |
+
|
| 109 |
+
While training with additional synthesized features helps to mitigate the unwanted correlation, utilizing them from the beginning of training does not improve the debiasing performance. To be more specific, in the early stage of training, the representations of $z _ { i }$ and $z _ { b }$ are imperfectly disentangled to be used as the sources of feature augmentation. Feature augmentation should be conducted after two features are disentangled at a certain degree. Without the disentangled representation, the augmented features work as noisy samples which may aggravate the debiasing performances. We verify the importance of scheduling the feature augmentation in Table 3. Our approach can be summarized with Algorithm 1.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 2: Example images of datasets utilized in our work. In each dataset, the images above the dotted line indicate the bias-aligned samples while the ones below the dotted line are the bias-conflicting samples. For Colored MNIST and Corrupted CIFAR-10, each column indicates each class. For BFFHQ, the group of three columns indicates each class.
|
| 113 |
+
|
| 114 |
+
# 5 Experiment
|
| 115 |
+
|
| 116 |
+
This section demonstrates the effectiveness of feature augmentation based on disentangled representation in debiasing with both quantitative and qualitative evaluation. We compare our method with the previous approaches in debiasing with three different datasets with varied bias ratios. Then, we conduct the ablation study which demonstrates the importance of 1) learning disentangled representation, 2) feature augmentation, and 3) scheduling feature augmentation. For the qualitative evaluation, we verify how our approach disentangles the intrinsic features and bias features by visualizing them on 2D embedding space via t-SNE [26] and reconstructing images from them.
|
| 117 |
+
|
| 118 |
+
# 5.1 Experiment details
|
| 119 |
+
|
| 120 |
+
Baselines Our baselines consist of vanilla network, HEX [7], EnD [27], ReBias [6] and LfF [12]. Vanilla denotes the classification model trained only with the original cross-entropy (CE) loss, without any debiasing strategies. EnD explicitly leverages the bias labels (e.g., the color label in Colored MNIST) during the training phase. HEX and ReBias explicitly presume the texture of an image as a bias type, while LfF requires no prior knowledge on it.
|
| 121 |
+
|
| 122 |
+
Datasets As shown in Fig. 2, we use two synthetic datasets (Colored MNIST and Corrputed CIFAR10) and one real-world dataset (Biased FFHQ) to evaluate the generalization of debiasing baselines over various domains. Biased FFHQ (BFFHQ) is curated from FFHQ dataset [28] which contains human face images annotated with their facial attributes. Among the facial attributes, we select age and gender as the intrinsic and bias attribute, respectively, and construct the dataset with images of high correlation between them. More specifically, most of the females are ‘young’ (i.e., age ranging from 10 to 29) and males are ‘old’ (i.e., age ranging from 40 to 59). Therefore, bias-aligned samples which compose the majority of the dataset are young women and old men.
|
| 123 |
+
|
| 124 |
+
For each dataset, we set the degree of correlation by adjusting the number of bias-conflicting samples among the training dataset. The ratio of bias-conflicting samples are $0 . 5 \%$ , $1 \%$ , $2 \%$ and $5 \%$ for both Colored MNIST and Corrupted CIFAR-10, respectively, and $0 . 5 \%$ for BFFHQ. For the evaluation of Colored MNIST and Corrupted CIFAR-10, we construct an unbiased test set which includes images without the high correlation existing in the training set. For the BFFHQ, we construct a bias-conflicting test set which excludes the bias-aligned samples from the unbiased test set. The reason is as following. The bias-aligned images consist a half of the unbiased test set in BFFHQ which may still be correctly classified by the biased classifier. This inflates the accuracy of the unbiased test set which is not our original intention. Therefore, we intentionally use the bias-conflicting test set for the BFFHQ.
|
| 125 |
+
|
| 126 |
+
Table 2: Image classification accuracy evaluated on unbiased test sets of Colored MNIST and Corrupted CIFAR-10, and the bias-conflicting test set of BFFHQ with varying ratio of bias-conflicting samples. We denote whether the model requires a bias type in advance by cross mark (i.e., not required), and check mark (i.e., required). Best performing results are marked in bold, while secondbest results are denoted with underlines.
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Ratio (%)</td><td>Vanilla [29]</td><td>HEX [7]</td><td>EnD [27]</td><td>ReBias [6]</td><td>LfF[12]</td><td>Ours</td></tr><tr><td>X</td><td>√</td><td>√</td><td>√</td><td>×</td><td>X</td></tr><tr><td rowspan="4">Colored MNIST</td><td>0.5</td><td>35.19±3.49</td><td>30.33±0.76</td><td>34.28±1.20</td><td>70.47±1.84</td><td>52.50±2.43</td><td>65.22±4.41</td></tr><tr><td>1.0</td><td>52.09±2.88</td><td>43.73±5.50</td><td>49.50±2.51</td><td>87.4±0.78</td><td>61.89±4.97</td><td>81.73±2.34</td></tr><tr><td>2.0</td><td>65.86±3.59</td><td>56.85±2.58</td><td>68.45±2.16</td><td>92.91±0.15</td><td>71.03±2.44</td><td>84.79±0.95</td></tr><tr><td>5.0</td><td>82.17±0.74</td><td>74.62±3.20</td><td>81.15±1.43</td><td>96.96±0.04</td><td>80.57±3.84</td><td>89.66±1.09</td></tr><tr><td rowspan="4">Corrupted CIFAR-10</td><td>0.5</td><td>23.08±1.25</td><td>13.87±0.06</td><td>22.89±0.27</td><td>22.27±0.41</td><td>28.57±1.30</td><td>29.95±0.71</td></tr><tr><td>1.0</td><td>25.82±0.33</td><td>14.81±0.42</td><td>25.46±0.41</td><td>25.72±0.20</td><td>33.07±0.77</td><td>36.49±1.79</td></tr><tr><td>2.0</td><td>30.06±0.71</td><td>15.20±0.54</td><td>31.31±0.35</td><td>31.66±0.43</td><td>39.91±0.30</td><td>41.78±2.29</td></tr><tr><td>5.0</td><td>39.42±0.64</td><td>16.04±0.63</td><td>40.26±0.85</td><td>43.43±0.41</td><td>50.27±1.56</td><td>51.13±1.28</td></tr><tr><td>BFFHQ</td><td>0.5</td><td>56.87±2.69</td><td>52.83±0.90</td><td>56.87±1.42</td><td>59.46±0.64</td><td>62.2±1.0</td><td>63.87±0.31</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Implementation details We use multi-layer perceptron (MLP) with three hidden layers for Colored MNIST, and ResNet-18 [29] for the remaining datasets. To accommodate the disentangled vectors, we double the number of hidden units in the last fully-connected layer of each network. During the inference phase, we use $C _ { i } ( z )$ for the final prediction, where $z = [ z _ { i } ; z _ { b } ]$ . For the training, we set the batch size of 256 for Colored MNIST and Corrupted CIFAR-10, respectively, and 64 for BFFHQ. Bias-conflicting augmentation is scheduled to be applied after 10K iterations for all datasets. We report the averaged accuracy of the unbiased test sets over three independent trials with the mean and the standard deviation. We include the remaining implementation details in Section D in the supplementary material.
|
| 131 |
+
|
| 132 |
+
# 5.2 Quantitative evaluation
|
| 133 |
+
|
| 134 |
+
Comparison on test sets Table 2 shows the comparisons of image classification accuracy evaluated on the test sets. In general, our approach demonstrates the superior performance in both synthetic and real-world datasets against the baselines with large gaps. Especially, compared to the baselines which do not define the bias types in advance (vanilla [29] and LfF [12]), our approach achieves the stateof-the-art performance across all datasets. This indicates that utilizing the diversified bias-conflicting samples through our augmentation plays a pivotal role in learning debiased representation regardless of the bias types.
|
| 135 |
+
|
| 136 |
+
Regarding the real-world dataset, our approach also outperforms HEX [7] and ReBias [6] which utilize the tailored modules for a specific bias type (e.g., color and texture), and EnD [27] that uses the explicit bias labels. We even show superior performance compared to HEX in Colored MNIST without defining the bias type beforehand. While ReBias achieves the best accuracy in Colored MNIST, they utilize BagNet [11] in order to focus on the color bias. Even without using such an architecture, we achieve the second best performance which is comparable to ReBias.
|
| 137 |
+
|
| 138 |
+
Ablation studies Table 3 demonstrates the importance of each module in our approach through ablation studies: 1) disentangled representation learning, 2) feature augmentation, and 3) scheduling feature augmentation. We set the ratio of bias-conflicting samples to $1 \%$ for Colored MNIST and Corrupted CIFAR10, and $0 . 5 \%$ for BFFHQ. We also compare each module with the vanilla network (first row). We observe that performing the scheduled feature augmentation shows the best classification accuracy on the test sets across all datasets. We also show that performing feature augmentation at the early stage of training does not guarantee the effectiveness of debiasing. Performing feature augmentation at the beginning of training rather aggravates the performance. That is, when the representation of intrinsic attributes and bias attributes are not disentangled at a certain degree, augmented features may act as noisy samples. Training with these additional noisy features prevents models from achieving further improvement.
|
| 139 |
+
|
| 140 |
+
Table 3: Ablation studies on 1) disentangled representation learning, 2) feature augmentation, and 3) scheduling feature augmentation. Each row indicates the different training settings with check mark denoting the setting applied. We average the accuracy of each training over three independent trials.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Disentangle</td><td>Augment</td><td>Scheduled Augment</td><td>Colored MNIST</td><td>Corrupted CIFAR10</td><td>BFFHQ</td></tr><tr><td></td><td></td><td></td><td>52.09±2.88</td><td>25.82±0.33</td><td>56.87±2.69</td></tr><tr><td><>></td><td></td><td></td><td>74.03±2.40</td><td>27.73±1.02</td><td>59.4±2.46</td></tr><tr><td></td><td></td><td></td><td>72.29±3.82</td><td>32.81±2.47</td><td>61.27±3.26</td></tr><tr><td></td><td>?</td><td>√</td><td>81.73±2.34</td><td>52.31±1.00</td><td>63.87±0.31</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# 5.3 Analysis
|
| 145 |
+
|
| 146 |
+
2D Projection of Disentangled Representation Fig. 3 shows the projection of latent vectors $z _ { i }$ and $z _ { b }$ extracted from the intrinsic encoder $E _ { i }$ and bias encoder $E _ { b }$ , respectively, on a 2D space using Colored MNIST. We show projection of $z _ { i }$ and $z _ { b }$ in Fig. 3(a) and Fig. 3(b), respectively. The colors of projected dots in the first row (i) and the second row (ii) indicate the target labels and bias labels, respectively. We observe that $z _ { i }$ are clustered according to the target labels while $z _ { b }$ are clustered with the bias labels. The results represent that our method successfully learns the disentangled intrinsic and bias attributes.
|
| 147 |
+
|
| 148 |
+
Prediction with Disentangled Representation In Table 4, we report the 1) original and 2) swapping accuracy of $C _ { i }$ and $C _ { b }$ , the linear classifiers of the intrinsic and the bias encoder, respectively. To be specific, for the original accuracy, we extract the two disentangled vectors, $z _ { i }$ and $z _ { b }$ , from the same image, concatenate them to make $z = [ z _ { i } ; z _ { b } ]$ , and forward them into each linear classifier. For the swapping accuracy, however, we first permute $z _ { b }$ and concatenate $z _ { i }$ with the permuted $z _ { b }$ (i.e., denoted as $\tilde { z _ { b } }$ in Section 4.2) to make $z _ { \mathrm { s w a p } } = [ z _ { i } ; \tilde { z _ { b } } ]$ . Then, we pass these concatenated latent vectors to each linear classifier. Afterward, we evaluate the accuracy of predicted labels of 1) $C _ { i } ( z )$ and $C _ { i } ( z _ { \mathrm { { s w a p } } } )$ with intrinsic labels and 2) $C _ { b } ( z )$ and $C _ { b } ( z _ { \mathrm { s w a p } } )$ with bias labels. The Intrinsic and Bias columns in Table 4 denote the accuracy with respect to the target labels and bias labels, respectively. Even the feature vectors of bias attributes are randomly swapped, our method maintains a reasonable classification accuracy. This indicates that our model well disentangles between $z _ { i }$ and $z _ { b }$ , and $C _ { i }$ robustly utilizes $z _ { i }$ to predict target labels even when $z _ { b }$ is taken from the different image, and vice versa. Note that we utilized the parameters of the model trained on each dataset after converging at a certain degree.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: Each row (i and ii) include 2D projection of $z _ { i }$ and $z _ { b }$ with the colors encoded by their labels (i.e., groundtruth labels in row i and bias labels in row ii) in Colored MNIST. We observe that $z _ { i }$ and $z _ { b }$ are well clustered according to the target and bias labels, respectively.
|
| 152 |
+
|
| 153 |
+
<table><tr><td rowspan="3">Accuracy(%)</td><td colspan="2">Colored MNIST</td><td colspan="2">Corrupted CIFAR10</td><td colspan="2">BFFHQ</td></tr><tr><td>Intrinsic</td><td>Bias</td><td>Intrinsic</td><td>Bias</td><td>Intrinsic</td><td>Bias</td></tr><tr><td>Original</td><td>76.08</td><td>98.07</td><td>35.63</td><td>74.16</td><td>57.40</td><td>49.00</td></tr><tr><td>Swapping</td><td>71.40</td><td>94.29</td><td>35.14</td><td>76.46</td><td>58.40</td><td>51.60</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 4: Accuracy from disentangled representation. The ratio of bias-conflicting samples in Colored MNIST, Corrupted CIFAR-10, and BFFHQ are $1 \%$ , $1 \%$ , and $0 . 5 \%$ , respectively.
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 4: Reconstructed images from disentangled representation in Colored MNIST. Each column and row indicate the samples where the bias attribute (color) and the intrinsic attribute (digit) are extracted, respectively. By swapping the bias features with a given intrinsic feature, we observe that the color changes while maintaining the digit.
|
| 159 |
+
|
| 160 |
+
Reconstruction of Disentangled Representation Fig. 4 shows the reconstructed images of Colored MNIST by using the disentangled representation of intrinsic features and bias features. Images in the first row and column indicate the images used for extracting the bias attribute (i.e., color) and intrinsic attribute (i.e., digit), respectively. We train an auxiliary decoder by providing the latent vector $z$ from our pre-trained models as input in order to visualize the disentangled representations at the pixel level. By changing the bias attributes (as the column changes), the color of digit changes while maintaining the digit shape. This demonstrates that the bias features and intrinsic features independently contain color and digit information, respectively. Note that the reconstruction loss for updating the decoder is not backpropagated to our pre-trained classification models. Due to this fact, the reconstructed images may lack qualities such as showing blurry images. Further implementation details are included in Section D in the supplementary material.
|
| 161 |
+
|
| 162 |
+
# 6 Conclusions
|
| 163 |
+
|
| 164 |
+
In this work, we propose a feature augmentation method based on the disentangled representation of intrinsic and bias attributes. The main intuition behind our work is that increasing the diversity of bias-conflicting samples beyond a given training set is crucial for debiasing. Since the biased dataset strongly correlates the bias attributes and labels, we intentionally train two different encoders and extract bias features and intrinsic features. After the representations are disentangled to a certain degree, we proliferate the bias-conflicting samples by randomly swapping the vectors. We demonstrate the effectiveness of feature augmentation via extensive experiments, ablation studies, and qualitative evaluation of the disentangled representation. We believe our work inspires the future work of learning debiased representation with the improved generalization capability.
|
| 165 |
+
|
| 166 |
+
Acknowledgements This work was supported by the Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korean government(MSIT) (No. 2019-0-00075, Artificial Intelligence Graduate School Program(KAIST), No. 2021-0-01778, Development of human image synthesis and discrimination technology below the perceptual threshold), the Air Force Research Laboratory, under agreement number FA9550-18-S-0003, and Kakao Enterprise. This material is based on research sponsored by The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon.
|
| 167 |
+
|
| 168 |
+
References
|
| 169 |
+
[1] A. Torralba and A. A. Efros. Unbiased look at dataset bias. CVPR ’11, 2011.
|
| 170 |
+
[2] Robert Geirhos, Jörn-Henrik Jacobsen, Claudio Michaelis, Richard Zemel, Wieland Brendel, Matthias Bethge, and Felix A Wichmann. Shortcut learning in deep neural networks. Nature Machine Intelligence, 2(11):665–673, 2020.
|
| 171 |
+
[3] Byungju Kim, Hyunwoo Kim, Kyungsu Kim, Sungjin Kim, and Junmo Kim. Learning not to learn: Training deep neural networks with biased data. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 172 |
+
[4] Yi Li and Nuno Vasconcelos. Repair: Removing representation bias by dataset resampling. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9572–9581, 2019.
|
| 173 |
+
[5] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019.
|
| 174 |
+
[6] Hyojin Bahng, Sanghyuk Chun, Sangdoo Yun, Jaegul Choo, and Seong Joon Oh. Learning de-biased representations with biased representations. In International Conference on Machine Learning (ICML), 2020.
|
| 175 |
+
[7] Haohan Wang, Zexue He, Zachary L. Lipton, and Eric P. Xing. Learning robust representations by projecting superficial statistics out. In International Conference on Learning Representations, 2019.
|
| 176 |
+
[8] Remi Cadene, Corentin Dancette, Hedi Ben younes, Matthieu Cord, and Devi Parikh. Rubi: Reducing unimodal biases for visual question answering. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché- Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 177 |
+
[9] Christopher Clark, Mark Yatskar, and Luke Zettlemoyer. Don’t take the easy way out: Ensemble based methods for avoiding known dataset biases. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4069–4082, Hong Kong, China, November 2019. Association for Computational Linguistics.
|
| 178 |
+
[10] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A. Wichmann, and Wieland Brendel. Imagenet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness. In International Conference on Learning Representations, 2019.
|
| 179 |
+
[11] Wieland Brendel and Matthias Bethge. Approximating cnns with bag-of-local-features models works surprisingly well on imagenet. International Conference on Learning Representations, 2019.
|
| 180 |
+
[12] Junhyun Nam, Hyuntak Cha, Sungsoo Ahn, Jaeho Lee, and Jinwoo Shin. Learning from failure: Training debiased classifier from biased classifier. In Advances in Neural Information Processing Systems, 2020.
|
| 181 |
+
[13] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010.
|
| 182 |
+
[14] Aishwarya Agrawal, Dhruv Batra, and Devi Parikh. Analyzing the behavior of visual question answering models. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1955–1960, Austin, Texas, November 2016. Association for Computational Linguistics.
|
| 183 |
+
[15] Luke Darlow, Stanisław Jastrz˛ebski, and Amos Storkey. Latent adversarial debiasing: Mitigating collider bias in deep neural networks. arXiv preprint arXiv:2011.11486, 2020.
|
| 184 |
+
[16] Zeyi Huang, Haohan Wang, Eric P. Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In ECCV, 2020.
|
| 185 |
+
[17] Zhilu Zhang and Mert R Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. arXiv preprint arXiv:1805.07836, 2018.
|
| 186 |
+
[18] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017.
|
| 187 |
+
[19] Matthias Minderer, Olivier Bachem, N. Houlsby, and M. Tschannen. Automatic shortcut removal for self-supervised representation learning. In ICML, 2020.
|
| 188 |
+
[20] Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. In ICLR, 2021.
|
| 189 |
+
[21] Hsin-Ying Lee, Hung-Yu Tseng, Jia-Bin Huang, Maneesh Kumar Singh, and Ming-Hsuan Yang. Diverse image-to-image translation via disentangled representations. In European Conference on Computer Vision, 2018.
|
| 190 |
+
[22] Xun Huang, Ming-Yu Liu, Serge Belongie, and Jan Kautz. Multimodal unsupervised image-to-image translation. In ECCV, 2018.
|
| 191 |
+
[23] Taesung Park, Jun-Yan Zhu, Oliver Wang, Jingwan Lu, Eli Shechtman, Alexei A. Efros, and Richard Zhang. Swapping autoencoder for deep image manipulation. In Advances in Neural Information Processing Systems, 2020.
|
| 192 |
+
[24] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 193 |
+
[25] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, 2019.
|
| 194 |
+
[26] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9:2579–2605, 2008.
|
| 195 |
+
[27] Enzo Tartaglione, Carlo Alberto Barbano, and Marco Grangetto. End: Entangling and disentangling deep representations for bias correction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 13508–13517, June 2021.
|
| 196 |
+
[28] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2019.
|
| 197 |
+
[29] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
md/train/1-j4VLSHApJ/1-j4VLSHApJ.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARN2WEIGHT: WEIGHTS TRANSFER DEFENSE AGAINST SIMILAR-DOMAIN ADVERSARIAL ATTACKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent work in black-box adversarial attacks for NLP systems has attracted attention. Prior black-box attacks assume that attackers can observe output labels from target models based on selected inputs. In this work, inspired by adversarial transferability, we propose a new type of black-box NLP adversarial attack that an attacker can choose a similar domain and transfer the adversarial examples to the target domain and cause poor performance in target model. Based on domain adaptation theory, we then propose a defensive strategy, called Learn2Weight, which trains to predict the weight adjustments for target model in order to defense the attack of similar-domain adversarial examples. Using Amazon multi-domain sentiment classification dataset, we empirically show that Learn2Weight model is effective against the attack compared to standard black-box defense methods such as adversarial training and defense distillation. This work contributes to the growing literature on machine learning safety.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
As machine learning models are applied to more and more real-world tasks, addressing machine learning safety is becoming an increasingly pressing issue. Deep learning algorithms have been shown to be vulnerable to adversarial examples (Szegedy et al., 2013; Goodfellow et al., 2014; Papernot et al., 2016a). In particular, prior black-box adversarial attacks assume that the adversary is not aware of the target model architecture, parameters or training data, but is capable of querying the target model with supplied inputs and obtaining the output predictions. The phenomenon that adversarial examples generated from one model may also be adversarial to another model is known as adversarial transferability (Szegedy et al., 2013).
|
| 12 |
+
|
| 13 |
+
Motivated by adversarial transferability, we conjecture another black-box attack pipeline where the adversary does not even need to have access to the target model nor query labels from crafted inputs. Instead, as long as the adversary knows the task of the target, he can choose a similar domain, to build a substitute model and then attack the target model with adversarial examples that are generated from the attack domain.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Diagrammatic representation of the problem
|
| 17 |
+
|
| 18 |
+
(a) Generalized architecture of similarity-based attacks.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
(b) Flow of how an adversary physician can leverage similarity attack to fool opioid risk models.
|
| 23 |
+
|
| 24 |
+
The similar-domain adversarial attack may be more practical than prior blackbox attacks as label querying from target model is not needed. This attack can be illustrated with the following example (Figure 1b) in medical insurance fraud (Finlayson et al., 2019). Insurance companies may use hypothetical opioid risk models to classify the likelihood (high/low) of a patient to abuse the opioids to be prescribed, based on the patient’s medical history as text input. Physicians can run the original patient history through the attack pipeline to generate an adversarial patient history, where the original is more likely to be rejected (”High” risk) and the adversarial is more likely to be accepted (”Low” risk). Perturbations in patient history could be, for example, a slight perturbation from ”alcohol abuse” to ”alcohol dependence”, and it may successfully fool the insurance company’s model.
|
| 25 |
+
|
| 26 |
+
Based on domain adaption theory (Ben-David et al., 2010), we conjecture that it is the domain-variant features that cause the success of the similar-domain attack. The adversarial examples with domainvariant features are likely to reside in the low-density regions (far away from decision boundary) of the empirical distribution of the target training data which could fool the target model (Zhang et al., 2019b). Literature indicates that worsened generalizability is a tradeoff faced by existing defenses such as adversarial training (Raghunathan et al., 2019) and domain generalization techniques (Wang et al., 2019). In trying to increase robustness against adversarial inputs, a model faces a tradeoff of weakened accuracy towards clean inputs. Given that an adversarial training loss function is composed of a loss against clean inputs and loss against adversarial inputs, improper optimization where the latter is highly-optimized and the former weakly-optimized does not improve general performance in the real-world. To curb this issue, methods have been proposed (Zhang et al., 2019b; Lamb et al., 2019; Schmidt et al., 2018), such as factoring in under-represented data points in training set.
|
| 27 |
+
|
| 28 |
+
To defend against this similar-domain adversarial attack, we propose a weight transfer network approach, Learn2Weight, so that the target model’s decision boundary can adapt to the examples from low-density regions. Experiments confirm the effectiveness of our approach against the similardomain attack over other baseline defense methods. Moreover, our approach is able to improve robustness accuracy without losing the target model’s standard generalization accuracy.
|
| 29 |
+
|
| 30 |
+
Our contribution can be summarized as follows:
|
| 31 |
+
|
| 32 |
+
• We are among the first to propose the similar-domain adversarial attack. This attack pipeline relaxes the previous black-box attack assumption that the adversary has access to the target model and can query the model with crafted examples.
|
| 33 |
+
• We propose a defensive strategy for this attack based on domain adaptation theory. Experiment results show the effectiveness of our approach over existing defense methods, against the similar-domain attack.
|
| 34 |
+
|
| 35 |
+
Recent work in adversarial attack for NLP systems has attracted attention. See (Zhang et al., 2020) survey for an overview of the adversarial attack in NLP. Existing research proposes different attack methods for generating adversarial text examples (Moosavi-Dezfooli et al., 2016; Ebrahimi et al., 2018; Wallace et al., 2019). The crafted adversarial text examples have been shown to fool the state-of-the-art NLP systems such as BERT (Jin et al., 2019). A large body of adversarial attack research focuses on black-box attack where the adversary builds a substitute model by querying the target model with supplied inputs and obtaining the output predictions. The key idea behind such black-box attack is that adversarial examples generated from one model may also be mis-classified by another model, which is known as adversarial transferability (Szegedy et al., 2013; Cheng et al., 2019). While prior work examines the transferability between different models trained over the same dataset, or the transferability between the same or different model trained over disjoint subsets of a dataset, our work examines the adversarial transferability between different domains, which we call similar-domain attack.
|
| 36 |
+
|
| 37 |
+
Table 1: Comparison of attack domain sentences correctly classified when unperturbed by respective attack domain models and target domain models, then misclassified after perturbation by target models trained on books and baby domain. The perturbations are in blue, and prediction confidence in brackets.
|
| 38 |
+
|
| 39 |
+
<table><tr><td colspan="3">Attack domain:baby,Target domain:books</td></tr><tr><td>Original sentence (Actual label: Pos)</td><td>I purchased this toy for my sonwhen he was 4 monthsold.At first,he seemed a little intimidated by the toys.</td><td>Pos (0.712)</td></tr><tr><td>Adversarial sentence</td><td>I obtained this toys for my children when he was 4 weeks senior. At first, he hoped a modest harassed by the toy.</td><td>Neg (0.364)</td></tr><tr><td>Original sentence (Actual label: Pos)</td><td>It felt like a big commitment for me to have to run the program 2 times a day, and near the end of my pregnancy I was annoyed with having anything strapped across my belly.</td><td>Pos (0.825)</td></tr><tr><td>Adversarial sentence</td><td>It felt like a big committed for me to have to run the program 2 length a day, and near the end of my pregnancy Iwas annoyed with takes anything strapped acrossmy belly.</td><td>Neg (0.420)</td></tr><tr><td colspan="3">Attack domain: dvd, Target domain: baby</td></tr><tr><td>Original sentence (Actual label: Pos)</td><td>Fast times at ridgemont high is a clever, insightful,and wicked film! It is not just another teen movie.</td><td>Pos (0.614)</td></tr><tr><td>Adversarial sentence</td><td>Sooner days at ridgemont high is a sane, thoughtful, and wicked flick! It is not just another adolescent flick.</td><td>Neg (0.335)</td></tr><tr><td>Original sentence</td><td>This dvd gives a very good 6O minute workout.As others have pointed out the</td><td>Pos (0.647)</td></tr><tr><td>(Actual label: Pos) Adversarial sentence</td><td>cardio is very dancy. The first time I did it,I felt a bit awkward with the steps. This dvd gives a awfully okay 6O minute exercise. As others have pointed out the cardio is very dancy. The first time I did it, I perceived a bit awkward with the steps.</td><td>Neg (0.258)</td></tr></table>
|
| 40 |
+
|
| 41 |
+
# 3 SIMILAR-DOMAIN ADVERSARIAL ATTACK
|
| 42 |
+
|
| 43 |
+
# 3.1 ADVERSARIAL ATTACK BACKGROUND
|
| 44 |
+
|
| 45 |
+
Adversarial attacks modify inputs to cause errors in machine learning inference (Szegedy et al., 2013). We utilize the basic gradient-based attack method Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) and its variants, RAND-FGSM (Tramer et al., 2017) and \` Basic Iterative Method (BIM) (Kurakin et al., 2016a;b; Xie et al., 2018). Other NLP adversarial generation algorithms could also be used, such as DeepFool (Moosavi-Dezfooli et al., 2016), HotFlip (Ebrahimi et al., 2018), universal adversarial trigger (Wallace et al., 2019), and TextFooler (Jin et al., 2019). To perform gradient-based perturbations upon discrete space data, we follow (Yang et al., 2018) to generate adversarial text.
|
| 46 |
+
|
| 47 |
+
Our proposed similar-domain adversarial attack is in-variant to adversarial algorithm, meaning that the adversarial algorithm used would not affect the attack performance. Without losing generality, we denote $A d v ( f , x )$ as an NLP adversarial text generation method, defined as below.
|
| 48 |
+
|
| 49 |
+
Definition 1. NLP Adversarial Generation. Given a deep neural network model $f$ built on text data $X$ , an NLP adversarial generation method produces one adversarial instances $x ^ { \prime } A d v ( f , x )$ for $x \in X$ , $x ^ { \prime } \approx x$ . The goal of the adversarial attack is to deviate the label to incorrect one $f ( x ^ { \prime } ) \neq f ( x )$
|
| 50 |
+
|
| 51 |
+
# 3.2 SIMILAR-DOMAIN ADVERSARIAL ATTACK
|
| 52 |
+
|
| 53 |
+
We present the architecture of similar-domain adversarial attack in Figure 1a. The defender, the target of the attack, constructs a target model trained on domain text data $T$ (0). An attacker, only having a rough idea about the target’s task but lacking direct access to the target data or target model parameters, collects attack data from a similar domain $S$ and trains an attack model (1). He runs the attack model on the test data (2) to obtain correctly-classified instances (3). He chooses an adversarial attack algorithm and generates a set of adversarial samples $A$ (4). He exposes $A$ to the target model, hoping $A$ mislead the target model to produce an output of his choice (5). This type of attack works best as an adversarial attack that compromises systems that base decision-making on one-instance.
|
| 54 |
+
|
| 55 |
+
Definition 2. Similar-domain Adversarial Attack. A target model $f$ , built on target domain data $T$ , is a deep neural network model with parameter weights $W _ { T }$ that maps a text instance to a label: $y f ( X , W _ { T } )$ . An adversary chooses a source attack domain $S$ , builds a substitute model $f _ { S }$ , and generates a set of adversarial examples $A$ from $S$ using $A d v ( f _ { S } , S )$ , so that during an attack $f ( A , W _ { T } ) = f _ { S } ( A )$ .
|
| 56 |
+
|
| 57 |
+
Table 2: Similar-domain attack performance. Bold indicates the least successful attack domain (i.e. highest after-attack accuracy) for each target domain, as well as the corresponding transfer loss value.
|
| 58 |
+
|
| 59 |
+
<table><tr><td>Target Domain</td><td colspan="3">book</td><td colspan="3">magazine</td><td colspan="3">baby</td></tr><tr><td>Original Accuracy Intra-attack Accuracy</td><td colspan="3">0.880</td><td colspan="3">0.960</td><td colspan="3">0.890</td></tr><tr><td></td><td></td><td>0.525</td><td></td><td></td><td>0.570</td><td></td><td></td><td>0.632</td><td></td></tr><tr><td>Attack Domain</td><td>magazine</td><td>baby</td><td>dvd</td><td>baby</td><td>dvd</td><td>book</td><td>dvd</td><td>book</td><td>magazine</td></tr><tr><td>Unperturbed Accuracy</td><td>0.726</td><td>0.646</td><td>0.745</td><td>0.739</td><td>0.663</td><td>0.673</td><td>0.624</td><td>0.652</td><td>0.665</td></tr><tr><td>After-attack Accuracy</td><td>0.398</td><td>0.421</td><td>0.395</td><td>0.381</td><td>0.366</td><td>0.343</td><td>0.365</td><td>0.386</td><td>0.401</td></tr><tr><td>Shared Vocab</td><td>0.381</td><td>0.255</td><td>0.455</td><td>0.260</td><td>0.345</td><td>0.381</td><td>0.270</td><td>0.255</td><td>0.260</td></tr><tr><td>Transfer Loss</td><td>0.017</td><td>0.071</td><td>0.000</td><td>0.079</td><td>0.022</td><td>0.010</td><td>0.066</td><td>0.050</td><td>0.069</td></tr></table>
|
| 60 |
+
|
| 61 |
+
# 3.3 DOMAIN SIMILARITY
|
| 62 |
+
|
| 63 |
+
Here, domain similarity refers to the similarity between attacker’s chosen domain and defender’s domain. SharedVocab measures the overlap of unique words, in each of the datasets; a higher degree of overlapping vocabulary implies the two domains are more similar. We also use Transfer Loss, a standard metric for domain adaptation Blitzer et al. (2007); Glorot et al. (2011), to measure domain similarity; lower loss indicates higher similarity. The test error from a target model trained on target domain $T$ and evaluated on attack domain $S$ returns transfer error $e ( S , T )$ . The baseline error $e ( T , T )$ term is the test error obtained from target model trained on target domain (train) data $T$ and tested on target domain (evaluation) data $T$ . This computes the transfer loss, $t f ( S , T ) = e ( S , T ) - e ( T , T )$ .
|
| 64 |
+
|
| 65 |
+
# 4 IS THE ATTACK EFFECTIVE?
|
| 66 |
+
|
| 67 |
+
# 4.1 SETUP
|
| 68 |
+
|
| 69 |
+
Dataset. We simulate the similar-domain adversarial attack using Amazon’s multi-domain sentiment classification dataset (Blitzer et al., 2007), a commonly-used dataset in cross-domain sentiment classification1, with 1,000 positive and 1,000 negative reviews for each of the 25 product categories.
|
| 70 |
+
|
| 71 |
+
Model. In practice, there could be unlimited choice for the attack model and target model, such as different deep learning architecture, different training parameters. To simplify the discussion, we choose Long Short-Term Memory (LSTM) network as a suitable baseline sentiment classification model (Wang et al., 2018) for our target model and attack model. The architecture consists of 64 LSTM cells, $80 \%$ dropout, using a sigmoid activation function.
|
| 72 |
+
|
| 73 |
+
Metrics. We first report the accuracy of the target models on the target domain test samples before the attack as the original accuracy. Then we measure the accuracy of the target models against adversarial samples crafted from the attack domain samples, denoted as the after-attack accuracy. Intra-attack accuracy denotes the after-attack accuracy where the attack domain is identical to the target domain. By comparing original and after-attack accuracy, we can evaluate the success of the attack. The greater the gap between the original and after-attack accuracy, the more successful the attack. Unperturbed accuracy measures the accuracy of the target model against the complete, unperturbed test set of the attack domain, to demonstrate that any drop in classification accuracy is not from domain shift alone but from adversarial transferability.
|
| 74 |
+
|
| 75 |
+
# 4.2 RESULTS
|
| 76 |
+
|
| 77 |
+
The similar-domain adversarial attack results are presented in Table 2. We see a significant gap between original accuracy and after-attack accuracy indicating that this attack can impose valid threat to a target NLP system. After the similar-domain adversarial attack, the accuracy drops dramatically by a large margin. Take the book target domain for example, when the attack domain is magazine, the after-attack accuracy drops to 0.398, and when the attack domain is baby, the accuracy is 0.421. Moreover, we observe a positive correlation between transfer loss and after-attack accuracy, and a negative correlation between shared vocab and after-attack accuracy.
|
| 78 |
+
|
| 79 |
+
# 5 DEFENDING AGAINST SIMILAR-DOMAIN ADVERSARIAL ATTACK
|
| 80 |
+
|
| 81 |
+
In order to defend against a similarity based adversarial attack, it is critical to block adversarial transferability. Adversarial training is the most intuitive yet effective defense strategy for adversarial attack (Goodfellow et al., 2014; Madry et al., 2017). However, this may not be effective for two reasons. First, there is no formal guidance for generating similar-domain adversarial examples because the defender has no idea what the attack data domain is. Second, simple feeding the target model with adversarial examples may even hurt the generalization of the target model (Raghunathan et al., 2019; Zhang et al., 2019a; Su et al., 2018), which is also confirmed in our experiments.
|
| 82 |
+
|
| 83 |
+
# 5.1 WEIGHT TRANSFER LEARNING
|
| 84 |
+
|
| 85 |
+
The use of weight transfer networks (Ha et al., 2016; Hu et al., 2018; Kuen et al., 2019) is concerned with adapting weights from one model into another, and generating/predicting the complete set of weights for a model given the input samples. In our context, distinctly different weights are produced for target models trained on inputs of different domains, and feature transferability (Yosinski et al., 2014) in the input space can be expected to translate to weight transferability in the model weights space. Rather than completely regenerating classification weights, our model robustification defense, Learn2Weight L2W predicts the perturbation to existing weights $\left( W ^ { \prime } = W + \Delta W \right)$ ) for each new instance.
|
| 86 |
+
|
| 87 |
+
# 5.2 LEARN2WEIGHT MODEL
|
| 88 |
+
|
| 89 |
+
We conjecture that an effective defense strategy is to perturb the target model weights depending on the feature distribution of the input instance. $L 2 W$ (Algorithm 1) recalculates the target model weights depending on the input. $L 2 W$ (Algorithm 2) trains on sentences from different domains and a weight differential for that domain (the weight adjustment required to tune the target model’s weights to adapt to the input’s domain). We obtain the weight differential $\Delta W$ by finding the difference between the weights of $f$ trained on sentence:label pairs from a specific domain $W _ { S _ { j } }$ and weights of $f$ trained on sentence:label pairs from the target domain $W _ { T }$ . Other training models may be possible; here we trained a sequence-to-sequence network (Sutskever et al., 2014) on sentence: $\Delta W$ pairs.
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Algorithm 1: Learn2Weight: Inference</td><td>Algorithm 2: Learn2Weight:Training</td></tr><tr><td>inference (Xadv, L2W(.), f(Wr,T)) Input:Passed arguments include the adversarial input Xadu, the Learn2Weight model L2W(-),and the target model f(Wr,T) Output :Target model with weighted</td><td>train (T,D) Input :Target domain T={Ti}0; Set of M domains D={S,j)j; withNsentences, N,M i indexing specific sentence tensor and j indexing specific domains Output :Trained Learn2Weight model L2W(·)</td></tr><tr><td>updated byLearn2Weight f(W*,T) is the expected output Pass Xadu as in input into the trained L2W(-) function,and the weight differential required for the target model with weights Wr is△W.</td><td>Initialize empty X and Y to store sentences Xi from each domain j with corresponding weight differential. X←;Y←; Compute weights of f trained on T. Wr ← f(T);</td></tr><tr><td>△W ← L2W(Xadv); The returned function is the target model with updated weights Wr+△W. return f(Wr +△W,T);</td><td>X←T;Y←WT-Wr; Train each domain Sj,compute respective weights, append the differential △W to Y and each sentence in Si,j into X. foreach domain Sj ∈D do Ws,← f(Sj); △W ←Wsj-Wr;</td></tr></table>
|
| 92 |
+
|
| 93 |
+
# Algorithm 3: tf-optimization
|
| 94 |
+
|
| 95 |
+
tfOptimization $( T , M , n _ { m a x } )$
|
| 96 |
+
|
| 97 |
+
Input :Target domain $T = \{ T _ { i } \} _ { i = 0 } ^ { N }$ to be used in synthesizing $M$ similar domains; with $N$ sentences, $i$ indexing specific sentence tensor; $n _ { m a x }$ is the max number of tf-optimization iterations
|
| 98 |
+
Output :Set $D$ containing $M$ domains
|
| 99 |
+
Initialize empty $D$ to store synthesized domains $S _ { j }$ of index $j$ .
|
| 100 |
+
$D \gets \emptyset ; j \gets 0$ ;
|
| 101 |
+
while $j < M$ do Run each iteration until $n _ { m a x }$ . for iter $ 0$ to $n _ { m a x }$ do Apply adversarial perturbations to $T$ . $T _ { i t e r } ^ { \hat { a } \hat { d } v } \gets A d v ( f , \hat { T } )$ ; Determine change to $A d v ( \cdot )$ or iter depending on computed transfer loss. if $c h e c k ( t f ( T _ { i t e r } ^ { a d v } , T ) ) \gets T r u e$ then If low enough, $T _ { i t e r } ^ { a d v }$ can be added as synthetic domain into $D$ . $D \gets T _ { i t e r } ^ { a d v }$ ; break; else Adjust perturbation parameters. $A d v ( \cdot ) a d j u s t ( A d v ( \cdot ) )$ ; $j \gets j + 1$ ; Return set of Domains to be used for training by $L 2 W$ .
|
| 102 |
+
return $D$ ;
|
| 103 |
+
|
| 104 |
+
# 5.3 TRANSFER LOSS OPTIMIZATION
|
| 105 |
+
|
| 106 |
+
To generate synthetic domains of varying domain similarity so that defenders defend their model using only target domain data $T$ , the following equation introduces transfer loss optimization (Algorithm 3). The defender iteratively generates adversarial examples $X _ { N } ^ { a d v }$ while maximizing the transfer loss function $t f$ ; this produces a substitute attack domain corpora $S _ { j }$ . We iteratively adjust perturbation parameters $A d v ( \cdot )$ and iteration count $N$ to minimize the transfer loss of our generated dataset.
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\underset { N , A d v ( \cdot ) } { \arg \operatorname* { m i n } } t f _ { N } \Bigl ( X _ { N } ^ { a d v } , T \Bigr ) = e \Bigl ( A d v ( f , T ) , T \Bigr ) - e \Bigl ( T , T \Bigr )
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
# 5.4 EXPLANATION: BLOCKING TRANSFERABILITY
|
| 113 |
+
|
| 114 |
+
To facilitate our explanation, we adapt from domain adaptation literature (Ben-David et al., 2010; Liu et al., 2019; Zhang et al., $2 0 1 9 \mathrm { c }$ ):
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
e ( A , T ) \leq e ( T , T ) + d _ { \mathcal { H } \Delta \mathcal { H } } ( A , T ) + \lambda
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where $\mathcal { H }$ is the hypothesis space, $h$ is a hypothesis function that returns labels $\{ 0 , 1 \}$ , and $e ( T , T )$ and $e ( A , T )$ are the generalization errors from passing target domain data $T$ and adversarial data $A$ through a classifier trained on $T$ . $d _ { \mathcal { H } \Delta \mathcal { H } } ( A , T )$ is the $\mathcal { H } \Delta \bar { \mathcal { H } }$ -distance between $T$ and $A$ , and measures the divergence between the feature distributions of $A$ and $T$ . $e _ { A } ( h , h ^ { ' } )$ and $e _ { T } ( h , h ^ { ' } )$ represents the probability that $h$ disagrees with $h ^ { ' }$ on the label of an input in the domain space $A$ and $T$ respectively.
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r } { d _ { \mathcal { H } \Delta \mathcal { H } } ( A , T ) = \underset { h , h ^ { \prime } \in \mathcal { H } } { \operatorname* { s u p } } | e _ { A } ( h , h ^ { ' } ) - e _ { T } ( h , h ^ { ' } ) | } \\ { d _ { \mathcal { H } \Delta \mathcal { H } } ( A , T ) = \operatorname* { s u p } _ { h , h ^ { \prime } \in \mathcal { H } } | \mathbb { E } _ { X \sim S } [ | ( h ( x ) - h ^ { ' } ( x ) | ] | } \\ { - | \mathbb { E } _ { X \sim T } [ | ( h ( x ) - h ^ { ' } ( x ) | ] | | } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
Divergence $d _ { \mathcal { H } \Delta \mathcal { H } }$ measures the divergence between feature distributions $A$ and $T$ . Higher $d _ { \mathcal { H } \Delta \mathcal { H } }$ indicates less shared features between 2 domains. The greater the intersection between feature distributions, the greater the proportion of domain-variant features; one approach to domain adaptation is learning domain-invariant features representations (Zhao et al., 2019) to minimize $d _ { \mathcal { H } \Delta \mathcal { H } }$ .
|
| 127 |
+
|
| 128 |
+
Table 3: After-defense accuracy performance of different defensive methods.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Target Domain</td><td colspan="3">magazine</td><td colspan="3">baby</td></tr><tr><td>Attack Domain</td><td>baby</td><td>dvd</td><td>book</td><td>dvd</td><td>book</td><td>magazine</td></tr><tr><td>After-attack Accuracy</td><td>0.381</td><td>0.366</td><td>0.343</td><td>0.365</td><td>0.386</td><td>0.401</td></tr><tr><td>After-defense Accuracy</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Adversarial training</td><td>0.639</td><td>0.559</td><td>0.657</td><td>0.558</td><td>0.577</td><td>0.661</td></tr><tr><td>Defensive distillation</td><td>0.549</td><td>0.561</td><td>0.597</td><td>0.588</td><td>0.629</td><td>0.577</td></tr><tr><td>SharedVocab defense</td><td>0.628</td><td>0.653</td><td>0.631</td><td>0.664</td><td>0.668</td><td>0.621</td></tr><tr><td>Domain-adapted adversarial training</td><td>0.608</td><td>0.637</td><td>0.620</td><td>0.604</td><td>0.620</td><td>0.587</td></tr><tr><td>Learn2Weight</td><td>0.796</td><td>0.842</td><td>0.843</td><td>0.774</td><td>0.751</td><td>0.737</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Explaining similarity-domain attacks. As demonstrated by empirical results, $e ( A , T )$ increases in a similarity-based attack setting, and this would arise if $d _ { \mathcal { H } \Delta \mathcal { H } }$ increases correspondingly. $d _ { \mathcal { H } \Delta \mathcal { H } }$ computes inconsistent labels from inconsistent feature distributions, and attributes the success of the attack to domain-variant features.
|
| 133 |
+
|
| 134 |
+
FGSM and variants adjust the input data to maximize the loss based on the backpropagated gradients of a model trained on $S$ . As our pipeline used correctly-labelled sentences before adversarially perturbing them, we can infer that perturbations applied to $S$ were not class-dependent (i.e. the success of the attack is not based on the removal of class-specific features), but class-independent features. It is already difficult for a model trained on $S$ to classify when there is insufficient classdependent features (hence a high $t f ( A , T ) )$ ; in a cross-domain setting, it must be even more difficult for a model trained on $T$ to classify given a shortage of domain-invariant, class-dependent features.
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array} { c } { { d _ { { \mathcal { H } } \Delta { \mathcal { H } } } \leq e ( A , T ) - e ( T , T ) - \lambda } } \\ { { d _ { { \mathcal { H } } \Delta { \mathcal { H } } } \leq t f ( A , T ) - \lambda } } \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Explaining Learn2Weight. $L 2 W$ minimizes divergence by training on $\{ d _ { \mathcal { H } \Delta \mathcal { H } } ( S _ { j } , T ) : \Delta W _ { A . S _ { j } } \}$ pairs, $d _ { \mathcal { H } \Delta \mathcal { H } } ( S _ { j } , T )$ being reconstructed from the difference between S $x _ { i } ^ { S _ { j } }$ and $x _ { i } ^ { T }$ . $L 2 W$ is trained on $\{ d _ { \mathcal { H } \Delta \mathcal { H } } ^ { S _ { j } } \} _ { j = 0 } ^ { N } : \{ \Delta W ^ { S _ { j } } \} _ { j = 0 } ^ { N }$ pairs, such that . Intuitively the target model possesses a decision boundary (Liu et al., 2019) to classify inputs based on whether they cross the boundary or not; adversarial inputs have a tendency of being near the boundary and fooling it. Weights transfer learning applies perturbations to the decision boundary such that the boundary covers certain adversarial inputs otherwise misclassified, and in this way blocks transferability. The advantage of training on multiple domains $\{ S _ { j } \} _ { j = 0 } ^ { M }$ is that the after- $. L 2 W$ divergence between $A$ and $T$ is smaller because $L 2 W$ ’s weight perturbations render the decision boundary more precise in classifying inputs.
|
| 141 |
+
|
| 142 |
+
Explaining tf-optimization. We have attributed why adversarial sentences $A$ are computed to be domain-dissimilar despite originating from $S$ due to insufficient domain-invariant, class-dependent features resulting in low $e ( A , T )$ , i.e. low $t f ( A , T )$ . To replicate this phenomenon in natural domains, we use $t f$ -optimization to iteratively perturb $T$ to increase the proportion of class-independent features. This approximates the real-world similarity-based attack scenario where class-dependent features may be limited for inference. By generating the synthetic data, we are feeding $L 2 W$ attack data with variations in $d _ { \mathcal { H } \Delta \mathcal { H } }$ and class-independent feature distributions. This prepares $L 2 W$ to robustify weights in $f ( T )$ when such feature distributions are encountered.
|
| 143 |
+
|
| 144 |
+
# 6 EXPERIMENTS
|
| 145 |
+
|
| 146 |
+
# 6.1 BASELINES
|
| 147 |
+
|
| 148 |
+
We consider two defense strategies that are empirically effective and are widely used for general black-box adversarial attacks: adversarial training (Goodfellow et al., 2014; Madry et al., 2017) and defensive distillation (Papernot et al., 2016b; 2017). In addition we consider two ablation baselines.
|
| 149 |
+
|
| 150 |
+
Defensive distillation: The high-level implementation of defensive distillation (Papernot et al., 2016b; 2017) is to first train an initial model against target domain inputs and labels, and retrieve the raw class probability scores. The predicted probability values would be used as the new labels for the same target sentences, and we would train a new model based on this new label-sentence pair.
|
| 151 |
+
|
| 152 |
+
Table 4: Learn2Weight comparison against different attack model architectures.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Target</td><td>Original</td><td>Attack</td><td colspan="4">Attack Model After-attack Accuracy</td><td colspan="6">After-Defense Accuracy</td></tr><tr><td>Domain</td><td>Accuracy Target Model: LSTM</td><td>Domain</td><td colspan="4"></td><td colspan="4">LogReg</td><td>CNN</td><td>LogReg</td></tr><tr><td colspan="4"></td><td colspan="4">BERT LSTM</td><td colspan="4">BERT LSTM</td></tr><tr><td rowspan="3">book</td><td rowspan="3">0.880</td><td>dvd</td><td>0.342</td><td>0.413</td><td>GRU 0.477</td><td>CNN 0.335</td><td>0.440</td><td>0.786</td><td>0.847</td><td>0.804</td><td>0.816</td><td>0.782</td></tr><tr><td>kitchenware</td><td>0.350</td><td>0.372</td><td>0.325</td><td>0.353</td><td>0.425</td><td>0.765</td><td>0.826</td><td>0.795</td><td>0.742</td><td>0.767</td></tr><tr><td>electronics</td><td>0.400</td><td>0.389</td><td>0.416</td><td>0.315</td><td>0.460</td><td>0.792</td><td>0.812</td><td>0.784</td><td>0.770</td><td>0.725</td></tr><tr><td rowspan="3">dvd</td><td rowspan="3">0.920</td><td></td><td>0.326</td><td>0.434</td><td>0.479</td><td>0.383</td><td>0.490</td><td>0.816</td><td>0.795</td><td>0.824</td><td>0.804</td><td>0.794</td></tr><tr><td>book kitchenware</td><td>0.355</td><td>0.370</td><td>0.379</td><td>0.359</td><td>0.490</td><td>0.728</td><td>0.796</td><td>0.755</td><td>0.735</td><td>0.695</td></tr><tr><td>electronics</td><td>0.387</td><td>0.377</td><td>0.332</td><td>0.348</td><td>0.455</td><td>0.825</td><td>0.836</td><td>0.812</td><td>0.834</td><td>0.796</td></tr><tr><td rowspan="3">electronics</td><td rowspan="3">0.910</td><td>book</td><td>0.425</td><td>0.394</td><td>0.473</td><td>0.358</td><td>0.474</td><td>0.775</td><td>0.821</td><td>0.795</td><td>0.782</td><td>0.712</td></tr><tr><td>dvd</td><td>0.342</td><td>0.395</td><td>0.452</td><td>0.368</td><td>0.493</td><td>0.784</td><td>0.845</td><td>0.855</td><td>0.842</td><td>0.792</td></tr><tr><td>kitchenware</td><td>0.390</td><td>0.384</td><td>0.464</td><td>0.329</td><td>0.432</td><td>0.730</td><td>0.824</td><td>0.753</td><td>0.724</td><td>0.678</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Adversarial training: It is shown that injecting adversarial examples throughout training increases the robustness of target neural network models. In this baseline, target model is trained with both original training data and adversarial examples generated from original training data. However, since the adversarial examples are still generated from the target domain, it is unlikely that the method can defend similar-domain attack which is the result of domain-variant features.
|
| 157 |
+
|
| 158 |
+
SharedVocab defense. Given that it is the domain-variant features that cause the success of similardomain attack, a simple baseline is to remove those words that are not in the target domain’s vocabulary. This tests whether the effect of perturbing target model weights w.r.t domain-variant features will yield incremental after-attack accuracy in the similar-domain attack setting.
|
| 159 |
+
|
| 160 |
+
Domain-adapted adversarial training. This ablation baseline tests for incremental performance to a baseline defense using domain-variant inputs. We adapt adversarial training to be trained on adversarial sentences from attack domain $S$ , whereas the traditional adversarial training generates adversarial samples $X ^ { a d v , T }$ from its training data $T$ , this adapted version uses adversarial samples $X ^ { a d v , S }$ generated from $S$ .
|
| 161 |
+
|
| 162 |
+
# 6.2 LEARN2WEIGHT PERFORMANCE
|
| 163 |
+
|
| 164 |
+
Defense performance. We present the results of different defense baselines in Table 3. First, we can see that Learn2Weight achieves the highest after-defense accuracy against the adversarial attack. Take the magazine as target domain for example, if the adversary chooses to use book data as the attack domain, it would reduce the target model accuracy to 0.343. However, the Learn2Weight method can improve the performance to 0.843, which is a significant and substantial improvement against the attack. This improvements also exist across different target/attack domain pairs. Second, we see that all defense methods can improve the accuracy to some extent which indicates the importance and effectiveness of having robust training for machine learning models. Third, it is interesting to note that two simple baselines SharedVocab defense and Domain-adapted adversarial training yield overall better performance compared to adversarial training and defensive distillation.
|
| 165 |
+
|
| 166 |
+
Attack model architectures. So far, all the results are conducted using the same LSTM as the target/attack model due to simplicity purpose. Here, we keep the target model unchanged, but vary the architecture of the attack model for the generation of adversarial examples. A variation of a Recurrent Neural Network is a Gated Recurrent Unit (GRU) network, with 512 GRU cells, $60 \%$ dropout and tanh activation function. We have also tested other attack model variants that are commonly-used in sentiment classification, including Bidirectional Encoder Representations from Transformers (BERT) (Devlin et al., 2019), Convolutional Neural Network (CNN) (Kim, 2014), and Logistic Regression (Maas et al., 2011). For both RNN and CNN, we use pre-computed Glove embeddings2 to encode words. All models are trained with enough epochs after ensuring the model achieved near state-of-the-art validation accuracy before proceeding to tests of adversarial attacks and defenses.
|
| 167 |
+
|
| 168 |
+
We present the results of different attack model architectures in Table 4. First, similar-domain attack is model-agnostic and it does not require the target and attack model to have identical architectures.
|
| 169 |
+
|
| 170 |
+
We can see that all four attack model architectures are able to reduce the target model accuracy. Second, the results suggest that Learn2Weight is also model-agnostic as it can substantially improve the after-defense accuracy regardless which attack model is used.
|
| 171 |
+
|
| 172 |
+
# 7 CONCLUSION
|
| 173 |
+
|
| 174 |
+
In this newly-proposed, empirically-effective similar-domain attack, an adversary can choose a similar domain to the target task, build a substitute model and produce adversarial examples to fool the target model. We also propose a defense strategy, Learn2Weight, that learns to adapt the target model’s weight using crafted adversarial examples. Compared with other adversarial defense strategies, Learn2Weight can improve the target model robustness against the similar-domain attack. Our method demonstrates properties of a good adversarial defense, such as adopting defense architectures that adapt to situations/inputs rather than compromising standard error versus robustness error, to leverage class-independent properties in domain-variant text, and factoring in domain similarity in adversarial robustness exercises.
|
| 175 |
+
|
| 176 |
+
# REFERENCES
|
| 177 |
+
|
| 178 |
+
Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Vaughan. A theory of learning from different domains. Machine Learning, 79:151–175, 2010. URL http://www.springerlink.com/content/q6qk230685577n52/.
|
| 179 |
+
|
| 180 |
+
John Blitzer, Mark Dredze, and Fernando Pereira. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In ACL, pp. 440–447, 2007.
|
| 181 |
+
|
| 182 |
+
Shuyu Cheng, Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Improving black-box adversarial attacks with a transfer-based prior. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alche-Buc, E. Fox, and R. Garnett (eds.), ´ Advances in Neural Information Processing Systems 32, pp. 10934–10944. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/ 9275-improving-black-box-adversarial-attacks-with-a-transfer-based-prior. pdf.
|
| 183 |
+
|
| 184 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https: //www.aclweb.org/anthology/N19-1423.
|
| 185 |
+
|
| 186 |
+
Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. Hotflip: White-box adversarial examples for text classification. In ACL, pp. 31–36, 2018.
|
| 187 |
+
|
| 188 |
+
Samuel G. Finlayson, John D. Bowers, Joichi Ito, Jonathan L. Zittrain, Andrew L. Beam, and Isaac S. Kohane. Adversarial attacks on medical machine learning. Science, 363(6433):1287–1289, 2019. ISSN 0036-8075. doi: 10.1126/science.aaw4399. URL https://science.sciencemag.org/ content/363/6433/1287.
|
| 189 |
+
|
| 190 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In ICML, pp. 513–520, 2011.
|
| 191 |
+
|
| 192 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 193 |
+
|
| 194 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 195 |
+
|
| 196 |
+
Ronghang Hu, Piotr Dollar, Kaiming He, Trevor Darrell, and Ross Girshick. Learning to segment ´ every thing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4233–4241, 2018.
|
| 197 |
+
|
| 198 |
+
Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. Is bert really robust? natural language attack on text classification and entailment. arXiv preprint arXiv:1907.11932, 2019.
|
| 199 |
+
|
| 200 |
+
Yoon Kim. Convolutional neural networks for sentence classification. In EMNLP, pp. 1746–1751, 2014.
|
| 201 |
+
|
| 202 |
+
Jason Kuen, Federico Perazzi, Zhe Lin, Jianming Zhang, and Yap-Peng Tan. Scaling object detection by transferring classification weights. In Proceedings of the IEEE International Conference on Computer Vision, pp. 6044–6053, 2019.
|
| 203 |
+
|
| 204 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016a.
|
| 205 |
+
|
| 206 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016b.
|
| 207 |
+
|
| 208 |
+
Alex Lamb, Vikas Verma, Juho Kannala, and Yoshua Bengio. Interpolated adversarial training: Achieving robust neural networks without sacrificing too much accuracy. In Proceedings of the 12th ACM Workshop on Artificial Intelligence and Security, AISec’19, pp. 95–103, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450368339. doi: 10.1145/3338501.3357369. URL https://doi.org/10.1145/3338501.3357369.
|
| 209 |
+
|
| 210 |
+
Hong Liu, Mingsheng Long, Jianmin Wang, and Michael Jordan. Transferable adversarial training: A general approach to adapting deep classifiers. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 4013–4022, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/liu19b.html.
|
| 211 |
+
|
| 212 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In ACL, pp. 142–150, 2011.
|
| 213 |
+
|
| 214 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 215 |
+
|
| 216 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In CVPR, pp. 2574–2582, 2016.
|
| 217 |
+
|
| 218 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016a.
|
| 219 |
+
|
| 220 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pp. 582–597. IEEE, 2016b.
|
| 221 |
+
|
| 222 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z. Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, ASIA CCS ’17, pp. 506–519, New York, NY, USA, 2017. Association for Computing Machinery. ISBN 9781450349444. doi: 10.1145/3052973.3053009. URL https://doi.org/10.1145/3052973.3053009.
|
| 223 |
+
|
| 224 |
+
Aditi Raghunathan, Sang Michael Xie, Fanny Yang, John C Duchi, and Percy Liang. Adversarial training can hurt generalization. arXiv preprint arXiv:1906.06032, 2019.
|
| 225 |
+
|
| 226 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, pp. 5019–5031, Red Hook, NY, USA, 2018. Curran Associates Inc.
|
| 227 |
+
|
| 228 |
+
Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy?–a comprehensive study on the robustness of 18 deep image classification models. In Proceedings of ECCV, pp. 631–648, 2018.
|
| 229 |
+
|
| 230 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14, pp. 3104–3112, Cambridge, MA, USA, 2014. MIT Press.
|
| 231 |
+
|
| 232 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 233 |
+
|
| 234 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- \` Daniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
|
| 235 |
+
|
| 236 |
+
Eric Wallace, Shi Feng, Nikhil Kandpal, Matt Gardner, and Sameer Singh. Universal adversarial triggers for attacking and analyzing nlp. In EMNLP, pp. 2153–2162, 2019.
|
| 237 |
+
|
| 238 |
+
Haohan Wang, Songwei Ge, Zachary Lipton, and Eric Xing. Learning robust global representations by penalizing local predictive power. Neural Information Processing Systems, pp. 10506–10518, 2019.
|
| 239 |
+
|
| 240 |
+
Jenq-Haur Wang, Ting-Wei Liu, Xiong Luo, and Long Wang. An LSTM approach to short text sentiment classification with word embeddings. In ROCLING, pp. 214–223, 2018.
|
| 241 |
+
|
| 242 |
+
Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan Yuille. Improving transferability of adversarial examples with input diversity, 2018.
|
| 243 |
+
|
| 244 |
+
Puyudi Yang, Jianbo Chen, Cho-Jui Hsieh, Jane-Ling Wang, and Michael I. Jordan. Greedy attack and gumbel attack: Generating adversarial examples for discrete data, 2018.
|
| 245 |
+
|
| 246 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14, pp. 3320–3328, Cambridge, MA, USA, 2014. MIT Press.
|
| 247 |
+
|
| 248 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. Theoretically principled trade-off between robustness and accuracy. In Proceedings of ICML, pp. 7472–7482, 2019a.
|
| 249 |
+
|
| 250 |
+
Huan Zhang, Hongge Chen, Zhao Song, Duane Boning, Inderjit S. Dhillon, and Cho-Jui Hsieh. The limitations of adversarial training and the blind-spot attack, 2019b.
|
| 251 |
+
|
| 252 |
+
Wei Emma Zhang, Quan Z Sheng, Ahoud Alhazmi, and Chenliang Li. Adversarial attacks on deep-learning models in natural language processing: A survey. ACM Transactions on Intelligent Systems and Technology (TIST), 11(3):1–41, 2020.
|
| 253 |
+
|
| 254 |
+
Yuchen Zhang, Tianle Liu, Mingsheng Long, and Michael Jordan. Bridging theory and algorithm for domain adaptation. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 7404–7413, Long Beach, California, USA, 09–15 Jun 2019c. PMLR. URL http://proceedings.mlr.press/v97/zhang19i.html.
|
| 255 |
+
|
| 256 |
+
Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoffrey Gordon. On learning invariant representations for domain adaptation. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 7523–7532, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/zhao19a.html.
|
md/train/9CPc4EIr2t1/9CPc4EIr2t1.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Stable Neural ODE with Lyapunov-Stable Equilibrium Points for Defending Against Adversarial Attacks
|
| 2 |
+
|
| 3 |
+
# Qiyu Kang∗
|
| 4 |
+
|
| 5 |
+
Continental-NTU Corporate Lab Nanyang Technological University 50 Nanyang Avenue, 639798, Singapore kang0080@e.ntu.edu.sg
|
| 6 |
+
|
| 7 |
+
Yang Song∗ School of Electrical and Electronic Engineering Nanyang Technological University 50 Nanyang Avenue, 639798, Singapore songy@ntu.edu.sg
|
| 8 |
+
|
| 9 |
+
# Qinxu Ding
|
| 10 |
+
|
| 11 |
+
School of Business
|
| 12 |
+
Singapore University of Social Sciences
|
| 13 |
+
463 Clementi Road, 599494, Singapore qinxuding@suss.edu.sg
|
| 14 |
+
|
| 15 |
+
Wee Peng Tay School of Electrical and Electronic Engineering Nanyang Technological University 50 Nanyang Avenue, 639798, Singapore wptay@ntu.edu.sg
|
| 16 |
+
|
| 17 |
+
# Abstract
|
| 18 |
+
|
| 19 |
+
Deep neural networks (DNNs) are well-known to be vulnerable to adversarial attacks, where malicious human-imperceptible perturbations are included in the input to the deep network to fool it into making a wrong classification. Recent studies have demonstrated that neural Ordinary Differential Equations (ODEs) are intrinsically more robust against adversarial attacks compared to vanilla DNNs. In this work, we propose a stable neural ODE with Lyapunov-stable equilibrium points for defending against adversarial attacks (SODEF). By ensuring that the equilibrium points of the ODE solution used as part of SODEF is Lyapunov-stable, the ODE solution for an input with a small perturbation converges to the same solution as the unperturbed input. We provide theoretical results that give insights into the stability of SODEF as well as the choice of regularizers to ensure its stability. Our analysis suggests that our proposed regularizers force the extracted feature points to be within a neighborhood of the Lyapunov-stable equilibrium points of the ODE. SODEF is compatible with many defense methods and can be applied to any neural network’s final regressor layer to enhance its stability against adversarial attacks.
|
| 20 |
+
|
| 21 |
+
# 1 Introduction
|
| 22 |
+
|
| 23 |
+
Although deep learning has found successful applications in many tasks such as image classification [1, 2], speech recognition [3], and natural language processing [4], the vulnerability of deep learning to adversarial attacks (e.g., see [5]) has limited its real-world applications due to performance and safety concerns in critical applications. Inputs corrupted with human-imperceptible perturbations can easily fool many vanilla deep neural networks (DNNs) into mis-classifying them and thus significantly impact their performance.
|
| 24 |
+
|
| 25 |
+
Recent studies [6–8] have applied neural Ordinary Differential Equations (ODEs) [9] to defend against adversarial attacks. Some works like [6] have revealed interesting intrinsic properties of
|
| 26 |
+
|
| 27 |
+
ODEs that make them more stable than conventional convolutional neural networks (CNNs). The paper [6] proposes a time-invariant steady neural ODE (TisODE) using the property that the integral curves from a ODE solution starting from different initial points (inputs) do not intersect and always preserve uniqueness in the solution function space. However, this does not guarantee that small perturbations of the initial point lead to small perturbations of the integral curve output at a later time $T$ . The authors thus proposed a regularizer to limit the evolution of the curves by forcing the integrand to be close to zero. However, neither the non-intersecting property nor the steady-state constraint used in TisODE can guarantee robustness against input perturbations since these constraints do not ensure that the inputs are within a neighborhood of Lyapunov-stable equilibrium points. An example is an ODE that serves as an identity mapping is not robust to input perturbations but satisfies all the constraints proposed in [6].
|
| 28 |
+
|
| 29 |
+
In this paper, our objective is to design a neural ODE such that the features extracted are within a neighborhood of the Lyapunov-stable equilibrium points of the ODE. We first develop a diversity promoting technique applied in the final fully connected (FC) layer to improve the ODE’s stability and analyze the reasons why. We then propose a stable neural ODE with Lyapunov-stable equilibrium points to eliminate the effects of perturbations in the input. From linear control theory [10], a linear time-invariant system $\mathrm { d } { \mathbf { z } ( t ) } / \mathrm { d } t = { \mathbf { A } } { \mathbf { z } ( t ) }$ , where $\mathbf { A }$ is a constant matrix, is exponentially stable if all eigenvalues of $\mathbf { A }$ have negative real parts. Specifically, we propose to force the Jacobian matrix of the ODE used in the neural ODE to have eigenvalues with negative real parts. Instead of directly imposing constraints on the eigenvalues of the matrix, which lead to high computational complexity when the Jacobian matrix is large, we instead add constraints to the matrix elements to implicitly force the real parts of its eigenvalues to be negative.
|
| 30 |
+
|
| 31 |
+
Our main contributions are summarized as follows:
|
| 32 |
+
|
| 33 |
+
1. Based on the concept of Lyapunov-stable equilibrium points, we propose a simple yet effective technique to improve the robustness of neural ODE networks by fixing the final FC layer to be a matrix whose rows have unit norm and such that the maximum cosine similarity between any two rows is minimized. Such a FC layer can be constructed off-line.
|
| 34 |
+
2. We propose a stable neural ODE for deFending against adversarial attacks (SODEF) to suppress the input perturbations. We derive an optimization formulation for SODEF to force the extracted feature points to be within a neighborhood of the Lyapunov-stable equilibrium points of the SODEF ODE. We provide sufficient conditions for learning a robust feature representation under SODEF.
|
| 35 |
+
3. We test SODEF on several widely used datasets MNIST [11], CIFAR-10 and CIFAR-100 [12] under well-known adversarial attacks. We demonstrate that SODEF is robust against adversarial white-box attacks with improvement in classification accuracy of adversarial examples under PGD attack [13] of up to $4 4 . 0 2 \%$ , $5 2 . 5 4 \%$ and $1 8 . 9 1 \%$ percentage points compared to another current state-of-the-art neural ODE network TisODE [6] on MNIST, CIFAR-10 and CIFAR-100, respectively. Similar improvements in classification accuracy of adversarial examples of up to $\bar { 4 3 . 6 9 \% }$ , $5 2 . 3 8 \%$ and $\mathrm { \bar { 1 8 . 9 9 \% } }$ percentage points compared to ODE net [9] are also obtained.
|
| 36 |
+
|
| 37 |
+
The rest of this paper is organized as follows. We provide essential preliminaries on neural ODE and its stability analysis in Section 2. In Section 3, we present SODEF model architecture and its training method. We show how to maximize the distance between stable equilibrium points of neural ODEs. We propose an optimization and present theoretical results on its stability properties. We summarize experimental results in Section 4 and conclude the paper in Section 5. The proofs for all lemmas and theorems proposed in this paper are given in the supplementary material. We also refer interested readers to the supplementary material for a more detailed account of related works [14–16, 6] and some popular adversarial attacks [17, 13] that are used to verify the robustness of our proposed SODEF. In the paper, we use lowercase boldface characters like $\mathbf { z }$ to denote vectors in $\mathbb { R } ^ { n }$ , capital boldface characters like $\mathbf { A }$ to denote matrices in $\mathbb { R } ^ { n \times n }$ , and normal characters like $z$ to denote scalars except that the notation $( x , y )$ are normal characters reserved to denote the input and label pairs. A vector $\mathbf { z } \in \mathbb { R } ^ { n }$ is represented as $( \mathbf { z } ^ { ( 1 ) } , \mathbf { z } ^ { ( 2 ) } , \ldots , \mathbf { z } ^ { ( n ) } )$ . The $( i , j )$ -th element of a matrix $\mathbf { A }$ is $\mathbf { A } _ { i j }$ or $[ \mathbf { A } ] _ { i j }$ . The Jacobian matrix of a function $f : \mathbb { R } ^ { n } \mapsto \mathbb { R } ^ { n }$ evaluated at $\mathbf { z }$ is denoted as $\nabla f ( \mathbf { z } )$ The set of functions $\mathbb { R } ^ { n } \mapsto \mathbb { R } ^ { n }$ with continuous first derivatives is denoted as $C ^ { 1 } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } )$ .
|
| 38 |
+
|
| 39 |
+
# 2 Preliminaries: Neural ODE and Stability
|
| 40 |
+
|
| 41 |
+
In a neural ODE layer, the relation between the layer input ${ \bf z } ( 0 )$ and output ${ \mathbf z } ( T )$ is described as the following differential equation:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\frac { \mathrm { d } \mathbf { z } ( t ) } { \mathrm { d } t } = f _ { \pmb { \theta } } ( \mathbf { z } ( t ) , t )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $f _ { \pmb \theta } : \mathbb { R } ^ { n } \times [ 0 , \infty ) \mapsto \mathbb { R } ^ { n }$ denotes the non-linear trainable layers that are parameterized by weights $\pmb { \theta }$ and $\mathbf { z } : [ 0 , \infty ) \mapsto \mathbb { R } ^ { n }$ represents the $n$ -dimensional state of the neural ODE. Neural ODEs are the continuous analog of residual networks where the hidden layers of residual networks can be regarded as discrete-time difference equations ${ \bf z } ( t + 1 ) = { \bf z } ( t ) + { f _ { \theta } } ( { \bf z } ( t ) , t )$ . In this work, for simplicity, we only consider the time-invariant (autonomous) case $f _ { \pmb \theta } ( \mathbf { z } ( t ) , t ) = f _ { \pmb \theta } ( \mathbf { z } ( t ) )$ , where the dynamical system does not explicitly depend on $t$ . For such non-linear dynamical systems, the following theorem shows that under mild conditions, its behaviour can be studied via linearization near special points called hyperbolic equilibrium points.
|
| 48 |
+
|
| 49 |
+
Theorem 1 (Hartman–Grobman Theorem [18]). Consider a system evolving in time with state $\mathbf { z } ( t ) \in \mathbb { R } ^ { n }$ that satisfies the differential equation $\frac { \mathrm { d } { \bf z } ( t ) } { \mathrm { d } t } = f ( { \bf z } ( t ) )$ for some $f \in C ^ { 1 } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } ) ;$ , $f ( \mathbf { z } ) = ( f ^ { ( 1 ) } ( \mathbf { z } ) , \ldots , f ^ { ( n ) } ( \mathbf { z } ) )$ . Suppose the map has a hyperbolic equilibrium state $\mathbf { z } ^ { \ast } \in \mathbb { R } ^ { n }$ , i.e., $f ( { \bf z } ^ { * } ) = 0$ and the Jacobian matrix with real part equal to zer $\nabla f = [ \partial f ^ { ( i ) } / \partial \mathbf { z } ^ { ( j ) } ] _ { i , j = 1 } ^ { n }$ of hb $f$ evalurhood at of $\textbf { z } = \textbf { z } ^ { * }$ has nolibrium $N _ { \mathbf { z } ^ { * } }$ point $\mathbf { z } ^ { \ast }$ and a homeomorphism $g : N _ { \mathbf { z } ^ { * } } \mapsto \mathbb { R } ^ { n }$ , such that $g ( \mathbf { z } ^ { * } ) = 0$ and in the neighbourhood $N _ { \mathbf { z } ^ { * } }$ , the flow of $\frac { \mathrm { d } { \bf z } ( t ) } { \mathrm { d } t } = f ( { \bf z } ( t ) )$ is topologically conjugate by the continuous map $\bar { \mathbf { z } } ( t ) = g ( \mathbf { z } ( t ) )$ to the flow of its linearization $\frac { \mathrm { d } \bar { \mathbf { z } } ( t ) } { \mathrm { d } t } = \nabla f ( \mathbf { z } ^ { * } ) \cdot \bar { \mathbf { z } } ( t ) .$
|
| 50 |
+
|
| 51 |
+
The theorem states that when the Jacobian matrix at the zeros of $f$ has no eigenvalue with zero real part, the behaviour of the original dynamical system can be studied using the simpler linearization of the system around those zeros. We next review some definitions and theorems from linear control theory [10].
|
| 52 |
+
|
| 53 |
+
Definition 1 (Lyapunov Stability [10]). The linear time-invariant system $\frac { \mathrm { d } \bar { \mathbf { z } } ( t ) } { \mathrm { d } t } = \mathbf { A } \bar { \mathbf { z } } ( t )$ with constant matrix A is marginally stable or stable in the sense of Lyapunov if every finite initial state $\bar { \mathbf { z } } ( 0 )$ excites a bounded response. It is asymptotically stable if every finite initial state excites $a$ bounded response, which, in addition, approaches 0 as $t \to \infty$ .
|
| 54 |
+
|
| 55 |
+
Theorem 2 (Lyapunov Stability Theorem [10]). a) The equation $\frac { \mathrm { d } \bar { \mathbf { z } } ( t ) } { \mathrm { d } t } = \mathbf { A } \bar { \mathbf { z } } ( t ) )$ is marginally stable if and only if all eigenvalues of A have zero or negative real parts and those with zero real parts are simple roots of the minimal polynomial of A. $^ b$ ) The equation $\frac { \mathrm { d } \bar { \mathbf { z } } ( t ) } { \mathrm { d } t } = \mathbf { A } \bar { \mathbf { z } } ( t )$ is asymptotically stable if and only if all eigenvalues of A have negative real parts.
|
| 56 |
+
|
| 57 |
+
In Theorem 1, we say that a hyperbolic equilibrium point is Lyapunov-stable if all eigenvalues of the Jacobian matrix evaluated at it have negative real parts. From Theorems 1 and 2, we see that a small perturbation around the Lyapunov-stable equilibrium point ${ \bf z } ( 0 )$ leads to $\tilde { \mathbf { z } } ( t ) \to \mathbf { z } ( 0 )$ as $t \to \infty$ , i.e., $\exists \delta > 0$ such that for all $\tilde { \mathbf { z } } ( 0 )$ with $\lVert { \mathbf z } ( 0 ) \dot { - } \tilde { { \mathbf z } } ( 0 ) \rVert _ { 2 } \dot { < } \delta$ , we have $\| \widetilde { \mathbf { z } } ( t ) - \mathbf { z } ( 0 ) \| _ { 2 } \to \dot { 0 }$ as $t \to \infty$ , where $\tilde { \mathbf { z } } ( t )$ is the ODE solution for the perturbed input $\tilde { \mathbf { z } } ( 0 )$ . In the context of neural network adversarial attacks, if the malicious perturbations around the ODE input ${ \bf z } ( 0 )$ is small, then the output ${ \mathbf z } ( T )$ for large enough $T$ will not be affected significantly by the perturbation. Consequently, the succeeding network layers after the neural ODE layer can still perform well without being affected by the input perturbation. The perturbation weakening phenomenon around Lyapunov-stable equilibrium points works like a noise filter and acts as a defense against adversarial attacks.
|
| 58 |
+
|
| 59 |
+
We require the following definition and result in our stability analysis.
|
| 60 |
+
|
| 61 |
+
Definition 2 (Strictly diagonally dominant [19]). Let $\mathbf { A } \in \mathbb { C } ^ { n \times n }$ . We say that A is strictly diagonally dominant if $\begin{array} { r } { \left| { { { \mathbf { A } } _ { i i } } } \right| > \sum _ { j \neq i } \left| { { { \mathbf { A } } _ { i j } } } \right| } \end{array}$ for all $i = 1 , . . . , n$ .
|
| 62 |
+
|
| 63 |
+
Theorem 3 (Levy–Desplanques theorem [19]). If $\mathbf { A } \in \mathbb { C } ^ { n \times n }$ is strictly diagonally dominant and if every main diagonal entry of A is real and negative, then $A$ is non-singular and every eigenvalue of A has negative real part.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Fig. 1: SODEF model architecture.
|
| 67 |
+
|
| 68 |
+
Lemma 1. Given $k$ distinct points $\mathbf { z } _ { i } \in \mathbb { R } ^ { n }$ and matrices $\mathbf { A } _ { i } \in \mathbb { R } ^ { n \times n }$ , $i = 1 , . . . , k$ , there exists a function $f \in C ^ { 1 } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } )$ such that $f ( \mathbf { z } _ { i } ) = 0$ and $\nabla f _ { \pmb { \theta } } ( \mathbf { z } _ { i } ) = \mathbf { A } _ { i }$ .
|
| 69 |
+
|
| 70 |
+
# 3 SODEF Architecture
|
| 71 |
+
|
| 72 |
+
We consider a classification problem with $L$ classes. The proposed SODEF model architecture is shown in Fig. 1. The input $x \in X$ (e.g., an image) is first passed through a feature extractor $h _ { \phi } : X \mapsto \mathbb { R } ^ { n }$ to obtain an embedding feature representation ${ \bf z } ( 0 )$ . A neural ODE layer $f _ { \theta }$ follows as a nonlinear feature mapping to stabilize the feature representation output ${ \bf z } ( 0 )$ from $h _ { \phi }$ . The final FC layer $\mathbf { V }$ serves as a linear mapping to generate a prediction vector based on the output $\mathbf { \dot { z } } ( T )$ of the neural ODE layer. The parameters $\phi , \theta$ and $\mathbf { V }$ are parameterized weights for the feature extractor, neural ODE layer and FC layer, respectively.
|
| 73 |
+
|
| 74 |
+
We provide motivation and design guidance for the FC layer V in Section 3.1, which attempts to separate Lyapunov-stable equilibrium points implicitly by maximizing the similarity distance between feature representations corresponding to the $L$ different classes. Experimental results demonstrate the advantages of our diversity promoting FC layer in Section 3.1 with comparisons to traditional neural ODEs without diversity promoting.
|
| 75 |
+
|
| 76 |
+
However, the embedded features after using diversity promoting are not guaranteed to locate near the Lyapunov-stable equilibrium points. In Section 3.2, we formulate an optimization problem to force embedding features to locate near the Lyapunov-stable equilibrium points. We introduce optimization constraints to force the Jacobian matrix of the ODE in our neural ODE layer to have eigenvalues with negative real parts at the Lyapunov-stable equilibrium points. Instead of directly imposing constraints on the eigenvalue of the matrix, which may be computationally complex especially when the matrix is large, we add constraints to the matrix elements instead.
|
| 77 |
+
|
| 78 |
+
# 3.1 Maximizing the Distance between Lyapunov-Stable Equilibrium Points
|
| 79 |
+
|
| 80 |
+
From Section 2, we observe that points in a small neighbourhood of a Lyapunov-stable equilibrium point is robust against adversarial perturbations. We call this neighborhood a stable neighborhood. However Lyapunov-stable equilibrium points for different classes may very well locate near each other and therefore each stable neighborhood may be very small, leading to poor adversarial defense. In this section, we propose to add a FC layer after the neural ODE layer given by (1) to avoid this scenario. The purpose of the FC layer is to map the output of the neural ODE layer to a feature vector $\mathbf { v } _ { l }$ if the input $x$ belongs to the class $l = 1 , \ldots , L$ . We design the FC layer so that the cosine similarities between different $\mathbf { v } _ { l }$ ’s are minimized.
|
| 81 |
+
|
| 82 |
+
Lemma 2. Given a set of $k$ unit vectors $\mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { k }$ in $\mathbb { R } ^ { n }$ , where $n \geq k$ , let $a ( \mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { k } ) =$ $\mathrm { m a x } _ { i \neq j } { \mathbf { \Delta v } _ { i } ^ { \mathsf { T } } } { \mathbf { v } _ { j } }$ . Then $\operatorname* { m i n } a ( \mathbf { v } _ { 1 } , . . . , \mathbf { v } _ { k } ) = 1 / ( 1 - k )$ , where the minimum is taken over all possible sets of $k$ unit vectors $\mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { k }$ .
|
| 83 |
+
|
| 84 |
+
Corollary 1. Consider a $k \times k$ matrix $\mathbf { B } = [ b _ { i j } ] _ { i , j = 1 } ^ { k }$ with $b _ { i i } = 1$ and $b _ { i j } = 1 / ( 1 - k )$ , $\forall i \ne j$ Let the eigen decomposition of $\mathbf { B }$ be $\mathbf { B } = \mathbf { U } \pmb { \Sigma } \bar { \mathbf { U } } ^ { \dag }$ . For any $n \geq k$ and $i = 1 , \ldots , k$ , let $\mathbf { v } _ { i }$ be the $i$ -th column of $\mathbf { Q } \mathbf { \Sigma } ^ { \mathrm { { X } ^ { 1 / 2 } \bar { U } ^ { \top } } }$ , where $\mathbf { Q }$ is any $n \times k$ matrix such that $\mathbf { Q } ^ { \intercal } \mathbf { Q } = \mathbf { I } _ { k }$ . Then, $a ( \mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { k } ) = \operatorname* { m a x } _ { i \neq j } \mathbf { v } _ { i } ^ { \mathsf { T } } \mathbf { v } _ { j } = { 1 } / ( 1 - k )$ .
|
| 85 |
+
|
| 86 |
+
Corollary 1 suggests a diversity promoting scheme to maximally separate the equilibrium points of the neural ODE layer. The FC layer is represented by an $n \times L$ matrix $\mathbf { V } = \left[ \mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { L } \right]$ , where $n$ is the dimension of ${ \mathbf z } ( T )$ , the output from the neural ODE layer. If ${ \mathbf z } ( T )$ is generated from an input from class $l$ , it is mapped to $\mathbf { v } _ { l }$ . By minimizing the maximum cosine similarity $a ( \mathbf { v } _ { 1 } , \ldots , \mathbf { v } _ { k } ) = \operatorname* { m a x } _ { i \neq j } \mathbf { v } _ { i } ^ { \mathsf { T } } \mathbf { v } _ { j }$ between the representations from two different classes, we ensure that the output of SODEF is robust to perturbations in the input. Corollary 1 provides a way to choose the FC layer weights $\mathbf { V }$ .
|
| 87 |
+
|
| 88 |
+
To validate our observations, we conduct experiments to compare the robustness of ODE net [9] and TisODE [6] with and without our proposed FC layer V, on two standard datasets: MNIST [2] and CIFAR10 [12] 2. On the MNIST dataset, all models consist of four convolutional layers and one fully-connected layer. On the CIFAR10 dataset, the networks are similar to those for MNIST except the down-sampling network is a stack of 2 ResNet blocks. In practice, the neural ODE can be solved with different numerical solvers such as the Euler method and the Runge-Kutta methods [9]. Here, we use Runge-Kutta of order 5 in our experiments. Our implementation builds on the open-source neural ODE codes.3 During training, no Gaussian noise or adversarial examples are augmented into the training set. We test the performance of our model in defending against white-box attacks FGSM [17] and PGD [13] . The parameters for different attack methods used in this paper are given in the supplementary material. From Tables 1 and 2, we observe that for both datasets, our fixed FC layer improves each network’s defense ability by a significant margin. We visualize the features before the final FC layer using t-SNE [20] in Figs. 2 and 3. We observe that with the FC layer, the features for different classes are well separated even under attacks.
|
| 89 |
+
|
| 90 |
+
Table 1: Classification accuracy $( \% )$ on adversarial MNIST examples, where the superscript + indicates the last FC layer is fixed to be $\mathbf { V }$ .
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Attack</td><td>Para.</td><td>ODE</td><td>ODE+</td><td>TisODE</td><td>TisODE+</td></tr><tr><td>None</td><td>-</td><td>99.6</td><td>99.7</td><td>99.5</td><td>99.7</td></tr><tr><td>FGSM</td><td>∈ = 0.3</td><td>31.4</td><td>52.8</td><td>45.9</td><td>63.5</td></tr><tr><td>PGD</td><td>∈=0.3</td><td>0.29</td><td>0.30</td><td>0.4</td><td>20.20</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Table 2: Classification accuracy $( \% )$ on adversarial CIFAR10 examples, where the superscript + indicates the last FC layer is fixed to be $\mathbf { V }$ .
|
| 95 |
+
|
| 96 |
+
<table><tr><td>Attack</td><td>Para.</td><td>ODE ODE+</td><td>TisODE</td><td>TisODE+</td></tr><tr><td>None</td><td>-</td><td>87.0 85.0</td><td>87.4</td><td>81.8</td></tr><tr><td>FGSM</td><td>∈ = 0.1</td><td>12.9 47.6</td><td>13.1</td><td>41.9</td></tr><tr><td>PGD</td><td>∈=0.1</td><td>7.8 14.7</td><td>7.4</td><td>16.2</td></tr></table>
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
Fig. 2: t-SNE visualization results on the features before the final FC layer. The input is the test set of MNIST. Left: trained with TisODE, middle: TisODE using a randomly chosen orthogonal matrix as the final FC, right: TisODE using proposed $\mathbf { V }$ as the final FC.
|
| 100 |
+
|
| 101 |
+
# 3.2 Objective Formulation and Stability
|
| 102 |
+
|
| 103 |
+
In this subsection, we formulate an optimization framework for SODEF to force output features to locate within the stable neighborhood of Lyapunov-stable equilibrium points. We make the following assumption.
|
| 104 |
+
|
| 105 |
+
Assumption 1. The input x takes values in a compact metric space $X$ and has probability distribution $\mu$ . The feature extractor $h _ { \phi }$ is injective and continuous.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Fig. 3: t-SNE visualization results on the features before the final FC layer. The input is the adversarial examples of the test set of MNIST generated using FGSM method at $\epsilon = 0 . 3$ . Left: trained with TisODE, middle: TisODE using a randomly chosen orthogonal matrix as the final FC, right: TisODE using proposed $\mathbf { V }$ as the final FC.
|
| 109 |
+
|
| 110 |
+
The above assumption is satisfied if the input $x$ (e.g., an image) resides in a bounded and closed set of a Euclidean space. We denote the pushforward measure (still a probability distribution) of $\mu$ under the continuous feature extractor mapping $h _ { \phi }$ as $\nu _ { \phi } = \mu \circ h _ { \phi } ^ { - 1 }$ , where $\circ$ denotes function composition. The conditional probability distribution for the embedding of each class $l \in \{ 1 , . . . , L \}$ has compact support $E _ { l } \subset \mathbb { R } ^ { n }$ since $E _ { l }$ is closed and $h _ { \phi } ( X )$ is bounded in $\mathbb { R } ^ { n }$ . In Section 3.1, the FC layer $\mathbf { V }$ tries to maximize the distance between $E _ { l }$ , $l = 1 , \ldots , L$ . In this section for analysis purposes, we also assume the following.
|
| 111 |
+
|
| 112 |
+
Assumption 2. We have $E _ { l } \bigcap E _ { l ^ { \prime } } = \varnothing i f l \neq l ^ { \prime }$ , i.e., the supports of each class are pairwise disjoint.
|
| 113 |
+
|
| 114 |
+
Our objective function is formulated as follows, which is explained in detail in the sequel:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r l } & { \underset { \theta , \phi } { \operatorname* { m i n } } \mathbb { E } _ { \boldsymbol { \mu } } \ell ( { \mathbf { V } } ^ { \top } ( { \mathbf { z } } ( T ) ) , y _ { i } ) } \\ & { \mathrm { s . t . } \ \mathbb { E } _ { \boldsymbol { \nu } _ { \phi } } \| f _ { \theta } ( { \mathbf { z } } ( 0 ) ) \| _ { 2 } < \epsilon , \ f _ { \theta } \in C ^ { 1 } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } ) , } \\ & { \quad \quad \quad \mathbb { E } _ { \boldsymbol { \nu } _ { \phi } } \left[ \nabla f _ { \theta } ( { \mathbf { z } } ( 0 ) ) \right] _ { i i } < 0 , \ \forall i = 1 , \ldots , n , } \\ & { \quad \quad \mathbb { E } _ { \boldsymbol { \nu } _ { \phi } } \left[ | [ \nabla f _ { \theta } ( { \mathbf { z } } ( 0 ) ) ] _ { i i } | - \sum _ { j \neq i } | [ \nabla f _ { \theta } ( { \mathbf { z } } ( 0 ) ) ] _ { i j } | \right] > 0 , \ \forall i = 1 , \ldots , n , } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
$\mathbf { z } ( 0 ) = h _ { \phi } ( x )$ , and ${ \mathbf z } ( T )$ is the output of (1) with input ${ \bf z } ( 0 )$ .
|
| 121 |
+
|
| 122 |
+
Here, $\ell$ is a loss function and $\epsilon > 0$ is a positive constant. The constraints (3) to (5) force ${ \bf z } ( 0 )$ to be near the Lyapunov-stable equilibrium points with strictly diagonally dominant derivatives. We limit the $f _ { \theta }$ to be in $C ^ { 1 } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } )$ to satisfy the condition in Theorem 1. From [21], we also know that standard multi-layer feed forward networks with as few as a single hidden layer and arbitrary bounded and non-constant activation function are universal approximators for $C ^ { 1 ^ { \prime } } ( \mathbb { R } ^ { n } , \mathbb { R } ^ { n } )$ functions with respect to some performance criteria provided only that sufficiently many hidden units are available.
|
| 123 |
+
|
| 124 |
+
As a comparison, TisODE [6] only includes a constraint similar to (3), which in general provides no guarantee to force ${ \bf z } ( 0 )$ near the Lyapunov-stable equilibrium points. In the extreme case with parameters $\theta = 0$ for $f _ { \theta }$ such that $f _ { \pmb { \theta } } = 0$ , the ODE degenerates to an identity mapping. No $\mathbf { z } ( 0 ) \in \mathbb { R } ^ { n }$ can now be a Lyapunov-stable equilibrium point, and no stability can therefore be guaranteed to defend against adversarial attacks even though the ODE curves still possess the nonintersecting property and steady-state constraint, which were cited as reasons for the stability of TisODE.
|
| 125 |
+
|
| 126 |
+
Instead of directly optimizing the above objective function, in our implementation, we optimize the following empirical Lagrangian with a training set $\left\{ \left( x _ { k } , y _ { k } \right) : k = 1 , { \overset { - } { \ldots } } , N \right\}$ :
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { l } { \displaystyle \operatorname* { m i n } _ { \theta , \phi } \frac { 1 } { N } \sum _ { k = 0 } ^ { N - 1 } \bigg ( \ell \big ( \mathbf { V } ^ { \top } \mathbf { z } _ { k } ( T ) , y _ { k } \big ) + \alpha _ { 1 } \| f _ { \theta } \big ( \mathbf { z } _ { k } ( 0 ) \big ) \| _ { 2 } + \alpha _ { 2 } g _ { 1 } \Big ( \displaystyle \sum _ { i = 1 } ^ { n } [ \nabla f _ { \theta } ( \mathbf { z } _ { k } ( 0 ) ) ] _ { i i } \Big ) } \\ { \displaystyle \quad \quad + \alpha _ { 3 } g _ { 2 } \Big ( \displaystyle \sum _ { i = 1 } ^ { n } ( - | [ \nabla f _ { \theta } ( \mathbf { z } _ { k } ( 0 ) ) ] _ { i i } | + \displaystyle \sum _ { j \neq i } \vert [ \nabla f _ { \theta } ( \mathbf { z } _ { k } ( 0 ) ) ] _ { i j } | ) \Big ) \bigg ) } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
s. t. $\mathbf { z } _ { k } ( 0 ) = h _ { \phi } ( x _ { k } )$ , and ${ \mathbf z } _ { k } ( T )$ is the output of (1) with input $\mathbf { z } _ { k } ( 0 ) , \forall k = 1 , . . . , N$ (8)
|
| 133 |
+
|
| 134 |
+
where $\alpha _ { 1 } , \alpha _ { 2 }$ and $\alpha _ { 3 }$ are hyperparameter weights, $g _ { 1 }$ and $g _ { 2 }$ are chosen monotonically increasing functions bounded below to eliminate the unbounded impact of the two regularizers that can otherwise dominate the loss. In this paper, we set $g _ { 1 } ( \cdot ) = g _ { 2 } ( \cdot ) \bar { = } \exp ( \cdot )$ . We call these two latter terms the SODEF regularizers.
|
| 135 |
+
|
| 136 |
+
Suppose for each class $l = 1 , \ldots , L$ , the embedding feature set $E _ { l } = \{ \mathbf { z } _ { 1 } ^ { ( l ) } , \dots , \mathbf { z } _ { k } ^ { ( l ) } \}$ z(l)k } is finite. For each $i = 1 , \ldots , k$ , let $\mathbf { A } _ { i } \in \mathbb { R } ^ { n \times n }$ be strictly diagonally dominant matrix with every main diagonal entry be negative such that the eigenvalues for $\mathbf { A } _ { i }$ all have negative real part. From Theorem 3, each $\mathbf { A } _ { i }$ is non-singular and every eigenvalue of $\mathbf { A } _ { i }$ has negative real part. Therefore, from Theorem 2 and Lemma 1, there exists a function $f _ { \theta }$ such that all $\mathbf { z } _ { i } ^ { ( l ) }$ are Lyapunov-stable equilibrium points with corresponding first derivative $\nabla f _ { \pmb \theta } ( \mathbf z _ { i } ^ { ( l ) } ) = \mathbf { A } _ { i }$ . This shows that if there exist only finite representation points for each class, we can find a function $f _ { \theta }$ such that all inputs to the neural ODE layer are Lyapunov-stable equilibrium points for $f _ { \theta }$ and
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { \mathbb { E } _ { \boldsymbol \nu _ { \phi } } \left\| f _ { \boldsymbol \theta } ( \mathbf { z } ( 0 ) ) \right\| _ { 2 } = 0 , } \\ & { \mathbb { E } _ { \boldsymbol \nu _ { \phi } } \left[ \nabla f _ { \boldsymbol \theta } ( \mathbf { z } ( 0 ) ) \right] _ { i i } < 0 , \forall i = 1 , \ldots , n , } \\ & { \mathbb { E } _ { \boldsymbol \nu _ { \phi } } \left[ | [ \nabla f _ { \boldsymbol \theta } ( \mathbf { z } ( 0 ) ) ] _ { i i } | - \sum _ { j \neq i } \vert [ \nabla f _ { \boldsymbol \theta } ( \mathbf { z } ( 0 ) ) ] _ { i j } \vert \right] > 0 , \forall i = 1 , \ldots , n . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
If the input space $X$ has infinite cardinality, then an injective and continuous feature extractor $h _ { \phi }$ results in a $\nu _ { \phi }$ with non-finite support, i.e., at least one $E _ { l }$ , $l = 1 , \ldots , L$ , is infinite. It is not obvious whether we can obtain a $f _ { \theta }$ where every point in $\textstyle E = \bigcup _ { l } E _ { l }$ is a stable equilibrium point. The following result gives a negative answer if $\nu _ { \phi }$ is a continuous measure (i.e., absolutely continuous with respect to (w.r.t.) Lebesgue measure) on some subset.
|
| 143 |
+
|
| 144 |
+
Lemma 3. If the restriction of $\nu _ { \phi }$ to some open set $E ^ { \prime } \subset E$ is a continuous measure, there is no continuous function fθ such that for $\nu _ { \phi }$ -almost surely all $\mathbf { z } \in E$ , $f _ { \pmb \theta } ( \mathbf z ) = 0$ and all the eigenvalues of $\nabla f _ { \boldsymbol { \theta } } ( \mathbf { z } )$ have negative real parts. In other words, there is no continuous function fθ such that almost surely all $\mathbf { z }$ in $E$ are Lyapunov-stable equilibrium points.
|
| 145 |
+
|
| 146 |
+
Lemma 3 indicates that it is too much to hope for all points in $E$ to be Lyapunov-stable equilibrium points. In the following, we relax this requirement and show that under mild conditions, for all $\epsilon > 0$ , we can find a continuous function $f _ { \theta }$ with finitely many stable equilibrium points such that conditions (b) and (c) above hold and condition (a) is replaced by $\mathbb { E } _ { \boldsymbol { \nu } _ { \phi } } \bar { \| } f _ { \theta } ( \mathbf { z } ( 0 ) ) \| _ { 2 } ^ { - } < \epsilon$ . This motivates the optimization constraints in (3) to (5).
|
| 147 |
+
|
| 148 |
+
Theorem 4. Suppose Assumptions $I$ and 2. If $\nu _ { \phi }$ is not a continuous uniform measure on $E _ { l }$ for each $l = 1 , \ldots , L$ , then the following holds: 1) The function space satisfying the constraints in (3) to (5) is non-empty for all $\epsilon > 0$ . 2) If additionally the restriction of $\nu _ { \phi }$ to any open set $O \subset E _ { l }$ is not a continuous uniform measure, there exist functions in this space such that each support $E _ { l }$ contains at least one Lyapunov-stable equilibrium point.
|
| 149 |
+
|
| 150 |
+
# 4 Experiments
|
| 151 |
+
|
| 152 |
+
In this section, we evaluate the robustness of SODEF under adversarial attacks with different attack parameters. We conduct experiments to compare the robustness of ODE net [9] and TisODE net [6] on three standard datasets: MNIST [2], CIFAR10 and CIFAR100 [3]. Since SODEF is compatible with many defense methods, it can be applied to any neural network’s final regressor layer to enhance its stability against adversarial attacks. Our experiment codes are provided in https://github.com/KANGQIYU/SODEF.
|
| 153 |
+
|
| 154 |
+
# 4.1 Setup
|
| 155 |
+
|
| 156 |
+
We use open-source pre-trained models that achieve the top accuracy on each dataset as the feature extractor $h _ { \phi }$ . Specifically for simple MNIST task, we use the ResNet18 model provided in Pytorch. We use the model provided by [22], which obtains nearly $8 8 \%$ clean accuracy on CIFAR100 using EfficientNet [23] and the model provided by [24], which has nearly $9 5 \%$ clean accuracy on CIFAR10. In the neural ODE layer, $f _ { \theta }$ consists of 2 FC layers. During the trainings of SODEF (except in the experiment included in Section 4.2), we train the neural network with the fixed FC introduced in Section 3.1. In the first 30 epochs, we fixed $f _ { \theta }$ to let the feature extractor $h _ { \phi }$ learn a feature representation with only the cross-entropy loss $\ell$ , and in the remaining 120 epochs, we release $h _ { \phi }$ to further train $f _ { \theta }$ using (7) with $\alpha _ { 1 } = 1$ and $\alpha _ { 2 } = \alpha _ { 3 } = 0 . 0 5$ . For CIFAR10 and CIFAR100, the pixel values are normalized by $( x - \mu ) / \sigma$ where $\mu = [ 0 . 4 9 1 4 , 0 . 4 8 2 2 , 0 . 4 4 6 5 ]$ and $\sigma = [ 0 . 2 0 2 3 , 0 . 1 9 9 4 , 0 . 2 0 1 0 ] ^ { 4 }$ . To show that our SODEF is compatible with many defense methods and can be applied to any neural network’s final regression layer, we conduct an experiment where we use a recently proposed robust network TRADES [25] as the feature extractor in our SODEF. The pretrained model is provided here 5, and we choose the model with architecture "WRN- $3 4 \mathrm { - } 1 0 "$ to conduct our experiments. Besides the two vanilla white-box attacks FGSM and PGD as metioned in Section 3.1, we also include a strong ensemble attack AutoAttack [26], which sequentially performs attack using all of the following four individual attacks: three white-box attacks APGDCE, APGDTDLR and FABT[27], and one black-box Square attack [28]. We refer the reader to the the supplementary material for more details of the attacks used in this paper, where, in additional, more experiments are included.
|
| 157 |
+
|
| 158 |
+
# 4.2 Compatibility of SODEF
|
| 159 |
+
|
| 160 |
+
Adversarial training (AT) is one of the most effective strategies for defending adversarial attacks. TRADES [25] is one of the adversarial training defense methods with combinations of tricks of warmup, early stopping, weight decay, batch size and other hyper parameter settings. In this experiment we fix the pretained TRADES model (except the final FC layer (size $6 4 0 \mathrm { x } 1 0 )$ ) as our feature extractor $h _ { \phi }$ . We then append our (trainable) SODEF with integration time $T = 5$ to the output of the feature extractor. To evaluate model robustness, we use AutoAttack and attack the models using both the $\mathcal { L } _ { 2 }$ norm $\epsilon = 0 . 5$ ) and $\mathcal { L } _ { \infty }$ norm $( \epsilon = 8 / 2 5 5 )$ ). The results are shown in Table 3. We clearly observe that our SODEF can enhance TRADES’s robustness under all the four individual attacks and the strongest ensemble AutoAttack. For the strong $\mathcal { L } _ { 2 }$ AutoAttack, our SODEF have improved the model robustness from $5 9 . 4 2 \%$ to $6 7 . 7 5 \%$ . Our experiment show that SODEF can be applied to many defense models’ regression layer to enhance their stability against attacks.
|
| 161 |
+
|
| 162 |
+
Table 3: Classification accuracy $( \% )$ using TRADES (w/ and w/o SODEF) under AutoAttack on adversarial CIFAR10 examples with $\mathcal { L } _ { 2 }$ norm $\epsilon = 0 . 5 )$ and $\mathcal { L } _ { \infty }$ norm $( \epsilon = 8 / 2 5 5 )$ .
|
| 163 |
+
|
| 164 |
+
<table><tr><td colspan="4">Attack /ModelTRADES LTRADES+SODEF LTRADES L2TRADES+SODEF L2</td></tr><tr><td>Clean</td><td>85.48</td><td>85.18</td><td>85.48 85.18</td></tr><tr><td>APGDcE</td><td>56.08</td><td>70.90</td><td>61.74 74.35</td></tr><tr><td>APGDDLR</td><td>53.70</td><td>64.15</td><td>59.22 68.55</td></tr><tr><td>FABT</td><td>54.18</td><td>82.92</td><td>60.31 83.15</td></tr><tr><td>Square</td><td>59.12</td><td>62.21</td><td>72.65 76.02</td></tr><tr><td>AutoAttack</td><td>53.69</td><td>57.76</td><td>59.42 67.75</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 4.3 Influence of Integration Time $T$
|
| 167 |
+
|
| 168 |
+
From the discussion after Theorems 1 and 2, we know if the malicious perturbations around the ODE input Lyapunov-stable equilibrium point ${ \bf z } ( 0 )$ is small, then the output ${ \mathbf z } ( T )$ for large enough $T$ will not be affected significantly by the perturbation: $\| \tilde { { \mathbf z } } ( t ) - { \mathbf z } ( 0 ) \| _ { 2 } \dot { \to } 0$ as $t \to \infty$ . Consequently, the succeeding network layers after the neural ODE layer can still perform well without being affected by the input perturbation. In this section, we test the influence of the SODEF integration time $T$ using CIFAR100. We use the model EfficientNet provided by [23] as $h _ { \phi }$ (Note, unlike Section 4.2, $h _ { \phi }$ is trainable in this experiments). We use AutoAttack with $\mathcal { L } _ { 2 }$ norm $\epsilon = 0 . 5$ ). We observe that for all the four individual attacks and the strongest ensemble AutoAttack, SODEF performs generally better for large integration time $T$ . We also test larger integration time $T > 1 0$ , but do not see any obvious improvements.
|
| 169 |
+
|
| 170 |
+
# 4.4 Performance Comparison Under AutoAttack
|
| 171 |
+
|
| 172 |
+
For a comparison, we provide the results of applying AutoAttack to other baseline models mentioned in the paper. We set the same integration time for ODE, TisODE and SODEF. We observe that for the
|
| 173 |
+
|
| 174 |
+
Table 4: Classification accuracy $( \% )$ under AutoAttack on adversarial CIFAR100 examples with $\mathcal { L } _ { 2 }$ norm, $\epsilon = 0 . 5$ and different integration time $T$ for SODEF.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Attack/T</td><td>1</td><td>3</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td></tr><tr><td>Clean</td><td>88.00</td><td>88.12</td><td>88.15</td><td>88.00</td><td>87.92</td><td>88.00</td><td>88.05</td><td>88.10</td></tr><tr><td>APGDcE</td><td>17.20</td><td>21.33</td><td>21.05</td><td>23.67</td><td>69.67</td><td>85.33</td><td>87.10</td><td>86.88</td></tr><tr><td>APGDLR</td><td>21.02</td><td>21.00</td><td>22.00</td><td>26.00</td><td>63.30</td><td>86.90</td><td>86.20</td><td>86.54</td></tr><tr><td>FABT</td><td>86.33</td><td>85.10</td><td>86.36</td><td>87.70</td><td>87.67</td><td>86.55</td><td>86.22</td><td>85.93</td></tr><tr><td>Square</td><td>84.67</td><td>86.22</td><td>87.05</td><td>87.20</td><td>86.90</td><td>86.33</td><td>87.05</td><td>86.75</td></tr><tr><td>AutoAttack</td><td>2.00</td><td>3.53</td><td>4.87</td><td>4.33</td><td>30.66</td><td>78.80</td><td>78.97</td><td>79.10</td></tr></table>
|
| 177 |
+
|
| 178 |
+
strongest AutoAttack, our SODEF outperforms the other baseline models by a significant margin. In this case, SODEF achieves $7 9 . 1 0 \%$ accuracy while other models only get less than $3 \%$ accuracy.
|
| 179 |
+
|
| 180 |
+
Table 5: Classification accuracy $( \% )$ under AutoAttack on adversarial CIFAR100 examples with $\mathcal { L } _ { 2 }$ norm, $\epsilon = 0 . 5$ and $T = 1 0$ .
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Attack/Model</td><td>NoODE</td><td>ODE</td><td>TisODE</td><td>SODEF</td></tr><tr><td>Clean</td><td>88.00</td><td>87.90</td><td>88.00</td><td>88.10</td></tr><tr><td>APGDCE</td><td>23.30</td><td>6.75</td><td>14.32</td><td>86.88</td></tr><tr><td></td><td>7.33</td><td>22.00</td><td>24.20</td><td>86.54</td></tr><tr><td>FAB</td><td>79.30</td><td>78.67</td><td>77.16</td><td>85.93</td></tr><tr><td>Square</td><td>84.52</td><td>85.67</td><td>86.32</td><td>86.75</td></tr><tr><td>AutoAttack</td><td>0.00</td><td>1.33</td><td>4.06</td><td>79.10</td></tr></table>
|
| 183 |
+
|
| 184 |
+
# 4.5 Performance Under PGD and FGSM Attacks
|
| 185 |
+
|
| 186 |
+
White-box adversaries have knowledge of the classifier models, including training data, model architectures and parameters. We test the performance of our model in defending against the whitebox attacks, PGD and FGSM. We set $T = 5$ as the integration time for the neural ODE layer. The parameters for different attack methods used are given in the supplementary material. The subsequent experiments use these settings by default, unless otherwise stated.
|
| 187 |
+
|
| 188 |
+
Table 6: Classification accuracy $( \% )$ on adversarial MNIST examples.
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Attack</td><td>Para.</td><td>no ode</td><td>ODE</td><td>TisODE</td><td>SODEF</td></tr><tr><td>None</td><td>-</td><td>99.45</td><td>99.42</td><td>99.43</td><td>99.44</td></tr><tr><td>FGSM</td><td>∈=0.3</td><td>10.03</td><td>29.6</td><td>36.70</td><td>63.36</td></tr><tr><td>PGD</td><td>∈= 0.3</td><td>0.31</td><td>1.56</td><td>1.82</td><td>45.25</td></tr></table>
|
| 191 |
+
|
| 192 |
+
The classification results on MNIST are shown in Table 6. We observe that while maintaining the state-of-the-art accuracy on normal images, SODEF improves the adversarial robustness as compared to the other two methods. For the most effective attack in this experiment, i.e., PGD attack, SODEF shows a $4 5 . 2 5 \% - 1 . 5 6 \% = 4 3 . 6 9 \%$ improvement over ODE and a $4 5 . 2 5 \% - 1 . 2 3 \% = 4 4 . 0 2 \%$ improvement over TisODE.
|
| 193 |
+
|
| 194 |
+
Table 7: Classification accuracy $( \% )$ on adversarial CIFAR10 examples.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Attack</td><td>Para.</td><td>no ode</td><td>ODE</td><td>TisODE</td><td>SODEF</td></tr><tr><td>None</td><td>-</td><td>95.2</td><td>94.9</td><td>95.1</td><td>95.0</td></tr><tr><td>FGSM</td><td>∈=0.1</td><td>47.31</td><td>45.23</td><td>43.28</td><td>68.05</td></tr><tr><td>PGD</td><td>∈=0.1</td><td>3.09</td><td>3.21</td><td>3.80</td><td>55.59</td></tr></table>
|
| 197 |
+
|
| 198 |
+
For CIFAR-10, we see from Table 7 that SODEF maintains high accuracy on normal examples and makes the best predictions under adversarial attacks. In particular, SODEF achieves an absolute percentage point improvement over ODE net up to $5 2 . 3 8 \%$ and over TisODE up to $5 2 . 5 4 \%$ for PGD attack.
|
| 199 |
+
|
| 200 |
+
For CIFAR-100, the results in the supplementary material shows that the most effective attack causes the classification accuracy to drop relatively by $\begin{array} { r } { 7 4 . 6 \% = \frac { 8 8 . 0 - 2 2 . 3 5 } { 8 8 . 0 } } \end{array}$ 88.0−22.35 for SODEF and by $\begin{array} { r } { 9 7 . 3 \% = \frac { 8 8 . 3 - 2 . 3 9 } { 8 8 . 3 } } \end{array}$ for vanilla EfficientNet, which is pre-trained on ImageNet to obtain a top clean accuracy. Neither ODE net nor TisODE net can improve the classification accuracy under PGD attack by a big margin, e.g. TisODE net only improves the classification accuracy from $2 . 3 9 \%$ to $3 . 4 4 \%$ , while SODEF still shows clear defense capability in this scenario.
|
| 201 |
+
|
| 202 |
+
# 4.6 Ablation Studies
|
| 203 |
+
|
| 204 |
+
The impact of the ODE with and without the SODEF regularizers in (7) has been presented in the above comparisons between SODEF and ODE. In this section, we show the necessity of diversity promoting using the FC introduced in Section 3.1 and conduct transferability study.
|
| 205 |
+
|
| 206 |
+
# 4.6.1 Impact of Diversity Promotion
|
| 207 |
+
|
| 208 |
+
Table 8: Classification accuracy $( \% )$ on adversarial MNIST examples, where the superscript indicates the last FC layer is not fixed to be $\mathbf { V }$ and is set to be a trainable layer.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Attack</td><td>Para.</td><td>SODEF</td><td>SODEF-</td></tr><tr><td>None</td><td>-</td><td>95.0</td><td>95.1</td></tr><tr><td>FGSM</td><td>∈=0.1</td><td>63.36</td><td>51.6</td></tr><tr><td>PGD</td><td>∈=0.1</td><td>45.25</td><td>34.9</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 8 shows the difference of the defense performance when fixing the final FC be $\mathbf { V }$ or setting it to a trainable linear layer. It can be seen that having diversity control improves the robustness. One possible reason for this phenomenon given in Section 3 is that diversity promotion with a fixed designed FC attempts to make the embedding feature support $E _ { l }$ of each class $l$ disjoint to each other and therefore the Lyapunov-stable equilibrium points for each $E _ { l }$ are well separated.
|
| 213 |
+
|
| 214 |
+
# 4.6.2 Transferability Study
|
| 215 |
+
|
| 216 |
+
Transferability study is carried out on CIFAR-10, where the adversarial examples are generated using FGSM and PGD attacks using ResNet18 without any ODEs. The classification accuracy drops from $6 8 . 0 5 \%$ to $5 9 \%$ for FGSM with $\epsilon = 0 . 3$ , and from $5 5 . 5 9 \%$ to $3 4 \%$ for PGD with $\epsilon = 0 . 1$ . One possible reason for this phenomenon is that ODEs have obfuscated gradient masking effect as discussed in [15], and a transfer attack may deteriorate the defense effect. However, as we observe from Table 7, even with a transfer attack on SODEF, it still performs better than other ODEs without transfer attacks.
|
| 217 |
+
|
| 218 |
+
# 5 Conclusion
|
| 219 |
+
|
| 220 |
+
In this paper, we have developed a new neural ODE network, SODEF, to suppress input perturbations. SODEF is compatible with any existing neural networks and can thus be appended to the state-of-theart networks to increase their robustness to adversarial attacks. We demonstrated empirically and theoretically that the robustness of SODEF mainly derives from its stability and proposed a training method that imposes constraints to ensure all eigenvalues of the Jacobian matrix of the neural ODE layer have negative real parts. When each classification class converges to its own equilibrium points, we showed that the last FC layer can be designed in such a way that the distance between the stable equilibrium points is maximized, which further improves the network’s robustness. The effectiveness of SODEF has been verified under several popular while-box attacks.
|
| 221 |
+
|
| 222 |
+
# Acknowledgments and Disclosure of Funding
|
| 223 |
+
|
| 224 |
+
This research is supported in part by A\*STAR under its RIE2020 Advanced Manufacturing and Engineering (AME) Industry Alignment Fund – Pre Positioning (IAF-PP) (Grant No. A19D6a0053) and the RIE2020 Industry Alignment Fund – Industry Collaboration Projects (IAF-ICP) Funding Initiative, as well as cash and in-kind contribution from the industry partner(s). The computational work for this article was partially performed on resources of the National Supercomputing Centre, Singapore (https://www.nscc.sg).
|
| 225 |
+
|
| 226 |
+
# Broader Impact
|
| 227 |
+
|
| 228 |
+
Our work, which contributes to more robust DNNs, is supposed to mitigate the threat of adversarial attacks. However, on the hand, the reliable deployment of DNNs in automation of tasks will potentially bring mass-scale unemployment and social unrest. As DNNs become more robust and more tasks, especially those whose failures will bring high risks to human lives or large property losses under adversarial attacks, fall into the automatic task category, massive jobs could disappear.
|
| 229 |
+
|
| 230 |
+
# References
|
| 231 |
+
|
| 232 |
+
[1] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet classification with deep convolutional neural networks,” in Proc. Advances Neural Inf. Process. Syst., 2012.
|
| 233 |
+
[2] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, Nov. 1998.
|
| 234 |
+
[3] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, and B. Kingsbury, “Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups,” IEEE Signal Process. Mag., vol. 29, no. 6, pp. 82–97, Nov. 2012.
|
| 235 |
+
[4] D. Andor, C. Alberti, D. Weiss, A. Severyn, A. Presta, K. Ganchev, S. Petrov, and M. Collins, “Globally normalized transition-based neural networks,” in Proc. Annu. Meeting Assoc, Comput. Linguistics, 2016.
|
| 236 |
+
[5] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus, “Intriguing properties of neural networks,” in Proc. Int. Conf. Learning Representations, 2013.
|
| 237 |
+
[6] H. Yan, J. Du, V. Y. Tan, and J. Feng, “On robustness of neural ordinary differential equations,” in Proc. Advances Neural Inf. Process. Syst., 2018, pp. 1–13.
|
| 238 |
+
[7] E. Haber and L. Ruthotto, “Stable architectures for deep neural networks,” Inverse Problems, vol. 34, no. 1, pp. 1–23, Dec. 2017.
|
| 239 |
+
[8] X. Liu, S. Si, Q. Cao, S. Kumar, and C.-J. Hsieh, “How does noise help robustness? Explanation and exploration under the neural sde framework,” in Proc. Conf. Comput. Vision Pattern Recognition, 2020, pp. 282–290.
|
| 240 |
+
[9] R. T. Chen, Y. Rubanova, J. Bettencourt, and D. Duvenaud, “Neural ordinary differential equations,” arXiv preprint arXiv:1806.07366, 2018.
|
| 241 |
+
[10] C.-T. Chen and B. Shafai, Linear system theory and design. New York: Oxford university press New York, 1999.
|
| 242 |
+
[11] Y. LeCun, C. Corte, and C. Burges, “MNIST handwritten digit database,” ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist, vol. 2, 2010, (Last accessed: Dec 1, 2020).
|
| 243 |
+
[12] A. Krizhevsky and G. Hinton, “Learning multiple layers of features from tiny images,” Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 244 |
+
[13] A. M ˛adry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu, “Towards deep learning models resistant to adversarial attacks,” in Proc. Int. Conf. Learning Representations, 2018.
|
| 245 |
+
[14] E. Haber and L. Ruthotto, “Stable architectures for deep neural networks,” Inverse Problems, vol. 34, no. 1, 2018.
|
| 246 |
+
[15] Y. Huang, Y. Yu, H. Zhang, Y. Ma, and Y. Yao, “Adversarial robustness of stabilized neuralodes might be from obfuscated gradients,” arXiv preprint arXiv:2009.13145, 2020.
|
| 247 |
+
[16] L. Mingjie, H. Lingshen, and L. Zhouchen, “Implicit Euler skip connections: Enhancing adversarial robustness via numerical stability,” in Proc. Int. Conf. Machine Learning, 2020.
|
| 248 |
+
[17] I. J. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and harnessing adversarial examples,” in Proc. Int. Conf. Learning Representations, 2015.
|
| 249 |
+
[18] D. Arrowsmith and C. M. Place, Dynamical systems: differential equations, maps, and chaotic behaviour. London: CRC Press, 1992.
|
| 250 |
+
[19] R. A. Horn and C. R. Johnson, Matrix analysis. New York: Cambridge university press, 2012.
|
| 251 |
+
[20] L. Van der Maaten and G. Hinton, “Visualizing data using t-sne,” J. Mach. Learning Res., vol. 9, no. 11, pp. 2580–2605, Nov. 2008.
|
| 252 |
+
[21] K. Hornik, “Approximation capabilities of multilayer feedforward networks,” Neural Networks, vol. 4, no. 2, pp. 251–257, Oct. 1991.
|
| 253 |
+
[22] Y. Luo, Y. Wong, S. M. Kankanhalli, and Q. Zhao, “Direction concentration learning: Enhancing congruency in machine learning,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 43, no. 1, pp. 1928 – 1946, Jun. 2021.
|
| 254 |
+
[23] M. Tan and Q. Le, “Efficientnet: Rethinking model scaling for convolutional neural networks,” in Proc. Int. Conf. Mach. Learning, 2019, pp. 6105–6114.
|
| 255 |
+
[24] Github pytorch-cifar repository. Accessed: May 1, 2021. [Online]. Available: https: //github.com/kuangliu/pytorch-cifar
|
| 256 |
+
[25] T. Pang, X. Yang, Y. Dong, H. Su, and J. Zhu, “Bag of tricks for adversarial training,” in Proc. Int. Conf. Learning Representations, 2021.
|
| 257 |
+
[26] F. Croce and M. Hein, “Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks,” in Proc. Int. Conf. Mach. Learning, 2020, pp. 2206–2216.
|
| 258 |
+
[27] ——, “Minimally distorted adversarial examples with a fast adaptive boundary attack,” in Proc. Int. Conf. Mach. Learning, 2020, pp. 2196–2205.
|
| 259 |
+
[28] M. Andriushchenko, F. Croce, N. Flammarion, and M. Hein, “Square attack: a query-efficient black-box adversarial attack via random search,” in Proc. European Conf. Comput. Vision. Springer, 2020, pp. 484–501.
|
| 260 |
+
|
| 261 |
+
# Checklist
|
| 262 |
+
|
| 263 |
+
1. For all authors...
|
| 264 |
+
|
| 265 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 266 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 267 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes]
|
| 268 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 269 |
+
|
| 270 |
+
2. If you are including theoretical results...
|
| 271 |
+
|
| 272 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] . See Assumption 1 and Assumption 2
|
| 273 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] . See supplementary material.
|
| 274 |
+
|
| 275 |
+
3. If you ran experiments...
|
| 276 |
+
|
| 277 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] .
|
| 278 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] . See Sections 3.1 and 4
|
| 279 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Having ODE blocks in our model, it would be too computationally expensive to repeat experiments for many times. We repeated each experiment for 2-3 times and we observe the deviation of the classification results is within $\pm 3 \%$ , though these experimental repetitions are not enough to construct error bars.
|
| 280 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 3.1.
|
| 281 |
+
|
| 282 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 283 |
+
|
| 284 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Sections 3.1 and 4 for the open-source models we have used from GitHub.
|
| 285 |
+
(b) Did you mention the license of the assets? [No] . Please see the licenses given in the GitHub link.
|
| 286 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] No new assets.
|
| 287 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] MNIST, CIFAR-10 and CIFAR-100 are all open-source datasets.
|
| 288 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] There is no identifiable information or offensive content in the datasets.
|
| 289 |
+
|
| 290 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 291 |
+
|
| 292 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 293 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 294 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/B1eksh4KvH/B1eksh4KvH.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CURRICULARFACE: ADAPTIVE CURRICULUM LEARN-ING LOSS FOR DEEP FACE RECOGNITION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
As an emerging topic in face recognition, designing margin-based loss functions can increase the feature margin between different classes for enhanced discriminability. More recently, absorbing the idea of mining-based strategies is adopted to emphasize the misclassified samples and achieve promising results. However, during the entire training process, the prior methods either do not explicitly emphasize the sample based on its importance that renders the hard samples not fully exploited; or explicitly emphasize the effects of semi-hard/hard samples even at the early training stage that may lead to convergence issue. In this work, we propose a novel Adaptive Curriculum Learning loss (CurricularFace) that embeds the idea of curriculum learning into the loss function to achieve a novel training strategy for deep face recognition, which mainly addresses easy samples in the early training stage and hard ones in the later stage. Specifically, our CurricularFace adaptively adjusts the relative importance of easy and hard samples during different training stages. In each stage, different samples are assigned with different importance according to their corresponding difficultness. Extensive experimental results on popular benchmarks demonstrate the superiority of our CurricularFace over the state-of-the-art competitors. Code will be available upon publication.
|
| 8 |
+
|
| 9 |
+
# INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The success of Convolutional Neural Networks (CNNs) on face recognition can be mainly credited to : enormous training data, network architectures, and loss functions. Recently, designing appropriate loss functions that enhance discriminative power is pivotal for training deep face CNNs.
|
| 12 |
+
|
| 13 |
+
Current state-of-the-art face recognition methods mainly adopt softmax-based classification loss. Since the learned features with the original softmax is not discriminative enough for the open-set face recognition problem, several margin-based variants have been proposed to enhance features’ discriminative power. For example, explicit margin, i.e., CosFace (Wang et al., 2018a), Sphereface (Li et al., 2017), ArcFace (Deng et al., 2019), and implicit margin, i.e., Adacos (Zhang et al., 2019a), supplement the original softmax function to enforce greater intra-class compactness and inter-class discrepancy, which are shown to result in more discriminate features. However, these margin-based loss functions do not explicitly emphasize each sample according to its importance.
|
| 14 |
+
|
| 15 |
+
As demonstrated in Chen et al. (2019), hard sample mining is also a critical step to further improve the final accuracy. Recently, Triplet loss (Schroff et al., 2015) and SV-Arc-Softmax (Wang et al., 2018b) integrate the motivations of both margin and mining into one framework for deep face recognition. Triplet loss adopts a semi-hard mining strategy to obtain semi-hard triplets and enlarge the margin between triplet samples. SV-Arc-Softmax (Wang et al., 2018b) clearly defines hard samples as misclassified samples and emphasizes them by increasing the weights of their negative cosine similarities with a preset constant. In a nutshell, mining-based loss functions explicitly emphasize the effects of semi-hard or hard samples.
|
| 16 |
+
|
| 17 |
+
However, there are drawbacks in training strategies of both margin- and mining-based loss functions. For margin-based methods, mining strategy is ignored and thus the difficultness of each sample is not fully exploited, which may lead to convergence issues when using a large margin on small backbones, e.g., MobileFaceNet (Chen et al., 2018). As shown in Fig. 1, the modulation coefficient for the negative cosine similarities $I ( \cdot )$ is fixed as a constant 1 in ArcFace for all samples during the entire training process. For mining-based methods, over-emphasizing hard samples in early training stage may hinder the model to converge. As SV-Arc-Softmax claimed, the manually defined constant $t$ plays a key role in the model convergence property and a slight larger value (e.g., ${ > } 1 . 4$ ) may cause the model difficult to converge. Thus $t$ needs to be carefully tuned.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Different training strategies for modulating negative cosine similarities of hard samples (i.e., the mis-classified sample) in ArcFace, SV-Arc-Softmax and our CurricularFace. Left: The modulation coefficients $I ( t , \cos \theta _ { j } )$ for negative cosine similarities of hard samples in different methods, where $t$ is an adaptively estimated parameter and $\theta _ { j }$ denotes the angle between the hard sample and the non-ground truth $j$ -class center. Right: The corresponding hard samples’ negative cosine similarities $N ( t , \cos \theta _ { j } ) = I ( t , \cos \theta _ { j } ) \cos \theta _ { j } + c$ after modulation, where $c$ indicates a constant. On one hand, during early training stage (e.g., $t$ is close to 0), hard sample’s negative cosine similarities is usually reduced and thus leads to smaller hard sample loss than the original one. Therefore, easier samples are relatively emphasized; during later training stage (e.g., $t$ is close to 1), the hard sample’s negative cosine similarities are enhanced and thus leads to larger hard sample loss. On the other hand, in the same training stage, we modulate the hard samples’ negative cosine similarities with $\cos \theta _ { j }$ . Specifically, the smaller the angle $\theta _ { j }$ is, the larger the modulation coefficient should be.
|
| 21 |
+
|
| 22 |
+
In this work, we propose a novel adaptive curriculum learning loss, termed CurricularFace, to achieve a novel training strategy for deep face recognition. Motivated by the nature of human learning that easy cases are learned first and then come the hard ones (Bengio et al., 2009), our CurricularFace incorporates the idea of Curriculum Learning (CL) into face recognition in an adaptive manner, which differs from the traditional CL in two aspects. First, the curriculum construction is adaptive. In traditional CL, the samples are ordered by the corresponding difficultness, which are often defined by a prior and then fixed to establish the curriculum. In CurricularFace, the samples are randomly selected in each mini-batch, while the curriculum is established adaptively via mining the hard samples online, which shows the diversity in samples with different importance. Second, the importance of hard samples are adaptive. On one hand, the relative importance between easy and hard samples is dynamic and could be adjusted in different training stages. On the other hand, the importance of each hard sample in current mini-batch depends on its own difficultness.
|
| 23 |
+
|
| 24 |
+
Specifically, the mis-classified samples in mini-batch are chosen as hard samples and weighted by adjusting the modulation coefficients $I ( t , c o s \theta _ { j } )$ of cosine similarities between the sample and the non-ground truth class center vectors, i.e., negative cosine similarity $N ( t , c o s \theta _ { j } )$ . To achieve the goal of adaptive curricular learning in the entire training, we design a novel coefficient function $I ( \cdot )$ that is determined by two factors: 1) the adaptively estimated parameter $t$ that utilizes moving average of positive cosine similarities between samples and the corresponding ground-truth class center to unleash the burden of manually tuning; and 2) the angle $\theta _ { j }$ that defines the difficultness of hard samples to achieve adaptive assignment. To sum up, the contributions of this work are:
|
| 25 |
+
|
| 26 |
+
• We propose an adaptive curriculum learning loss for face recognition, which automatically emphasizes easy samples first and hard samples later. To the best of our knowledge, it is the first work to introduce the idea of adaptive curriculum learning for face recognition. We design a novel modulation coefficient function $I ( \cdot )$ to achieve adaptive curriculum learning during training, which connects positive and negative cosine similarity simultaneously without the need of manually tuning any additional hyper-parameter. • We conduct extensive experiments on popular facial benchmarks, which demonstrate the superiority of our CurricularFace over the state-of-the-art competitors.
|
| 27 |
+
|
| 28 |
+
# RELATED WORK
|
| 29 |
+
|
| 30 |
+
Margin-based loss function Loss design is pivotal for large-scale face recognition. Current stateof-the-art deep face recognition methods mostly adopt softmax-based classification loss. Since the learned features with the original softmax loss are not guaranteed to be discriminative enough for open-set face recognition problem, margin-based losses (Liu et al., 2016; Li et al., 2017; Deng et al., 2019) are proposed. Though the margin-based loss functions are verified to obtain good performance, they do not take the difficultness of each sample into consideration, while our CurricularFace emphasizes easy samples first and hard samples later, which is more reasonable and effectiveness.
|
| 31 |
+
|
| 32 |
+
Mining-based loss function Though some mining-based loss function such as Focal loss (Lin et al., 2017), Online Hard Sample Mining (OHEM) (Shrivastava et al., 2016) are prevalent in the field of object detection, they are rarely used in face recognition. OHEM focuses on the large-loss samples in one mini-batch, in which the percentage of the hard samples is empirically determined and easy samples are completely discarded. Focal loss is a soft mining variant that rectifies the loss function to an elaborately designed form, where two hyper-parameters should be tuned with a lot of efforts to decide the weights of each samples and hard samples are emphasized by reducing the weight of easy samples. The recent work, SV-Arc-Softmax (Wang et al., 2018b) fuses the motivations of both margin and mining into one framework for deep face recognition. They define hard samples as misclassified samples and enlarge the weight of hard samples with a preset constant. Our method differs from SV-Arc-Softmax in three aspects: 1) We do not always emphasize the hard samples, especially in the early training stages. 2) We assign different weights for hard samples according to their corresponding difficultness. 3) There’s no need in our method to manually tune the additional hyper-parameter $t$ , which is estimated adaptively.
|
| 33 |
+
|
| 34 |
+
Curriculum Learning Learning from easier samples first and harder samples later is a common strategy in Curriculum Learning (CL) (Bengio et al., 2009), (Zhou & Bilmes, 2018). The key problem in CL is to define the difficultness of each sample. For example, Basu & Christensen (2013) takes the negative distance to the boundary as the indicator for easiness in classification. However, the ad-hoc curriculum design in CL turns out to be difficult to implement in different problems. To alleviate this issue, Kumar et al. (2010) designs a new formulation, called Self-Paced Learning (SPL), where examples with lower losses are considered to be easier and emphasized during training. The key differences between our CurricularFace with SPL are: 1) Our method focuses on easier samples in the early training stage and emphasizes hard samples in the later training stage. 2) Our method proposes a novel modulation function $N ( \cdot )$ for negative cosine similarities, which achieves not only adaptive assignment on modulation coefficients $I ( \cdot )$ for different samples in the same training stage, but also adaptive curriculum learning strategy in different training stages.
|
| 35 |
+
|
| 36 |
+
# THE PROPOSED CURRICULARFACE
|
| 37 |
+
|
| 38 |
+
PRELIMINARY KNOWLEDGE ON LOSS FUNCTION
|
| 39 |
+
|
| 40 |
+
The original softmax loss is formulated as follows:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathcal { L } = - \log \frac { e ^ { W _ { y _ { i } } x _ { i } + b _ { y _ { i } } } } { \sum _ { j = 1 } ^ { n } e ^ { W _ { j } x _ { i } + b _ { j } } } ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $x _ { i } \in R ^ { d }$ denotes the deep feature of $i$ -th sample which belongs to the $y _ { i }$ class, $W _ { j } \in R ^ { d }$ denotes the $j$ -th column of the weight $W \in R ^ { d \times n }$ and $b _ { j }$ is the bias term. The class number and the embedding feature size are $n$ and $d$ , respectively. In practice, the bias is usually set to $b _ { j } = 0$ and the individual weight is set to $| | W _ { j } | | = 1$ by $l _ { 2 }$ normalization. The deep feature is also normalized and re-scaled to $s$ . Thus, the original softmax can be modified as follows:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathcal { L } = - \log \frac { e ^ { s ( \cos \theta _ { y _ { i } } ) } } { e ^ { s ( \cos \theta _ { y _ { i } } ) } + \sum _ { j = 1 , j \neq y _ { i } } ^ { n } e ^ { s ( \cos \theta _ { j } ) } } .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Since the learned features with original softmax loss may not be discriminative enough for open-set face recognition problem, several variants are proposed and can be formulated in a general form:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathcal { L } = - G ( \boldsymbol { p } ( \boldsymbol { x } _ { i } ) ) \log \frac { e ^ { s T ( \cos \theta _ { y _ { i } } ) } } { e ^ { s T ( \cos \theta _ { y _ { i } } ) + \sum _ { j = 1 , j \neq y _ { i } } ^ { n } e ^ { s N ( t , \cos \theta _ { j } ) } } , }
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\begin{array} { r l r } { p ( x _ { i } ) } & { = } & { \frac { e ^ { s T ( \cos \theta _ { y _ { i } } ) } } { e ^ { s T ( \cos \theta _ { y _ { i } } ) + \sum _ { j = 1 , j \neq y _ { i } } ^ { n } e ^ { s N ( t , \cos \theta _ { j } ) } } } } \end{array}$ esN(t,cos θj) is the predicted ground truth probability and $G ( \boldsymbol { p } ( \boldsymbol { x } _ { i } ) )$ is an indicator function. $T ( \cos \theta _ { y _ { i } } )$ and $N ( t , \cos \theta _ { j } ) = I ( t , \cos \theta _ { j } ) \cos \theta _ { j } + c$ are the functions to modulate the positive and negative cosine similarities, respectively, where $c$ is a constant, and $I ( t , \cos \theta _ { j } )$ denotes the modulation coefficients of negative cosine similarities. In margin-based loss function, e.g, ArcFace, $G ( p ( x _ { i } ) ) = 1$ , $T ( \cos \theta _ { y _ { i } } ) = \cos ( \theta _ { y _ { i } } + m )$ , and $N ( t , \cos \theta _ { j } ) = \cos \theta _ { j }$ . It only modifies the positive cosine similarity of each sample to enhance the feature discrimination. As shown in Fig. 1, the modulation coefficients of each sample’ negative cosine similarity $I ( \cdot )$ is fixed as 1. The recent work, SV-Arc-Softmax emphasizes hard samples by increasing $I ( t , \cos \theta _ { j } )$ for hard samples. That is, $G ( p ( x _ { i } ) ) = 1$ and $N ( t , \mathrm { c o s } _ { \theta _ { j } } )$ is formulated as follows:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
N ( t , c o s _ { \theta _ { j } } ) = \left\{ \begin{array} { l l } { \cos \theta _ { j } , } & { T ( \cos \theta _ { y _ { i } } ) - \cos \theta _ { j } \geq 0 } \\ { t \cos \theta _ { j } + t - 1 , } & { T ( \cos \theta _ { y _ { i } } ) - \cos \theta _ { j } < 0 . } \end{array} \right.
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
If a sample is defined to be easy, its negative cosine similarity is kept the same as the original one, $\cos \theta _ { j }$ ; if as a hard sample, its negative cosine similarity becomes $t \cos \theta _ { j } + t - 1$ . That is, as shown in Fig. 1, $I ( \cdot )$ is a constant and determined by a preset hyper-parameter $t$ . Meanwhile, since $t$ is always larger than 1, $t \cos \theta _ { j } + t - 1 > \cos \theta _ { j }$ always holds true, which means the model always focuses on hard samples, even in the early training stage. However, the parameter $t$ is sensitive that a large pre-defined value $( e . g . , > 1 . 4 ,$ ) may lead to convergence issue.
|
| 65 |
+
|
| 66 |
+
# ADAPTIVE CURRICULAR LEARNING LOSS
|
| 67 |
+
|
| 68 |
+
Next, we present the details of our proposed adaptive curriculum learning loss, which is the first attempt to introduce adaptive curriculum learning into deep face recognition. The formulation of our loss function is also contained in the general form, where $G ( p ( x _ { i } ) ) = 1$ , positive and negative cosine similarity functions are defined as follows:
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
T ( \cos \theta _ { y _ { i } } ) = \cos ( \theta _ { y _ { i } } + m ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
N ( t , \cos _ { \theta _ { j } } ) = \left\{ { \begin{array} { l l } { \cos \theta _ { j } , } & { T ( \cos \theta _ { y _ { i } } ) - \cos \theta _ { j } \geq 0 } \\ { \cos \theta _ { j } ( t + \cos \theta _ { j } ) , } & { T ( \cos \theta _ { y _ { i } } ) - \cos \theta _ { j } < 0 . } \end{array} } \right.
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
It should be noted that the positive cosine similarity can adopt any margin-based loss functions and here we adopt ArcFace as the example. As shown in Fig. 1, the modulation coefficient of hard sample negative cosine similarity $I ( t , \bar { \theta _ { j } } )$ depends on both the value of $t$ and $\theta _ { j }$ . In the early training stage, learning from easy samples is beneficial to model convergence. Thus, $t$ should be close to zero and $I ( \cdot )$ is smaller than 1. Therefore, the weights of hard samples are reduced and the easy samples are emphasized relatively. As training goes on, the model gradually focuses on the hard samples, i.e., the value of $t$ shall increase and $I ( \cdot )$ is larger than 1. Then, the weights of hard samples are enlarged, which are thus emphasized. Moreover, within the same training stage, $I ( \cdot )$ is monotonically decreasing with $\theta _ { j }$ so that harder sample can be assigned with larger coefficient according to its difficultness. The value of the parameter $t$ is automatically estimated in our CurricularFace, otherwise it would require a lot of efforts for manually tuning.
|
| 79 |
+
|
| 80 |
+
Adaptive estimation of $t$ It is critical to determine appropriate values of $t$ in different training stages. Ideally the value of $t$ can indicate the model training process. We empirically find the average of positive cosine similarities is a good indicator. However, mini-batch statistic-based methods usually face an issue: when many extreme data are sampled in one mini-batch, the statistics can be vastly noisy and the estimation will be unstable. Exponential Moving Average (EMA) is a common solution to address this issue (Li et al., 2019). Specifically, let $r ^ { ( k ) }$ be the average of the positive cosine similarities of the $k$ -th batch and be formulated as $\begin{array} { r } { r ^ { ( k ) } = \sum _ { i } \cos \theta _ { y _ { i } } } \end{array}$ , we have:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
t ^ { ( k ) } = \alpha r ^ { ( k ) } + ( 1 - \alpha ) t ^ { ( k - 1 ) } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $t ^ { 0 } = 0$ , $\alpha$ is the momentum parameter and set to 0.99. As shown in Fig. 2, the parameter $t$ increases with the model training, thus the gradient modulation coefficients’ range of hard sample, $M ( \cdot ) = 2 \cos \theta _ { j } + t$ , also increases. Therefore, hard samples are emphasized gradually. With the EMA, we avoid the hyper-parameter tuning and make the modulation coefficients of hard sample
|
| 87 |
+
|
| 88 |
+
# Algorithm 1: CurricularFace
|
| 89 |
+
|
| 90 |
+
Input: The deep feature of $_ { i }$ -th sample $x _ { i }$ with its corresponding label $y _ { i }$ , last fully-connected layer parameters $W$ , cosine similarity $\cos \theta _ { j }$ between two vectors, embedding network parameters $\Theta$ , learning rate $\lambda$ , number of iteration $k$ , parameter $t$ , and margin $m$
|
| 91 |
+
$k 0$ , $t \gets 0$ , $m \gets 0 . 5$ ;
|
| 92 |
+
while not converged do $k \gets k + 1$ ; if $\cos ( \theta _ { y _ { i } } + m ) > \cos \theta _ { j }$ then $N ( t , \cos \theta _ { j } ) = \cos \theta _ { j }$ ; else $\begin{array} { r l } { \small \int _ { - \infty } ( t , \cos \theta _ { j } ) = ( t ^ { ( k ) } + \cos \theta _ { j } ) \cos \theta _ { j } \ ; } \end{array}$ end $T ( \cos \theta _ { y _ { i } } ) = \cos ( \theta _ { y _ { i } } + m )$ ; Compute the loss $\mathcal { L }$ by Eq. 8; Compute the back-propagation error of $x _ { i }$ and $W _ { j }$ by Eq. 9; Update the parameters $W$ and $\Theta$ by: $\begin{array} { r } { \boldsymbol { W } ^ { ( k + 1 ) } = \boldsymbol { W } ^ { ( k ) } - \lambda ^ { ( k ) } \frac { \partial \boldsymbol { L } } { \partial \boldsymbol { W } } , \Theta ^ { ( k + 1 ) } = \Theta ^ { ( k ) } - \lambda ^ { ( k ) } \frac { \partial \boldsymbol { L } } { \partial x _ { i } } \frac { \partial x _ { i } } { \partial \Theta ^ { ( k ) } } ; } \end{array}$ Update the parameter $t$ by Eq. 7;
|
| 93 |
+
|
| 94 |
+
negative cosine similarities $I ( \cdot )$ adaptive to the current training stage. To sum up, the loss function of our CurricularFace is formulated as follows:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } = - \log \frac { e ^ { s \cos ( \theta _ { y _ { i } } + m ) } } { e ^ { s \cos ( \theta _ { y _ { i } } + m ) } + \sum _ { j = 1 , j \neq y _ { i } } ^ { n } e ^ { s N ( t ^ { ( k ) } , \cos \theta _ { j } ) } } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $N ( t ^ { ( k ) } , \cos \theta _ { j } )$ is defined in Eq. 6. The entire training process is summarized in Algorithm 1.
|
| 101 |
+
|
| 102 |
+
Fig. 3 illustrates how the loss changes from ArcFace to our CurricularFace during training. Here are some observations: 1) As we excepted, hard samples are suppressed in early training stage but emphasized later. 2) The ratio is monotonically increasing with $c o s \theta _ { j }$ , since the larger $c o s \theta _ { j }$ is, the harder the sample is. 3) The positive cosine similarity of a perceptualwell image is often large. However, during the early training stage, the negative cosine similarities of the perceptual-well image may also be large so that it could be classified as the hard one.
|
| 103 |
+
|
| 104 |
+
Optimization Next, we show our CurricularFace can be easily optimized by the conventional stochastic gradient descent. Assuming $x _ { i }$ denotes the deep feature of $i$ -th sample which belongs to the $y _ { i }$ class, the input of the proposed function is the logit $f _ { j }$ , where $j$ denotes the $j$ -th class.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Illustrations on the adaptive parameter $t$ (red line) and gradient modulation coefficients $M ( \cdot ) = 2 \cos \theta _ { j } + t$ of hard samples (green area). Since the number of mined hard samples reduces with the model training, the green area $M ( \cdot )$ is relatively smooth in early stage and there are some burrs in later stage.
|
| 108 |
+
|
| 109 |
+
In the forwarding process, when $j ~ = ~ y _ { i }$ , it is the same as the ArcFace, i.e., $f _ { j } = s T ( \cos \theta _ { y _ { i } } )$ $T ( \cos \theta _ { y _ { i } } ) = \cos ( \theta _ { y _ { i } } + m )$ . When $j \neq y _ { i }$ , it has two cases, if $x _ { i }$ is an easy sample, it is the the same as the original softmax, i.e., $f _ { j } = s \cos \theta _ { j }$ . Otherwise, it will be modulated as $f _ { j } = s N ( t , \cos \theta _ { j } )$ , where $N ( t , \cos \theta _ { j } ) = ( t + \cos \theta _ { j } ) \cos \theta _ { j }$ . In the backward propagation process, the gradient of $x _ { i }$ and $W _ { j }$ can also be divided into three cases and formulated as follows:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\frac { \partial L } { \partial x _ { i } } = \left\{ \begin{array} { l l } { \frac { \partial L } { \partial f _ { y _ { i } } } ( s \frac { \sin ( \theta _ { y _ { i } } + m ) } { \sin \theta _ { y _ { i } } } ) W _ { y _ { i } } , } & { j = y _ { i } } \\ { \frac { \partial L } { \partial f _ { j } } s W _ { j } , } & { j \neq y _ { i } , \mathrm { e a s y } , \frac { \partial L } { \partial W _ { j } } = \left\{ \begin{array} { l l } { \frac { \partial L } { \partial f _ { y _ { i } } } ( s \frac { \sin ( \theta _ { y _ { i } } + m ) } { \sin \theta _ { y _ { i } } } ) x _ { i } , } & { j = y _ { i } } \\ { \frac { \partial L } { \partial f _ { j } } s x _ { i } , } & { j \neq y _ { i } , \mathrm { e a s y } } \\ { \frac { \partial L } { \partial f _ { j } } s ( 2 \cos \theta _ { j } + t ) W _ { j } } & { j \neq y _ { i } , \mathrm { h a r d } } \end{array} \right. , } \end{array} \right.
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Based on the above formulations, we can find the gradient magnitude of the hard sample is determined by two parts, the negative cosine similarity $N ( \cdot )$ and the value of $t$ .
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Illustrations on (ratio between our loss and ArcFace, maximum $c o s \theta _ { j }$ ) from early (Top) to later (Bottom) training stages.
|
| 119 |
+
|
| 120 |
+
Table 1: Decision boundaries of popular loss functions.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan=1 colspan=1>Loss</td><td rowspan=1 colspan=1>Decision Boundary</td></tr><tr><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>cosOy=cos0j</td></tr><tr><td rowspan=1 colspan=1>SphereFace</td><td rowspan=1 colspan=1>cos(m0y)=cos0j</td></tr><tr><td rowspan=1 colspan=1>CosFace</td><td rowspan=1 colspan=1>cosθy-m=cos0j</td></tr><tr><td rowspan=1 colspan=1>ArcFace</td><td rowspan=1 colspan=1>cos(0y;+m)=cos0j</td></tr><tr><td rowspan=1 colspan=1>SV-Arc-Softmax</td><td rowspan=1 colspan=1>cos(0y+m)=cos0j(easy)cos(0y;+m)=tcos0j+t-i(hard)</td></tr><tr><td rowspan=1 colspan=1>CurricularFace (Ours)</td><td rowspan=1 colspan=1>cos(0yi+m)=cos0j (easy)cos(0y:+m)=(t+cos0j) cos0j(hard)</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Table 2: Verification performance of different values of $t$
|
| 125 |
+
|
| 126 |
+
<table><tr><td>Dataset (%)</td><td>t=0</td><td>t=0.3</td><td>t=0.7</td><td>t=1</td><td>Adaptive t</td></tr><tr><td>LFW</td><td>99.32</td><td>99.37</td><td>99.42</td><td>99.45</td><td>99.47</td></tr><tr><td>CFP-FP</td><td>95.90</td><td>96.47</td><td>96.66</td><td>93.94</td><td>96.96</td></tr></table>
|
| 127 |
+
|
| 128 |
+
# DISCUSSIONS WITH SOTA LOSS FUNCTIONS
|
| 129 |
+
|
| 130 |
+
Comparison with ArcFace and SV-Arc-Softmax We first discuss the difference between our CurricularFace and the two competitors, ArcFace and SV-Arc-Softmax, from the perspective of the decision boundary in Tab. 1. ArcFace introduces a margin function $T ( \cos \theta _ { y _ { i } } ) \dot { ~ = ~ } \dot { \cos ( \theta _ { y _ { i } } + m ) }$ from the perspective of positive cosine similarity. As shown in Fig. 4, its decision condition changes from $\cos \theta _ { y _ { i } } = \cos \theta _ { j }$ (i.e., blue line) to $\cos ( \dot { \theta } _ { y _ { i } } + m ) = \cos \bar { \theta } _ { j }$ (i.e., red line) for each sample. SV-Arc-Softmax introduces additional margin from the perspective of negative cosine similarity for hard samples, and the decision boundary becomes $\cos ( \theta _ { y _ { i } } + m ) = t \cos \theta _ { j } + t - 1$ (i.e., green line). Conversely, we adaptively adjust the weights of hard samples in different training stages. The decision condition becomes $\cos ( \theta _ { y _ { i } } + m ) = ( t + \cos \theta _ { j } ) \cos \theta _ { j }$ (i.e., purple line). During the training stage, the decision boundary for hard samples changes from one purple line (early stage) to another (later stage), which emphasizes easy samples first and hard samples later.
|
| 131 |
+
|
| 132 |
+
Comparison with Focal loss Focal loss is a soft mining-based loss, which is formulated as: $G ( \bar { p ( x ) } ) = \alpha ( 1 - p ( x _ { i } ) ) ^ { \beta }$ , where $\alpha$ and $\beta$ are modulating factors that need to be tuned manually. The definition of hard samples in Focal loss is ambiguous, since it always focuses on relatively hard samples by reducing the weight of easier samples during the entire training process. In contrast, the definition of hard samples in our CurricularFace is more clear, i.e., mis-classified samples. Meanwhile, the weights of hard samples are adaptively determined in different training stages.
|
| 133 |
+
|
| 134 |
+
# EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
# IMPLEMENTATION DETAILS
|
| 137 |
+
|
| 138 |
+
Datasets We separately employ CASIA-WebFace (Yi et al., 2014) and refined MS1MV2 (Deng et al., 2019) as our training data for fair comparisons with other methods. We extensively test our method on several popular benchmarks, including LFW (Huang et al., 2007), CFP-FP (Sengupta et al., 2016), CPLFW (Zheng et al., 2018), AgeDB (Moschoglou et al., 2017), CALFW (Zheng et al., 2017), IJB-B (Whitelam et al., 2017), IJB-C (Maze et al., 2018), and MegaFace (KemelmacherShlizerman et al., 2016).
|
| 139 |
+
|
| 140 |
+
Training Setting We follow Deng et al. (2019) to generate the normalised faces $( 1 1 2 \times 1 1 2 )$ with five landmarks (Zhang et al., 2016). For the embedding network, we adopt ResNet50 and ResNet100 as in Deng et al. (2019). Our framework is implemented in Pytorch (Paszke et al., 2017). We train models on 4 NVIDIA Tesla P40 (24GB) GPU with batch size 512. The models are trained with SGD algorithm, with momentum 0.9 and weight decay $5 e - 4$ . On CASIA-WebFace, the learning rate starts from 0.1 and is divided by 10 at 28, 38, 46 epochs. The training process is finished at 50 epochs. On MS1MV2, we divide the learning rate at 10, 18, 22 epochs and finish at 24 epochs. We follow the common setting as Deng et al. (2019) to set scale $s = 6 4$ and margin $m = 0 . 5$ , respectively. Last but not least, since we only modify the loss function but use the same backbone as previous methods (e.g., ArcFace), NO additional time complexity is introduced for inference.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 4: From left to right, decision boundaries of ArcFace, SV-Arc-Softmax, and ours. Blue line, red line, green line and purple line denote the decision boundary of Softmax, ArcFace, SV-Arc-Softmax, and ours, respectively. $m$ denotes the angular margin added by ArcFace. $d$ denotes the additional margin of SVArc-Softmax and ours. In SV-Arc-Softmax, $d = ( t - 1 ) \cos \theta _ { j } +$ $t - 1$ . In ours, $d = ( t + \cos \theta _ { j } - 1 ) \cos \theta _ { j }$ .
|
| 144 |
+
|
| 145 |
+
Table 3: Verification performance of different strategies for setting t.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 5: Illustration on convergence issue with small backbone.
|
| 149 |
+
|
| 150 |
+
# ABLATION STUDY
|
| 151 |
+
|
| 152 |
+
Effects on Fixed vs. Adaptive Parameter $t$ We first investigate the effect of adaptive estimation of $t$ . We choose four fixed values between 0 and 1 for comparison. Specifically, 0 means the modulation coefficient $I ( \cdot )$ of each hard sample’s negative cosine similarity is always reduced based on its difficultness. In contrast, 1 means the hard samples are always emphasized. 0.3 and 0.7 are between the two cases. Tab. 2 shows that it is more effective to learn from easier samples first and hard samples later based on our adaptively estimated parameter $t$ .
|
| 153 |
+
|
| 154 |
+
Effects on Different Statistics for Estimating $t$ We now investigate the effects of several other statistics, i.e., mode of positive cosine similarities in a mini-batch, or mean of the predicted ground truth probability for estimating $t$ in our loss. As Tab. 3 shows, on one hand, the mean of positive cosine similarities is better than the mode. On the other hand, the positive cosine similarity is more accurate than the predicted ground truth probability to indicate the training stages.
|
| 155 |
+
|
| 156 |
+
Robustness on Training Convergence As claimed in Li (2019), ArcFace exists divergence issue when using small backbones like MobileFaceNet. As the result, softmax loss must be incorporated for pre-training. To illustrate the robustness of our loss function on convergence issue with small backbone, we use the MobileFaceNet as the network architecture and train it on CASIA-WebFace. As shown in Fig. 5, when the margin $m$ is set to 0.5, the model trained with our loss achieves 99.25 accuracy on LFW, while the model trained with ArcFace does not converge and the loss is NAN at about 2, 400-th step. When the margin $m$ is set to 0.45, both losses can converge, but our loss achieves better performance $( 9 9 . 2 0 \%$ vs. $9 9 . 1 0 \%$ ). Comparing the yellow and red curves, since the losses of hard samples are reduced in early training stages, our loss converges much faster in the beginning, leading to lower loss than ArcFace. Later on, the value of our loss is slightly larger than ArcFace, because we emphasize the hard samples in later stages. The results prove that learning from easy samples first and hard samples later is beneficial to model convergence.
|
| 157 |
+
|
| 158 |
+
# COMPARISONS WITH SOTA METHODS
|
| 159 |
+
|
| 160 |
+
Results on LFW, CFP-FP, CPLFW, AgeDB and CALFW Next, we train our CurricularFace on dataset MS1MV2 with ResNet100, and compare with the SOTA competitors on various benchmarks, including LFW for unconstrained face verification, CFP-FP and CPLFW for large pose variations, AgeDB and CALFW for age variations. As reported in Tab. 4, our CurricularFace achieves comparable result (i.e., $9 9 . 8 0 \%$ ) with the competitors on LFW where the performance is near saturated. While for both CFP-FP and CPLFW, our method shows superiority over the baselines including general methods, e.g., (Wen et al., 2016), (Cao et al., 2018b), and cross-pose methods, e.g., (Tran et al., 2017), (Peng et al., 2017), (Cao et al., 2018a) and (Deng et al., 2018). As a recent face recognition method, SV-Arc-Softmax achieves better performance than ArcFace, but still worse than Our CurricularFace. Finally, for AgeDB and CALFW, as Tab. 4 shows, our CurricularFace again achieves the best performance than all of the other state-of-the-art methods.
|
| 161 |
+
|
| 162 |
+
Table 4: Verification comparison with SOTA methods on various small-scale benchmarks.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Methods (%)</td><td>LFW</td><td>CFP-FP</td><td>CPLFW</td><td>AgeDB</td><td>CALFW</td></tr><tr><td>Center Loss (ECCV'16)</td><td>98.75</td><td>1</td><td>77.48</td><td>1</td><td>85.48</td></tr><tr><td>SphereFace (CVPR'17)</td><td>99.27</td><td>一</td><td>81.40</td><td></td><td>90.30</td></tr><tr><td>DRGAN (CVPR'17)</td><td>1</td><td>93.41</td><td>1</td><td></td><td>1</td></tr><tr><td>Peng et al. (ICCV'17)</td><td>一</td><td>93.76</td><td>一</td><td></td><td>一</td></tr><tr><td>VGGFace2 (FG'18)</td><td>99.43</td><td>一</td><td>84.00</td><td></td><td>90.57</td></tr><tr><td>Dream (CVPR'18)</td><td>1</td><td>93.98</td><td>一</td><td></td><td>一</td></tr><tr><td>Deng et al.(CVPR'18)</td><td>99.60</td><td>94.05</td><td></td><td></td><td></td></tr><tr><td>ArcFace (CVPR'19)</td><td>99.77</td><td>98.27</td><td>92.08</td><td>98.15</td><td>95.45</td></tr><tr><td>SV-Arc-Softmax</td><td>99.78</td><td>98.28</td><td>92.83</td><td>97.95</td><td>96.10</td></tr><tr><td>CurricularFace (Ours)</td><td>99.80</td><td>98.37</td><td>93.13</td><td>98.32</td><td>96.20</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 5: 1:1 verification TAR ( ${ \bf @ F A R = }$ 1e − 4) on IJB-B and IJB-C.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Methods (%)</td><td>IJB-B</td><td>IJB-C</td></tr><tr><td>SENet50 (FG'18)</td><td>80.0</td><td>84.1</td></tr><tr><td>Multicolumn (BMVC'18)</td><td>83.1</td><td>86.2</td></tr><tr><td>DCN (ECCV'18)</td><td>84.9</td><td>88.5</td></tr><tr><td>ArcFace-R100 (CVPR'19)</td><td>94.2</td><td>95.6</td></tr><tr><td>Adacos (CVPR'19)</td><td>1</td><td>92.4</td></tr><tr><td>P2SGrad (CVPR'19)</td><td>1</td><td>92.3</td></tr><tr><td>PFE (ICCV'19)</td><td>一</td><td>93.3</td></tr><tr><td>SV-Arc-Softmax</td><td>93.6</td><td>95.2</td></tr><tr><td>CurricularFace (Ours)</td><td>94.8</td><td>96.1</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 6: Verification comparison with SOTA methods on MegaFace Challenge 1 using FaceScrub as the probe set. Left table: ‘Id’ refers to the rank-1 face identification accuracy with 1M distractors, and ‘Ver’ refers to the face verification TAR at $1 0 ^ { - 6 }$ FAR. ‘R’ refers to data refinement on both probe set and 1M distractors. Right figure: Rank-1 identification results of recent SOTA methods on probe set refined from ArcFace.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>CASIA(%)</td><td>Id</td><td>Ver</td><td>MS1MV2(%)</td><td>Id</td><td>Ver</td><td>CosFace(CVPR’18)- 97.91</td><td></td></tr><tr><td>Contrastive Loss (CVPR'14)</td><td>65.21</td><td>78.86</td><td>CosFace-MS1MV2-R100</td><td>80.56</td><td>96.56</td><td></td><td></td></tr><tr><td>Triplet (CVPR'15)</td><td>64.79</td><td>78.32</td><td>CosFace-MS1MV2-R100, R</td><td>97.91</td><td>97.91</td><td></td><td>Adacos (CVPR'19)-97.41</td></tr><tr><td>Center Loss (ECCV'16)</td><td>65.49</td><td>80.14</td><td>ArcFace-MS1MV2-R100</td><td>81.03</td><td>96.98</td><td></td><td></td></tr><tr><td>SphereFace(CVPR'17)</td><td>72.73</td><td>85.56</td><td>ArcFace-MS1MV2-R100, R</td><td>98.35</td><td>98.48</td><td></td><td>P2SGrad (CVPR’19)-97.25</td></tr><tr><td>CosFace (CVRP'18)</td><td>77.11</td><td>89.88</td><td>PFE (ICCV'19)</td><td>78.95</td><td>92.51</td><td></td><td>AreFace (CVPR'19)-98.35</td></tr><tr><td>AM-Softmax (SPL'18)</td><td>72.47</td><td>84.44</td><td>Adacos,R(CVPR'19')</td><td>97.41</td><td></td><td></td><td></td></tr><tr><td>ArcFace-CASIA-R50 (CVPR'19)</td><td>77.50</td><td>92.34</td><td>P2SGrad,R(CVPR'19')</td><td>97.25</td><td></td><td></td><td>SV-Arc-Softmax (arXiv'19)- 97.14</td></tr><tr><td>ArcFace-CASIA-R50, R</td><td>91.75</td><td>93.69</td><td>SV-Arc-Softmax,R</td><td>97.14</td><td>97.57</td><td></td><td></td></tr><tr><td>Ours-CASIA-R50</td><td>77.65</td><td>92.91</td><td>Ours-MS1MV2-R100</td><td>81.26</td><td>97.26</td><td></td><td>CurricularFace (Ours)-98.71</td></tr><tr><td>Ours-CASIA-R50, R</td><td>92.48</td><td>94.55</td><td>Ours-MS1MV2-R100, R</td><td>98.71</td><td>98.64</td><td>97</td><td></td></tr></table>
|
| 173 |
+
|
| 174 |
+
Results on IJB-B and IJB-C The IJB-B dataset contains 1, 845 subjects with 21.8K still images and 55K frames from 7, 011 videos. In the 1:1 verification, there are 10, 270 positive matches and 8M negative matches. The IJB-C dataset is a further extension of IJB-B, which contains about 3, 500 identities with a total of 31, 334 images and 117, 542 unconstrained video frames. In the 1:1 verification, there are 19, 557 positive matches and 15, 638, 932 negative matches. On IJB-B and IJB-C datasets, we employ MS1MV2 and the ResNet100 for a fair comparison with recent methods. We follow the testing protocol in ArcFace and take the average of the image features as the corresponding template representation without bells and whistles. Tab. 5 exhibits the performance of different methods, e.g., Multicolumn (Xie & Zisserman, 2018), DCN (Xie et al., 2018), Adacos (Zhang et al., 2019a), P2SGrad (Zhang et al., 2019b), PFE (Shi et al., 2019) and SV-Arc-Softmax (Wang et al., 2018b) on IJB-B and IJB-C 1:1 verification, our method again achieves the best performance.
|
| 175 |
+
|
| 176 |
+
Results on MegaFace Finally, we evaluate the performance on the MegaFace Challenge. The gallery set of MegaFace includes 1M images of 690K subjects, and the probe set includes 100K photos of 530 unique individuals from FaceScrub. We report the two testing results under two protocols (large or small training set). Here, we use CASIA-WebFace and MS1MV2 under the small protocol and large protocol, respectively. In Tab. 6, our method achieves the best singlemodel identification and verification performance under both protocols, surpassing the recent strong competitors, e.g., CosFace, ArcFace, Adacos, P2SGrad and PFE. We also report the results following the ArcFace testing protocol, which refines both the probe set and the gallery set. As shown from the figure in Tab. 6, our method still clearly outperforms the competitors and achieves the best performance on both verification and identification.
|
| 177 |
+
|
| 178 |
+
# CONCLUSIONS
|
| 179 |
+
|
| 180 |
+
In this paper, we propose a novel Adaptive Curriculum Learning Loss that embeds the idea of adaptive curriculum learning into deep face recognition. Our key idea is to address easy samples in the early training stage and hard ones in the later stage. Our method is easy to implement and robust to converge. Extensive experiments on popular facial benchmarks demonstrate the effectiveness of our method compared to the state-of-the-art competitors. Following the main idea of this work, future research can be expanded in various aspects, including designing a better function $N ( \cdot )$ for negative cosine similarity that shares similar adaptive characteristic during training, and investigating the effects of noise samples that could be optimized as hard samples.
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
Sumit Basu and Janara Christensen. Teaching classification boundaries to humans. In AAAI, 2013.
|
| 185 |
+
|
| 186 |
+
Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ ICML, 2009.
|
| 187 |
+
|
| 188 |
+
Kaidi Cao, Yu Rong, Cheng Li, Xiaoou Tang, and Chen Change Loy. Pose-robust face recognition via deep residual equivariant mapping. In CVPR, 2018a.
|
| 189 |
+
|
| 190 |
+
Qiong Cao, Li Shen, Weidi Xie, Omkar M. Parkhi, and Andrew Zisserman. Vggface2: A dataset for recognising faces across pose and age. In FG, 2018b.
|
| 191 |
+
|
| 192 |
+
Beidi Chen, Weiyang Liu, Animesh Garg, Zhiding Yu, Anshumali Shrivastava, and Anima Anandkumar. Angular visual hardness. In ICML Workshop on Deep Phenomena, 2019.
|
| 193 |
+
|
| 194 |
+
Sheng Chen, Yang Liu, Xiang Gao, and Zhen Han. Mobilefacenets: Efficient cnns for accurate real-time face verification on mobile devices. In CCBR, 2018.
|
| 195 |
+
|
| 196 |
+
Jiankang Deng, Shiyang Cheng, Niannan Xue, Yuxiang Zhou, and Stefanos Zafeiriou. Uv-gan: Adversarial facial uv map completion for pose-invariant face recognition. In CVPR, 2018.
|
| 197 |
+
|
| 198 |
+
Jiankang Deng, Jia Guo, and Stefanos Zafeiriou. ArcFace: Additive angular margin loss for deep face recognition. In CVPR, 2019.
|
| 199 |
+
|
| 200 |
+
Gary B. Huang, Manu Ramesh, Tamara Berg, and Erik Learned-Miller. Labeled faces in the wild: A database for studying face recognition in unconstrained environments. Technical Report 07-49, University of Massachusetts, Amherst, October 2007.
|
| 201 |
+
|
| 202 |
+
Ira Kemelmacher-Shlizerman, Steven M Seitz, Daniel Miller, and Evan Brossard. The megaface benchmark: 1 million faces for recognition at scale. In CVPR, 2016.
|
| 203 |
+
|
| 204 |
+
M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In NIPS, 2010.
|
| 205 |
+
|
| 206 |
+
Buyu Li, Yu Liu, and Xiaogang Wang. Gradient harmonized single-stage detector. In AAAI, 2019.
|
| 207 |
+
|
| 208 |
+
Weiyang Li, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Sphereface: Deep hypersphere embedding for face recognition. In CVPR, 2017.
|
| 209 |
+
|
| 210 |
+
Xianyang Li. Airface: Lightweight and efficient model for face recognition. arXiv:1907.12256, 2019.
|
| 211 |
+
|
| 212 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In ICCV, pp. 2980–2988, 2017.
|
| 213 |
+
|
| 214 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In ICML, 2016.
|
| 215 |
+
|
| 216 |
+
Brianna Maze, Jocelyn Adams, James A Duncan, Nathan Kalka, Tim Miller, Charles Otto, Anil K Jain, W Tyler Niggel, Janet Anderson, Jordan Cheney, et al. Iarpa janus benchmark-c: Face dataset and protocol. In ICB, 2018.
|
| 217 |
+
|
| 218 |
+
Stylianos Moschoglou, Athanasios Papaioannou, Christos Sagonas, Jiankang Deng, Irene Kotsia, and Stefanos Zafeiriou. Agedb: the first manually collected, in-the-wild age database. In CVPR Workshops, 2017.
|
| 219 |
+
|
| 220 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017.
|
| 221 |
+
|
| 222 |
+
Xi Peng, Xiang Yu, Kihyuk Sohn, Dimitris Metaxas, and Manmohan Chandraker. Reconstructionbased disentanglement for poseinvariant face recognition. In ICCV, 2017.
|
| 223 |
+
|
| 224 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, 2015.
|
| 225 |
+
|
| 226 |
+
S. Sengupta, J.-C. Chen, C. Castillo, V. M. Patel, R. Chellappa, and D.W. Jacobs. Frontal to profile face verification in the wild. In WACV, 2016.
|
| 227 |
+
|
| 228 |
+
Yichun Shi, Anil K Jain, and Nathan D Kalka. Probabilistic face embeddings. In ICCV, 2019.
|
| 229 |
+
|
| 230 |
+
Abhinav Shrivastava, Abhinav Gupta, and Ross Girshick. Training region-based object detectors with online hard example mining. In CVPR, 2016.
|
| 231 |
+
|
| 232 |
+
Luan Tran, Xi Yin, and Xiaoming Liu. Disentangled representation learning GAN for pose-invariant face recognition. In CVPR, 2017.
|
| 233 |
+
|
| 234 |
+
Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In CVPR, 2018a.
|
| 235 |
+
|
| 236 |
+
Xiaobo Wang, Shuo Wang, Shifeng Zhang, Tianyu Fu, Hailin Shi, and Tao Mei. Support vector guided softmax loss for face recognition. arXiv:1812.11317, 2018b.
|
| 237 |
+
|
| 238 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In ECCV, 2016.
|
| 239 |
+
|
| 240 |
+
Cameron Whitelam, Emma Taborsky, Austin Blanton, Brianna Maze, Jocelyn Adams, Tim Miller, Nathan Kalka, Anil K Jain, James A Duncan, Kristen Allen, et al. Iarpa janus benchmark-b face dataset. In CVPR Workshops, 2017.
|
| 241 |
+
|
| 242 |
+
Weidi Xie and Andrew Zisserman. Multicolumn networks for face recognition. In BMVC, 2018.
|
| 243 |
+
|
| 244 |
+
Weidi Xie, Li Shen, and Andrew Zisserman. Comparator networks. In ECCV, 2018.
|
| 245 |
+
|
| 246 |
+
Dong Yi, Zhen Lei, Shengcai Liao, and Stan Z. Li. Learning face representation from scratch. arXiv:1411.7923, 2014.
|
| 247 |
+
|
| 248 |
+
Kaipeng Zhang, Zhanpeng Zhang, Zhifeng Li, and Yu Qiao. Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499–1503, 2016.
|
| 249 |
+
|
| 250 |
+
Xiao Zhang, Rui Zhao, Yu Qiao, Xiaogang Wang, and Hongsheng Li. Adacos: Adaptively scaling cosine logits for effectively learning deep face representations. In CVPR, 2019a.
|
| 251 |
+
|
| 252 |
+
Xiao Zhang, Rui Zhao, Junjie Yan, Mengya Gao, Yu Qiao, Xiaogang Wang, and Hongsheng Li. P2sgrad: Refined gradients for optimizing deep face models. In CVPR, 2019b.
|
| 253 |
+
|
| 254 |
+
Tianyue Zheng, Weihong Deng, and Jiani Hu. Cross-age lfw: A database for studying cross-age face recognition in unconstrained environments. arXiv:1708.08197, 2017.
|
| 255 |
+
|
| 256 |
+
Tianyue Zheng, Weihong Deng, and Jiani Hu. Cross-pose lfw: A database for studying cross-pose face recognition in unconstrained environments. Technical Report 18-01, Beijing University of Posts and Telecommunications, February 2018.
|
| 257 |
+
|
| 258 |
+
Tianyi Zhou and Jeff Bilmes. Minimax curriculum learning: Machine teaching with desirable difficulties and scheduled diversity. In ICLR, 2018. URL https://openreview.net/forum? id $=$ BywyFQlAW.
|
md/train/B1g5sA4twr/B1g5sA4twr.md
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP DOUBLE DESCENT: WHERE BIGGER MODELS AND MORE DATA HURT
|
| 2 |
+
|
| 3 |
+
Preetum Nakkiran∗ Harvard University
|
| 4 |
+
|
| 5 |
+
Gal Kaplun† Harvard University
|
| 6 |
+
|
| 7 |
+
Yamini Bansal† Harvard University
|
| 8 |
+
|
| 9 |
+
Tristan Yang Harvard University
|
| 10 |
+
|
| 11 |
+
Boaz Barak Harvard University
|
| 12 |
+
|
| 13 |
+
Ilya Sutskever OpenAI
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
We show that a variety of modern deep learning tasks exhibit a “double-descent” phenomenon where, as we increase model size, performance first gets worse and then gets better. Moreover, we show that double descent occurs not just as a function of model size, but also as a function of the number of training epochs. We unify the above phenomena by defining a new complexity measure we call the effective model complexity and conjecture a generalized double descent with respect to this measure. Furthermore, our notion of model complexity allows us to identify certain regimes where increasing (even quadrupling) the number of train samples actually hurts test performance.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Left: Train and test error as a function of model size, for ResNet18s of varying width on CIFAR-10 with $15 \%$ label noise. Right: Test error, shown for varying train epochs. All models trained using Adam for 4K epochs. The largest model (width 64) corresponds to standard ResNet18.
|
| 23 |
+
|
| 24 |
+
The bias-variance trade-off is a fundamental concept in classical statistical learning theory (e.g., Hastie et al. (2005)). The idea is that models of higher complexity have lower bias but higher variance. According to this theory, once model complexity passes a certain threshold, models “overfit” with the variance term dominating the test error, and hence from this point onward, increasing model complexity will only decrease performance (i.e., increase test error). Hence conventional wisdom in classical statistics is that, once we pass a certain threshold, “larger models are worse.”
|
| 25 |
+
|
| 26 |
+
However, modern neural networks exhibit no such phenomenon. Such networks have millions of parameters, more than enough to fit even random labels (Zhang et al. (2016)), and yet they perform much better on many tasks than smaller models. Indeed, conventional wisdom among practitioners is that “larger models are better’’ (Krizhevsky et al. (2012), Huang et al. (2018), Szegedy et al.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 2: Left: Test error as a function of model size and train epochs. The horizontal line corresponds to model-wise double descent–varying model size while training for as long as possible. The vertical line corresponds to epoch-wise double descent, with test error undergoing double-descent as train time increases. Right Train error of the corresponding models. All models are Resnet18s trained on CIFAR-10 with $15 \%$ label noise, data-augmentation, and Adam for up to 4K epochs.
|
| 30 |
+
|
| 31 |
+
(2015), Radford et al. (2019)). The effect of training time on test performance is also up for debate. In some settings, “early stopping” improves test performance, while in other settings training neural networks to zero training error only improves performance. Finally, if there is one thing both classical statisticians and deep learning practitioners agree on is “more data is always better”.
|
| 32 |
+
|
| 33 |
+
In this paper, we present empirical evidence that both reconcile and challenge some of the above “conventional wisdoms.” We show that many deep learning settings have two different regimes. In the under-parameterized regime, where the model complexity is small compared to the number of samples, the test error as a function of model complexity follows the U-like behavior predicted by the classical bias/variance tradeoff. However, once model complexity is sufficiently large to interpolate i.e., achieve (close to) zero training error, then increasing complexity only decreases test error, following the modern intuition of “bigger models are better”. Similar behavior was previously observed in Opper (1995; 2001), Advani & Saxe (2017), Spigler et al. (2018), and Geiger et al. (2019b). This phenomenon was first postulated in generality by Belkin et al. (2018) who named it “double descent”, and demonstrated it for decision trees, random features, and 2-layer neural networks with $\ell _ { 2 }$ loss, on a variety of learning tasks including MNIST and CIFAR-10.
|
| 34 |
+
|
| 35 |
+
Main contributions. We show that double descent is a robust phenomenon that occurs in a variety of tasks, architectures, and optimization methods (see Figure 1 and Section 5; our experiments are summarized in Table A). Moreover, we propose a much more general notion of “double descent” that goes beyond varying the number of parameters. We define the effective model complexity (EMC) of a training procedure as the maximum number of samples on which it can achieve close to zero training error. The EMC depends not just on the data distribution and the architecture of the classifier but also on the training procedure—and in particular increasing training time will increase the EMC.
|
| 36 |
+
|
| 37 |
+
We hypothesize that for many natural models and learning algorithms, double descent occurs as a function of the EMC. Indeed we observe “epoch-wise double descent” when we keep the model fixed and increase the training time, with performance following a classical U-like curve in the underfitting stage (when the EMC is smaller than the number of samples) and then improving with training time once the EMC is sufficiently larger than the number of samples (see Figure 2). As a corollary, early stopping only helps in the relatively narrow parameter regime of critically parameterized models.
|
| 38 |
+
|
| 39 |
+
Sample non-monotonicity. Finally, our results shed light on test performance as a function of the number of train samples. Since the test error peaks around the point where EMC matches the number of samples (the transition from the under- to over-parameterization), increasing the number of samples has the effect of shifting this peak to the right. While in most settings increasing the number of samples decreases error, this shifting effect can sometimes result in a setting where more data is worse! For example, Figure 3 demonstrates cases in which increasing the number of samples by a factor of 4.5 results in worse test performance.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: Test loss (per-token perplexity) as a function of Transformer model size (embedding dimension $d _ { m o d e l . }$ ) on language translation (IWSLT‘14 German-to-English). The curve for $1 8 \mathrm { k }$ samples is generally lower than the one for $4 \mathrm { k }$ samples, but also shifted to the right, since fitting 18k samples requires a larger model. Thus, for some models, the performance for $1 8 \mathrm { k }$ samples is worse than for $4 \mathrm { k \Omega }$ samples.
|
| 43 |
+
|
| 44 |
+
# 2 OUR RESULTS
|
| 45 |
+
|
| 46 |
+
To state our hypothesis more precisely, we define the notion of effective model complexity. We define a training procedure $\tau$ to be any procedure that takes as input a set $S = \{ ( x _ { 1 } , y _ { 1 } ) , \dots , ( x _ { n } , y _ { n } ) \}$ of labeled training samples and outputs a classifier $\mathcal { T } ( S )$ mapping data to labels. We define the effective model complexity of $\tau$ (w.r.t. distribution $\mathcal { D }$ ) to be the maximum number of samples $n$ on which $\tau$ achieves on average $\approx 0$ training error.
|
| 47 |
+
|
| 48 |
+
Definition 1 (Effective Model Complexity) The Effective Model Complexity (EMC) of a training procedure $\tau$ , with respect to distribution $\mathcal { D }$ and parameter $\epsilon > 0$ , is defined as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\operatorname { E M C } _ { { \mathscr { D } } , \epsilon } ( { \mathscr { T } } ) : = \operatorname* { m a x } \left\{ n \mid \mathbb { E } _ { S \sim { \mathscr { D } } ^ { n } } [ \operatorname { E r r o r } _ { S } ( { \mathscr { T } } ( S ) ) ] \leq \epsilon \right\}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where Error $s ( M )$ is the mean error of model $M$ on train samples $S$ .
|
| 55 |
+
|
| 56 |
+
Our main hypothesis can be informally stated as follows:
|
| 57 |
+
|
| 58 |
+
Hypothesis 1 (Generalized Double Descent hypothesis, informal) For any natural data distribution $\mathcal { D }$ , neural-network-based training procedure $\tau$ , and small $\epsilon > 0$ , if we consider the task of predicting labels based on n samples from $\mathcal { D }$ then:
|
| 59 |
+
|
| 60 |
+
Under-paremeterized regime. If $\cdot _ { \mathrm { E M C } _ { { \mathscr D } , \epsilon } } ( \mathcal T )$ is sufficiently smaller than $n _ { \ast }$ , any perturbation of $\tau$ that increases its effective complexity will decrease the test error.
|
| 61 |
+
|
| 62 |
+
Over-parameterized regime. If $\mathrm { E M C } _ { { \cal D } , \epsilon } ( T )$ is sufficiently larger than $n$ , any perturbation of $\tau$ that increases its effective complexity will decrease the test error.
|
| 63 |
+
|
| 64 |
+
Critically parameterized regime. I $f \mathrm { E M C } _ { \mathcal { D } , \epsilon } ( \mathcal { T } ) \approx n$ , then a perturbation of $\tau$ that increases its effective complexity might decrease or increase the test error.
|
| 65 |
+
|
| 66 |
+
Hypothesis 1 is informal in several ways. We do not have a principled way to choose the parameter $\epsilon$ (and currently heuristically use $\epsilon = 0 . 1$ ). We also are yet to have a formal specification for “sufficiently smaller” and “sufficiently larger”. Our experiments suggest that there is a critical interval around the interpolation threshold when $\mathrm { E M C } _ { \mathcal { D } , \epsilon } ( \mathcal { T } ) = n$ : below and above this interval increasing complexity helps performance, while within this interval it may hurt performance. The width of the critical interval depends on both the distribution and the training procedure in ways we do not yet completely understand.
|
| 67 |
+
|
| 68 |
+
We believe Hypothesis 1 sheds light on the interaction between optimization algorithms, model size, and test performance and helps reconcile some of the competing intuitions about them. The main result of this paper is an experimental validation of Hypothesis 1 under a variety of settings, where we considered several natural choices of datasets, architectures, and optimization algorithms, and we changed the “interpolation threshold” by varying the number of model parameters, the length of training, the amount of label noise in the distribution, and the number of train samples.
|
| 69 |
+
|
| 70 |
+
Model-wise Double Descent. In Section 5, we study the test error of models of increasing size, for a fixed large number of optimization steps. We show that “model-wise double-descent” occurs for various modern datasets (CIFAR-10, CIFAR-100, IWSLT‘14 de-en, with varying amounts of label noise), model architectures (CNNs, ResNets, Transformers), optimizers (SGD, Adam), number of train samples, and training procedures (data-augmentation, and regularization). Moreover, the peak in test error systematically occurs at the interpolation threshold. In particular, we demonstrate realistic settings in which bigger models are worse.
|
| 71 |
+
|
| 72 |
+
Epoch-wise Double Descent. In Section 6, we study the test error of a fixed, large architecture over the course of training. We demonstrate, in similar settings as above, a corresponding peak in test performance when models are trained just long enough to reach $\approx 0$ train error. The test error of a large model first decreases (at the beginning of training), then increases (around the critical regime), then decreases once more (at the end of training)—that is, training longer can correct overfitting.
|
| 73 |
+
|
| 74 |
+
Sample-wise Non-monotonicity. In Section 7, we study the test error of a fixed model and training procedure, for varying number of train samples. Consistent with our generalized double-descent hypothesis, we observe distinct test behavior in the “critical regime”, when the number of samples is near the maximum that the model can fit. This often manifests as a long plateau region, in which taking significantly more data might not help when training to completion (as is the case for CNNs on CIFAR-10). Moreover, we show settings (Transformers on IWSLT‘14 en-de), where this manifests as a peak—and for a fixed architecture and training procedure, more data actually hurts.
|
| 75 |
+
|
| 76 |
+
Remarks on Label Noise. We observe all forms of double descent most strongly in settings with label noise in the train set (as is often the case when collecting train data in the real-world). However, we also show several realistic settings with a test-error peak even without label noise: ResNets (Figure 4a) and CNNs (Figure 20) on CIFAR-100; Transformers on IWSLT‘14 (Figure 8). Moreover, all our experiments demonstrate distinctly different test behavior in the critical regime— often manifesting as a “plateau” in the test error in the noiseless case which develops into a peak with added label noise. See Section 8 for further discussion.
|
| 77 |
+
|
| 78 |
+
# 3 RELATED WORK
|
| 79 |
+
|
| 80 |
+
Model-wise double descent was first proposed as a general phenomenon by Belkin et al. (2018). Similar behavior had been observed in Opper (1995; 2001), Advani & Saxe (2017), Spigler et al. (2018), and Geiger et al. (2019b). Subsequently, there has been a large body of work studying the double descent phenomenon. A growing list of papers that theoretically analyze it in the tractable setting of linear least squares regression includes Belkin et al. (2019); Hastie et al. (2019); Bartlett et al. (2019); Muthukumar et al. (2019); Bibas et al. (2019); Mitra (2019); Mei & Montanari (2019). Moreover, Geiger et al. (2019a) provide preliminary results for model-wise double descent in convolutional networks trained on CIFAR-10. Our work differs from the above papers in two crucial aspects: First, we extend the idea of double-descent beyond the number of parameters to incorporate the training procedure under a unified notion of “Effective Model Complexity”, leading to novel insights like epoch-wise double descent and sample non-monotonicity. The notion that increasing train time corresponds to increasing complexity was also presented in Nakkiran et al. (2019). Second, we provide an extensive and rigorous demonstration of double-descent in modern deep learning, spanning a variety of architectures, datasets, and optimization procedures. An extended discussion of the related work is provided in Appendix C.
|
| 81 |
+
|
| 82 |
+
# 4 EXPERIMENTAL SETUP
|
| 83 |
+
|
| 84 |
+
We briefly describe the experimental setup here; full details are in Appendix B 1. We consider three families of architectures: ResNets, standard CNNs, and Transformers. ResNets: We parameterize a family of ResNet18s (He et al. (2016)) by scaling the width (number of filters) of convolutional layers. Specifically, we use layer widths $[ k , 2 k , \bar { 4 } k , 8 k ]$ for varying $k$ . The standard ResNet18 corresponds to $k = 6 4$ . Standard CNNs: We consider a simple family of 5-layer CNNs, with 4 convolutional layers of widths $[ k , 2 k , 4 k , 8 k ]$ for varying $k$ , and a fully-connected layer. For context, the CNN with width $k = 6 4$ , can reach over $9 0 \%$ test accuracy on CIFAR-10 with dataaugmentation. Transformers: We consider the 6 layer encoder-decoder from Vaswani et al. (2017), as implemented by Ott et al. (2019). We scale the size of the network by modifying the embedding dimension $d _ { \mathrm { m o d e l } }$ , and setting the width of the fully-connected layers proportionally $( d _ { \mathrm { f f } } = 4 \cdot d _ { \mathrm { m o d e l } } )$ .
|
| 85 |
+
|
| 86 |
+
For ResNets and CNNs, we train with cross-entropy loss, and the following optimizers: (1) Adam with learning-rate 0.0001 for 4K epochs; (2) SGD with learning rate $\propto \frac { 1 } { \sqrt { T } }$ for 500K gradient steps. We train Transformers for 80K gradient steps, with $10 \%$ label smoothing and no drop-out.
|
| 87 |
+
|
| 88 |
+
Label Noise. In our experiments, label noise of probability $p$ refers to training on a samples which have the correct label with probability $( 1 - p )$ , and a uniformly random incorrect label otherwise (label noise is sampled only once and not per epoch). Figure 1 plots test error on the noisy distribution, while the remaining figures plot test error with respect to the clean distribution (the two curves are just linear rescaling of one another).
|
| 89 |
+
|
| 90 |
+
# 5 MODEL-WISE DOUBLE DESCENT
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
(a) CIFAR-100. There is a peak in test error even with no label noise.
|
| 94 |
+
Figure 4: Model-wise double descent for ResNet18s. Trained on CIFAR-100 and CIFAR-10, with varying label noise. Optimized using Adam with LR 0.0001 for 4K epochs, and data-augmentation.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
(b) CIFAR-10. There is a “plateau” in test error around the interpolation point with no label noise, which develops into a peak for added label noise.
|
| 98 |
+
|
| 99 |
+
In this section, we study the test error of models of increasing size, when training to completion (for a fixed large number of optimization steps). We demonstrate model-wise double descent across different architectures, datasets, optimizers, and training procedures. The critical region exhibits distinctly different test behavior around the interpolation point and there is often a peak in test error that becomes more prominent in settings with label noise.
|
| 100 |
+
|
| 101 |
+
For the experiments in this section (Figures 4, 5, 6, 7, 8), notice that all modifications which increase the interpolation threshold (such as adding label noise, using data augmentation, and increasing the number of train samples) also correspondingly shift the peak in test error towards larger models. Additional plots showing the early-stopping behavior of these models, and additional experiments showing double descent in settings with no label noise (e.g. Figure 19) are in Appendix E.2. We also observed model-wise double descent for adversarial training, with a prominent robust test error peak even in settings without label noise. See Figure 26 in Appendix E.2.
|
| 102 |
+
|
| 103 |
+
Discussion. Fully understanding the mechanisms behind model-wise double descent in deep neural networks remains an important open question. However, an analog of model-wise double descent occurs even for linear models. A recent stream of theoretical works analyzes this setting (Bartlett et al. (2019); Muthukumar et al. (2019); Belkin et al. (2019); Mei & Montanari (2019); Hastie et al. (2019)). We believe similar mechanisms may be at work in deep neural networks.
|
| 104 |
+
|
| 105 |
+
Informally, our intuition is that for model-sizes at the interpolation threshold, there is effectively only one model that fits the train data and this interpolating model is very sensitive to noise in the train set and/or model mis-specification. That is, since the model is just barely able to fit the train data, forcing it to fit even slightly-noisy or mis-specified labels will destroy its global structure, and result in high test error. (See Figure 28 in the Appendix for an experiment demonstrating this noise sensitivity, by showing that ensembling helps significantly in the critically-parameterized regime). However for over-parameterized models, there are many interpolating models that fit the train set, and SGD is able to find one that “memorizes” (or “absorbs”) the noise while still performing well on the distribution.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 5: Effect of Data Augmentation. 5-layer CNNs on CIFAR10, with and without dataaugmentation. Data-augmentation shifts the interpolation threshold to the right, shifting the test error peak accordingly. Optimized using SGD for 500K steps. See Figure 27 for larger models.
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: SGD vs. Adam. 5-Layer CNNs on CIFAR-10 with no label noise, and no data augmentation. Optimized using SGD for 500K gradient steps, and Adam for 4K epochs.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 7: Noiseless settings. 5-layer CNNs on CIFAR-100 with no label noise; note the peak in test error. Trained with SGD and no data augmentation. See Figure 20 for the early-stopping behavior of these models.
|
| 117 |
+
|
| 118 |
+
The above intuition is theoretically justified for linear models. In general, this situation manifests even without label noise for linear models (Mei & Montanari (2019)), and occurs whenever there is model mis-specification between the structure of the true distribution and the model family. We believe this intuition extends to deep learning as well, and it is consistent with our experiments.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 8: Transformers on language translation tasks: Multi-head-attention encoderdecoder Transformer model trained for $8 0 \mathrm { k }$ gradient steps with labeled smoothed cross-entropy loss on IWSLT‘14 Germanto-English (160K sentences) and WMT‘14 English-to-French (subsampled to 200K sentences) dataset. Test loss is measured as pertoken perplexity.
|
| 122 |
+
|
| 123 |
+
# 6 EPOCH-WISE DOUBLE DESCENT
|
| 124 |
+
|
| 125 |
+
In this section, we demonstrate a novel form of double-descent with respect to training epochs, which is consistent with our unified view of effective model complexity (EMC) and the generalized double descent hypothesis. Increasing the train time increases the EMC—and thus a sufficiently large model transitions from under- to over-parameterized over the course of training.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 9: Left: Training dynamics for models in three regimes. Models are ResNet18s on CIFAR10 with $20 \%$ label noise, trained using Adam with learning rate 0.0001, and data augmentation. Right: Test error over (Model size $\times$ Epochs). Three slices of this plot are shown on the left.
|
| 129 |
+
|
| 130 |
+
As illustrated in Figure 9, sufficiently large models can undergo a “double descent” behavior where test error first decreases then increases near the interpolation threshold, and then decreases again. In contrast, for “medium sized” models, for which training to completion will only barely reach $\approx 0$ error, the test error as a function of training time will follow a classical U-like curve where it is better to stop early. Models that are too small to reach the approximation threshold will remain in the “under parameterized” regime where increasing train time monotonically decreases test error. Our experiments (Figure 10) show that many settings of dataset and architecture exhibit epoch-wise double descent, in the presence of label noise. Further, this phenomenon is robust across optimizer variations and learning rate schedules (see additional experiments in Appendix E.1). As in modelwise double descent, the test error peak is accentuated with label noise.
|
| 131 |
+
|
| 132 |
+
Conventional wisdom suggests that training is split into two phases: (1) In the first phase, the network learns a function with a small generalization gap (2) In the second phase, the network starts to over-fit the data leading to an increase in test error. Our experiments suggest that this is not the complete picture—in some regimes, the test error decreases again and may achieve a lower value at the end of training as compared to the first minimum (see Fig 10 for $10 \%$ label noise).
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 10: Epoch-wise double descent for ResNet18 and CNN (width $\scriptstyle 1 = 1 2 8$ ). ResNets trained using Adam with learning rate 0.0001, and CNNs trained with SGD with inverse-squareroot learning rate.
|
| 136 |
+
|
| 137 |
+
# 7 SAMPLE-WISE NON-MONOTONICITY
|
| 138 |
+
|
| 139 |
+
In this section, we investigate the effect of varying the number of train samples, for a fixed model and training procedure. Previously, in model-wise and epoch-wise double descent, we explored behavior in the critical regime, where $\mathrm { E M C } _ { \mathcal { D } , \epsilon } ( \mathcal { T } ) \approx n$ , by varying the EMC. Here, we explore the critical regime by varying the number of train samples $n$ . By increasing $n$ , the same training procedure $\tau$ can switch from being effectively over-parameterized to effectively under-parameterized.
|
| 140 |
+
|
| 141 |
+
We show that increasing the number of samples has two different effects on the test error vs. model complexity graph. On the one hand, (as expected) increasing the number of samples shrinks the area under the curve. On the other hand, increasing the number of samples also has the effect of “shifting the curve to the right” and increasing the model complexity at which test error peaks.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
|
| 147 |
+
(a) Model-wise double descent for 5-layer CNNs on CIFAR-10, for varying dataset sizes. Top: There is a range of model sizes (shaded green) where training on $2 \times$ more samples does not improve test error. Bottom: There is a range of model sizes (shaded red) where training on $4 \times$ more samples does not improve test error.
|
| 148 |
+
|
| 149 |
+
(b) Sample-wise non-monotonicity. Test loss (per-word perplexity) as a function of number of train samples, for two transformer models trained to completion on IWSLT’14. For both model sizes, there is a regime where more samples hurt performance. Compare to Figure 3, of model-wise double-descent in the identical setting.
|
| 150 |
+
|
| 151 |
+
Figure 11: Sample-wise non-monotonicity.
|
| 152 |
+
|
| 153 |
+
These twin effects are shown in Figure 11a. Note that there is a range of model sizes where the effects “cancel out”—and having $4 \times$ more train samples does not help test performance when training to completion. Outside the critically-parameterized regime, for sufficiently under- or overparameterized models, having more samples helps. This phenomenon is corroborated in Figure 12, which shows test error as a function of both model and sample size, in the same setting as Figure 11a.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 12: Left: Test Error as a function of model size and number of train samples, for 5-layer CNNs on CIFAR- $10 + 2 0 \%$ noise. Note the ridge of high test error again lies along the interpolation threshold. Right: Three slices of the left plot, showing the effect of more data for models of different sizes. Note that, when training to completion, more data helps for small and large models, but does not help for near-critically-parameterized models (green).
|
| 157 |
+
|
| 158 |
+
In some settings, these two effects combine to yield a regime of model sizes where more data actually hurts test performance as in Figure 3 (see also Figure 11b). Note that this phenomenon is not unique to DNNs: more data can hurt even for linear models (see Appendix D).
|
| 159 |
+
|
| 160 |
+
# 8 CONCLUSION AND DISCUSSION
|
| 161 |
+
|
| 162 |
+
We introduce a generalized double descent hypothesis: models and training procedures exhibit atypical behavior when their Effective Model Complexity is comparable to the number of train samples. We provide extensive evidence for our hypothesis in modern deep learning settings, and show that it is robust to choices of dataset, architecture, and training procedures. In particular, we demonstrate “model-wise double descent” for modern deep networks and characterize the regime where bigger models can perform worse. We also demonstrate “epoch-wise double descent,” which, to the best of our knowledge, has not been previously proposed. Finally, we show that the double descent phenomenon can lead to a regime where training on more data leads to worse test performance. Preliminary results suggest that double descent also holds as we vary the amount of regularization for a fixed model (see Figure 22).
|
| 163 |
+
|
| 164 |
+
We also believe our characterization of the critical regime provides a useful way of thinking for practitioners—if a model and training procedure are just barely able to fit the train set, then small changes to the model or training procedure may yield unexpected behavior (e.g. making the model slightly larger or smaller, changing regularization, etc. may hurt test performance).
|
| 165 |
+
|
| 166 |
+
Early stopping. We note that many of the phenomena that we highlight often do not occur with optimal early-stopping. However, this is consistent with our generalized double descent hypothesis: if early stopping prevents models from reaching 0 train error then we would not expect to see doubledescent, since the EMC does not reach the number of train samples. Further, we show at least one setting where model-wise double descent can still occur even with optimal early stopping (ResNets on CIFAR-100 with no label noise, see Figure 19). We have not observed settings where more data hurts when optimal early-stopping is used. However, we are not aware of reasons which preclude this from occurring. We leave fully understanding the optimal early stopping behavior of double descent as an important open question for future work.
|
| 167 |
+
|
| 168 |
+
Label Noise. In our experiments, we observe double descent most strongly in settings with label noise. However, we believe this effect is not fundamentally about label noise, but rather about model mis-specification. For example, consider a setting where the label noise is not truly random, but rather pseudorandom (with respect to the family of classifiers being trained). In this setting, the performance of the Bayes optimal classifier would not change (since the pseudorandom noise is deterministic, and invertible), but we would observe an identical double descent as with truly random label noise. Thus, we view adding label noise as merely a proxy for making distributions “harder”— i.e. increasing the amount of model mis-specification.
|
| 169 |
+
|
| 170 |
+
Other Notions of Model Complexity. Our notion of Effective Model Complexity is related to classical complexity notions such as Rademacher complexity, but differs in several crucial ways: (1) EMC depends on the true labels of the data distribution, and (2) EMC depends on the training procedure, not just the model architecture.
|
| 171 |
+
|
| 172 |
+
Other notions of model complexity which do not incorporate features (1) and (2) would not suffice to characterize the location of the double-descent peak. Rademacher complexity, for example, is determined by the ability of a model architecture to fit a randomly-labeled train set. But Rademacher complexity and VC dimension are both insufficient to determine the model-wise double descent peak location, since they do not depend on the distribution of labels— and our experiments show that adding label noise shifts the location of the peak.
|
| 173 |
+
|
| 174 |
+
Moreover, both Rademacher complexity and VC dimension depend only on the model family and data distribution, and not on the training procedure used to find models. Thus, they are not capable of capturing train-time double-descent effects, such as “epoch-wise” double descent, and the effect of data-augmentation on the peak location.
|
| 175 |
+
|
| 176 |
+
# ACKNOWLEDGMENTS
|
| 177 |
+
|
| 178 |
+
We thank Mikhail Belkin for extremely useful discussions in the early stages of this work. We thank Christopher Olah for suggesting the Model Size $\times$ Epoch visualization, which led to the investigation of epoch-wise double descent, as well as for useful discussion and feedback. We also thank Alec Radford, Jacob Steinhardt, and Vaishaal Shankar for helpful discussion and suggestions. P.N. thanks OpenAI, the Simons Institute, and the Harvard Theory Group for a research environment that enabled this kind of work.
|
| 179 |
+
|
| 180 |
+
We thank Dimitris Kalimeris, Benjamin L. Edelman, and Sharon Qian, and Aditya Ramesh for comments on an early draft of this work.
|
| 181 |
+
|
| 182 |
+
This work supported in part by NSF grant CAREER CCF 1452961, BSF grant 2014389, NSF USICCS proposal 1540428, a Google Research award, a Facebook research award, a Simons Investigator Award, a Simons Investigator Fellowship, and NSF Awards CCF 1715187, CCF 1565264, CCF 1301976, IIS 1409097, and CNS 1618026. Y.B. would like to thank the MIT-IBM Watson AI Lab for contributing computational resources for experiments.
|
| 183 |
+
|
| 184 |
+
# REFERENCES
|
| 185 |
+
|
| 186 |
+
Madhu S Advani and Andrew M Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
|
| 187 |
+
|
| 188 |
+
Peter L Bartlett, Philip M Long, Gabor Lugosi, and Alexander Tsigler. Benign overfitting in linear ´ regression. arXiv preprint arXiv:1906.11300, 2019.
|
| 189 |
+
|
| 190 |
+
Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine learning and the bias-variance trade-off. arXiv preprint arXiv:1812.11118, 2018.
|
| 191 |
+
|
| 192 |
+
Mikhail Belkin, Daniel Hsu, and Ji Xu. Two models of double descent for weak features. arXiv preprint arXiv:1903.07571, 2019.
|
| 193 |
+
|
| 194 |
+
Koby Bibas, Yaniv Fogel, and Meir Feder. A new look at an old problem: A universal learning approach to linear regression. arXiv preprint arXiv:1905.04708, 2019.
|
| 195 |
+
|
| 196 |
+
Mauro Cettolo, Christian Girardi, and Marcello Federico. Wit3: Web inventory of transcribed and translated talks. In Proceedings of the $l 6 ^ { t h }$ Conference of the European Association for Machine Translation (EAMT), pp. 261–268, Trento, Italy, May 2012.
|
| 197 |
+
|
| 198 |
+
Robert PW Duin. Small sample size generalization. In Proceedings of the Scandinavian Conference on Image Analysis, volume 2, pp. 957–964. PROCEEDINGS PUBLISHED BY VARIOUS PUBLISHERS, 1995.
|
| 199 |
+
|
| 200 |
+
Robert PW Duin. Classifiers in almost empty spaces. In Proceedings 15th International Conference on Pattern Recognition. ICPR-2000, volume 2, pp. 1–7. IEEE, 2000.
|
| 201 |
+
|
| 202 |
+
Mario Geiger, Arthur Jacot, Stefano Spigler, Franck Gabriel, Levent Sagun, Stephane d’Ascoli, ´ Giulio Biroli, Clement Hongler, and Matthieu Wyart. Scaling description of generalization with ´ number of parameters in deep learning. arXiv preprint arXiv:1901.01608, 2019a.
|
| 203 |
+
|
| 204 |
+
Mario Geiger, Stefano Spigler, Stephane d’Ascoli, Levent Sagun, Marco Baity-Jesi, Giulio Biroli, ´ and Matthieu Wyart. Jamming transition as a paradigm to understand the loss landscape of deep neural networks. Physical Review E, 100(1):012115, 2019b.
|
| 205 |
+
|
| 206 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 207 |
+
|
| 208 |
+
Trevor Hastie, Robert Tibshirani, Jerome Friedman, and James Franklin. The elements of statistical learning: data mining, inference and prediction. The Mathematical Intelligencer, 27(2):83–85, 2005.
|
| 209 |
+
|
| 210 |
+
Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J Tibshirani. Surprises in highdimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
|
| 211 |
+
|
| 212 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016.
|
| 213 |
+
|
| 214 |
+
Yanping Huang, Yonglong Cheng, Dehao Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V. Le, and Zhifeng Chen. Gpipe: Efficient training of giant neural networks using pipeline parallelism. CoRR, abs/1811.06965, 2018. URL http://arxiv.org/abs/1811.06965.
|
| 215 |
+
|
| 216 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 217 |
+
|
| 218 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 219 |
+
|
| 220 |
+
Marco Loog and Robert PW Duin. The dipping phenomenon. In Joint IAPR International Workshops on Statistical Techniques in Pattern Recognition (SPR) and Structural and Syntactic Pattern Recognition (SSPR), pp. 310–317. Springer, 2012.
|
| 221 |
+
|
| 222 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 223 |
+
|
| 224 |
+
Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve. arXiv preprint arXiv:1908.05355, 2019.
|
| 225 |
+
|
| 226 |
+
Partha P. Mitra. Understanding overfitting peaks in generalization error: Analytical risk curves for l2 and l1 penalized interpolation. ArXiv, abs/1906.03667, 2019.
|
| 227 |
+
|
| 228 |
+
Vidya Muthukumar, Kailas Vodrahalli, and Anant Sahai. Harmless interpolation of noisy data in regression. arXiv preprint arXiv:1903.09139, 2019.
|
| 229 |
+
|
| 230 |
+
Preetum Nakkiran, Gal Kaplun, Dimitris Kalimeris, Tristan Yang, Benjamin L Edelman, Fred Zhang, and Boaz Barak. Sgd on neural networks learns functions of increasing complexity. arXiv preprint arXiv:1905.11604, 2019.
|
| 231 |
+
|
| 232 |
+
Brady Neal, Sarthak Mittal, Aristide Baratin, Vinayak Tantia, Matthew Scicluna, Simon LacosteJulien, and Ioannis Mitliagkas. A modern take on the bias-variance tradeoff in neural networks. arXiv preprint arXiv:1810.08591, 2018.
|
| 233 |
+
|
| 234 |
+
Manfred Opper. Statistical mechanics of learning: Generalization. The Handbook of Brain Theory and Neural Networks, 922-925., 1995.
|
| 235 |
+
|
| 236 |
+
Manfred Opper. Learning to generalize. Frontiers of Life, 3(part 2), pp.763-775., 2001.
|
| 237 |
+
|
| 238 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan $\mathrm { N g }$ , David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
|
| 239 |
+
|
| 240 |
+
David Page. How to train your resnet. https://myrtle.ai/ how-to-train-your-resnet-4-architecture/, 2018.
|
| 241 |
+
|
| 242 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NeurIPS Autodiff Workshop, 2017.
|
| 243 |
+
|
| 244 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 245 |
+
|
| 246 |
+
Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pp. 1177–1184, 2008.
|
| 247 |
+
|
| 248 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. ArXiv, abs/1508.07909, 2015.
|
| 249 |
+
|
| 250 |
+
Marina Skurichina and Robert PW Duin. Bagging, boosting and the random subspace method for linear classifiers. Pattern Analysis & Applications, 5(2):121–135, 2002.
|
| 251 |
+
|
| 252 |
+
Stefano Spigler, Mario Geiger, Stephane d’Ascoli, Levent Sagun, Giulio Biroli, and Matthieu Wyart.´ A jamming transition from under-to over-parametrization affects loss landscape and generalization. arXiv preprint arXiv:1810.09665, 2018.
|
| 253 |
+
|
| 254 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition (CVPR), 2015. URL http://arxiv.org/abs/ 1409.4842.
|
| 255 |
+
|
| 256 |
+
Gerard V Trunk. A problem of dimensionality: A simple example. IEEE Transactions on pattern analysis and machine intelligence, (3):306–307, 1979.
|
| 257 |
+
|
| 258 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017.
|
| 259 |
+
|
| 260 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. ICLR, abs/1611.03530, 2016.
|
| 261 |
+
|
| 262 |
+
A SUMMARY TABLE OF EXPERIMENTAL RESULTS
|
| 263 |
+
|
| 264 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Architecture</td><td rowspan="2">Opt.</td><td rowspan="2">Aug.</td><td rowspan="2">% Noise</td><td colspan="2">Double-Descent</td><td rowspan="2">Figure(s)</td></tr><tr><td>Model</td><td>Epoch</td></tr><tr><td>CIFAR 10</td><td>CNN</td><td>SGD</td><td>√</td><td>0</td><td>X</td><td>×</td><td>5,27</td></tr><tr><td rowspan="10"></td><td></td><td></td><td>√</td><td>10</td><td>广</td><td>广</td><td>5,27,6</td></tr><tr><td></td><td></td><td>√</td><td>20</td><td></td><td></td><td>5,27</td></tr><tr><td></td><td></td><td></td><td>0</td><td>X</td><td>x√</td><td>5,25</td></tr><tr><td></td><td></td><td></td><td>10</td><td></td><td></td><td>5</td></tr><tr><td></td><td></td><td></td><td>20</td><td>√</td><td>√</td><td>5</td></tr><tr><td></td><td>SGD + w.d.</td><td>√</td><td>20</td><td>√</td><td>√</td><td>21</td></tr><tr><td>ResNet</td><td>Adam</td><td></td><td>0</td><td>√</td><td></td><td>25</td></tr><tr><td>Adam</td><td>√</td><td>0</td><td>X</td><td></td><td>X</td><td>4,10</td></tr><tr><td></td><td>√</td><td>5</td><td>√</td><td></td><td></td><td>4</td></tr><tr><td></td><td>√</td><td>10</td><td></td><td></td><td></td><td>4,10</td></tr><tr><td></td><td></td><td>√</td><td>15</td><td>√</td><td></td><td>4,2</td></tr><tr><td rowspan="2"></td><td></td><td>Various</td><td>√</td><td>20</td><td>√</td><td></td><td>4,9,10</td></tr><tr><td></td><td></td><td>√</td><td>20</td><td></td><td>√</td><td>16, 17, 18</td></tr><tr><td rowspan="2">(subsampled)</td><td>CNN</td><td>SGD SGD</td><td>√</td><td>10</td><td>√</td><td></td><td>11a</td></tr><tr><td></td><td></td><td>√</td><td>20</td><td>√</td><td></td><td>11a, 12</td></tr><tr><td>(adversarial)</td><td>ResNet</td><td>SGD</td><td></td><td>0</td><td>Robust err.</td><td></td><td>26</td></tr><tr><td rowspan="4">CIFAR 100</td><td>ResNet</td><td>Adam</td><td></td><td>0</td><td>√</td><td>X</td><td>4,19,10</td></tr><tr><td></td><td></td><td>>></td><td>10</td><td>√</td><td>√</td><td>4,10</td></tr><tr><td>CNN</td><td>SGD</td><td>√</td><td>20</td><td>√</td><td>√</td><td>4,10</td></tr><tr><td></td><td></td><td></td><td>0</td><td>√</td><td>X</td><td>20</td></tr><tr><td>IWSLT '14 de-en</td><td>Transformer</td><td>Adam</td><td></td><td>0</td><td>√</td><td>X</td><td>8,24</td></tr><tr><td>(subsampled)</td><td>Transformer</td><td>Adam</td><td></td><td>0</td><td>√</td><td>X</td><td>11b,23</td></tr><tr><td>WMT'14 en-fr</td><td>Transformer</td><td>Adam</td><td></td><td>0</td><td>√</td><td>X</td><td>8,24</td></tr></table>
|
| 265 |
+
|
| 266 |
+
# B APPENDIX: EXPERIMENTAL DETAILS
|
| 267 |
+
|
| 268 |
+
# B.1 MODELS
|
| 269 |
+
|
| 270 |
+
We use the following families of architectures. The PyTorch Paszke et al. (2017) specification of our ResNets and CNNs are available at https://gitlab.com/ harvard-machine-learning/double-descent/tree/master.
|
| 271 |
+
|
| 272 |
+
ResNets. We define a family of ResNet18s of increasing size as follows. We follow the Preactivation ResNet18 architecture of He et al. (2016), using 4 ResNet blocks, each consisting of two BatchNorm-ReLU-Convolution layers. The layer widths for the 4 blocks are $[ k , 2 k , 4 k , 8 k ]$ for varying $k \in \mathbb N$ and the strides are [1, 2, 2, 2]. The standard ResNet18 corresponds to $k = 6 4$ convolutional channels in the first layer. The scaling of model size with $k$ is shown in Figure 13b. Our implementation is adapted from https://github.com/kuangliu/pytorch-cifar.
|
| 273 |
+
|
| 274 |
+
Standard CNNs. We consider a simple family of 5-layer CNNs, with four Conv-BatchNormReLU-MaxPool layers and a fully-connected output layer. We scale the four convolutional layer widths as $[ k , 2 k , 4 k , 8 k ]$ . The MaxPool is [1, 2, 2, 8]. For all the convolution layers, the kernel size $= 3$ , stride $= 1$ and padding $^ { = 1 }$ . This architecture is based on the “backbone” architecture from Page (2018). For $k = 6 4$ , this CNN has 1558026 parameters and can reach $> 9 0 \%$ test accuracy on CIFAR-10 (Krizhevsky (2009)) with data-augmentation. The scaling of model size with $k$ is shown in Figure 13a.
|
| 275 |
+
|
| 276 |
+
Transformers. We consider the encoder-decoder Transformer model from Vaswani et al. (2017) with 6 layers and 8 attention heads per layer, as implemented by fairseq Ott et al. (2019). We scale the size of the network by modifying the embedding dimension $( d _ { \mathrm { m o d e l } } )$ , and scale the width of the fully-connected layers proportionally $\begin{array} { r } { \dot { \mathcal { d } } _ { \mathrm { f f } } = 4 { d } _ { \mathrm { m o d e l } } ) } \end{array}$ . We train with $10 \%$ label smoothing and no drop-out, for 80 gradient steps.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 13: Scaling of model size with our parameterization of width & embedding dimension.
|
| 280 |
+
|
| 281 |
+
B.2 IMAGE CLASSIFICATION: EXPERIMENTAL SETUP
|
| 282 |
+
|
| 283 |
+
We describe the details of training for CNNs and ResNets below.
|
| 284 |
+
|
| 285 |
+
Loss function: Unless stated otherwise, we use the cross-entropy loss for all the experiments.
|
| 286 |
+
|
| 287 |
+
Data-augmentation: In experiments where data-augmentation was used, we apply RandomCrop(32, padding ${ \cdot = } 4$ ) and RandomHorizontalFlip. In experiments with added label noise, the label for all augmentations of a given training sample are given the same label.
|
| 288 |
+
|
| 289 |
+
Regularization: No explicit regularization like weight decay or dropout was applied unless explicitly stated.
|
| 290 |
+
|
| 291 |
+
Initialization: We use the default initialization provided by PyTorch for all the layers.
|
| 292 |
+
|
| 293 |
+
# Optimization:
|
| 294 |
+
|
| 295 |
+
• Adam: Unless specified otherwise, learning rate was set at constant to 1e−4 and all other parameters were set to their default PyTorch values.
|
| 296 |
+
SGD: Unless specified otherwise, learning rate schedule inverse-square root (defined below) was used with initial learning rate $\gamma _ { 0 } = 0 . 1$ and updates every $L = 5 1 2$ gradient steps. No momentum was used.
|
| 297 |
+
|
| 298 |
+
We found our results are robust to various other natural choices of optimizers and learning rate schedule. We used the above settings because (1) they optimize well, and (2) they do not require experiment-specific hyperparameter tuning, and allow us to use the same optimization across many experiments.
|
| 299 |
+
|
| 300 |
+
Batch size: All experiments use a batchsize of 128.
|
| 301 |
+
|
| 302 |
+
# Learning rate schedule descriptions:
|
| 303 |
+
|
| 304 |
+
• Inverse-square root $( \gamma _ { 0 } , L )$ : At gradient step $t$ , the learning rate is set to $\gamma ( t ) : =$ $\frac { \gamma _ { 0 } } { \sqrt { 1 + \lfloor t / 5 1 2 \rfloor } }$ . We set learning-rate with respect to number of gradient steps, and not epochs, in order to allow comparison between experiments with varying train-set sizes. • Dynamic drop ( $\mathrm { \Delta } \cdot \mathrm { \Delta } \gamma _ { 0 }$ , drop, patience): Starts with an initial learning rate of $\gamma _ { 0 }$ and drops by a factor of ’drop’ if the training loss has remained constant or become worse for ’patience’ number of gradient steps.
|
| 305 |
+
|
| 306 |
+
B.3 NEURAL MACHINE TRANSLATION: EXPERIMENTAL SETUP
|
| 307 |
+
|
| 308 |
+
Here we describe the experimental setup for the neural machine translation experiments.
|
| 309 |
+
|
| 310 |
+
# Training procedure.
|
| 311 |
+
|
| 312 |
+
In this setting, the distribution $\mathcal { D }$ consists of triples
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
( x , y , i ) : x \in V _ { s r c } ^ { * } , y \in V _ { t g t } ^ { * } , i \in \{ 0 , \ldots , | y | \}
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
where $V _ { s r c }$ and $V _ { t g t }$ are the source and target vocabularies, the string $x$ is a sentence in the source language, $y$ is its translation in the target language, and $i$ is the index of the token to be predicted by the model. We assume that $i | x , y$ is distributed uniformly on $\{ 0 , \ldots , | y | \}$ .
|
| 319 |
+
|
| 320 |
+
A standard probabilistic model defines an autoregressive factorization of the likelihood:
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
p _ { M } ( y | x ) = \prod _ { i = 1 } ^ { | y | } p _ { M } ( y _ { i } | y _ { < i } , x ) .
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
Given a set of training samples $S$ , we define
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\operatorname { E r r o r } _ { S } ( M ) = { \frac { 1 } { | S | } } \sum _ { ( x , y , i ) \in S } - \log p _ { M } ( y _ { i } | y _ { < i } , x ) .
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
In practice, $S$ is not constructed from independent samples from $D$ , but rather by first sampling $( x , y )$ and then including all $( x , y , 0 ) , \dotsc , ( x , y , | y | )$ in $S$ .
|
| 333 |
+
|
| 334 |
+
For training transformers, we replicate the optimization procedure specified in Vaswani et al. (2017) section 5.3, where the learning rate schedule consists of a “warmup” phase with linearly increasing learning rate followed by a phase with inverse square-root decay. We preprocess the data using byte pair encoding (BPE) as described in Sennrich et al. (2015). We use the implementation provided by fairseq (https://github.com/pytorch/fairseq).
|
| 335 |
+
|
| 336 |
+
Datasets. The IWSLT ’14 German to English dataset contains TED Talks as described in Cettolo et al. (2012). The WMT ’14 English to French dataset is taken from http://www.statmt. org/wmt14/translation-task.html.
|
| 337 |
+
|
| 338 |
+
# B.4 PER-SECTION EXPERIMENTAL DETAILS
|
| 339 |
+
|
| 340 |
+
Here we provide full details for experiments in the body, when not otherwise provided.
|
| 341 |
+
|
| 342 |
+
Introduction: Experimental Details Figure 1: All models were trained using Adam with learningrate 0.0001 for 4K epochs. Plotting means and standard deviations for 5 trials, with random network initialization.
|
| 343 |
+
|
| 344 |
+
Model-wise Double Descent: Experimental Details Figure 7: Plotting means and standard deviations for 5 trials, with random network initialization.
|
| 345 |
+
|
| 346 |
+
Sample-wise Nonmonotonicity: Experimental Details Figure 11a: All models are trained with SGD for 500K epochs, and data-augmentation. Bottom: Means and standard deviations from 5 trials with random initialization, and random subsampling of the train set.
|
| 347 |
+
|
| 348 |
+
# C EXTENDED DISCUSSION OF RELATED WORK
|
| 349 |
+
|
| 350 |
+
Belkin et al. (2018): This paper proposed, in very general terms, that the apparent contradiction between traditional notions of the bias-variance trade-off and empirically successful practices in deep learning can be reconciled under a double-descent curve—as model complexity increases, the test error follows the traditional “U-shaped curve”, but beyond the point of interpolation, the error starts to decrease. This work provides empirical evidence for the double-descent curve with fully connected networks trained on subsets of MNIST, CIFAR10, SVHN and TIMIT datasets. They use the $l _ { 2 }$ loss for their experiments. They demonstrate that neural networks are not an aberration in this regard—double-descent is a general phenomenon observed also in linear regression with random features and random forests.
|
| 351 |
+
|
| 352 |
+
Theoretical works on linear least squares regression: A variety of papers have attempted to theoretically analyze this behavior in restricted settings, particularly the case of least squares regression under various assumptions on the training data, feature spaces and regularization method.
|
| 353 |
+
|
| 354 |
+
1. Advani & Saxe (2017); Hastie et al. (2019) both consider the linear regression problem stated above and analyze the generalization behavior in the asymptotic limit $N , D \to \infty$ using random matrix theory. Hastie et al. (2019) highlight that when the model is misspecified, the minimum of training error can occur for over-parameterized models
|
| 355 |
+
2. Belkin et al. (2019) Linear least squares regression for two data models, where the input data is sampled from a Gaussian and a Fourier series model for functions on a circle. They provide a finite-sample analysis for these two cases
|
| 356 |
+
3. Bartlett et al. (2019) provides generalization bounds for the minimum $l _ { 2 }$ -norm interpolant for Gaussian features
|
| 357 |
+
4. Muthukumar et al. (2019) characterize the fundamental limit of of any interpolating solution in the presence of noise and provide some interesting Fourier-theoretic interpretations.
|
| 358 |
+
5. Mei & Montanari (2019): This work provides asymptotic analysis for ridge regression over random features
|
| 359 |
+
|
| 360 |
+
Similar double descent behavior, in restricted settings, was investigated in Trunk (1979); Opper (1995; 2001); Skurichina & Duin (2002).
|
| 361 |
+
|
| 362 |
+
Neal et al. (2018) conducts a study of bias and variance in modern neural networks, observing that both bias and variance can decrease with increasing model size, contrary to conventional wisdom.
|
| 363 |
+
|
| 364 |
+
Geiger et al. (2019b) showed that deep fully connected networks trained on the MNIST dataset with hinge loss exhibit a “jamming transition” when the number of parameters exceeds a threshold that allows training to near-zero train loss. Geiger et al. (2019a) provide further experiments on CIFAR10 with a convolutional network. They also highlight interesting behavior with ensembling around the critical regime, which is consistent with our informal intuitions in Section 5 and our experiments in Figures 28, 29.
|
| 365 |
+
|
| 366 |
+
Advani & Saxe (2017); Geiger et al. (2019b;a) also point out that double-descent is not observed when optimal early-stopping is used.
|
| 367 |
+
|
| 368 |
+
The study of sample non-monotonicity in learning algorithms had also existed prior to double descent, including in Duin (1995; 2000); Opper (2001); Loog & Duin (2012).
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
Figure 14: Random Fourier Features on the Fashion MNIST dataset. The setting is equivalent to two-layer neural network with $e ^ { - i x }$ activation, with randomly-initialized first layer that is fixed throughout training. The second layer is trained using gradient flow.
|
| 372 |
+
|
| 373 |
+
In this section, for completeness sake, we show that both the model- and sample-wise double descent phenomena are not unique to deep neural networks—they exist even in the setting of Random Fourier Features of Rahimi & Recht (2008). This setting is equivalent to a two-layer neural network with $e ^ { - i x }$ activation. The first layer is initialized with a $\textstyle { \hat { \mathcal { N } } } ( 0 , { \frac { 1 } { d } } )$ Gaussian distribution and then fixed throughout training. The width (or embedding dimension) $\dot { d }$ of the first layer parameterizes the model size. The second layer is initialized with 0s and trained with MSE loss.
|
| 374 |
+
|
| 375 |
+
Figure 14 shows the grid of Test Error as a function of both number of samples $n$ and model size $d$ . Note that in this setting $\mathrm { E M C } = d$ (the embedding dimension). As a result, as demonstrated in the figure, the peak follows the path of $n = d$ . Both model-wise and sample-wise (see figure 15) double descent phenomena are captured, by horizontally and vertically crossing the grid, respectively.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 15: Sample-wise double-descent slice for Random Fourier Features on the Fashion MNIST dataset. In this figure the embedding dimension (number of random features) is 1000.
|
| 379 |
+
|
| 380 |
+
# E APPENDIX: ADDITIONAL EXPERIMENTS
|
| 381 |
+
|
| 382 |
+
E.1 EPOCH-WISE DOUBLE DESCENT: ADDITIONAL RESULTS
|
| 383 |
+
|
| 384 |
+
Here, we provide a rigorous evaluation of epoch-wise double descent for a variety of optimizers and learning rate schedules. We train ResNet18 on CIFAR-10 with data-augmentation and $20 \%$ label noise with three different optimizers—Adam, SGD, SGD $^ +$ Momentum (momentum set to 0.9) and three different learning rate schedules—constant, inverse-square root, dynamic drop for differnet values of initial learning rate. We observe that double-descent occurs reliably for all optimizers and learning rate schedules and the peak of the double descent curve shifts with the interpolation point.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 16: Epoch-wise double descent for ResNet18 trained with Adam and multiple learning rate schedules
|
| 388 |
+
|
| 389 |
+
A practical recommendation resulting from epoch-wise double descent is that stopping the training when the test error starts to increase may not always be the best strategy. In some cases, the test error may decrease again after reaching a maximum, and the final value may be lower than the minimum earlier in training.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 17: Epoch-wise double descent for ResNet18 trained with SGD and multiple learning rate schedules
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 18: Epoch-wise double descent for ResNet18 trained with $\mathrm { S G D + I }$ Momentum and multiple learning rate schedules
|
| 396 |
+
|
| 397 |
+
E.2 MODEL-WISE DOUBLE DESCENT: ADDITIONAL RESULTS
|
| 398 |
+
|
| 399 |
+
# E.2.1 CLEAN SETTINGS WITH MODEL-WISE DOUBLE DESCENT
|
| 400 |
+
|
| 401 |
+
CIFAR100, ResNet18
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 19: Top: Train and test performance as a function of both model size and train epochs. Bottom: Test error dynamics of the same model (ResNet18, on CIFAR-100 with no label noise, data-augmentation and Adam optimizer trained for $4 \mathrm { k }$ epochs with learning rate 0.0001). Note that even with optimal early stopping this setting exhibits double descent.
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 20: Top: Train and test performance as a function of both model size and train epochs. Bottom: Test error dynamics of the same models. 5-Layer CNNs, CIFAR-100 with no label noise, no data-augmentation Trained with SGD for 1e6 steps. Same experiment as Figure 7.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
Figure 21: Left: Test error dynamics with weight decay of 5e-4 (bottom left) and without weight decay (top left). Right: Test and train error and test loss for models with varying amounts of weight decay. All models are 5-Layer CNNs on CIFAR-10 with $10 \%$ label noise, trained with data-augmentation and SGD for 500K steps.
|
| 411 |
+
|
| 412 |
+
Here, we now study the effect of varying the level of regularization on test error. We train CIFAR10 with data-augmentation and $20 \%$ label noise on ResNet18 for weight decay co-efficients $\lambda$ ranging from 0 to 0.1. We train the networks using $\mathrm { S G D + }$ inverse-square root learning rate. Figure below shows a picture qualitatively very similar to that observed for model-wise double descent wherein ”model complexity” is now controlled by the regularization parameter. This confirms our generalized double descent hypothesis along yet another axis of Effective Model Complexity.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 22: Generalized double descent for weight decay. We found that using the same initial learning rate for all weight decay values led to training instabilities. This resulted in some noise in the Test Error (Weight Decay $\times$ Epochs) plot shown above.
|
| 416 |
+
|
| 417 |
+
Language models
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
Figure 23: Model-wise test error dynamics for a subsampled IWSLT‘14 dataset. Left: 4k samples, Right: 18k samples. Note that with optimal early-stopping, more samples is always better.
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
Figure 24: Model-wise test error dynamics for a IWSLT‘14 de-en and subsampled WMT‘14 en-fr datasets. Left: IWSLT‘14, Right: subsampled (200k samples) WMT‘14. Note that with optimal early-stopping, the test error is much lower for this task.
|
| 424 |
+
|
| 425 |
+
CIFAR10, $10 \%$ noise, SGD
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 25: Top: Train and test performance as a function of both model size and train epochs. Bottom: Test error dynamics of the same model (CNN, on CIFAR-10 with $10 \%$ label noise, dataaugmentation and SGD optimizer with learning rate $\propto 1 / \sqrt { T } )$ ).
|
| 429 |
+
|
| 430 |
+
# E.2.4 TRAINING PROCEDURE
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 26: Model-wise double descent for adversarial training ResNet18s on CIFAR-10 (subsampled to $2 5 \mathrm { k }$ train samples) with no label noise. We train for L2 robustness of radius $\epsilon = 0 . 5$ and $\epsilon = 1 . 0$ , using 10-step PGD (Goodfellow et al. (2014); Madry et al. (2017)). Trained using SGD (batch size 128) with learning rate 0.1 for 400 epochs, then 0.01 for 400 epochs.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 27
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 28: Effect of Ensembling (ResNets, $15 \%$ label noise). Test error of an ensemble of 5 models, compared to the base models. The ensembled classifier is determined by plurality vote over the 5 base models. Note that emsembling helps most around the critical regime. All models are ResNet18s trained on CIFAR-10 with $15 \%$ label noise, using Adam for 4K epochs (same setting as Figure 1). Test error is measured against the original (not noisy) test set, and each model in the ensemble is trained using a train set with independently-sampled $15 \%$ label noise.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure 29: Effect of Ensembling (CNNs, no label noise). Test error of an ensemble of 5 models, compared to the base models. All models are 5-layer CNNs trained on CIFAR-10 with no label noise, using SGD and no data augmentation. (same setting as Figure 7).
|
md/train/B1l08oAct7/B1l08oAct7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/B1n8LexRZ/B1n8LexRZ.md
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERALIZING HAMILTONIAN MONTE CARLO WITH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Daniel Levy1∗, Matthew D. Hoffman2, Jascha Sohl-Dickstein3 1Stanford University, 2Google AI Perception , 3Google Brain danilevy@cs.stanford.edu, {mhoffman,jaschasd}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present a general-purpose method to train Markov chain Monte Carlo kernels, parameterized by deep neural networks, that converge and mix quickly to their target distribution. Our method generalizes Hamiltonian Monte Carlo and is trained to maximize expected squared jumped distance, a proxy for mixing speed. We demonstrate large empirical gains on a collection of simple but challenging distributions, for instance achieving a $1 0 6 \times$ improvement in effective sample size in one case, and mixing when standard HMC makes no measurable progress in a second. Finally, we show quantitative and qualitative gains on a real-world task: latent-variable generative modeling. We release an open source TensorFlow implementation of the algorithm.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
High-dimensional distributions that are only analytically tractable up to a normalizing constant are ubiquitous in many fields. For instance, they arise in protein folding (Schutte et al., 1999), physics ¨ simulations (Olsson, 1995), and machine learning (Andrieu et al., 2003). Sampling from such distributions is a critical task for learning and inference (MacKay, 2003), however it is an extremely hard problem in general.
|
| 12 |
+
|
| 13 |
+
Markov Chain Monte Carlo (MCMC) methods promise a solution to this problem. They operate by generating a sequence of correlated samples that converge in distribution to the target. This convergence is most often guaranteed through detailed balance, a sufficient condition for the chain to have the target equilibrium distribution. In practice, for any proposal distribution, one can ensure detailed balance through a Metropolis-Hastings (Hastings, 1970) accept/reject step.
|
| 14 |
+
|
| 15 |
+
Despite theoretical guarantees of eventual convergence, in practice convergence and mixing speed depend strongly on choosing a proposal that works well for the task at hand. What’s more, it is often more art than science to know when an MCMC chain has converged (“burned-in”), and when the chain has produced a new uncorrelated sample (“mixed”). Additionally, the reliance on detailed balance, which assigns equal probability to the forward and reverse transitions, often encourages random-walk behavior and thus slows exploration of the space (Ichiki & Ohzeki, 2013).
|
| 16 |
+
|
| 17 |
+
For densities over continuous spaces, Hamiltonian Monte Carlo (HMC; Duane et al., 1987; Neal, 2011) introduces independent, auxiliary momentum variables, and computes a new state by integrating Hamiltonian dynamics. This method can traverse long distances in state space with a single Metropolis-Hastings test. This is the state-of-the-art method for sampling in many domains. However, HMC can perform poorly in a number of settings. While HMC mixes quickly spatially, it struggles at mixing across energy levels due to its volume-preserving dynamics. HMC also does not work well with multi-modal distributions, as the probability of sampling a large enough momentum to traverse a very low-density region is negligibly small. Furthermore, HMC struggles with ill-conditioned energy landscapes (Girolami & Calderhead, 2011) and deals poorly with rapidly changing gradients (Sohl-Dickstein et al., 2014).
|
| 18 |
+
|
| 19 |
+
Recently, probabilistic models parameterized by deep neural networks have achieved great success at approximately sampling from highly complex, multi-modal empirical distributions (Kingma &
|
| 20 |
+
|
| 21 |
+
Welling, 2013; Rezende et al., 2014; Goodfellow et al., 2014; Bengio et al., 2014; Sohl-Dickstein et al., 2015). Building on these successes, we present a method that, given an analytically described distribution, automatically returns an exact sampler with good convergence and mixing properties, from a class of highly expressive parametric models. The proposed family of samplers is a generalization of HMC; it transforms the HMC trajectory using parametric functions (deep networks in our experiments), while retaining theoretical guarantees with a tractable Metropolis-Hastings accept/reject step. The sampler is trained to minimize a variation on expected squared jumped distance (similar in spirit to Pasarica & Gelman (2010)). Our parameterization reduces easily to standard HMC. It is further capable of emulating several common extensions of HMC such as withintrajectory tempering (Neal, 1996) and diagonal mass matrices (Bennett, 1975).
|
| 22 |
+
|
| 23 |
+
We evaluate our method on distributions where HMC usually struggles, as well as on a the real-world task of training latent-variable generative models.
|
| 24 |
+
|
| 25 |
+
Our contributions are as follows:
|
| 26 |
+
|
| 27 |
+
• We introduce a generic training procedure which takes as input a distribution defined by an energy function, and returns a fast-mixing MCMC kernel.
|
| 28 |
+
• We show significant empirical gains on various distributions where HMC performs poorly.
|
| 29 |
+
• We finally evaluate our method on the real-world task of training and sampling from a latent variable generative model, where we show improvement in the model’s log-likelihood, and greater complexity in the distribution of posterior samples.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Adaptively modifying proposal distributions to improve convergence and mixing has been explored in the past (Andrieu & Thoms, 2008). In the case of HMC, prior work has reduced the need to choose step size (Neal, 2011) or number of leapfrog steps (Hoffman & Gelman, 2014) by adaptively tuning those parameters. Salimans et al. (2015) proposed an alternate scheme based on variational inference. We adopt the much simpler approach of Pasarica & Gelman (2010), who show that choosing the hyperparameters of a proposal distribution to maximize expected squared jumped distance is both principled and effective in practice.
|
| 34 |
+
|
| 35 |
+
Previous work has also explored applying models from machine learning to MCMC tasks. Kernel methods have been used both for learning a proposal distribution (Sejdinovic et al., 2014) and for approximating the gradient of the energy (Strathmann et al., 2015). In physics, Restricted and semiRestricted Boltzmann machines have been used both to build approximations of the energy function which allow more rapid sampling (Liu et al., 2017; Huang & Wang, 2017), and to motivate new hand-designed proposals (Wang, 2017).
|
| 36 |
+
|
| 37 |
+
Most similar to our approach is recent work from Song et al. (2017), which uses adversarial training of a volume-preserving transformation, which is subsequently used as an MCMC proposal distribution. While promising, this technique has several limitations. It does not use gradient information, which is often crucial to maintaining high acceptance rates, especially in high dimensions. It also can only indirectly measure the quality of the generated sample using adversarial training, which is notoriously unstable, suffers from “mode collapse” (where only a portion of a target distribution is covered), and often requires objective modification to train in practice (Arjovsky et al., 2017). Finally, since the proposal transformation preserves volume, it can suffer from the same difficulties in mixing across energy levels as HMC, as we illustrate in Section 5.
|
| 38 |
+
|
| 39 |
+
To compute the Metropolis-Hastings acceptance probability for a deterministic transition, the operator must be invertible and have a tractable Jacobian. Recent work (Dinh et al., 2016), introduces RNVP, an invertible transformation that operates by, at each layer, modifying only a subset of the variables by a function that depends solely on the remaining variables. This is exactly invertible with an efficiently computable Jacobian. Furthermore, by chaining enough of these layers, the model can be made arbitrarily expressive. This parameterization will directly motivate our extension of the leapfrog integrator in HMC.
|
| 40 |
+
|
| 41 |
+
# 3 BACKGROUND
|
| 42 |
+
|
| 43 |
+
# 3.1 MCMC METHODS AND METROPOLIS-HASTINGS
|
| 44 |
+
|
| 45 |
+
Let $p$ be a target distribution, analytically known up to a constant, over a space $\mathcal { X }$ . Markov chain Monte Carlo (MCMC) methods (Neal, 1993) aim to provide samples from $p$ . To that end, MCMC methods construct a Markov Chain whose stationary distribution is the target distribution $p$ . Obtaining samples then corresponds to simulating a Markov Chain, i.e., given an initial distribution $\pi _ { 0 }$ and a transition kernel $K$ , constructing the following sequence of random variables:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
X _ { 0 } \sim \pi _ { 0 } , \quad X _ { t + 1 } \sim K ( \cdot | X _ { t } ) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
In order for $p$ to be the stationary distribution of the chain, three conditions must be satisfied: $K$ must be irreducible and aperiodic (these are usually mild technical conditions) and $p$ has to be a fixed point of $K$ . This last condition can be expressed as: $\begin{array} { r } { p ( x ^ { \prime } ) = \int K ( x ^ { \prime } | x ) p ( x ) \mathrm { d } x } \end{array}$ . This condition is most often satisfied by satisfying the stronger detailed balance condition, which can be written as: $p ( x ^ { \prime } ) K ( x | x ^ { \prime } ) = p ( x ) \dot { K } ( x ^ { \prime } | \dot { x } )$ .
|
| 52 |
+
|
| 53 |
+
Given any proposal distribution $q$ , satisfying mild conditions, we can easily construct a transition kernel that respects detailed balance using Metropolis-Hastings (Hastings, 1970) accept/reject rules. More formally, starting from $x _ { 0 } \sim \pi _ { 0 }$ , at each step $t$ , we sample $x ^ { \prime } \sim q ( \cdot | X _ { t } )$ , and with probability $\begin{array} { r } { A ( x ^ { \prime } | x _ { t } ) = \operatorname* { m i n } \left( 1 , \frac { p ( x ^ { \prime } ) q ( x _ { t } | x ^ { \prime } ) } { p ( x _ { t } ) q ( x ^ { \prime } | x _ { t } ) } \right) } \end{array}$ , accept $x ^ { \prime }$ as the next sample $x _ { t + 1 }$ in the chain. If we reject $x ^ { \prime }$ , then we retain the previous state and $x _ { t + 1 } ~ = ~ x _ { t }$ . For typical proposals this algorithm has strong asymptotic guarantees. But in practice one must often choose between very low acceptance probabilities and very cautious proposals, both of which lead to slow mixing. For continuous state spaces, Hamiltonian Monte Carlo (HMC; Neal, 2011) tackles this problem by proposing updates that move far in state space while staying roughly on iso-probability contours of $p$ .
|
| 54 |
+
|
| 55 |
+
# 3.2 HAMILTONIAN MONTE CARLO
|
| 56 |
+
|
| 57 |
+
Without loss of generality, we assume $p \left( x \right)$ to be defined by an energy function $U \left( x \right)$ , s.t. $p ( x ) \propto \exp ( - U ( { \bar { x } } ) )$ , and where the state $x \in \mathbb { R } ^ { n }$ . HMC extends the state space with an additional momentum vector $v \in \mathbb { R } ^ { n }$ , where $v$ is distributed independently from $x$ , as $p ( v ) \propto \exp ( - \frac { 1 } { 2 } v ^ { T } v )$ (i.e., identity-covariance Gaussian). From an augmented state $\xi \triangleq ( x , v )$ , HMC produces a proposed state $\xi ^ { \prime } = ( \dot { x } ^ { \prime } , v ^ { \prime } )$ by approximately integrating Hamiltonian dynamics jointly on $x$ and $v$ , with $U \left( x \right)$ taken to be the potential energy, and $\scriptstyle { \frac { 1 } { 2 } } v ^ { \overline { { T } } } v$ the kinetic energy. Since Hamiltonian dynamics conserve the total energy of a system, their approximate integration moves along approximate iso-probability contours of $p \bar { ( \boldsymbol { x } , \boldsymbol { v } ) } = \bar { p } ( \boldsymbol { x } ) p ( \boldsymbol { v } )$ .
|
| 58 |
+
|
| 59 |
+
The dynamics are typically simulated using the leapfrog integrator (Hairer et al., 2003; Leimkuhler & Reich, 2004), which for a single time step consists of:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { v ^ { \frac { 1 } { 2 } } = v - \frac { \epsilon } { 2 } \partial _ { x } U ( x ) ; \quad x ^ { \prime } = x + \epsilon v ^ { \frac { 1 } { 2 } } ; \quad v ^ { \prime } = v - \frac { \epsilon } { 2 } \partial _ { x } U ( x ^ { \prime } ) . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Following Sohl-Dickstein et al. (2014), we write the action of the leapfrog integrator in terms of an operator $\mathbf { L }$ : $\mathbf { L } \boldsymbol { \xi } \triangleq \mathbf { L } ( \boldsymbol { x } , \boldsymbol { v } ) \triangleq ( \boldsymbol { x } ^ { \prime } , \boldsymbol { v } ^ { \prime } )$ , and introduce a momentum flip operator $\mathbf { F }$ : $\mathbf { F } ( x , v ) \triangleq$ $( x , - v )$ . It is important to note two properties of these operators. First, the transformation $\mathbf { F L }$ is an involution, i.e. $\mathbf { F L F L } ( x , v ) = \mathbf { F L } ( x ^ { \prime } , - v ^ { \prime } ) = ( x , v )$ . Second, the transformations from $( x , v )$ to $( x , v ^ { \frac { 1 } { 2 } } )$ , from $( x , v ^ { \frac { 1 } { 2 } } )$ to $( x ^ { \prime } , v ^ { \frac { 1 } { 2 } } )$ , and from $( x ^ { \prime } , v ^ { \frac { 1 } { 2 } } )$ to $( x ^ { \prime } , v ^ { \prime } )$ are all volume-preserving shear transformations i.e., only one of the variables ( $x$ or $v$ ) changes, by an amount determined by the other one. The determinant of the Jacobian, $\left. \frac { \partial [ \mathbf { F } \mathbf { L } \xi ] } { \partial \xi ^ { T } } \right.$ , is thus easy to compute. For vanilla HMC $\begin{array} { r } { \left| \frac { \partial [ \mathbf { F } \mathbf { L } \xi ] } { \partial \xi ^ { T } } \right| = 1 } \end{array}$ , but we will leave it in symbolic form for use in Section 4. The Metropolis-HastingsGreen (Hastings, 1970; Green, 1995) acceptance probability for the HMC proposal is made simple by these two properties, and is
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { A ( \mathbf { F } \mathbf { L } \xi | \xi ) = \operatorname* { m i n } \left( 1 , \frac { p ( \mathbf { F } \mathbf { L } \xi ) } { p ( \xi ) } \left| \frac { \partial [ \mathbf { F } \mathbf { L } \xi ] } { \partial \xi ^ { T } } \right| \right) . } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
# 4 L2HMC: TRAINING MCMC SAMPLERS
|
| 72 |
+
|
| 73 |
+
In this section, we describe our proposed method L2HMC (for ‘Learning To Hamiltonian Monte Carlo’). Given access to only an energy function $U$ (and not samples), L2HMC learns a parametric leapfrog operator $\mathbf { L } _ { \theta }$ over an augmented state space. We begin by describing what desiderata we have for $\mathbf { L } _ { \theta }$ , then go into detail on how we parameterize our sampler. Finally, we conclude this section by describing our training procedure.
|
| 74 |
+
|
| 75 |
+
# 4.1 AUGMENTING HMC
|
| 76 |
+
|
| 77 |
+
HMC is a powerful algorithm, but it can still struggle even on very simple problems. For example, a two-dimensional multivariate Gaussian with an ill-conditioned covariance matrix can take arbitrarily long to traverse (even if the covariance is diagonal), whereas it is trivial to sample directly from it. Another problem is that HMC can only move between energy levels via a random walk (Neal, 2011), which leads to slow mixing in some models. Finally, HMC cannot easily traverse low-density zones. For example, given a simple Gaussian mixture model, HMC cannot mix between modes without recourse to additional tricks, as illustrated in Figure 1b. These observations determine the list of desiderata for our learned MCMC kernel: fast mixing, fast burn-in, mixing across energy levels, and mixing between modes.
|
| 78 |
+
|
| 79 |
+
While pursuing these goals, we must take care to ensure that our proposal operator retains two key features of the leapfrog operator used in HMC: it must be invertible, and the determinant of its Jacobian must be tractable. The leapfrog operator satisfies these properties by ensuring that each sub-update only affects a subset of the variables, and that no sub-update depends nonlinearly on any of the variables being updated. We are free to generalize the leapfrog operator in any way that preserves these properties. In particular, we are free to translate and rescale each sub-update of the leapfrog operator, so long as we are careful to ensure that these translation and scale terms do not depend on the variables being updated.
|
| 80 |
+
|
| 81 |
+
# 4.1.1 STATE SPACE
|
| 82 |
+
|
| 83 |
+
As in HMC, we begin by augmenting the current state $x \in \mathbb { R } ^ { n }$ with a continuous momentum variable $v \in \mathbb { R } ^ { n }$ drawn from a standard normal. We also introduce a binary direction variable $d \in \{ - 1 , 1 \}$ , drawn from a uniform distribution. We will denote the complete augmented state as $\xi \triangleq ( x , v , d )$ , with probability density $p ( \xi ) = p ( x ) p ( v ) p ( d )$ . Finally, to each step $t$ of the operator $\mathbf { L } _ { \theta }$ we assign a fixed random binary mask $m ^ { t } \in \{ 0 , 1 \} ^ { n }$ that will determine which variables are affected by each sub-update. We draw $m ^ { t }$ uniformly from the set of binary vectors satisfying $\begin{array} { r } { \sum _ { i = 1 } ^ { n } m _ { i } ^ { t } = \lfloor \frac { n } { 2 } \rfloor } \end{array}$ , that is, half of the entries of $m ^ { t }$ are 0 and half are 1. For convenience, we write $\bar { m } ^ { t } = 1 - m ^ { t }$ and $x _ { m ^ { t } } = x \odot m ^ { t }$ $\odot$ denotes element-wise multiplication, and $\mathbb { 1 }$ the all ones vector).
|
| 84 |
+
|
| 85 |
+
# 4.1.2 UPDATE STEPS
|
| 86 |
+
|
| 87 |
+
We now describe the details of our augmented leapfrog integrator $\mathbf { L } _ { \theta }$ , for a single time-step $t$ , and for direction $d = 1$ .
|
| 88 |
+
|
| 89 |
+
We first update the momenta $v$ . This update can only depend on a subset $\zeta _ { 1 } \triangleq ( x , \partial _ { x } U ( x ) , t )$ of the full state, which excludes $v$ . It takes the form
|
| 90 |
+
|
| 91 |
+
We have introduced three new functions of $\zeta _ { 1 } \colon T _ { v }$ , $Q _ { v }$ , and $S _ { v }$ . $T _ { v }$ is a translation, $\exp ( Q _ { v } )$ rescales the gradient, and $\exp ( \frac { \epsilon } { 2 } S _ { v } )$ rescales the momentum. The determinant of the Jacobian of this transformation is exp $, \left( \frac { \epsilon } { 2 } \mathbb { 1 } \cdot S _ { v } ( \zeta _ { 1 } ) \right)$ . Note that if $T _ { v }$ , $Q _ { v }$ , and $S _ { v }$ are all zero, then we recover the standard leapfrog momentum update.
|
| 92 |
+
|
| 93 |
+
We now update $x$ . As hinted above, to make our transformation more expressive, we first update a subset of the coordinates of $x$ , followed by the complementary subset. The first update, which yields $x ^ { \prime }$ and affects only $x _ { m } t$ , depends on the state subset $\zeta _ { 2 } \triangleq ( x _ { \bar { m } ^ { t } } , v , t )$ . Conversely, with $x ^ { \prime }$ defined below, the second update only affects $\boldsymbol { x } _ { \bar { m } ^ { t } } ^ { \prime }$ and depends only on $\zeta _ { 3 } \triangleq ( x _ { m ^ { t } } ^ { \prime } , v , t )$ :
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { l } { { x ^ { \prime } = x _ { \bar { m } ^ { t } } + m ^ { t } \odot [ x \odot \exp ( \epsilon S _ { x } ( \zeta _ { 2 } ) ) + \epsilon ( v ^ { \prime } \odot \exp ( \epsilon Q _ { x } ( \zeta _ { 2 } ) ) + T _ { x } ( \zeta _ { 2 } ) ) ] } } \\ { { x ^ { \prime \prime } = x _ { m ^ { t } } ^ { \prime } + \bar { m } ^ { t } \odot [ x ^ { \prime } \odot \exp ( \epsilon S _ { x } ( \zeta _ { 3 } ) ) + \epsilon ( v ^ { \prime } \odot \exp ( \epsilon Q _ { x } ( \zeta _ { 3 } ) ) + T _ { x } ( \zeta _ { 3 } ) ) ] . } } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Again, $T _ { x }$ is a translation, $\exp ( Q _ { x } )$ rescales the effect of the momenta, $\exp ( \epsilon S _ { x } )$ rescales the positions $x$ , and we recover the original leapfrog position update if $T _ { x } = Q _ { x } = S _ { x } = 0$ . The determinant of the Jacobian of the first transformation is $\bar { \exp { ( \epsilon m ^ { t } \cdot S _ { x } ( \zeta _ { 2 } ) ) } }$ , and the determinant of the Jacobian of the second transformation is $\exp { ( \epsilon \bar { m } ^ { t } \cdot S _ { x } ( \zeta _ { 3 } ) ) }$ .
|
| 100 |
+
|
| 101 |
+
Finally, we update $v$ again, based on the subset $\zeta _ { 4 } \triangleq ( x ^ { \prime \prime } , \partial _ { x } U ( x ^ { \prime \prime } ) , t )$ :
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r } { v ^ { \prime \prime } = v ^ { \prime } \odot \exp ( \frac { \epsilon } { 2 } S _ { v } ( \zeta _ { 4 } ) ) - \frac { \epsilon } { 2 } ( \partial _ { x } U ( x ^ { \prime \prime } ) \odot \exp ( \epsilon Q _ { v } ( \zeta _ { 4 } ) ) + T _ { v } ( \zeta _ { 4 } ) ) . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
This update has the same form as the momentum update in equation 4.
|
| 108 |
+
|
| 109 |
+
To give intuition into these terms, the scaling applied to the momentum can enable, among other things, acceleration in low-density zones, to facilitate mixing between modes. The scaling term applied to the gradient of the energy may allow better conditioning of the energy landscape (e.g., by learning a diagonal inertia tensor), or partial ignoring of the energy gradient for rapidly oscillating energies.
|
| 110 |
+
|
| 111 |
+
The corresponding integrator for $d = - 1$ is given in Appendix A; it essentially just inverts the updates in equations 4, 5 and 6. For all experiments, the functions $Q , S , T$ are implemented using multi-layer perceptrons, with shared weights. We encode the current time step in the MLP input.
|
| 112 |
+
|
| 113 |
+
Our leapfrog operator $\mathbf { L } _ { \theta }$ corresponds to running $M$ steps of this modified leapfrog, $\begin{array} { r l } { \mathbf { L } _ { \theta } \boldsymbol { \xi } } & { { } = } \end{array}$ ${ \bf L } _ { \theta } ( x , v , d ) \stackrel { } { = } ( x ^ { \prime \prime \times M } , v ^ { \prime \prime \times M } , d )$ , and our flip operator $\mathbf { F }$ reverses the direction variable $d$ , $\mathbf { F } \xi =$ $( x , v , - d )$ . Written in terms of these modified operators, our proposal and acceptance probability are identical to those for standard HMC. Note, however, that this parameterization enables learning non-volume-preserving transformations, as the determinant of the Jacobian is a function of $S _ { x }$ and $S _ { v }$ that does not necessarily evaluate to 1. This quantity is derived in Appendix B.
|
| 114 |
+
|
| 115 |
+
# 4.1.3 MCMC TRANSITIONS
|
| 116 |
+
|
| 117 |
+
For convenience, we denote by $\mathbf { R }$ an operator that re-samples the momentum and direction. I.e., given $\xi ~ = ~ ( x , v , d )$ , $\mathbf { R } \xi = ( x , v ^ { \prime } , d ^ { \prime } )$ where $v ^ { \prime } \sim \mathcal { N } ( 0 , I ) , d ^ { \prime } \sim \mathcal { U } \left( \{ - 1 , 1 \} \right)$ . Sampling thus consists of alternating application of the $\mathbf { F L } _ { \theta }$ and $\mathbf { R }$ , in the following two steps each of which is a Markov transition that satisfies detailed balance with respect to $p$ :
|
| 118 |
+
|
| 119 |
+
1. $\boldsymbol { \xi } ^ { \prime } = \mathbf { F } \mathbf { L } _ { \boldsymbol { \theta } } \boldsymbol { \xi }$ with probability $A ( \mathbf { F L } _ { \theta } \xi | \xi )$ (Equation 3), otherwise $\xi ^ { \prime } = \xi$
|
| 120 |
+
2. $\boldsymbol { \xi } ^ { \prime } = \mathbf { R } \boldsymbol { \xi }$
|
| 121 |
+
|
| 122 |
+
This parameterization is effectively a generalization of standard HMC as it is non-volume preserving, with learnable parameters, and easily reduces to standard HMC for $Q , S , T = 0$ .
|
| 123 |
+
|
| 124 |
+
# 4.2 LOSS AND TRAINING PROCEDURE
|
| 125 |
+
|
| 126 |
+
We need some criterion to train the parameters $\theta$ that control the functions $Q , S$ , and $T$ . We choose a loss designed to reduce mixing time. Specifically, we aim to minimize lag-one autocorrelation. This is equivalent to maximizing expected squared jumped distance (Pasarica & Gelman, 2010). For $\xi , \xi ^ { \prime }$ in the extended state space, we define $\delta ( \xi ^ { \bar { \prime } } , \xi ) \ = \ \delta ( ( x ^ { \prime } , v ^ { \prime } , d ^ { \prime } ) , ( x , v , d ) ) \ = \ | | x - x ^ { \prime } | | _ { 2 } ^ { 2 }$ . Expected squared jumped distance is thus $\mathbb { E } _ { \xi \sim p ( \xi ) } \left[ \delta ( \mathbf { F L } _ { \theta } \xi , \xi ) A ( \mathbf { F L } _ { \theta } \xi | \xi ) \right]$ . However, this loss need not encourage mixing across the entire state space. Indeed, maximizing this objective can lead to regions of state space where almost no mixing occurs, so long as the average squared distance traversed remains high. To optimize both for typical and worst case behavior, we include a reciprocal term in the loss,
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\begin{array} { r } { \ell _ { \lambda } ( \xi , \xi ^ { \prime } , A ( \xi ^ { \prime } | \xi ) ) = \frac { \lambda ^ { 2 } } { \delta ( \xi , \xi ^ { \prime } ) A ( \xi ^ { \prime } | \xi ) } - \frac { \delta ( \xi , \xi ^ { \prime } ) A ( \xi ^ { \prime } | \xi ) } { \lambda ^ { 2 } } , } \end{array}
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
where $\lambda$ is a scale parameter, capturing the characteristic length scale of the problem. The second term encourages typical moves to be large, while the first term strongly penalizes the sampler if it is ever in a state where it cannot move effectively – $\delta ( \xi , \xi ^ { \prime } )$ being small resulting in a large loss value. We train our sampler by minimizing this loss over both the target distribution and initialization distribution. Formally, given an initial distribution $\pi _ { 0 }$ over $\mathcal { X }$ , we define $q ( \xi ) = \pi _ { 0 } ( x ) \mathcal { N } ( v ; 0 , I ) p ( d )$ , and minimize
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\begin{array} { r } { \mathcal { L } ( \boldsymbol { \theta } ) \triangleq \mathbb { E } _ { p ( \boldsymbol { \xi } ) } \left[ \ell _ { \lambda } ( \boldsymbol { \xi } , \mathbf { F } \mathbf { L } _ { \boldsymbol { \theta } } \boldsymbol { \xi } , A ( \mathbf { F } \mathbf { L } _ { \boldsymbol { \theta } } \boldsymbol { \xi } | \boldsymbol { \xi } ) ) \right] + \lambda _ { b } \mathbb { E } _ { q ( \boldsymbol { \xi } ) } \left[ \ell _ { \lambda } ( \boldsymbol { \xi } , \mathbf { F } \mathbf { L } _ { \boldsymbol { \theta } } \boldsymbol { \xi } , A ( \mathbf { F } \mathbf { L } _ { \boldsymbol { \theta } } \boldsymbol { \xi } | \boldsymbol { \xi } ) ) \right] . } \end{array}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
The first term of this loss encourages mixing as it considers our operator applied on draws from the distribution; the second term rewards fast burn-in; $\lambda _ { b }$ controls the strength of the ‘burn-in’ regularization. Given this loss, we exactly describe our training procedure in Algorithm 1. It is important to note that each training iteration can be done with only one pass through the network and can be efficiently batched. We further emphasize that this training procedure can be applied to any learnable operator whose Jacobian’s determinant is tractable, making it a general framework for training MCMC proposals.
|
| 139 |
+
|
| 140 |
+
# Algorithm 1 Training L2HMC
|
| 141 |
+
|
| 142 |
+
Input: Energy function $U : \mathcal { X } \mathbb { R }$ and its gradient $\nabla _ { x } U : x x$ , initial distribution over
|
| 143 |
+
the augmented state space $q$ , number of iterations $n _ { \mathrm { i t e r s } }$ , number of leapfrogs $M$ , learning rate
|
| 144 |
+
schedule (αt)t≤n , batch size $N$ , scale parameter $\lambda$ and regularization strength $\lambda _ { b }$ .
|
| 145 |
+
Initialize the parameters of the sampler $\theta$ .
|
| 146 |
+
Initialize $\{ \xi _ { p } ^ { ( i ) } \} _ { i \le N }$ from $q ( \xi )$ .
|
| 147 |
+
for $t = 0$ to $n _ { \mathrm { i t e r s } } - 1$ do Sample a minibatch $\{ \xi _ { q } ^ { ( i ) } \} _ { i \leq N }$ from $q ( \xi )$ . $\mathcal { L } 0$ for r $\begin{array} { r l } & { \xi _ { p } ^ { ( i ) } \gets \mathbf { R } \xi _ { p } ^ { ( i ) } } \\ & { \mathcal { L } \gets \mathcal { L } + \ell _ { \lambda } \left( \xi _ { p } ^ { ( i ) } , \mathbf { F L } _ { \theta } \xi _ { p } ^ { ( i ) } , A ( \mathbf { F L } _ { \theta } \xi _ { p } ^ { ( i ) } | \xi _ { p } ^ { ( i ) } ) \right) + \lambda _ { b } \ell _ { \lambda } \left( \xi _ { q } ^ { ( i ) } , \mathbf { F L } _ { \theta } \xi _ { q } ^ { ( i ) } , A ( \mathbf { F L } _ { \theta } \xi _ { q } ^ { ( i ) } | \xi _ { q } ^ { ( i ) } ) \right) } \\ & { } \end{array}$ $i = 1$ to $N$ do $\begin{array} { r } { \xi _ { p } ^ { ( i ) } \mathbf { F L } _ { \theta } \xi _ { p } ^ { ( i ) } } \end{array}$ with probability $A ( \mathbf { F L } _ { \theta } \xi _ { p } ^ { ( i ) } | \xi _ { p } ^ { ( i ) } )$ . end for θ θ α t θ
|
| 148 |
+
end for
|
| 149 |
+
|
| 150 |
+
# 5 EXPERIMENTS
|
| 151 |
+
|
| 152 |
+
We present an empirical evaluation of our trained sampler on a diverse set of energy functions. We first present results on a collection of toy distributions capturing common pathologies of energy landscapes, followed by results on a task from machine learning: maximum-likelihood training of deep generative models. For each, we compare against HMC with well-tuned step length and show significant gains in mixing time. Code implementing our algorithm is available online1.
|
| 153 |
+
|
| 154 |
+
# 5.1 VARIED COLLECTION OF ENERGY FUNCTIONS
|
| 155 |
+
|
| 156 |
+
We evaluate our L2HMC sampler on a diverse collection of energy functions, each posing different challenges for standard HMC.
|
| 157 |
+
|
| 158 |
+
Ill-Conditioned Gaussian (ICG): Gaussian distribution with diagonal covariance spaced loglinearly between $1 0 ^ { - 2 }$ and $1 0 ^ { 2 }$ . This demonstrates that L2HMC can learn a diagonal inertia tensor.
|
| 159 |
+
|
| 160 |
+
Strongly correlated Gaussian (SCG): We rotate a diagonal Gaussian with variances $[ 1 0 ^ { 2 } , 1 0 ^ { - 2 } ]$ by $\frac { \pi } { 4 }$ . This is an extreme version of an example from Neal (2011). This problem shows that, although our parametric sampler only applies element-wise transformations, it can adapt to structure which is not axis-aligned.
|
| 161 |
+
|
| 162 |
+
Mixture of Gaussians (MoG): Mixture of two isotropic Gaussians with $\sigma ^ { 2 } = 0 . 1$ , and centroids separated by distance 4. The means are thus about 12 standard deviations apart, making it almost impossible for HMC to mix between modes.
|
| 163 |
+
|
| 164 |
+
Rough Well: Similar to an example from Sohl-Dickstein et al. (2014), for a given $\eta > 0 , U ( x ) =$ $\begin{array} { r } { \frac { 1 } { 2 } x ^ { T } \overset { \smile } { x } + \eta \sum _ { i } \cos ( \frac { x _ { i } } { \eta } ) } \end{array}$ . For small $\eta$ the energy itself is altered negligibly, but its gradient is perturbed by a high frequency noise oscillating between $- 1$ and 1. In our experiments, we choose $\eta = 1 0 ^ { - 2 }$ .
|
| 165 |
+
|
| 166 |
+
For each of these distributions, we compare against HMC with the same number of leapfrog steps and a well-tuned step-size. To compare mixing time, we plot auto-correlation for each method and report effective sample size (ESS). We compute those quantities in the same way as Sohl-Dickstein et al. (2014). We observe that samplers trained with L2HMC show greatly improved autocorrelation and ESS on the presented tasks, providing more than $1 0 6 \times$ improved ESS on the SCG task. In addition, for the MoG, we show that L2HMC can easily mix between modes while standard HMC gets stuck in a mode, unable to traverse the low density zone. Experimental details, as well as a comparison with LAHMC (Sohl-Dickstein et al., 2014), are shown in Appendix C.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 1: L2HMC mixes faster than well-tuned HMC, and than A-NICE-MC, on a collection of toy distributions.
|
| 170 |
+
|
| 171 |
+
Comparison to A-NICE-MC (Song et al., 2017) In addition to the well known challenges associated with adversarial training (Arjovsky et al., 2017), we note that parameterization using a volume-preserving operator can dramatically fail on simple energy landscapes. We build off of the mog2 experiment presented in (Song et al., 2017), which is a 2-d mixture of isotropic Gaussians separated by a distance of 10 with variances 0.5. We consider that setup but increase the ratio of variances: $\dot { \sigma } _ { 1 } ^ { 2 } = 3 , \sigma _ { 2 } ^ { 2 } = 0 . 0 5$ . We show in Figure 1d sample chains trained with L2HMC and A-NICE-MC; A-NICE-MC cannot effectively mix between the two modes as only a fraction of the volume of the large mode can be mapped to the small one, making it highly improbable to traverse. This is also an issue for HMC. On the other hand, L2HMC can both traverse the low-density region between modes, and map a larger volume in the left mode to a smaller volume in the right mode. It is important to note that the distance between both clusters is less than in the mog2 case, and it is thus a good diagnostic of the shortcomings of volume-preserving transformations.
|
| 172 |
+
|
| 173 |
+
# 5.2 LATENT-VARIABLE GENERATIVE MODEL
|
| 174 |
+
|
| 175 |
+
We apply our learned sampler to the task of training, and sampling from the posterior of, a latentvariable generative model. The model consists of a latent variable $z \sim p ( z )$ , where we choose $p ( z ) = \breve { \mathscr { N } } ( z ; 0 , I )$ , and a conditional distribution $p ( x | z )$ which generates the image $x$ . Given a family of parametric ‘decoders’ $\{ z \mapsto p ( x | z ; \phi ) , \phi \in \Phi \}$ , and a set of samples $\mathcal { D } = \{ x ^ { ( i ) } \} _ { i \leq N }$ training involves finding $\begin{array} { r } { \phi ^ { * } = \arg \operatorname* { m a x } _ { \phi \in \Phi } p ( \mathcal { D } ; \phi ) } \end{array}$ . However, the log-likelihood is intractable as $\begin{array} { r } { p ( x ; \boldsymbol { \phi } ) = \int p ( x | \boldsymbol { z } ; \boldsymbol { \phi } ) p ( \boldsymbol { z } ) \mathrm { d } \boldsymbol { z } } \end{array}$ . To remedy that problem, Kingma $\&$ Welling (2013) proposed jointly training an approximate posterior $q _ { \psi }$ that maximizes a tractable lower-bound on the log-likelihood:
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 2: Training and held-out log-likelihood for models trained with L2HMC, HMC, and the ELBO (VAE).
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\mathcal { L } _ { \mathrm { E L B O } } ( x , \phi , \psi ) = \mathbb { E } _ { q _ { \psi } ( z | x ) } \left[ p ( x | z ; \phi ) \right] - \mathrm { K L } ( q _ { \psi } ( z | x ) | | p ( z ) ) \leq p ( x ) ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
where $q _ { \psi } ( z | x )$ is a tractable conditional distribution with parameters $\psi$ , typically parameterized by a neural network. Recently, to improve upon well-known pitfalls like over-pruning (Burda et al., 2015) of the VAE, Hoffman (2017) proposed HMC-DLGM. For a data sample $x ^ { ( i ) }$ , after obtaining a sample from the approximate posterior $q _ { \psi } ( \cdot | x ^ { ( i ) } )$ , Hoffman (2017) runs a MCMC algorithm with energy function $U ( z , x ^ { ( i ) } ) = - \log p ( z ) - \log p ( x ^ { ( i ) } | z ; \phi )$ to obtain a more exact posterior sample from $p ( \boldsymbol { z } | \boldsymbol { x } ^ { ( i ) } ; \boldsymbol { \phi } )$ . Given that better posterior sample $z ^ { \prime }$ , the algorithm maximizes $\log p ( x ^ { ( i ) } | z ^ { \prime } ; \phi )$ .
|
| 185 |
+
|
| 186 |
+
To show the benefits of L2HMC, we borrow the method from Hoffman (2017), but replace HMC by jointly training an L2HMC sampler to improve the efficiency of the posterior sampling. We call this model L2HMC-DLGM. A diagram of our model and a formal description of our training procedure are presented in Appendix D. We define, for $\xi = \{ z , v , d \} , r ( \xi | x ; \psi ) \triangleq$ $q _ { \psi } ( z | x ) \mathcal { N } ( v ; \bar { 0 , I } ) \mathcal { U } ( d ; \{ - 1 , \bar { 1 } \} )$ .
|
| 187 |
+
|
| 188 |
+
In the subsequent sections, we compare our method to the standard VAE model from Kingma & Welling (2013) and HMC-DGLM from Hoffman (2017). It is important to note that, since our sampler is trained jointly with $p _ { \phi }$ and $q _ { \psi }$ , it performs exactly the same number of gradient computations of the energy function as HMC. We first show that training a latent variable generative model with L2HMC results in better generative models both qualitatively and quantitatively. We then show that our improved sampler enables a more expressive, non-Gaussian, posterior.
|
| 189 |
+
|
| 190 |
+
Implementation details: Our decoder $( p _ { \phi } )$ is a neural network with 2 fully connected layers, with 1024 units each and softplus non-linearities, and outputs Bernoulli activation probabilities for each pixel. The encoder $( q _ { \psi } )$ has the same architecture, returning mean and variance for the approximate posterior. Our model was trained for 300 epochs with Adam (Kingma & Ba, 2014) and a learning rate $\alpha = 1 0 ^ { - 3 }$ . All experiments were done on the dynamically binarized MNIST dataset (LeCun).
|
| 191 |
+
|
| 192 |
+
# 5.2.1 SAMPLE QUALITY AND DATA LIKELIHOOD
|
| 193 |
+
|
| 194 |
+
We first present samples from decoders trained with L2HMC, HMC and the ELBO (i.e. vanilla VAE). Although higher log likelihood does not necessarily correspond to better samples (Theis et al., 2015), we can see in Figure 5, shown in the Appendix, that the decoder trained with L2HMC generates sharper samples than the compared methods.
|
| 195 |
+
|
| 196 |
+
We now compare our method to HMC in terms of log-likelihood of the data. As we previously stated, the marginal likelihood of a data point $x \in \mathcal { X }$ is not tractable as it requires integrating $p ( x , z )$ over a high-dimensional space. However, we can estimate it using annealed importance sampling (AIS; Neal (2001)). Following Wu et al. (2016), we evaluate our generative models on both training and held-out data. In Figure 2, we plot the data’s log-likelihood against the number of gradient computation steps for both HMC-DGLM and L2HMC-DGLM. We can see that for a similar number of gradient computations, L2HMC-DGLM achieves higher likelihood for both training and held-out data. This is a strong indication that L2HMC provides significantly better posterior samples.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
|
| 200 |
+
(a) Block Gibbs inpainting of the top half of an MNIST digit, using (top) L2HMC as a posterior sampler, and (bottom) $q _ { \psi }$ as a posterior sampler.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
(b) Non-Gaussian posterior
|
| 204 |
+
Figure 3: Demonstrations of the value of a more expressive posterior approximation.
|
| 205 |
+
|
| 206 |
+
# 5.2.2 INCREASED EXPRESSIVITY OF THE POSTERIOR
|
| 207 |
+
|
| 208 |
+
In the standard VAE framework, approximate posteriors are often parametrized by a Gaussian, thus making a strong assumption of uni-modality. In this section, we show that using L2HMC to sample from the posterior enables learning of a richer posterior landscape.
|
| 209 |
+
|
| 210 |
+
Block Gibbs Sampling To highlight our ability to capture more expressive posteriors, we in-paint the top of an image using Block Gibbs Sampling using the approximate posterior or L2HMC. Formally, let $x _ { 0 }$ be the starting image. We denote top or bottom-half pixels as $x _ { 0 } ^ { \mathrm { t o p } }$ and $x _ { 0 } ^ { \mathrm { b o t t o m } }$ . At each step $t$ , we sample $z ^ { ( t ) } \sim p ( z | x _ { t } ; \theta )$ , sample $\tilde { x } \sim p ( x | z _ { t } ; \theta )$ . We then set $x _ { t + 1 } ^ { \mathrm { t o p } } = \tilde { x } ^ { \mathrm { t o p } }$ and $x _ { t + 1 } ^ { \mathrm { b o t t o m } } = x _ { 0 } ^ { \mathrm { b o t t o m } }$ . We compare the results obtained by sampling from ior) vs. our trained sampler. The results are reported i $p ( z | x ; \theta )$ using a. We $q _ { \psi }$ (i.e. the see that L2HMC easily mixes between modes (3, 5, 8, and plausibly 9 in the figure) while the approximate posterior gets stuck on the same reconstructed digit (3 in the figure).
|
| 211 |
+
|
| 212 |
+
Visualization of the posterior After training a decoder with L2HMC, we randomly choose an element $x _ { 0 } \in \mathcal { D }$ and run 512 parallel L2HMC chains for 20, 000 Metropolis-Hastings steps. We then find the direction of highest variance, project the samples along that direction and show a histogram in Figure 3b. This plot shows non-Gaussianity in the latent space for the posterior. Using our improved sampler enables the decoder to make use of a more expressive posterior, and enables the encoder to sample from this non-Gaussian posterior.
|
| 213 |
+
|
| 214 |
+
# 6 FUTURE WORK
|
| 215 |
+
|
| 216 |
+
The loss in Section 4.2 targets lag-one autocorrelation. It should be possible to extend this to also target lag-two and higher autocorrelations. It should also be possible to extend this loss to reward fast decay in the autocorrelation of other statistics of the samples, for instance the sample energy as well as the sample position. These additional statistics could also include learned statistics of the samples, combining benefits of the adversarial approach of (Song et al., 2017) with the current work.
|
| 217 |
+
|
| 218 |
+
Our learned generalization of HMC should prove complementary to several other research directions related to HMC. It would be interesting to explore combining our work with the use of HMC in a minibatch setting (Chen et al., 2014); with shadow Hamiltonians (Izaguirre & Hampton, 2004); with gradient pre-conditioning approaches similar to those used in Riemannian HMC (Girolami et al., 2009; Betancourt, 2013); with the use of alternative HMC accept-reject rules (Sohl-Dickstein et al., 2014; Berger et al., 2015); with the use of non-canonical Hamiltonian dynamics (Tripuraneni et al., 2016); with variants of AIS adapted to HMC proposals (Sohl-Dickstein & Culpepper, 2012); with the extension of HMC to discrete state spaces (Zhang et al., 2012); and with the use of alternative Hamiltonian integrators (Creutz & Gocksch, 1989; Chao et al., 2015).
|
| 219 |
+
|
| 220 |
+
Finally, our work is also complementary to other methods not utilizing gradient information. For example, we could incorporate the intuition behind Multiple Try Metropolis schemes (Martino & Read, 2013) by having several parametric operators and training each one when used. In addition, one could draw inspiration from the adaptive literature (Haario et al., 2001; Andrieu & Thoms, 2008) or component-wise strategies (Gilks & Wild, 1992).
|
| 221 |
+
|
| 222 |
+
# 7 CONCLUSION
|
| 223 |
+
|
| 224 |
+
In this work, we presented a general method to train expressive MCMC kernels parameterized with deep neural networks. Given a target distribution $p$ , analytically known up to a constant, our method provides a fast-mixing sampler, able to efficiently explore the state space. Our hope is that our method can be utilized in a “black-box” manner, in domains where sampling constitutes a huge bottleneck such as protein foldings (Schutte et al., 1999) or physics simulations (Olsson, 1995). ¨
|
| 225 |
+
|
| 226 |
+
# ACKNOWLEDGMENTS
|
| 227 |
+
|
| 228 |
+
We would like to thank Ben Poole, Aditya Grover, David Belanger, and Colin Raffel for insightful comments on the draft, Mohammad Norouzi for support and encouragement launching the project, and Jiaming Song for discussions and help running A-NICE-MC.
|
| 229 |
+
|
| 230 |
+
# REFERENCES
|
| 231 |
+
|
| 232 |
+
Christophe Andrieu and Johannes Thoms. A tutorial on adaptive MCMC. Statistics and computing, 18(4): 343–373, 2008.
|
| 233 |
+
|
| 234 |
+
Christophe Andrieu, Nando De Freitas, Arnaud Doucet, and Michael I Jordan. An introduction to MCMC for machine learning. Machine learning, 50(1-2):5–43, 2003.
|
| 235 |
+
|
| 236 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein GAN. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 237 |
+
|
| 238 |
+
Yoshua Bengio, Eric Laufer, Guillaume Alain, and Jason Yosinski. Deep generative stochastic networks trainable by backprop. In International Conference on Machine Learning, pp. 226–234, 2014.
|
| 239 |
+
|
| 240 |
+
Charles H Bennett. Mass tensor molecular dynamics. Journal of Computational Physics, 19(3):267–279, 1975.
|
| 241 |
+
|
| 242 |
+
Andrew B Berger, Mayur Mudigonda, Michael R DeWeese, and Jascha Sohl-Dickstein. A Markov jump process for more efficient Hamiltonian Monte Carlo. arXiv preprint arXiv:1509.03808, 2015.
|
| 243 |
+
|
| 244 |
+
Michael Betancourt. A general metric for Riemannian manifold Hamiltonian Monte Carlo. In Geometric science of information, pp. 327–334. Springer, 2013.
|
| 245 |
+
|
| 246 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
|
| 247 |
+
|
| 248 |
+
Wei-Lun Chao, Justin Solomon, Dominik Michels, and Fei Sha. Exponential integration for Hamiltonian Monte Carlo. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1142–1151, 2015.
|
| 249 |
+
|
| 250 |
+
Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient Hamiltonian Monte Carlo. In International Conference on Machine Learning, pp. 1683–1691, 2014.
|
| 251 |
+
|
| 252 |
+
Michael Creutz and Andreas Gocksch. Higher-order hybrid Monte Carlo algorithms. Physical Review Letters, 63(1):9, 1989.
|
| 253 |
+
|
| 254 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real NVP. arXiv preprint arXiv:1605.08803, 2016.
|
| 255 |
+
|
| 256 |
+
Simon Duane, Anthony D Kennedy, Brian J Pendleton, and Duncan Roweth. Hybrid Monte Carlo. Physics letters B, 195(2):216–222, 1987.
|
| 257 |
+
|
| 258 |
+
Walter R Gilks and Pascal Wild. Adaptive rejection sampling for gibbs sampling. Applied Statistics, pp. 337–348, 1992.
|
| 259 |
+
|
| 260 |
+
Mark Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 73(2):123–214, 2011.
|
| 261 |
+
|
| 262 |
+
Mark Girolami, Ben Calderhead, and Siu A Chin. Riemannian manifold Hamiltonian Monte Carlo. arXiv preprint arXiv:0907.1100, 2009.
|
| 263 |
+
|
| 264 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 265 |
+
|
| 266 |
+
Peter J Green. Reversible jump markov chain monte carlo computation and bayesian model determination. Biometrika, 82(4):711–732, 1995.
|
| 267 |
+
|
| 268 |
+
Heikki Haario, Eero Saksman, Johanna Tamminen, et al. An adaptive metropolis algorithm. Bernoulli, 7(2): 223–242, 2001.
|
| 269 |
+
|
| 270 |
+
Ernst Hairer, Christian Lubich, and Gerhard Wanner. Geometric numerical integration illustrated by the Stormer–Verlet method. ¨ Acta numerica, 12:399–450, 2003.
|
| 271 |
+
|
| 272 |
+
W Keith Hastings. Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57 (1):97–109, 1970.
|
| 273 |
+
|
| 274 |
+
Matthew D Hoffman. Learning deep latent Gaussian models with Markov chain Monte Carlo. In International Conference on Machine Learning, pp. 1510–1519, 2017.
|
| 275 |
+
|
| 276 |
+
Matthew D Hoffman and Andrew Gelman. The no-U-turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15(1):1593–1623, 2014.
|
| 277 |
+
|
| 278 |
+
Li Huang and Lei Wang. Accelerated monte carlo simulations with restricted boltzmann machines. Physical Review B, 95(3):035105, 2017.
|
| 279 |
+
|
| 280 |
+
Akihisa Ichiki and Masayuki Ohzeki. Violation of detailed balance accelerates relaxation. Physical Review E, 88(2):020101, 2013.
|
| 281 |
+
|
| 282 |
+
Jesus A Izaguirre and Scott S Hampton. Shadow hybrid Monte Carlo: an efficient propagator in phase space of ´ macromolecules. Journal of Computational Physics, 200(2):581–604, 2004.
|
| 283 |
+
|
| 284 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 285 |
+
|
| 286 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 287 |
+
|
| 288 |
+
Yann LeCun. The MNIST database of handwritten digits. http://yann. lecun. com/exdb/mnist/.
|
| 289 |
+
|
| 290 |
+
Benedict Leimkuhler and Sebastian Reich. Simulating Hamiltonian dynamics, volume 14. Cambridge University Press, 2004.
|
| 291 |
+
|
| 292 |
+
Junwei Liu, Yang Qi, Zi Yang Meng, and Liang Fu. Self-learning monte carlo method. Physical Review B, 95 (4):041101, 2017.
|
| 293 |
+
|
| 294 |
+
David JC MacKay. Information theory, inference and learning algorithms. Cambridge university press, 2003.
|
| 295 |
+
|
| 296 |
+
Luca Martino and Jesse Read. On the flexibility of the design of multiple try metropolis schemes. Computational Statistics, 28(6):2797–2823, 2013.
|
| 297 |
+
|
| 298 |
+
Radford M Neal. Probabilistic inference using Markov chain Monte Carlo methods. 1993.
|
| 299 |
+
|
| 300 |
+
Radford M Neal. Sampling from multimodal distributions using tempered transitions. Statistics and computing, 6(4):353–366, 1996.
|
| 301 |
+
|
| 302 |
+
Radford M Neal. Annealed importance sampling. Statistics and computing, 11(2):125–139, 2001.
|
| 303 |
+
|
| 304 |
+
Radford M Neal. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2(11), 2011.
|
| 305 |
+
|
| 306 |
+
Peter Olsson. Two phase transitions in the fully frustrated XY model. Physical review letters, 75(14):2758, 1995.
|
| 307 |
+
|
| 308 |
+
Cristian Pasarica and Andrew Gelman. Adaptively scaling the Metropolis algorithm using expected squared jumped distance. Statistica Sinica, pp. 343–364, 2010.
|
| 309 |
+
|
| 310 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014.
|
| 311 |
+
|
| 312 |
+
Tim Salimans, Diederik Kingma, and Max Welling. Markov chain Monte Carlo and variational inference: Bridging the gap. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1218–1226, 2015.
|
| 313 |
+
|
| 314 |
+
Ch Schutte, Alexander Fischer, Wilhelm Huisinga, and Peter Deuflhard. A direct approach to conformational¨ dynamics based on hybrid Monte Carlo. Journal of Computational Physics, 151(1):146–168, 1999.
|
| 315 |
+
|
| 316 |
+
Dino Sejdinovic, Heiko Strathmann, Maria Lomeli Garcia, Christophe Andrieu, and Arthur Gretton. Kernel adaptive metropolis-hastings. In International Conference on Machine Learning, pp. 1665–1673, 2014.
|
| 317 |
+
Jascha Sohl-Dickstein and Benjamin J Culpepper. Hamiltonian annealed importance sampling for partition function estimation. arXiv preprint arXiv:1205.1925, 2012.
|
| 318 |
+
Jascha Sohl-Dickstein, Mayur Mudigonda, and Michael R DeWeese. Hamiltonian Monte Carlo without detailed balance. pp. 719–726, 2014.
|
| 319 |
+
Jascha Sohl-Dickstein, Eric A Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. arXiv preprint arXiv:1503.03585, 2015.
|
| 320 |
+
Jiaming Song, Shengjia Zhao, and Stefano Ermon. A-nice-mc: Adversarial training for mcmc. In Advances in Neural Information Processing Systems, pp. 5146–5156, 2017.
|
| 321 |
+
Heiko Strathmann, Dino Sejdinovic, Samuel Livingstone, Zoltan Szabo, and Arthur Gretton. Gradient-free hamiltonian monte carlo with efficient kernel exponential families. In Advances in Neural Information Processing Systems, pp. 955–963, 2015.
|
| 322 |
+
Lucas Theis, Aaron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. ¨ arXiv preprint arXiv:1511.01844, 2015.
|
| 323 |
+
Nilesh Tripuraneni, Mark Rowland, Zoubin Ghahramani, and Richard Turner. Magnetic Hamiltonian Monte Carlo. arXiv preprint arXiv:1607.02738, 2016.
|
| 324 |
+
Lei Wang. Can boltzmann machines discover cluster updates? arXiv preprint arXiv:1702.08586, 2017.
|
| 325 |
+
Yuhuai Wu, Yuri Burda, Ruslan Salakhutdinov, and Roger Grosse. On the quantitative analysis of decoderbased generative models. arXiv preprint arXiv:1611.04273, 2016.
|
| 326 |
+
Yichuan Zhang, Zoubin Ghahramani, Amos J Storkey, and Charles A Sutton. Continuous relaxations for discrete hamiltonian monte carlo. In Advances in Neural Information Processing Systems, pp. 3194–3202, 2012.
|
| 327 |
+
|
| 328 |
+
# Appendix
|
| 329 |
+
|
| 330 |
+
# A REVERSE LEAPFROG OPERATOR
|
| 331 |
+
|
| 332 |
+
Let $\xi = \{ x , v , d \}$ in the extended state space with $d = - 1$ . Here, we describe the leapfrog updates for a single time step $t$ , this consists of inverting the equations presented in the corresponding section.
|
| 333 |
+
|
| 334 |
+
Let $\zeta _ { 1 } = \{ x , v , t \}$ , we have:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
v ^ { \prime } = \left[ v + \frac { \epsilon } { 2 } \left( \partial _ { x } U ( x ) \odot \exp ( \epsilon Q _ { v } ( \zeta _ { 1 } ) ) + T _ { v } ( \zeta _ { 1 } ) \right) \right] \odot \exp ( - S _ { v } ( \zeta _ { 1 } ) ) .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
With the notation from Section 4, let $\zeta _ { 2 } \triangleq \{ x _ { m ^ { t } } , v , t \}$
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
x ^ { \prime } = x _ { m ^ { t } } + \bar { m } ^ { t } \odot [ ( x - \epsilon ( \exp ( \epsilon Q _ { x } ( \zeta _ { 2 } ) ) \odot v ^ { \prime } + T _ { x } ( \zeta _ { 2 } ) ) ] \odot \exp ( - \epsilon S _ { v } ( \zeta _ { 2 } ) ) .
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Let us denote $\zeta _ { 3 } \triangleq \{ x _ { \bar { m } ^ { t } } ^ { \prime } , v , t \}$ :
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
x ^ { \prime \prime } = x _ { \bar { m } ^ { t } } + m ^ { t } \odot [ ( x ^ { \prime } - \epsilon ( \exp ( \epsilon Q _ { x } ( \zeta _ { 3 } ) ) \odot v ^ { \prime } + T _ { x } ( \zeta _ { 3 } ) ) ] \odot \exp ( - \epsilon S _ { v } ( \zeta _ { 3 } ) ) .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
Finally, the last update, with $\zeta _ { 4 } \triangleq \{ x ^ { \prime \prime } , \partial _ { x } U ( x ^ { \prime \prime } ) , t \}$ :
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
v ^ { \prime } = \left[ v + { \frac { \epsilon } { 2 } } \left( \partial _ { x } U ( x ^ { \prime \prime } ) \odot \exp ( \epsilon Q _ { v } ( \zeta _ { 4 } ) ) + T _ { v } ( \zeta _ { 4 } ) \right) \right] \odot \exp ( - S _ { v } ( \zeta _ { 4 } ) ) .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
It is important to note that to invert $\mathbf { L } _ { \theta }$ , these steps should be ran for $t$ from $M$ to 1.
|
| 359 |
+
|
| 360 |
+
# B DETERMINANT OF THE JACOBIAN
|
| 361 |
+
|
| 362 |
+
Given the derivations (and notations) from Section 4, for the forward operator $\mathbf { L } _ { \theta }$ , we can immediately compute the Jacobian:
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\log \left| \frac { \partial [ \mathbf { F } \mathbf { L } _ { \theta } \boldsymbol { \xi } ] } { \partial \boldsymbol { \xi } ^ { T } } \right| = d \sum _ { t \leq M } \left[ \frac { \epsilon } { 2 } \mathbf { 1 } \cdot S _ { v } ( \boldsymbol { \zeta } _ { 1 } ^ { t } ) + \epsilon m ^ { t } \cdot S _ { x } ( \boldsymbol { \zeta } _ { 2 } ^ { t } ) + \epsilon \bar { m } ^ { t } \cdot S _ { x } ( \boldsymbol { \zeta } _ { 3 } ^ { t } ) + \frac { \epsilon } { 2 } \mathbf { 1 } \cdot S _ { v } ( \boldsymbol { \zeta } _ { 4 } ^ { t } ) \right] .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
Where $\zeta _ { i } ^ { t }$ denotes the intermediary variable $\zeta _ { i }$ at time step $t$ and $d$ is the direction of $\xi$ i.e. $\xi =$
|
| 369 |
+
$\{ x , v , d \}$ .
|
| 370 |
+
|
| 371 |
+
# C EXPERIMENTAL DETAILS OF SECTION 5
|
| 372 |
+
|
| 373 |
+
# C.1 IMPLEMENTATION DETAILS
|
| 374 |
+
|
| 375 |
+
First of all, we keep separate parameters for the network responsible for updating $v$ and those updating $x$ . The architectures are the same. Let us take the example of $Q _ { v } , S _ { v } , T _ { v }$ . The time step $t$ is given as input to the MLP, encoded as $\begin{array} { r } { \tau ( t ) = ( \cos ( \frac { 2 \pi t } { M } ) , \sin ( \frac { 2 \pi { \hat { t } } } { M } ) ) } \end{array}$ . $\sigma ( \cdot )$ denotes the ReLU non-linearity.
|
| 376 |
+
|
| 377 |
+
For $n _ { h }$ hidden units per layer:
|
| 378 |
+
|
| 379 |
+
• We first compute $h _ { 1 } = \sigma ( W _ { 1 } x + W _ { 2 } v + W _ { 3 } \tau ( t ) + b ) ( h \in \mathbb { R } ^ { n _ { h } } ) .$ · $h _ { 2 } = \sigma ( W _ { 4 } h + b _ { 4 } ) \in \mathbb { R } ^ { n _ { h } }$ • $S _ { v } = \lambda _ { s } \mathtt { t a n h } ( W _ { s } h _ { 2 } + b _ { s } ) , Q _ { v } = \lambda _ { q } \mathtt { t a n h } ( W _ { q } h _ { 2 } + b _ { q } ) , T _ { v } = W _ { t } h _ { 2 } + b _ { t } .$
|
| 380 |
+
|
| 381 |
+
In Section 5.1, the $Q , S , T$ are neural networks with 2 hidden layers with 10 (100 for the 50-d ICG) units and ReLU non-linearities. We train with Adam (Kingma & Ba, 2014) and a learning rate $\alpha = 1 0 ^ { - 3 }$ . We train for 5, 000 iterations with a batch size of 200.
|
| 382 |
+
|
| 383 |
+
$\lambda _ { b }$ was set to 0 for ICG and SCG and to 1 for MoG and Rough Well. For the MoG tasks, we train our sampler with a temperature parameter that we continuously anneal; we evaluate the trained sampler without using temperature.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 4: Diagram of our L2HMC-DGLM model. Nodes are functions of their parents. Round nodes are deterministic, diamond nodes are stochastic and the doubly-circled node is observed.
|
| 387 |
+
|
| 388 |
+
# C.2 AUTO-CORRELATION AND ESS
|
| 389 |
+
|
| 390 |
+
Let $( x _ { \tau } ) _ { \tau \leq T }$ be a set of correlated samples converging to the distribution $p$ with mean $\mu$ and covariance $\Sigma$ . We define auto-correlation at time $t$ as:
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\rho _ { t } \triangleq \frac { 1 } { \mathrm { T r a c e } ( \Sigma ) ( T - t ) } \sum _ { \tau \leq T - t - 1 } ( x _ { \tau } - \mu ) ^ { T } ( x _ { \tau + t } - \mu ) .
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
We can now define effective sample size (ESS) as:
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\mathrm { E S S } \left( ( x _ { \tau } ) _ { \tau \leq T } \right) \triangleq \frac { 1 } { 1 + 2 \sum _ { t } \rho _ { t } } .
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
Similar to Hoffman & Gelman (2014), we truncate the sum when the auto-correlation goes below 0.05.
|
| 403 |
+
|
| 404 |
+
# C.3 COMPARISON WITH LAHMC
|
| 405 |
+
|
| 406 |
+
We compare our trained sampler with LAHMC (Sohl-Dickstein et al., 2014). Results are reported in Table 1. L2HMC largely outperforms LAHMC on all task. LAHMC is also unable to mix between modes for the MoG task. We also note that L2HMC could be easily combined with LAHMC, by replacing the leapfrog integrator of LAHMC with the learned one of L2HMC.
|
| 407 |
+
|
| 408 |
+
Table 1: ESS for a fixed number of gradient evaluations.
|
| 409 |
+
|
| 410 |
+
<table><tr><td>Distribution</td><td>Gradient Evaluations</td><td>ESS-L2HMC</td><td>ESS-LAHMC</td><td>Ratio</td></tr><tr><td>50-d ICG</td><td>2000</td><td>156.6</td><td>21.4</td><td>7.3</td></tr><tr><td>Rough Well</td><td>200</td><td>12.5</td><td>8.6</td><td>1.5</td></tr><tr><td>2-d SCG</td><td>5000</td><td>116</td><td>16.7</td><td>14.9</td></tr><tr><td>MoG</td><td>20,000</td><td>65.0</td><td><0.53</td><td>> 123.5</td></tr></table>
|
| 411 |
+
|
| 412 |
+
# D L2HMC-DGLM
|
| 413 |
+
|
| 414 |
+
# D.1 TRAINING ALGORITHM
|
| 415 |
+
|
| 416 |
+
In this section, we present our training algorithm as well as a diagram explaining L2HMC-DGLM. For conciseness, given our operator $\mathbf { L } _ { \theta }$ , we denote by $\mathbf { K } _ { \theta } ( \cdot | x )$ the distribution over next state given sampling of a momentum and direction and the Metropolis-Hastings step.
|
| 417 |
+
|
| 418 |
+
# D.2 IMPLEMENTATION DETAILS OF L2HMC-DGLM
|
| 419 |
+
|
| 420 |
+
Similar to our L2HMC training on unconditional sampling, we share weights across $Q , S$ and $T$ . In addition, the auxiliary variable $x$ (here the image from MNIST) is first passed through a 2-layer neural network, with softplus non-linearities and 512 hidden units. This input is given to both
|
| 421 |
+
|
| 422 |
+
# Algorithm 2 L2HMC for latent variable generative models
|
| 423 |
+
|
| 424 |
+
Input: dataset $\mathcal { D }$ , number of iterations $n _ { \mathrm { i t e r s } }$ , number of Metropolis-Hastings step $J$ , number of
|
| 425 |
+
leapfrogs M , and learning rate schedule (αt)t≤niters .
|
| 426 |
+
Randomly initialize the decoder’s parameters $\phi$ and the approximate posterior $\psi$ . Initialize the
|
| 427 |
+
parameters of the sampler $\theta$ with $M$ leapfrog steps.
|
| 428 |
+
for $t = 0$ to $n _ { \mathrm { i t e r s } } - 1$ do Randomly sample a minibatch $\boldsymbol { B }$ from the dataset $\mathcal { D }$ . $\mathcal { L } _ { \mathrm { E L B O } } , \mathcal { L } _ { \mathrm { S a m p l e r } } , \mathcal { L } _ { \mathrm { D e c o d e r } } 0$ for $\boldsymbol { x } ^ { ( b ) } \in B \mathrm { d } \mathbf { 0 }$ ∈Sample $\xi _ { 0 } ^ { ( b ) } \sim r ( \cdot | x ^ { ( b ) } ; \psi )$ . $\mathcal { L } _ { \mathrm { E L B O } } p ( x ^ { ( b ) } | z _ { 0 } ^ { ( b ) } ; \phi ) - \mathrm { K L } ( q _ { \psi } ( z | x ^ { ( b ) } ) | | p ( z ) )$ . With ξ(b)0 = {z(b)0 , v(b)0 , d(b)0 } Define the energy function $U _ { x ^ { ( b ) } } ( z ) = - \log p ( x ^ { ( b ) } | z ; \theta ) - \log p ( z )$ $\mathcal { L } _ { \mathrm { S a m p l e r } } 0$ $\lambda \sqrt { \mathrm { V a r } ( q _ { \psi } ( z _ { 0 } ^ { ( b ) } | x ^ { ( b ) } ) }$ for $j = 0$ to $J - 1$ do ξ (j −b) ← Rξ(b)j LSampler ← LSampler + \`λ(ξ(b)j , FLθξ(b)j , A(FLθξ(b)j |ξ(b)j )) Set $\xi _ { j + 1 } ^ { ( b ) }$ to $\mathbf { F L } _ { \theta } \boldsymbol { \xi } _ { j } ^ { ( b ) }$ with probability $A ( \mathbf { F L } _ { \theta } \xi _ { j } ^ { ( b ) } | \xi _ { j } ^ { ( b ) } )$ . $\begin{array} { r } { \begin{array} { l l } { \frac { \operatorname { c a s s a } ^ { \ast } \operatorname { s o r } } { \mathcal { L } _ { \mathrm { D e c o d e r } } } \mathcal { L } _ { \mathrm { D e c o d e r } } + \log p ( x ^ { ( b ) } | z _ { J } ^ { ( s ) } ; \phi ) } & { \qquad \mathrm { ~ s ~ W i t h ~ } \xi _ { J } ^ { ( b ) } = \{ z _ { J } ^ { ( b ) } , v _ { J } ^ { ( b ) } , d _ { J } ^ { ( b ) } \} } \end{array} } \end{array}$ end for $\begin{array} { l } { \phi \phi + \alpha _ { t } \nabla _ { \phi } \mathcal { L } _ { \mathrm { D e c o d e r } } } \\ { \psi \psi + \alpha _ { t } \nabla _ { \psi } \mathcal { L } _ { \mathrm { E L B O } } } \\ { \theta \theta + \alpha _ { t } \nabla _ { \theta } \mathcal { L } _ { \mathrm { S a m p l e r } } } \end{array}$
|
| 429 |
+
end for
|
| 430 |
+
$\begin{array} { r l } { 3 } & { 0 } & { 1 \leq 9 \leq 9 \leq 2 \leq 9 \leq 5 } \\ { 2 } & { 4 \times 1 \leq 2 \leq 3 \leq 6 } \\ { 6 } & { 5 \leq 2 \leq 3 \leq 5 } \\ { 3 } & { 6 \leq 8 \leq 7 \leq 3 \leq 4 } \\ { 4 \leq 9 \leq 4 \leq 9 \leq 4 } \\ { 7 \geq 5 \leq 5 \leq 5 \leq 2 \leq 4 \leq 6 } \\ { 0 \leq 6 \leq 1 \leq 2 \leq 2 \leq 4 \leq 6 } \\ { 3 \geq 6 \leq 8 \leq 5 \leq 4 } \end{array}$ 644又9 7 1 9 9 3 / 2 3 S 6 a a 8 7 2 4 一 6 8 9 9 4 D 4 B 7 5 3 6 9 7 7 9 2 4 6 7 0 8 7 ?6 4S q 1 1 23 3 7 9 1 972 076997 090q499 65『6630295147309 h0?b414593&84076 (a) L2HMC (b) HMC (c) VAE
|
| 431 |
+
|
| 432 |
+
networks $\{ \cdot \} _ { x }$ and $\{ \cdot \} _ { v }$ . The architecture then consists of 2 hidden layers of 200 units and ReLU non-linearities. For $\lambda$ (scale parameter of the loss), we use the standard deviation of the approximate posterior.
|
| 433 |
+
|
| 434 |
+
AIS Evaluation For each data point, we run 20 Markov Chains in parallel, 10, 000 annealing steps with 10 leapfrogs per step and choose the step size for an acceptance rate of 0.65.
|
| 435 |
+
|
| 436 |
+
# D.3 MNIST SAMPLES
|
| 437 |
+
|
| 438 |
+
We show in Figure 5 samples from the three evaluated models: VAE (Kingma & Welling, 2013), HMC-DGLM (Hoffman, 2017) and L2HMC-DGLM.
|
md/train/BJ5UeU9xx/BJ5UeU9xx.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VISUALIZING DEEP NEURAL NETWORK DECISIONS: PREDICTION DIFFERENCE ANALYSIS
|
| 2 |
+
|
| 3 |
+
Luisa M Zintgraf1,3, Taco S Cohen1, Tameem Adel1, Max Welling1,2 1University of Amsterdam, 2Canadian Institute of Advanced Research, 3Vrije Universiteit Brussel {lmzintgraf,tameem.hesham}@gmail.com, {t.s.cohen, m.welling}@uva.nl
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This article presents the prediction difference analysis method for visualizing the response of a deep neural network to a specific input. When classifying images, the method highlights areas in a given input image that provide evidence for or against a certain class. It overcomes several shortcoming of previous methods and provides great additional insight into the decision making process of classifiers. Making neural network decisions interpretable through visualization is important both to improve models and to accelerate the adoption of black-box classifiers in application areas such as medicine. We illustrate the method in experiments on natural images (ImageNet data), as well as medical images (MRI brain scans).
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Over the last few years, deep neural networks (DNNs) have emerged as the method of choice for perceptual tasks such as speech recognition and image classification. In essence, a DNN is a highly complex non-linear function, which makes it hard to understand how a particular classification comes about. This lack of transparency is a significant impediment to the adoption of deep learning in areas of industry, government and healthcare where the cost of errors is high.
|
| 12 |
+
|
| 13 |
+
In order to realize the societal promise of deep learning - e.g., through self-driving cars or personalized medicine - it is imperative that classifiers learn to explain their decisions, whether it is in the lab, the clinic, or the courtroom. In scientific applications, a better understanding of the complex dependencies learned by deep networks could lead to new insights and theories in poorly understood domains.
|
| 14 |
+
|
| 15 |
+
In this paper, we present a new, probabilistically sound methodology for explaining classification decisions made by deep neural networks. The method can be used to produce a saliency map for each (instance, node) pair that highlights the parts (features) of the input that constitute most evidence for or against the activation of the given (internal or output) node. See figure 1 for an example.
|
| 16 |
+
|
| 17 |
+
In the following two sections, we review related work and then present our approach. In section 4 we provide several demonstrations of our technique for deep convolutional neural networks (DCNNs) trained on ImageNet data, and further how the method can be applied when classifying MRI brain scans of HIV patients with neurodegenerative disease.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Example of our visualization method: explains why the DCNN (GoogLeNet) predicts "cockatoo". Shown is the evidence for (red) and against (blue) the prediction. We see that the facial features of the cockatoo are most supportive for the decision, and parts of the body seem to constitute evidence against it. In fact, the classifier most likely considers them evidence for the second-highest scoring class, white wolf.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORK
|
| 23 |
+
|
| 24 |
+
Broadly speaking, there are two approaches for understanding DCNNs through visualization investigated in the literature: find an input image that maximally activates a given unit or class score to visualize what the network is looking for (Erhan et al., 2009; Simonyan et al., 2013; Yosinski et al., 2015), or visualize how the network responds to a specific input image in order to explain a particular classification made by the network. The latter will be the subject of this paper.
|
| 25 |
+
|
| 26 |
+
One such instance-specific method is class saliency visualization proposed by Simonyan et al. (2013) who measure how sensitive the classification score is to small changes in pixel values, by computing the partial derivative of the class score with respect to the input features using standard backpropagation. They also show that there is a close connection to using deconvolutional networks for visualization, proposed by Zeiler & Fergus (2014). Other methods include Shrikumar et al. (2016), who compare the activation of a unit when a specific input is fed forward through the net to a reference activation for that unit. Zhou et al. (2016) and Bach et al. (2015) also generate interesting visualization results for individual inputs, but are both not as closely related to our method as the two papers mentioned above. The idea of our method is similar to another analysis Zeiler & Fergus (2014) make: they estimate the importance of input pixels by visualizing the probability of the (correct) class as a function of a gray patch occluding parts of the image. In this paper, we take a more rigorous approach at both removing information from the image and evaluating the effect of this.
|
| 27 |
+
|
| 28 |
+
In the field of medical image classification specifically, a widely used method for visualizing feature importances is to simply plot the weights of a linear classifier (Klöppel et al., 2008; Ecker et al., 2010), or the p-values of these weights (determined by permutation testing) (Mourao-Miranda et al., 2005; Wang et al., 2007). These are independent of the input image, and, as argued by Gaonkar & Davatzikos (2013) and Haufe et al. (2014), interpreting these weights can be misleading in general.
|
| 29 |
+
|
| 30 |
+
The work presented in this paper is based on an instance-specific method by Robnik-Šikonja & Kononenko (2008), the prediction difference analysis, which is reviewed in the next section. Our main contributions are three substantial improvements of this method: conditional sampling (section 3.1), multivariate analysis (section 3.2), and deep visualization (section 3.3).
|
| 31 |
+
|
| 32 |
+
# 3 APPROACH
|
| 33 |
+
|
| 34 |
+
Our method is based on the technique presented by Robnik-Šikonja & Kononenko (2008), which we will now review. For a given prediction, the method assigns a relevance value to each input feature with respect to a class $c$ . The basic idea is that the relevance of a feature $x _ { i }$ can be estimated by measuring how the prediction changes if the feature is unknown, i.e., the difference between $p ( c | \mathbf { x } )$ and $p ( c | \mathbf { x } _ { \backslash i } )$ , where $\mathbf { x } _ { \backslash i }$ denotes the set of all input features except $x _ { i }$ .
|
| 35 |
+
|
| 36 |
+
To find $p ( c | \mathbf { x } _ { \backslash i } )$ , i.e., evaluate the prediction when a feature is unknown, the authors propose three strategies. The first is to label the feature as unknown (which only few classifiers allow). The second is to re-train the classifier with the feature left out (which is clearly infeasible for DNNs and high-dimensional data like images). The third approach is to simulate the absence of a feature by marginalizing the feature:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
p ( c | \mathbf { x } _ { \backslash i } ) = \sum _ { x _ { i } } p ( x _ { i } | \mathbf { x } _ { \backslash i } ) p ( c | \mathbf { x } _ { \backslash i } , x _ { i } )
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
(with the sum running over all possible values for $x _ { i }$ ). However, modeling $p ( x _ { i } | \mathbf { x } _ { \backslash i } )$ can easily become infeasible with a large number of features. Therefore, the authors approximate equation (1) by assuming that feature $x _ { i }$ is independent of the other features, $\mathbf { x } _ { \backslash i }$ :
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
p ( c | \mathbf { x } _ { \backslash i } ) \approx \sum _ { x _ { i } } p ( x _ { i } ) p ( c | \mathbf { x } _ { \backslash i } , x _ { i } ) .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
The prior probability $p ( x _ { i } )$ is usually approximated by the empirical distribution for that feature.
|
| 49 |
+
|
| 50 |
+
Once the class probability $p ( c | \mathbf { x } _ { \backslash i } )$ is estimated, it can be compared to $p ( c | \mathbf { x } )$ . We stick to an evaluation proposed by the authors referred to as weight of evidence, given by
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { \mathbf { W E } _ { i } ( c | \mathbf { x } ) = \log _ { 2 } \left( \operatorname { o d d s } ( c | \mathbf { x } ) \right) - \log _ { 2 } \left( \operatorname { o d d s } ( c | \mathbf { x } _ { \backslash i } ) \right) , } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Simple illustration of the sampling procedure in algorithm 1. Given the input image $x$ , we select every possible patch $x _ { w }$ (in a sliding window fashion) of size $k \times k$ and place a larger patch $\hat { x } _ { w }$ of size $l \times l$ around it. We can then conditionally sample $x _ { w }$ by conditioning on the surrounding patch $\hat { x } _ { w }$ .
|
| 58 |
+
|
| 59 |
+
Algorithm 1 Evaluating the prediction difference using conditional and multivariate sampling Input: classifier with outputs $\mathsf { p } ( \mathsf { c } | \mathbf { x } )$ , input image $\mathbf { x }$ of size $n \times n$ , inner patch size $k$ , outer patch size $l > k$ , class of interest $c$ , probabilistic model over patches of size $l \times l$ , number of samples $S$ Initialization: $\mathrm { W E = z e r o s ( n ^ { * } n ) }$ , counts $\mathbf { \mu } _ { \mathrm { : } } = \mathbf { Z } \mathbf { e }$ ros $( \mathfrak { n } ^ { * } \mathfrak { n } )$ for every patch $\mathbf { x } _ { w }$ of size $k \times k$ in $\mathbf { x }$ do $\mathbf { x } ^ { \prime } = { \bar { \mathrm { c o p y } } } ( \mathbf { x } )$ $\mathrm { s u m } _ { w } = 0$ define patch $\hat { \mathbf { x } } _ { w }$ of size $l \times l$ that contains $\mathbf { x } _ { w }$ for $s = 1$ to $S$ do $\mathbf { x } _ { w } ^ { \prime } \gets \mathbf { x } _ { w }$ sampled from $p ( \mathbf { x } _ { w } | \hat { \mathbf { x } } _ { w } \backslash \mathbf { x } _ { w } )$ $\mathrm { s u m } _ { w } \mathrel { + { = } } p ( c | \mathbf { x } ^ { \prime } )$ . evaluate classifier end for $p ( c | \mathbf x \backslash \mathbf x _ { w } ) : = \mathtt { s u m } _ { w } / S$ WE[coordinates of $\mathbf { x } _ { w } ] + = \log _ { 2 } ( \operatorname { o d d s } ( c | \mathbf { x } ) ) - \log _ { 2 } ( \operatorname { o d d s } ( c | \mathbf { x } \backslash \mathbf { x } _ { w } ) )$ counts[coordinates of $\mathbf { x } _ { w } ] + = 1$ end for Output: WE / counts . point-wise division where $\mathrm { o d d s } ( c | \mathbf { x } ) = p ( c | \mathbf { x } ) / ( 1 - p ( c | \mathbf { x } ) )$ . To avoid problems with zero probabilities, Laplace correction $p \gets ( p N + 1 ) / ( N + K )$ is used, where $N$ is the number of training instances and $K$ the number of classes.
|
| 60 |
+
|
| 61 |
+
The method produces a relevance vector $( \mathrm { W E } _ { i } ) _ { i = 1 \dots m }$ ( $\textbar { m }$ being the number of features) of the same size as the input, which reflects the relative importance of all features. A large prediction difference means that the feature contributed substantially to the classification, whereas a small difference indicates that the feature was not important for the decision. A positive value $\mathrm { W E } _ { i }$ means that the feature has contributed evidence for the class of interest: removing it would decrease the confidence of the classifier in the given class. A negative value on the other hand indicates that the feature displays evidence against the class: removing it also removes potentially conflicting or irritating information and the classifier becomes more certain in the investigated class.
|
| 62 |
+
|
| 63 |
+
# 3.1 CONDITIONAL SAMPLING
|
| 64 |
+
|
| 65 |
+
In equation (3), the conditional probability $p ( x _ { i } | \mathbf { x } _ { \backslash i } )$ of a feature $x _ { i }$ is approximated using the marginal distribution $p ( x _ { i } )$ . This is a very crude approximation. In images for example, a pixel’s value is highly dependent on other pixels. We propose a much more accurate approximation, based on the following two observations: a pixel depends most strongly on a small neighborhood around it, and the conditional of a pixel given its neighborhood does not depend on the position of the pixel in the image. For a pixel $x _ { i }$ , we can therefore find a patch $\hat { \mathbf { x } } _ { i }$ of size $l \times l$ that contains $x _ { i }$ , and condition on the remaining pixels in that patch:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
p ( x _ { i } | \mathbf { x } _ { \backslash i } ) \approx p ( x _ { i } | \hat { \mathbf { x } } _ { \backslash i } ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
This greatly improves the approximation while remaining completely tractable.
|
| 72 |
+
|
| 73 |
+
For a feature to become relevant when using conditional sampling, it now has to satisfy two conditions: being relevant to predict the class of interest, and be hard to predict from the neighboring pixels. Relative to the marginal method, we therefore downweight the pixels that can easily be predicted and are thus redundant in this sense.
|
| 74 |
+
|
| 75 |
+
# 3.2 MULTIVARIATE ANALYSIS
|
| 76 |
+
|
| 77 |
+
Robnik-Šikonja & Kononenko (2008) take a univariate approach: only one feature at a time is removed. However, we would expect that a neural network is relatively robust to just one feature of a high-dimensional input being unknown, like a pixel in an image. Therefore, we will remove several features at once by again making use of our knowledge about images by strategically choosing these feature sets: patches of connected pixels. Instead of going through all individual pixels, we go through all patches of size $k \times k$ in the image ( $k \times k \times 3$ for RGB images and $k \times k \times k$ for 3D images like MRI scans), implemented in a sliding window fashion. The patches are overlapping, so that ultimately an individual pixel’s relevance is obtained by taking the average relevance obtained from the different patches it was in.
|
| 78 |
+
|
| 79 |
+
Algorithm 1 and figure 2 illustrate how the method can be implemented, incorporating the proposed improvements.
|
| 80 |
+
|
| 81 |
+
# 3.3 DEEP VISUALIZATION OF HIDDEN LAYERS
|
| 82 |
+
|
| 83 |
+
When trying to understand neural networks and how they make decisions, it is not only interesting to analyze the input-output relation of the classifier, but also to look at what is going on inside the hidden layers of the network. We can adapt the method to see how the units of any layer of the network influence a node from a deeper layer. Mathematically, we can formulate this as follows. Let h be the vector representation of the values in a layer $H$ in the network (after forward-propagating the input up to this layer). Further, let $z = z ( \mathbf { h } )$ be the value of a node that depends on $\mathbf { h }$ , i.e., a node in a subsequent layer. Then the analog of equation (2) is given by the expectation:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
g ( z | \mathbf { h } _ { \setminus i } ) \equiv \mathbb { E } _ { p ( h _ { i } | \mathbf { h } _ { \setminus i } ) } \left[ z ( \mathbf { h } ) \right] = \sum _ { h _ { i } } p ( h _ { i } | \mathbf { h } _ { \setminus i } ) z ( \mathbf { h } _ { \setminus i } , h _ { i } ) ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
which expresses the distribution of $z$ when unit $h _ { i }$ in layer $H$ is unobserved. The equation now works for arbitrary layer/unit combinations, and evaluates to the same as equation (1) when the input-output relation is analyzed. To evaluate the difference between $g ( z | \mathbf { h } )$ and $g ( z | \mathbf { h } _ { \backslash i } )$ , we will in general use the activation difference, $\mathrm { A D } _ { i } ( z | \mathbf { h } ) = g ( z | \mathbf { h } ) - g ( z | \mathbf { h } _ { \backslash i } )$ , for the case when we are not dealing with probabilities (and equation (3) is not applicable).
|
| 90 |
+
|
| 91 |
+
# 4 EXPERIMENTS
|
| 92 |
+
|
| 93 |
+
In this section, we illustrate how the proposed visualization method can be applied, on the ImageNet dataset of natural images when using DCNNs (section 4.1), and on a medical imaging dataset of MRI scans when using a logistic regression classifier (section 4.2). For marginal sampling we always use the empirical distribution, i.e., we replace a feature (patch) with samples taken directly from other images, at the same location. For conditional sampling we use a multivariate normal distribution. For both sampling methods we use 10 samples to estimate $p ( c | \mathbf { x } _ { \backslash i } )$ (since no significant difference was observed with more samples). Note that all images are best viewed digital and in color.
|
| 94 |
+
|
| 95 |
+
Our implementation is available at github.com/lmzintgraf/DeepVis-PredDiff.
|
| 96 |
+
|
| 97 |
+
# 4.1 IMAGENET: UNDERSTANDING HOW A DCNN MAKES DECISIONS
|
| 98 |
+
|
| 99 |
+
We use images from the ILSVRC challenge (Russakovsky et al., 2015) (a large dataset of natural images from 1000 categories) and three DCNNs: the AlexNet (Krizhevsky et al., 2012), the GoogLeNet (Szegedy et al., 2015) and the (16-layer) VGG network (Simonyan & Zisserman, 2014). We used the publicly available pre-trained models that were implemented using the deep learning framework caffe (Jia et al., 2014). Analyzing one image took us on average 20, 30 and 70 minutes for the respective classifiers AlexNet, GoogLeNet and VGG (using the GPU implementation of caffe and mini-batches with the standard settings of 10 samples and a window size of $k = 1 0$ ).
|
| 100 |
+
|
| 101 |
+
The results shown here are chosen from among a small set of images in order to show a range of behavior of the algorithm. The shown images are quite representative of the performance of the method in general. Examples on randomly selected images, including a comparison to the sensitivity analysis of Simonyan et al. (2013), can be seen in appendix A.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 3: Visualization of the effects of marginal versus conditional sampling using the GoogLeNet classifier. The classifier makes correct predictions (ostrich and saxophone), and we show the evidence for (red) and against (blue) this decision at the output layer. We can see that conditional sampling gives more targeted explanations compared to marginal sampling. Also, marginal sampling assigns too much importance on pixels that are easily predictable conditioned on their neighboring pixels.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4: Visualization of how different window sizes influence the visualization result. We used the conditional sampling method and the AlexNet classifier with $l = k + 4$ and varying $k$ . We can see that even when removing single pixels $k = 1 ,$ ), this has a noticeable effect on the classifier and more important pixels get a higher score. By increasing the window size we can get a more easily interpretable, smooth result until the image gets blurry for very large window sizes.
|
| 108 |
+
|
| 109 |
+
We start this section by demonstrating our proposed improvements (sections 3.1 - 3.3).
|
| 110 |
+
|
| 111 |
+
# Marginal vs Conditional Sampling
|
| 112 |
+
|
| 113 |
+
Figure 3 shows visualizations of the spatial support for the highest scoring class, using marginal and conditional sampling (with $k = 1 0$ and $l = 1 4$ ). We can see that conditional sampling leads to results that are more refined in the sense that they concentrate more around the object. We can also see that marginal sampling leads to pixels being declared as important that are very easily predictable conditioned on their neighboring pixels (like in the saxophone example). Throughout our experiments, we have found that conditional sampling tends to give more specific and fine-grained results than marginal sampling. For the rest of our experiments, we therefore show results using conditional sampling only.
|
| 114 |
+
|
| 115 |
+
# Multivariate Analysis
|
| 116 |
+
|
| 117 |
+
For ImageNet data, we have observed that setting $k = 1 0$ gives a good trade-off between sharp results and a smooth appearance. Figure 4 shows how different window sizes influence the resolution of the visualization. Surprisingly, removing only one pixel does have a measurable effect on the prediction, and the largest effect comes from sensitive pixels. We expected that removing only one pixel does not have any effect on the classification outcome, but apparently the classifier is sensitive even to these small changes. However when using such a small window size, it is difficult to make sense of the sign information in the visualization. If we want to get a good impression of which parts in the image are evidence for/against a class, it is therefore better to use larger windows. If $k$ is chosen too large however, the results tend to get blurry. Note that these results are not just simple averages of one another, but a multivariate approach is indeed necessary to observe the presented results.
|
| 118 |
+
|
| 119 |
+
# Deep Visualization of Hidden Network Layers
|
| 120 |
+
|
| 121 |
+
Our third main contribution is the extension of the method to neural networks; to understand the role of hidden layers in a DNN. Figure 5 shows how different feature maps in three different layers of the GoogLeNet react to the input of a tabby cat (see figure 6, middle image). For each feature map in a convolutional layer, we first compute the relevance of the input image for each hidden unit in that map. To estimate what the feature map as a whole is doing, we show the average of the relevance vectors over all units in that feature map. The first convolutional layer works with different types of simple image filters (e.g., edge detectors), and what we see is which parts of the input image respond positively or negatively to these filters. The layer we picked from somewhere in the middle of the network is specialized to higher level features (like facial features of the cat). The activations of the last convolutional layer are very sparse across feature channels, indicating that these units are highly specialized.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5: Visualization of feature maps from thee different layers of the GoogLeNet (l.t.r.: ”conv $1 / 7 \mathrm { x } 7 \_ \mathrm { s } 2 ^ { \cdot \prime }$ , ”inception_3a/output”, ”inception_5b/output”), using conditional sampling and patch sizes $k = 1 0$ and $l = 1 4$ (see alg. 1). For each feature map in the convolutional layer, we first evaluate the relevance for every single unit, and then average the results over all the units in one feature map to get a sense of what the unit is doing as a whole. Red pixels activate a unit, blue pixels decreased the activation.
|
| 125 |
+
|
| 126 |
+

|
| 127 |
+
Figure 6: Visualization of three different feature maps, taken from the ”inception_ $3 \mathrm { a } I$ output” layer of the GoogLeNet (from the middle of the network). Shown is the average relevance of the input features over all activations of the feature map. We used patch sizes $k = 1 0$ and $l = 1 4$ (see alg. 1). Red pixels activate a unit, blue pixels decreased the activation.
|
| 128 |
+
|
| 129 |
+
To get a sense of what single feature maps in convolutional layers are doing, we can look at their visualization for different input images and look for patterns in their behavior. Figure 6 shows this for four different feature maps from a layer from the middle of the GoogLeNet network. We can directly see which kind of features the model has learned at this stage in the network. For example, one feature map is mostly activated by the eyes of animals (third row), and another is looking mostly at the background (last row).
|
| 130 |
+
|
| 131 |
+
# Penultimate vs Output Layer
|
| 132 |
+
|
| 133 |
+
If we visualize the influence of the input features on the penultimate (pre-softmax) layer, we show only the evidence for/against this particular class, without taking other classes into consideration. After the softmax operation however, the values of the nodes are all interdependent: a drop in the probability for one class could be due to less evidence for it, or because a different class becomes more likely. Figure 7 compares visualizations for the last two layers. By looking at the top three scoring classes, we can see that the visualizations in the penultimate layer look very similar if the classes are similar (like different dog breeds). When looking at the output layer however, they look rather different. Consider the case of the elephants: the top three classes are different elephant subspecies, and the visualizations of the penultimate layer look similar since every subspecies can be identified by similar characteristics. But in the output layer, we can see how the classifier decides for one of the three types of elephants and against the others: the ears in this case are the crucial difference.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 7: Visualization of the support for the top-three scoring classes in the penultimate- and output layer. Next to the input image, the first row shows the results with respect to the penultimate layer; the second row with respect to the output layer. For each image, we additionally report the values of the units. We used the AlexNet with conditional sampling and patch sizes $k = 1 0$ and $l = 1 4$ (see alg. 1). Red pixels are evidence for a class, and blue against it.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 8: Comparison of the prediction visualization of different DCNN architectures. For two input images, we show the results of the prediction difference analysis when using different neural networks - the AlexNet, GoogLeNet and VGG network.
|
| 140 |
+
|
| 141 |
+
# Network Comparison
|
| 142 |
+
|
| 143 |
+
When analyzing how neural networks make decisions, we can also compare how different network architectures influence the visualization. Here, we tested our method on the AlexNet, the GoogLeNet and the VGG network. Figure 8 shows the results for the three different networks, on two input images. The AlexNet seems to more on contextual information (the sky in the balloon image), which could be attributed to it having the least complex architecture compared to the other two networks. It is also interesting to see that the VGG network deems the basket of the balloon as very important compared to all other pixels. The second highest scoring class in this case was a parachute - presumably, the network learned to not confuse a balloon with a parachute by detecting a square basket (and not a human).
|
| 144 |
+
|
| 145 |
+
# 4.2 MRI DATA: EXPLAINING CLASSIFIER DECISIONS IN MEDICAL IMAGING
|
| 146 |
+
|
| 147 |
+
To illustrate how our visualization method can also be useful in a medical domain, we show some experimental results on an MRI dataset of HIV and healthy patients. In such settings, it is crucial that the practitioner has some insight into the algorithm’s decision when classifying a patient, to weigh this information and incorporate it in the overall diagnosis process.
|
| 148 |
+
|
| 149 |
+
The dataset used here is referred to as the COBRA dataset. It contains 3D MRIs from $1 0 0 \ \mathrm { H I V }$ patients and 70 healthy individuals, included in the Academic Medical Center (AMC) in Amsterdam, The Netherlands. Of these subjects, diffusion weighted MRI data were acquired. Preprocessing of the data was performed with software developed in-house, using the HPCN-UvA Neuroscience Gateway and using resources of the Dutch e-Science Grid Shahand et al. (2015). As a result, Fractional Anisotropy (FA) maps were computed. FA is sensitive to microstructural damage and therefore expected to be, on average, decreased in patients. Subjects were scanned on two 3.0 Tesla scanner systems, 121 subjects on a Philips Intera system and 39 on a Philips Ingenia system. Patients and controls were evenly distributed. FA images were spatially normalized to standard space Andersson et al. (2007), resulting in volumes with $9 1 \times 1 0 9 \times 9 1 = 9 0 2 , 6 2 9$ voxels.
|
| 150 |
+
|
| 151 |
+
We trained an L2-regularized Logistic Regression classifier on a subset of the MRI slices (slices 29-40 along the first axis) and on a balanced version of the dataset (by taking the first 70 samples of the HIV class) to achieve an accuracy of $6 9 . 3 \%$ in a 10-fold cross-validation test. Analyzing one image took around half an hour (on a CPU, with $k = 3$ and $l = 7$ , see algorithm 1). For conditional sampling, we also tried adding location information in equation (2), i.e., we split up the 3D image into a $2 0 \times 2 0 \times 2 0$ grid and also condition on the index in that grid. We found that this slightly improved the interpretability of the results, since the pixel values in the special case of MRI scans does depend on spacial location as well.
|
| 152 |
+
|
| 153 |
+
Figure 9 (first row) shows one way via which the prediction difference results could be presented to a physician, for an HIV sample. By overlapping the prediction difference and the MRI image, the exact regions can be pointed out that are evidence for (red parts) or against (blue parts) the classifier’s decision. The second row shows the results using the weights of the logistic regression classifier, which is a commonly used method in neuroscientific literature. We can see that they are considerably noisier (in the sense that, compared to our method, the voxels relevant for the classification decisions are more scattered), and also, they are not specific to the given image. Figure 10 shows the visualization results for four healthy, and four HIV samples. We can clearly see that the patterns for the two classes are distinct, and there is some pattern to the decision of the classifier, but which is still specific to the input image. Figure 11 shows the same (HIV) sample as in figure 9 along different axes, and figure 12 shows how the visualization changes with different patch sizes. We believe that both varying the slice and patch size can give different insights to a clinician, and in clinical practice, a 3D animation where these parameters can be adjusted would be very useful for analyzing the visualization result.
|
| 154 |
+
|
| 155 |
+
In general we can assume that the better the classifier, the closer the explanations for its decisions are to the true class difference. For clinical practice it is therefore crucial to have very good classifiers. This will increase computation time, but in many medical settings, longer waiting times for test results are common and worth the wait if the patient is not in an acute life threatening condition (e.g., when predicting HIV or Alzheimer from MRI scans, or the field of cancer diagnosis and detection). The presented results here are for demonstration purposes of the visualization method, and we claim no medical validity. A thorough qualitative analysis incorporating expert knowledge was outside the scope of this paper.
|
| 156 |
+
|
| 157 |
+
# 5 FUTURE WORK
|
| 158 |
+
|
| 159 |
+
In our experiments, we used a simple multivariate normal distribution for conditional sampling. We can imagine that using more sophisticated generative models will lead to better results: pixels that are easily predictable by their surrounding are downweighted even more. However this will also significantly increase the computational resources needed to produce the explanations. Similarly, we could try to modify equation (4) to get an even better approximation by using a conditional distribution that takes more information about the whole image into account (like adding spatial information for the MRI scans).
|
| 160 |
+
|
| 161 |
+
To make the method applicable for clinical analysis and practice, a better classification algorithm is required. Also, software that visualizes the results as an interactive 3D model will improve the usability of the system.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION
|
| 164 |
+
|
| 165 |
+
We presented a new method for visualizing deep neural networks that improves on previous methods by using a more powerful conditional, multivariate model. The visualization method shows which pixels of a specific input image are evidence for or against a node in the network. The signed information offers new insights - for research on the networks, as well as the acceptance and usability in domains like healthcare. While our method requires significant computational resources, real-time 3D visualization is possible when visualizations are pre-computed. With further optimization and powerful GPUs, pre-computation time can be reduced a lot further. In our experiments, we have presented several ways in which the visualization method can be put into use for analyzing how DCNNs make decisions.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 9: Visualization of the support for the correct classification ”HIV”, using the Prediction Difference method and Logistic Regression Weights. For an HIV sample, we show the results with the prediction difference (first row), and using the weights of the logistic regression classifier (second row), for slices 29 and 40 (along the first axis). Red are positive values, and blue negative. For each slice, the left image shows the original image, overlaid with the relevance values. The right image shows the original image with reversed colors and the relevance values. Relevance values are shown only for voxels with (absolute) relevance value above $1 5 \%$ of the (absolute) maximum value.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 10: Prediction difference visualization for different samples. The first four samples are of the class ”healthy”; the last four of the class ”HIV”. All images show slice 39 (along the first axis). All samples are correctly classified, and the results show evidence for (red) and against (blue) this decision. Prediction differences are shown only for voxels with (absolute) relevance value above $1 5 \%$ of the (absolute) maximum value.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 11: Visualization results across different slices of the MRI image, using the same input image as shown in 9. Prediction differences are shown only for voxels with (absolute) relevance value above $1 5 \%$ of the (absolute) maximum value.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 12: How the patch size influences the visualization. For the input image (HIV sample, slice 39 along the first axis) we show the visualization with different patch sizes $k$ in alg. 1). Prediction differences are shown only for voxels with (absolute) relevance value above $1 5 \%$ of the (absolute) maximum (for $k = 2$ it is $10 \%$ ).
|
| 178 |
+
|
| 179 |
+
# ACKNOWLEDGMENTS
|
| 180 |
+
|
| 181 |
+
This work was supported by AWS in Education Grant award. We thank Facebook and Google for financial support, and our reviewers for their time and valuable, constructive feedback.
|
| 182 |
+
|
| 183 |
+
This work was also in part supported by: Innoviris, the Brussels Institute for Research and Innovation, Brussels, Belgium; the Nuts-OHRA Foundation (grant no. 1003-026), Amsterdam, The Netherlands; The Netherlands Organization for Health Research and Development (ZonMW) together with AIDS Fonds (grant no 300020007 and 2009063). Additional unrestricted scientific grants were received from Gilead Sciences, ViiV Healthcare, Janssen Pharmaceutica N.V., Bristol-Myers Squibb, Boehringer Ingelheim, and Merck&Co.
|
| 184 |
+
|
| 185 |
+
We thank Barbara Elsenga, Jane Berkel, Sandra Moll, Maja Totté, and Marjolein Martens for running the AGEhIV study program and capturing our data with such care and passion. We thank Yolanda Ruijs-Tiggelman, Lia Veenenberg-Benschop, Sima Zaheri, and Mariska Hillebregt at the HIV Monitoring Foundation for their contributions to data management. We thank Aafien Henderiks and Hans-Erik Nobel for their advice on logistics and organization at the Academic Medical Center. We thank all HIV-physicians and HIV-nurses at the Academic Medical Center for their efforts to include the HIV-infected participants into the AGEhIV Cohort Study, and the Municipal Health Service Amsterdam personnel for their efforts to include the HIV-uninfected participants into the AGEhIV Cohort Study. We thank all study participants without whom this research would not be possible.
|
| 186 |
+
|
| 187 |
+
AGEhIV Cohort Study Group. Scientific oversight and coordination: P. Reiss (principal investigator), F.W.N.M. Wit, M. van der Valk, J. Schouten, K.W. Kooij, R.A. van Zoest, E. Verheij, B.C. Elsenga (Academic Medical Center (AMC), Department of Global Health and Amsterdam Institute for Global Health and Development (AIGHD)). M. Prins (co-principal investigator), M.F. Schim van der Loeff, M. Martens, S. Moll, J. Berkel, M. Totté, G.R. Visser, L. May, S. Kovalev, A. Newsum, M. Dijkstra (Public Health Service of Amsterdam, Department of Infectious Diseases). Datamanagement: S. Zaheri, M.M.J. Hillebregt, Y.M.C. Ruijs, D.P. Benschop, A. el Berkaoui (HIV Monitoring Foundation). Central laboratory support: N.A. Kootstra, A.M. Harskamp-Holwerda, I. Maurer, T. Booiman, M.M. Mangas Ruiz, A.F. Girigorie, B. Boeser-Nunnink (AMC, Laboratory for Viral Immune Pathogenesis and Department of Experimental Immunology). Project management and administrative support: W. Zikkenheiner, F.R. Janssen (AIGHD). Participating HIV physicians and nurses: S.E. Geerlings, M.H. Godfried, A. Goorhuis, J.W.R. Hovius, J.T.M. van der Meer, F.J.B. Nellen, T. van der Poll, J.M. Prins, P. Reiss, M. van der Valk, W.J. Wiersinga, M. van Vugt, G. de Bree, F.W.N.M. Wit; J. van Eden, A.M.H. van Hes, M. Mutschelknauss , H.E. Nobel, F.J.J. Pijnappel, M. Bijsterveld, A. Weijsenfeld, S. Smalhout (AMC, Division of Infectious Diseases). Other collaborators: J. de Jong, P.G. Postema (AMC, Department of Cardiology); P.H.L.T. Bisschop, M.J.M. Serlie (AMC, Division of Endocrinology and Metabolism); P. Lips (Free University Medical Center Amsterdam); E. Dekker (AMC, Department of Gastroenterology); N. van der Velde (AMC, Division of Geriatric Medicine); J.M.R. Willemsen, L. Vogt (AMC, Division of Nephrology); J. Schouten, P. Portegies, B.A. Schmand, G.J. Geurtsen (AMC, Department of Neurology); F.D. Verbraak, N. Demirkaya (AMC, Department of Ophthalmology); I. Visser (AMC, Department of Psychiatry); A. Schadé (Free University Medical Center Amsterdam, Department of Psychiatry); P.T. Nieuwkerk, N. Langebeek (AMC, Department of Medical Psychology); R.P. van Steenwijk, E. Dijkers (AMC, Department of Pulmonary medicine); C.B.L.M. Majoie, M.W.A. Caan, T. Su (AMC, Department of Radiology); H.W. van Lunsen, M.A.F. Nievaard (AMC, Department of Gynaecology); B.J.H. van den Born, E.S.G. Stroes, (AMC, Division of Vascular Medicine); W.M.C. Mulder (HIV Vereniging Nederland).
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Jesper LR Andersson, Mark Jenkinson, and Stephen Smith. Non-linear optimisation. fmrib technical report tr07ja1. University of Oxford FMRIB Centre: Oxford, UK, 2007.
|
| 192 |
+
|
| 193 |
+
Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015.
|
| 194 |
+
|
| 195 |
+
Christine Ecker, Andre Marquand, Janaina Mourão-Miranda, Patrick Johnston, Eileen M Daly, Michael J Brammer, Stefanos Maltezos, Clodagh M Murphy, Dene Robertson, Steven C Williams, et al. Describing the brain in autism in five dimensions—magnetic resonance imaging-assisted diagnosis of autism spectrum disorder using a multiparameter classification approach. The Journal of Neuroscience, 30(32):10612–10623, 2010.
|
| 196 |
+
|
| 197 |
+
Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. Dept. IRO, Université de Montréal, Tech. Rep, 4323, 2009.
|
| 198 |
+
|
| 199 |
+
Bilwaj Gaonkar and Christos Davatzikos. Analytic estimation of statistical significance maps for support vector machine based multi-variate image analysis and classification. NeuroImage, 78:270–283, 2013.
|
| 200 |
+
|
| 201 |
+
Stefan Haufe, Frank Meinecke, Kai Görgen, Sven Dähne, John-Dylan Haynes, Benjamin Blankertz, and Felix Bießmann. On the interpretation of weight vectors of linear models in multivariate neuroimaging. Neuroimage, 87:96–110, 2014.
|
| 202 |
+
|
| 203 |
+
Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014.
|
| 204 |
+
|
| 205 |
+
Stefan Klöppel, Cynthia M Stonnington, Carlton Chu, Bogdan Draganski, Rachael I Scahill, Jonathan D Rohrer, Nick C Fox, Clifford R Jack, John Ashburner, and Richard SJ Frackowiak. Automatic classification of mr scans in alzheimer’s disease. Brain, 131(3):681–689, 2008.
|
| 206 |
+
|
| 207 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 208 |
+
|
| 209 |
+
Janaina Mourao-Miranda, Arun LW Bokde, Christine Born, Harald Hampel, and Martin Stetter. Classifying brain states and determining the discriminating activation patterns: Support vector machine on functional mri data. NeuroImage, 28(4):980–995, 2005.
|
| 210 |
+
|
| 211 |
+
Marko Robnik-Šikonja and Igor Kononenko. Explaining classifications for individual instances. Knowledge and Data Engineering, IEEE Transactions on, 20(5):589–600, 2008.
|
| 212 |
+
|
| 213 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 214 |
+
|
| 215 |
+
Shayan Shahand, Ammar Benabdelkader, Mohammad Mahdi Jaghoori, Mostapha al Mourabit, Jordi Huguet, Matthan WA Caan, Antoine HC Kampen, and Sílvia D Olabarriaga. A data-centric neuroscience gateway: design, implementation, and experiences. Concurrency and Computation: Practice and Experience, 27(2): 489–506, 2015.
|
| 216 |
+
|
| 217 |
+
Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv preprint arXiv:1605.01713, 2016.
|
| 218 |
+
|
| 219 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 220 |
+
|
| 221 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
|
| 222 |
+
|
| 223 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015.
|
| 224 |
+
|
| 225 |
+
Ze Wang, Anna R Childress, Jiongjiong Wang, and John A Detre. Support vector machine learning-based fmri data group analysis. NeuroImage, 36(4):1139–1151, 2007.
|
| 226 |
+
|
| 227 |
+
Jason Yosinski, Jeff Clune, Anh Nguyen, Thomas Fuchs, and Hod Lipson. Understanding neural networks through deep visualization. arXiv preprint arXiv:1506.06579, 2015.
|
| 228 |
+
|
| 229 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In Computer vision–ECCV 2014, pp. 818–833. Springer, 2014.
|
| 230 |
+
|
| 231 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921–2929, 2016.
|
| 232 |
+
|
| 233 |
+
# A RANDOM RESULTS
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
Figure 13: Results on 34 randomly chosen ImageNet images. Middle columns: original image; left columns: sensitivity maps (Simonyan et al., 2013) where the red pixels indicate high sensitivity, and white pixels mean no sensitivity (note that we show the absolute values of the partial derivatives, since the sign cannot be interpreted like in our method); right columns: results from our method. For both methods, we visualize the results with respect to the correct class which is given above the image. In brackets we see how the classifier ranks this class, i.e., a (1) means it was correctly classified, whereas a (4) means that it was misclassified, and the correct class was ranked fourth. For our method, red areas show evidence for the correct class, and blue areas show evidence against the class (e.g., the scuba diver looks more like a tea pot to the classifier).
|
md/train/BJlahxHYDS/BJlahxHYDS.md
ADDED
|
@@ -0,0 +1,567 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONSERVATIVE UNCERTAINTY ESTIMATION BY FITTING PRIOR NETWORKS
|
| 2 |
+
|
| 3 |
+
Kamil Ciosek1, Vincent Fortuin1,2, Ryota Tomioka1, Katja Hofmann1, Richard Turner1,3
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Obtaining high-quality uncertainty estimates is essential for many applications of deep neural networks. In this paper, we theoretically justify a scheme for estimating uncertainties, based on sampling from a prior distribution. Crucially, the uncertainty estimates are shown to be conservative in the sense that they never underestimate a posterior uncertainty obtained by a hypothetical Bayesian algorithm. We also show concentration, implying that the uncertainty estimates converge to zero as we get more data. Uncertainty estimates obtained from random priors can be adapted to any deep network architecture and trained using standard supervised learning pipelines. We provide experimental evaluation of random priors on calibration and out-of-distribution detection on typical computer vision tasks, demonstrating that they outperform deep ensembles in practice.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has achieved huge success in many applications. In particular, increasingly often, it is used as a component in decision-making systems. In order to have confidence in decisions made by such systems, it is necessary to obtain good uncertainty estimates, which quantify how certain the network is about a given output. In particular, if the cost of failure is large, for example where the automated system has the capability to accidentally hurt humans, the availability and quality of uncertainty estimates can determine whether the system is safe to deploy at all (Carvalho, 2016; Leibig et al., 2017; Michelmore et al., 2018). Moreover, when decisions are made sequentially, good uncertainty estimates are crucial for achieving good performance quickly (Bellemare et al., 2016; Houthooft et al., 2016; Ostrovski et al., 2017; Burda et al., 2018).
|
| 12 |
+
|
| 13 |
+
Because any non-Bayesian inference process is potentially sub-optimal (De Finetti, 1937), these uncertainty estimates should ideally be relatable to Bayesian inference with a useful prior. Deep ensembles (Lakshminarayanan et al., 2017), one of the most popular methods available for uncertainty estimation in deep networks today, struggle with this requirement. While deep ensembles can be related (Rubin, 1981) to Bayesian inference in settings where the individual models are trained on subsets of the data, this is not how they are used in practice. In order to improve data efficiency, all ensembles are typically trained using the same data (Lakshminarayanan et al., 2017), resulting in a method which does not have a theoretical justification. Moreover, deep ensembles can give overconfident uncertainty estimates in practice. On the other hand, Monte-Carlo dropout can be viewed (Gal & Ghahramani, 2016) as a certain form of Bayesian inference. However, doing so requires requires either a limit to be taken or a generalization of variational inference to a quasi-KL divergence (Hron et al., 2018). In practice, MC dropout can give arbitrarily overconfident estimates (Foong et al., 2019). More broadly, a category of approaches, known as Bayesian Neural Networks (Blundell et al., 2015; Welling & Teh, 2011; Neal, 1996), maintains a distribution over the weights of the neural network. These methods have a sound Bayesian justification, but training them is both difficult and carries an accuracy penalty, particularly for networks with convolutional architectures (Osawa et al., 2019). Moreover, tuning BNNs is hard and achieving a good approximation to the posterior is difficult (Brosse et al., 2018).
|
| 14 |
+
|
| 15 |
+
We use another way of obtaining uncertainties for deep networks, based on fitting random priors (Osband et al., 2018; 2019). Random priors are easy to train and were found to work very well in practice (Burda et al., 2018). To obtain the uncertainty estimates, Affiliations: 1. Microsoft Research Cambridge; 2. ETH Zurich; 3. University of Cambridge. The second author was an intern at Microsoft when contributing to this work.
|
| 16 |
+
|
| 17 |
+
we first train a predictor network to fit a prior. Two examples of prior-predictor pairs are shown in the top two plots of Figure 1.Faced with a novel input point, we obtain an uncertainty (Figure 1, bottom plot) by measuring the error of the predictor network against this pattern. Intuitively, these errors will be small close to the training points, but large far from them. The patterns themselves are drawn from randomly initialized (and therefore untrained) neural networks. While this way of estimating uncertainties was known before (Osband et al., 2019), it did not have a theoretical justification beyond Bayesian linear regression, which is too limiting for modern applications.
|
| 18 |
+
|
| 19 |
+
Contributions We provide a sound theoretical framework for obtaining uncertainty estimates by fitting random priors, a method previously lacking a principled justification. Specifically, we justify estimates in the uncertainty of the output of neural networks with any architecture. In particular, we show in Lemma 1 and Proposition 1 that these uncertainty estimates are conservative, meaning they are never more certain than a Bayesian algorithm would be. Moreover, in Proposition 2 we show concentration, i.e. that the uncertainties become zero with infinite data. Empirically, we evaluate the calibration and out-of-distribution performance of our uncertainty estimates on typical computer vision tasks, showing a practical benefit over deep ensembles and MC dropout.
|
| 20 |
+
|
| 21 |
+
# 2 PRELIMINARIES
|
| 22 |
+
|
| 23 |
+
We are going to reason about uncertainty within the formal framework of stochastic processes. We now introduce the required notations.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: On top, two predictors (green) were trained to fit two randomlygenerated priors (red). On the bottom, we obtain uncertainties from the difference between predictors and priors. Dots correspond to training points $x _ { i }$ .
|
| 27 |
+
|
| 28 |
+
A stochastic process is a collection of random variables $\{ f ( x ) \}$ . We consider processes where $\boldsymbol { x } \in \mathbb { R } ^ { K }$ and the random-variable $f ( x )$ takes values in $\mathbb { R } ^ { M }$ . A stochastic process has exchangeable outputs if the distribution does not change when permuting the $M$ entries in the output vector. Allowing a slight abuse of notation, we denote the finite-dimensional distribution of the process $\{ f ( x ) \}$ for the set $X =$ $\{ x _ { i } \} _ { i = 1 , \ldots , N }$ as $f ( x _ { 1 } , \dots , x _ { N } ) = f ( X )$ . In practice, the finite-dimensional distribution reflects the idea of restricting the process to points $x _ { 1 } , \ldots , x _ { N }$ and marginalizing over all the other points. Inference can be performed on stochastic processes similarly to probability distributions. In particular, we can start with some prior process $\{ f ( x ) \}$ , observe a set of $N$ training points $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ and labels $y = \{ y _ { i } \} _ { i = 1 , \dots , N }$ and then consider the posterior process $\{ f _ { X y } ( x ) \}$ , whose finite-dimensional distributions are given by $f _ { X y } ( x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star } ) = f ( x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star } | x _ { 1 } , \ldots , x _ { N } , y _ { 1 } , \ldots , y _ { N } )$ for any set of testing points $x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star }$ . We use subscripts to denote conditioning on the dataset throughout the paper. We denote the variance of $f _ { X y } ( x _ { \star } )$ with $\sigma _ { X f } ^ { 2 } ( x _ { \star } )$ . A stochastic process is called Gaussian if if all its finite-dimensional distributions are Gaussian. Given a test point $x _ { \star }$ , we denote the posterior GP mean with $\mu _ { X y } ( x _ { \star } )$ and posterior GP variance with $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ . We provide more background on GPs in Appendix D.
|
| 29 |
+
|
| 30 |
+
# 3 ESTIMATING UNCERTAINTY FROM RANDOM PRIORS
|
| 31 |
+
|
| 32 |
+
Intuition Uncertainties obtained from random priors have an appealing intuitive justification. Consider the networks in the top part of Figure 1. We start with a randomly initialized prior network, shown in red. Whenever we see a datapoint, we train the predictor network (green) to match this prior. Uncertainties can then be obtained by considering the squared error between the prior and the predictor at a given point. An example uncertainty estimate is shown as the shaded blue area in the bottom of Figure 1. While it may at first seem that the squared error is a poor measure of uncertainty because it can become very small by random chance, we formally show in Section 4.1 that this is very improbable. In Section 4.2, we show that this error goes down to zero as we observe more data. Similarly to GP inference, uncertainty estimation in our framework does not depend on the regression label. The prediction mean (blue curve in the bottom part of Figure 1) is obtained by fitting a completely separate neural network. In section 6, we discuss how this framework avoids the overconfidence characteristic of deep ensembles (Lakshminarayanan et al., 2017).
|
| 33 |
+
|
| 34 |
+
Prior The process of obtaining network uncertainties involves randomly initialized prior networks, which are never trained. While this may at first appear very different from they way deep learning is normally done, these random networks are a crucial component of our method. We show in Section 4.1 that the random process that corresponds to initializing these networks can be interpreted as a prior of a Bayesian inference procedure. A prior conveys the information about how the individual data points are related. The fact that we are using random networks has both practical and theoretical benefits. Practically, since the prior does not depend on the data, there is no way that it can overfit. The use of random priors also has strong empirical support – randomly initialized networks have been recently used as priors to obtain state-of-the-art performance on computer vision tasks (Ulyanov et al., 2018; Cheng et al., 2019). Theoretically, using random priors satisfies the likelihood principle (Robert, 2007). Moreover, random priors can be viewed as a safe choice since they make the minimum reasonable assumption that the network architecture is appropriate for the task. In fact, whenever deep learning is used, with or without uncertainty estimates, practitioners are already implicitly making that assumption.
|
| 35 |
+
|
| 36 |
+
Algorithm The process of training the predictor networks is shown in Algorithm 1. The function TRAIN-UNCERTAINTIES first generates random priors, i.e. neural networks with random weights. In our notation, it corresponds to sampling functions from the prior process $\{ f ( x ) \}$ . These priors, evaluated at points from the dataset $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ are then used as labels for supervised learning, performed by the function FIT. After training, when we want to obtain an uncertainty estimate $\phi$ at a given test point $x _ { \star }$ , we use the formula
|
| 37 |
+
|
| 38 |
+
<table><tr><td>Algorithm 1 Training the predictors.</td></tr><tr><td>function TRAIN-UNCERTAINTIES(X) fori=1...Bdo fi~{f(x)} > random prior hxfi ←FIT(X,fi(X)) end for</td></tr><tr><td>return fi,hx fi end function</td></tr><tr><td>function FIT(X, fi(X))</td></tr><tr><td>L(h)=∑x∈x If²(x)-h(x)ll² h xfi← OPTIMIZE(L)>SGD or similar return h x fi >return trained predictor</td></tr></table>
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\hat { \sigma } ^ { 2 } ( x _ { \star } ) = \operatorname* { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \beta \hat { v } _ { \sigma } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
Here, the quantity $\hat { \sigma } _ { \mu } ^ { 2 }$ is the sample mean of the squared error. We will show in Section 4 that it is an unbiased estimator of a variable that models the uncertainty. On the other hand, $\hat { v } _ { \sigma }$ is the samplebased estimate of the standard deviation of squared error across bootstraps, needed to quantify our uncertainty about what the uncertainty is. The hyper-parameter $\beta$ controls the degree to which this uncertainty is taken into account. Formally, the quantities are defined as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r l } & { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \triangleq \sum _ { i = 1 } ^ { B } \frac { 1 } { M B } \| f ( x _ { \star } ) - h _ { X f _ { i } } ( x _ { \star } ) \| ^ { 2 } , } \\ & { \hat { v } _ { \sigma } ( x _ { \star } ) \triangleq \sqrt { \sum _ { i = 1 } ^ { B } \frac { 1 } { B } ( \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f _ { i } } ( x _ { \star } ) \| ^ { 2 } ) ^ { 2 } } . } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
In the above equations, $B$ is the number of prior functions and each prior and predictor network has $M$ outputs. Because the predictors are trained independently, uncertainty estimates obtained from each of the $B$ predictor-prior pairs are independent. We defer the discussion of details of network architecture to Section 5. Our experiments (Section 7) show that it is often sufficient to use $B = 1$ in practice.
|
| 51 |
+
|
| 52 |
+
# 4 THEORETICAL RESULTS
|
| 53 |
+
|
| 54 |
+
In Section 3, we introduced a process for obtaining uncertainties in deep learning. We now seek to provide a formal justification. We define the expected uncertainties as
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \triangleq \operatorname { E } _ { f } \left[ \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] = \operatorname { E } _ { f } \left[ \frac { 1 } { M } \lVert f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \rVert ^ { 2 } \right] . } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
In other words, $\tilde { \sigma } _ { \mu } ^ { 2 }$ is the expected version of the sample-based uncertainties $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ introduced in equation 2. Since Bayesian inference is known to be optimal (De Finetti, 1937; Jaynes, 2003; Robert, 2007), the most appealing way of justifying uncertainty estimates ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ and $\hat { \sigma } _ { \mu } ^ { 2 }$ is to relate them to a Bayesian posterior $\sigma _ { X f } ^ { 2 } ( x _ { \star } )$ . We do this in two stages. First, in Section 4.1, we prove that the obtained uncertainties are larger than ones arrived at by Bayesian inference. This means that our uncertainties are conservative, ensuring that our algorithm is never more certain than it should be. Next, in Section 4.2, we show that uncertainties concentrate, i.e., they become small as we get more and more data. These two properties are sufficient to justify the use of our uncertainties in many applications.
|
| 61 |
+
|
| 62 |
+
# 4.1 UNCERTAINTIES FROM RANDOM PRIORS ARE CONSERVATIVE
|
| 63 |
+
|
| 64 |
+
From the point of view of safety, it is preferable to overestimate the ground truth uncertainty than to underestimate it. We now show that this property holds for uncertainties obtained from random priors. We first justify conservatism for the expected uncertainty ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ defined in equation 4 and then for the sampled uncertainty $\hat { \sigma } _ { \mu } ^ { 2 }$ defined in equation 2.
|
| 65 |
+
|
| 66 |
+
Amortized Conservatism We first consider a weak form of this conservatism, which we call amortized. It guarantees that ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ is never smaller than the average posterior uncertainty across labels sampled from the prior. Formally, amortized conservatism holds if for any test point $x _ { \star }$ we have
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) \right] .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Here $\sigma _ { X f } ^ { 2 }$ corresponds to the second moment of the posterior process $\{ f _ { X f } ( x ) \}$ . We will introduce a stronger version of conservatism, which does not have an expectation on the right-hand side, later in this section (eq. 8). For now, we concentrate on amortized conservatism. In Lemma 1 (proof in appendix), we show that it holds under very general conditions.
|
| 73 |
+
|
| 74 |
+
Lemma 1. For any function $h : \mathbb { R } ^ { N \times ( K + 1 ) } \mathbb { R } ^ { M }$ , for any test point $\boldsymbol { x } _ { \star } ~ \in ~ \mathbb { R } ^ { K }$ and for any stochastic process $\{ f ( x ) \} _ { x \in \mathbb { R } ^ { K } }$ with all second moments finite and exchangeable outputs
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Relation to a GP Lemma 1 holds for any prior process $\{ f ( x ) \}$ . However, the prior process used by Algorithm 1 is not completely arbitrary. The fact that prior samples are obtained by initializing neural networks with independently sampled weights gives us additional structure. In fact, it can be shown that randomly initialized neural networks become close to GPs as the width of the layers increases. While the original result due to Neal (1996) held for a simple network with one hidden layer, it has been extended to a wide class of popular architectures, including to CNNs and RNNs of arbitrary depth (Matthews et al., 2018; Lee et al., 2018; Novak et al., 2019; Williams, 1997; Le Roux & Bengio, 2007; Hazan & Jaakkola, 2015; Daniely et al., 2016; Garriga-Alonso et al., 2019). Recently, it has been shown to hold for a broad class of functions trainable by gradient descent (Yang, 2019). While the precise statement of these results involves technicalities which fall beyond the scope of this paper, we recall the key insight. For a family of neural networks $\{ f ^ { W } ( x ) \}$ , where the weights are sampled independently and $W$ is the width of the hidden layers, there exists a limiting kernel function $k _ { \infty }$ such that
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname* { l i m } _ { W \infty } [ \{ f ^ { W } ( x ) \} ] = \mathcal { G P } ( 0 , k _ { \infty } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
In other words, as the size of the hidden layers increases, the stochastic process obtained by initializing networks randomly converges in distribution to a GP. In the context of our uncertainty estimates, this makes it reasonable for $W$ large enough to consider the prior to be a GP. We stress that the GP assumption has to hold only for the prior network, which is never trained. We do not make any assumptions about connections between the predictor training process and GPs.
|
| 87 |
+
|
| 88 |
+
Strict Conservatism Denoting the posterior GP variance with $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ , we define uncertainty estimates to be strictly conservative when
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
This statement is stronger than the amortized conservatism in equation 5. Intuitively, equation 8 can be interpreted as saying that our uncertainty estimates are never too small. This confirms the intuition expressed by Burda et al. (2018) that random priors do not overfit. Below, in Proposition 1, we outline how to guarantee strict conservatism formally. It is proved in Appendix F.1.
|
| 95 |
+
|
| 96 |
+
Proposition 1 (Strict Conservatism in Expectation). Assume that $f$ is a GP. Then for any function $h : \bar { \mathbb { R } } ^ { N \times K } \to \bar { \mathbb { R } } ^ { M }$ , we have
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \sigma _ { X } ^ { 2 } ( x _ { \star } ) + \underbrace { { \mathrm E } _ { f ( X ) } \left[ \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] } _ { \geq 0 } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Moreover, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ .
|
| 103 |
+
|
| 104 |
+
Conservatism with Finite Bootstraps Lemma 1 above shows conservatism for expected uncertainties, i.e. ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ introduced in equation 5. However, in practice we have to estimate this expectation using a finite number of bootstraps, and use the sampled uncertainties $\hat { \sigma } _ { \mu } ^ { 2 }$ defined in equation 2. We now state a conservatism guarantee that holds even in the case of just one bootstrap $B = 1$ ). The proof is deferred to Appendix F.1.
|
| 105 |
+
|
| 106 |
+
Corollary 1 (Strict Conservatism for Finite Bootstraps). Assume that $f$ is a GP. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB. Then with probability $1 - \delta$ , for any function $h : \mathbb { R } ^ { N \times K } \to \mathbb { R } ^ { M }$ , we have
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \geq \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
However, applying Corollary 1 requires the knowledge of $v _ { \mathrm { U B } }$ . We now provide an upper bound.
|
| 113 |
+
|
| 114 |
+
Lemma 2. Assume that the GP $\{ f ( x ) \}$ is zero mean with exchangeable outputs and the function $h _ { X f }$ takes values in $[ - U , U ] ^ { M }$ . Assume that permuting the outputs of $f$ produces the same permutation in the outputs of $h _ { X f }$ . With probability $1 - \delta$ , we have
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\operatorname { V a r } _ { f _ { 1 } , \dots , f _ { B } } \left[ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq v _ { U B } ,
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where vUB is expressible in terms of observable quantities.
|
| 121 |
+
|
| 122 |
+
The proof and the explicit formula for $v _ { \mathrm { U B } }$ is deferred to Appendix F.1. In cases where conservatism is desired, but not absolutely essential, we can avoid the torturous calculation of Lemma 2 and replace $v _ { \mathrm { U B } }$ with the sample-based estimate $\hat { v } _ { \sigma } ( x _ { \star } )$ , defined in equation 2. In this case, the conservatism guarantee is only approximate. This is how we obtained equation 1, used by the algorithm in practice.
|
| 123 |
+
|
| 124 |
+
# 4.2 UNCERTAINTIES FROM RANDOM PRIORS CONCENTRATE
|
| 125 |
+
|
| 126 |
+
While the conservatism property in Proposition 1 is appealing, it is not sufficient on its own for the uncertainty estimates to be useful. We also need concentration, i.e. a guarantee that the uncertainties $\hat { \sigma } ^ { 2 }$ become small with more data. We can gurantee this formally by assuming that the class of neural networks being fitted is Lipschitz-continuous and bounded. Intuitively, by assumption of Lipschitz continuity, the predictors $h _ { X f }$ cannot behave very differently on points from the training and test sets, since both come from the same data distribution. We can then show concentration by using standard Rademacher tools to obtain a bound on the expected uncertainty in terms of the squared error on the training set. This process is formalized in Proposition 2.
|
| 127 |
+
|
| 128 |
+
Proposition 2. If the training converges, i.e. the training loss $\begin{array} { r } { \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } = \sigma _ { A } ^ { 2 } } \end{array}$ for arbitrarily large training sets, then assuming the predictors $h _ { X f }$ are bounded and Lipschitz continuous with constant $L _ { i }$ , then under technical conditions the uncertainties concentrate, i.e. $\hat { \sigma } ^ { 2 } ( x _ { \star } ) 0$ as $N \to \infty$ and $B \infty$ with probability $^ { l }$ .
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: Architecture of the random prior networks $f$ and predictor networks $h _ { X f }$ . The predictor networks $h _ { X f }$ typically share the same architectural core, but have additional layers relative to the prior networks. Both the green and red parts of the predictor networks are trained.
|
| 132 |
+
|
| 133 |
+
The proof and the technical conditions are given in Appendix F. Proposition 2 assumes that the training error is zero for arbitrarily large training sets, which might at first seem unrealistic. We argue that this assumption is in fact reasonable. The architecture of our predictor networks (Figure 2, right diagram) is a superset of the prior architecture (Figure 2, left diagram), guaranteeing the existence of weight settings for the predictor that make the training loss zero. Recent results on deep learning optimization (Du et al., 2019; Allen-Zhu et al., 2019) have shown that stochastic gradient descent can in general be expected to find representable functions.
|
| 134 |
+
|
| 135 |
+
# 5 PRACTICAL CONCLUSIONS FROM THE THEORY
|
| 136 |
+
|
| 137 |
+
We now re-visit the algorithm we defined in Section 3, with the aim of using the theory above to obtain practical improvements in the quality of the uncertainty estimates.
|
| 138 |
+
|
| 139 |
+
Architecture and Choosing the Number of Bootstraps Our conservatism guarantee in Proposition 1 holds for any architecture for the predictor $h _ { X f }$ . In theory, the predictor could be completely arbitrary and does not even have to be a deep network. In particular, there is no formal requirement for the predictor architecture to be the same as the prior. On the other hand, to show concentration in Proposition 2, we had to ensure that the prior networks are representable by the predictor. In practice, we use the architecture shown in Figure 2, where the predictor mirrors the prior, but has additional layers, giving it more representational power. Moreover, the architecture requires choosing the number of bootstraps $B$ . Our experiments in Section 7 show that even using $B = 1$ , i.e. one bootstrap, produces uncertainty estimates of high quality in practice.
|
| 140 |
+
|
| 141 |
+
Modeling Epistemic and Aleatoric Uncertainty Proposition 1 and Proposition 2 hold for any Gaussian Process prior. By choosing the process appropriately, we can model both epistemic and aleatoric uncertainty. Denote by $\{ n ( x ) \}$ a stochastic process obtained by randomly initializing neural networks and denote by $\bar { \{ \epsilon ( x ) \sigma _ { A } ^ { 2 } \} }$ the noise term, modeling the aleatoric (observation) noise, where samples are obtained from $\mathsf { \bar { \epsilon } } ( x ) \sim \mathcal { N } ( 0 , 1 )$ at each $x$ independently (see Appendix D for more background on aleatoric noise). We can now choose the prior process as a sum $\dot { \{ f ( x ) \} } = \{ n ( x ) + \epsilon ( \bar { x ) } \sigma _ { A } ^ { 2 } \}$ of epistemic component $\{ n ( x ) \}$ and the noise term. The amount of aleatoric uncertainty can be adjusted by choosing $\sigma _ { A } ^ { 2 }$ .
|
| 142 |
+
|
| 143 |
+
Prior Choice, Weight Copying and Conservatism One question that can be asked about our architecture (Figure 2) is whether it is possible for the predictor to exactly copy the prior weights, giving zero uncertainty everywhere. A useful edge case to consider here is when we are solving a one-dimensional regression problem, $\sigma _ { A } ^ { 2 } = 0$ and the both the priors and predictors are linear functions. In this case, after training on two points, the predictors will agree with the priors everywhere and uncertainty estimates will be zero. However, this is still consistent with our conservatism guarantee The reason for this is once we assume such a linear prior, we are comparing to a GP with a linear kernel. But a GP with that kernel will also have zero uncertainty after seeing two samples.
|
| 144 |
+
|
| 145 |
+
In practice, this means that we have to choose the architecture of the prior networks be expressive enough, which is no different from choosing a reasonable prior for Bayesian inference. Empirically, the tested network architecture did not show weight copying.
|
| 146 |
+
|
| 147 |
+
# 6 PRIOR WORK
|
| 148 |
+
|
| 149 |
+
Randomized Prior Functions (RPFs) Our work was inspired by, and builds on, Randomised Prior Functions (Osband et al., 2019; 2018), but it is different in two important respects. First, the existing theoretical justification for RPFs only holds for Bayesian linear regression (Osband et al., 2018, equation 3) with non-zero noise1 added to the priors. In contrast, our results are much more general and hold for any deep network with or without added aleatoric noise. Second, we are targeting a different setting. While RPFs were designed as a way of sampling functions from the posterior, we provide estimates of posterior uncertainty at a given test point. Our algorithm is based on the work by Burda et al. (2018), who applied RPFs to exploration in MDPs, obtaining state-of-the art results, but without justifying their uncertainty estimates formally. Our paper provides this missing justification, while also introducing a way of quantifying the error in estimating the uncertainty itself. Moreover, since Burda et al. (2018) focused on the application of RPFs to Reinforcement Learning, they only performed out-of-distribution evaluation on the relatively easy MNIST dataset (LeCun, 1998). In contrast, in Section 7 we evaluate the uncertainties on more complex vision tasks. The term prior networks has also been used (Malinin & Gales, 2018) to denote deep networks that output the parameters of a prior distribution, an approach fundamentally different from our work.
|
| 150 |
+
|
| 151 |
+
Deep Ensembles The main alternative approach for obtaining uncertainties in deep learning are deep ensembles (Lakshminarayanan et al., 2017). Building on the bootstrap (Efron & Tibshirani, 1994), deep ensembles maintain several models and quantify epistemic uncertainty by measuring how their outputs vary. Crucially, deep ensembles use representations trained on regression labels, and tend to learn similar representations for different inputs with similar labels, which can lead to over-fitting the uncertainty estimates. A useful edge case to consider is if the each of the models in the ensemble is convex in the weights. In this case, models in a deep ensemble will all converge to the same weights and produce zero uncertainty. While deep learning models used in practice aren’t normally convex, we show empirically in section 7 that deep ensembles can give overconfident uncertainty estimates in practical vision tasks, particularly on points that have the same label as points in the training set. Since our method avoids overconfidence, it can be understood as complementary to deep ensembles, to be used in situations where obtaining conservative estimates is more important than the representational benefit of using labels. In practice, deep ensembles also require using more bootstraps to achieve the same OOD performance. Moreover, they do not have theoretical support in the case when all the members of the ensemble are trained on the same data, which is how they are used in practice (Lakshminarayanan et al., 2017).
|
| 152 |
+
|
| 153 |
+
Dropout In cases where it is not economical to train more than one network, uncertainties can be obtained with dropout (Srivastava et al., 2014; Gal & Ghahramani, 2016). Monte-Carlo dropout can be viewed (Gal & Ghahramani, 2016) as a form of approximate Bayesian inference. However, to do so requires a rather unnatural approximating family from the perspective of approximate inference. Also, one has then either to take a limit or generalize variational inference to a quasi-KL (Hron et al., 2018) divergence. In addition, dropout can be interpreted in terms of MAP inference (Nalisnick et al., 2019). Another alternative view of MC dropout is as an ensemble method in which the ensemble members have shared parameters (which means they are trained together) and where the ensembling is applied at test time too. This latter view is arguably as natural as the Bayesian interpretation. For this reason we discuss MC dropout separately from BNNs. Since dropout implicitly approximates non-Gaussian weight distribution with Gaussians, it exhibits spurious patterns in the obtained uncertainties, which can lead to arbitrarily overconfident estimates (Foong et al., 2019). In contrast, due to the conservatism property, random priors avoid such overconfidence.
|
| 154 |
+
|
| 155 |
+
Bayesian Neural Networks (BNNs) Bayesian Neural Networks (Blundell et al., 2015; Kingma & Welling, 2014; Rezende et al., 2014; Welling & Teh, 2011; Brosse et al., 2018) explicitly model the distribution over weights of a neural network. While BNNs provide a link between deep learning and Bayesian inference, they are very slow to train. Even recent tuned implementations of BNNs (Osawa et al., 2019) are several times slower than supervised learning. This happens despite using a battery of technical optimizations, including distributed training and batch normalization. Moreover, modern convolutional BNNs still carry a significant accuracy penalty when deployed with realistic settings of prior variance.2
|
| 156 |
+
|
| 157 |
+
# 7 EXPERIMENTS
|
| 158 |
+
|
| 159 |
+
Encouraged by the huge empirical success of random priors in Reinforcement Learning (Burda et al., 2018), we wanted to provide an evaluation in a more typical supervised learning setting. We tested the uncertainties in two ways. First, we investigated calibration, i.e. whether we can expect a higher accuracy for more confident estimates. Next, we checked whether the uncertainties can be used for out-of-distribution detection. We compared to two competing approaches for uncertainty detection: deep ensembles (Lakshminarayanan et al., 2017) and spatial concrete dropout (Gal et al., 2017). The same ResNet architecture served as a basis for all methods. Details of the implementation are provided in Appendix A.
|
| 160 |
+
|
| 161 |
+
Out-Of-Distribution Detection We evaluated the uncertainty estimates on out-ofdistribution detection. To quantify the results, we evaluated the area under the ROC curve (AUROC) for the task of deciding whether a given image comes from the same distribution or not. All methods were trained on four classes from the CIFAR-10 (Krizhevsky et al., 2009) dataset (training details are provided in Appendix A). We then tested the resulting networks on images from withheld classes and on the SVHN dataset (Netzer et al., 2011), which contains completely different images. Results are shown in Table 1. Considering the statistical errors (see Appendix B), random priors performed slightly better than deep ensembles with adversarial training for $B = 1$ and about the same for $B ~ = ~ 1 0$ . For dropout, $B$ refers to the number of dropout samples. Dropout per
|
| 162 |
+
|
| 163 |
+
Table 1: Out-of-distribution AUROC for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). Estimated confidence intervals are provided in Appendix B.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RP</td><td rowspan=1 colspan=1>DE</td><td rowspan=1 colspan=1>DE+AT</td><td rowspan=1 colspan=1>DR</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Train v. cat/deerTrain v. vehiclesTrain v. excludedTrain v. SVHN</td><td rowspan=2 colspan=1>0.991.001.000.95</td><td rowspan=1 colspan=1>0.83</td><td rowspan=2 colspan=1>0.960.960.960.96</td><td rowspan=2 colspan=1>0.810.760.770.86</td></tr><tr><td rowspan=1 colspan=1>0.820.820.88</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Train v.cat/deerTrain v. vehiclesTrain v. excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.95</td><td rowspan=2 colspan=1>0.990.980.980.99</td><td rowspan=2 colspan=1>0.820.780.790.87</td></tr><tr><td rowspan=1 colspan=1>1.001.000.97</td><td rowspan=1 colspan=1>0.920.930.94</td></tr></table>
|
| 166 |
+
|
| 167 |
+
formed worse, but was cheaper to train. In order to gain a more finely-grained insight into the quality of the uncertainties, we also show uncertainty histograms in Figure 3. The figure shows the distribution of uncertainty estimates for seen data (top row) vs. unseen data (bottom row) for bootstrap sizes $B = \{ 1 , 5 , 1 0 \}$ . The main conclusion is that uncertainties obtained from random priors are already well-separated with $B = 1$ , while deep ensembles need more bootstraps to achieve the full separation between test and train examples. We provide additional experimental results, showing OOD accuracy and an evaluation on CIFAR 100 in Appendix B.
|
| 168 |
+
|
| 169 |
+
Calibration Good uncertainty estimates have the property that accuracy increases as we become more certain, a property known as calibration. We measured it by evaluating average accuracy on the subset of images with uncertainty smaller than a given value. We trained on four classes from the CIFAR-10 (Krizhevsky et al., 2009) dataset. We then tested the resulting networks on the whole dataset, which included both the seen and unseen classes. Results are shown in Figure 4. Ideally, in a calibrated method, these curves should be increasing, indicating that a method always becomes more accurate as it becomes more confident. In coarse terms, Figure 4 confirms that all methods except a degenerate deep ensemble with only one bootstrap are roughly monotonic. However, uncertainty estimates from random priors are more stable, showing monotonicity on a finer scale as well as on a large scale. Interestingly, calibration improved only slightly when increasing the number of bootstraps $B$ .
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-10. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 - \operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 4: Calibration curves showing the relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B = 1 , 5 , 1 0$ on CIFAR-10.
|
| 176 |
+
|
| 177 |
+
Subsampling Ablation In the previous experiment, we kept the architectural and optimization choices fixed across algorithms. This ensured a level playing field, but meant that we were not able to obtain zero training error on the predictor networks used by random priors. However, we also wanted to evaluate random priors in the setting of near-zero training error. To do this, we used a smaller set of training images, while still keeping the network architecture the same. This allowed us to obtain nearcomplete convergence (details in Appendix A).
|
| 178 |
+
|
| 179 |
+
Table 2: Out-of-distribution AUROC for the same models as above (see Tab. 1) on subsampled data. Numbers are accurate up to $\pm 0 . 0 1$ .
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.90</td><td>0.89</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.95</td><td>0.94</td><td>0.97</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.94</td><td>0.90</td><td>0.92</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.97</td><td>0.95</td><td>0.97</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Results of this ablation are shown in Figures 5 and 6, as well as Table 2, analogous to our results on the full dataset presented above. In this sub-sampled regime, the random prior method easily outperformed competing approaches, showing better calibration (Fig. 5). The histograms in Figure 6 also demonstrate good separation between seen and unseen data. In the out-of-distribution benchmarks reported in Table 2, the random prior method has comfortably outperformed the baselines. While this training regime is not practical for real-life tasks, it demonstrates the potential performance of random priors when trained to full convergence.
|
| 184 |
+
|
| 185 |
+
Sensitivity to Initialization Scale We performed an ablation to test the robustness of our algorithm to the scaling of the weight initialization in the prior. Results are shown in Figure 7, where we plot the relationship between initialization scale (taken from the set $\{ 0 . 0 1 , 0 . 1 , 1 . 0 , 2 . 0 , 5 . 0 , 1 0 . 0 \} )$ and AUROC performance on the CIFAR-10 task. OOD performance is relatively robust with respect to the weight initialization within one order of magnitude.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: The relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B =$ 1, 5, 10 on a subset of 75 samples from CIFAR-10. In well-calibrated models, accuracy increases as uncertainty declines.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 6: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-10, where we trained on a sample of 75 images from the training set. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 -$ $\operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 192 |
+
|
| 193 |
+
Summary of experiments We have shown that uncertainties obtained from random priors achieve competitive performance with fewer bootstraps in a regime where the network architecture is typical for standard supervised learning workloads. Random priors showed superior performance in a regime where the predictors can be trained to near-zero loss.
|
| 194 |
+
|
| 195 |
+
# 8 CONCLUSIONS
|
| 196 |
+
|
| 197 |
+
We provided a theoretical justification for the use of random priors for obtaining uncertainty estimates in the context of deep learning. We have shown that the obtained uncertainties are conservative and that they concentrate for any neural network architecture. We performed an extensive empirical comparison, showing that random priors perform similarly to deep ensembles in a typical supervised training setting, while outperforming them in a regime where we are able to accomplish near-zero training loss for the predictors.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 7: Robustness of OOD perfromance to initialization scale. Conf. bars present, but small, denoting high confidence. Horizontal axis is logarithmic.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 242–252, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings. mlr.press/v97/allen-zhu19a.html.
|
| 205 |
+
|
| 206 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 207 |
+
|
| 208 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 209 |
+
|
| 210 |
+
Nicolas Brosse, Alain Durmus, and Eric Moulines. The promises and pitfalls of stochastic gradient langevin dynamics. In Advances in Neural Information Processing Systems, pp. 8268–8278, 2018.
|
| 211 |
+
|
| 212 |
+
Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
|
| 213 |
+
|
| 214 |
+
Ashwin Mark Carvalho. Predictive Control under Uncertainty for Safe Autonomous Driving: Integrating DataDriven Forecasts with Control Design. PhD thesis, UC Berkeley, 2016.
|
| 215 |
+
|
| 216 |
+
Zezhou Cheng, Matheus Gadelha, Subhransu Maji, and Daniel Sheldon. A bayesian perspective on the deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5443–5451, 2019.
|
| 217 |
+
|
| 218 |
+
Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, pp. 2253–2261, 2016.
|
| 219 |
+
|
| 220 |
+
Bruno De Finetti. La prevision: ses lois logiques, ses sources subjectives. In ´ Annales de l’institut Henri Poincare´, pp. 1–68, 1937.
|
| 221 |
+
|
| 222 |
+
Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675–1685, 2019.
|
| 223 |
+
|
| 224 |
+
John Duchi. Probability bounds, 2009.
|
| 225 |
+
|
| 226 |
+
Bradley Efron and Robert J. Tibshirani. An Introduction to the Bootstrap. SIAM Review, 36(4):677–678, 1994. doi: 10.1137/1036171.
|
| 227 |
+
|
| 228 |
+
Andrew YK Foong, David R Burt, Yingzhen Li, and Richard E Turner. Pathologies of factorised gaussian and mc dropout posteriors in bayesian neural networks. arXiv preprint arXiv:1909.00719, 2019.
|
| 229 |
+
|
| 230 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pp. 1050–1059, 2016. URL http://proceedings.mlr. press/v48/gal16.html.
|
| 231 |
+
|
| 232 |
+
Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 3581–3590, 2017.
|
| 233 |
+
|
| 234 |
+
Adri Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\equiv$ Bklfsi0cKm.
|
| 235 |
+
|
| 236 |
+
Tamir Hazan and Tommi Jaakkola. Steps toward deep kernel methods from infinite neural networks. arXiv preprint arXiv:1508.05133, 2015.
|
| 237 |
+
|
| 238 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109– 1117, 2016.
|
| 239 |
+
|
| 240 |
+
Jiri Hron, Alexander G. de G. Matthews, and Zoubin Ghahramani. Variational bayesian dropout: pitfalls and fixes. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 2024–2033, 2018. URL http: //proceedings.mlr.press/v80/hron18a.html.
|
| 241 |
+
|
| 242 |
+
Edwin T Jaynes. Probability theory: The logic of science. Cambridge university press, 2003.
|
| 243 |
+
|
| 244 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 245 |
+
|
| 246 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. URL http://arxiv.org/abs/1312.6114.
|
| 247 |
+
|
| 248 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 249 |
+
|
| 250 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pp. 6402–6413, 2017.
|
| 251 |
+
|
| 252 |
+
Nicolas Le Roux and Yoshua Bengio. Continuous neural networks. In Artificial Intelligence and Statistics, pp. 404–411, 2007.
|
| 253 |
+
|
| 254 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 255 |
+
|
| 256 |
+
Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ B1EA-M-0Z.
|
| 257 |
+
|
| 258 |
+
Christian Leibig, Vaneeda Allken, Murat Sec¸kin Ayhan, Philipp Berens, and Siegfried Wahl. Leveraging uncertainty information from deep neural networks for disease detection. Scientific reports, 7(1):17816, 2017.
|
| 259 |
+
|
| 260 |
+
Ulrike von Luxburg and Olivier Bousquet. Distance-based classification with lipschitz functions. Journal of Machine Learning Research, 5(Jun):669–695, 2004.
|
| 261 |
+
|
| 262 |
+
Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. In Advances in Neural Information Processing Systems, pp. 7047–7058, 2018.
|
| 263 |
+
|
| 264 |
+
AGDG Matthews, M Rowland, J Hron, RE Turner, and Z Ghahramani. Gaussian process behaviour in wide deep neural networks. In Proceedings of the 6th International Conference on Learning Representations., 2018.
|
| 265 |
+
|
| 266 |
+
Rhiannon Michelmore, Marta Kwiatkowska, and Yarin Gal. Evaluating uncertainty quantification in end-to-end autonomous driving control. arXiv preprint arXiv:1811.06817, 2018.
|
| 267 |
+
|
| 268 |
+
Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018.
|
| 269 |
+
|
| 270 |
+
Kevin P Murphy. Machine learning: a probabilistic perspective. MIT press, 2012.
|
| 271 |
+
|
| 272 |
+
Eric Nalisnick, Jose Miguel Hernandez-Lobato, and Padhraic Smyth. Dropout as a structured shrinkage prior. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 4712–4722, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/ nalisnick19a.html.
|
| 273 |
+
|
| 274 |
+
Radford M Neal. Bayesian learning for neural networks. Phd Thesis, 1996.
|
| 275 |
+
|
| 276 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011.
|
| 277 |
+
|
| 278 |
+
Roman Novak, Lechao Xiao, Yasaman Bahri, Jaehoon Lee, Greg Yang, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id=B1g30j0qF7.
|
| 279 |
+
|
| 280 |
+
K. Osawa, S. Swaroop, A. Jain, R. Eschenhagen, R. E. Turner, R. Yokota, and M. E. Khan. Practical deep learning with bayesian principles. In The 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada, Dec. 8-14 2019.
|
| 281 |
+
|
| 282 |
+
Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 8617–8629, 2018.
|
| 283 |
+
|
| 284 |
+
Ian Osband, Benjamin Van Roy, Daniel J. Russo, and Zheng Wen. Deep exploration via randomized value functions. Journal of Machine Learning Research, 20(124):1–62, 2019. URL http://jmlr.org/papers/ v20/18-339.html.
|
| 285 |
+
|
| 286 |
+
Georg Ostrovski, Marc G Bellemare, Aaron van den Oord, and R ¨ emi Munos. Count-based exploration with ´ neural density models. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2721–2730. JMLR. org, 2017.
|
| 287 |
+
|
| 288 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 289 |
+
|
| 290 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1278–1286, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/ rezende14.html.
|
| 291 |
+
|
| 292 |
+
Christian Robert. The Bayesian choice: from decision-theoretic foundations to computational implementation. Springer Science & Business Media, 2007.
|
| 293 |
+
|
| 294 |
+
Donald B Rubin. The bayesian bootstrap. The annals of statistics, pp. 130–134, 1981.
|
| 295 |
+
|
| 296 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1): 1929–1958, 2014.
|
| 297 |
+
|
| 298 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9446–9454, 2018.
|
| 299 |
+
|
| 300 |
+
Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 681–688, 2011.
|
| 301 |
+
|
| 302 |
+
Christopher KI Williams. Computing with infinite networks. In Advances in neural information processing systems, pp. 295–301, 1997.
|
| 303 |
+
|
| 304 |
+
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006.
|
| 305 |
+
|
| 306 |
+
Greg Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 307 |
+
|
| 308 |
+
# APPENDICES
|
| 309 |
+
|
| 310 |
+
APPENDIX A REPRODUCIBILITY AND DETAILS OF EXPERIMENTAL SETUP
|
| 311 |
+
|
| 312 |
+
APPENDIX A.1 SYNTHETIC DATA
|
| 313 |
+
|
| 314 |
+
For the 1D regression experiment on synthetic data (Fig 1), we used feed-forward neural networks with 2 layers of 128 units each and a 1-dimensional output layer. We used an ensemble size of 5. The network was trained on 20 points sampled from the negative domain of a sigmoid function and tested on 20 points sampled from the positive domain.
|
| 315 |
+
|
| 316 |
+
APPENDIX A.2 EXPERIMENTAL SETUP
|
| 317 |
+
|
| 318 |
+
Model architecture For the CIFAR-10 experiments, we adapted the setup from the cifar10-fast model.3 For the network predicting the mean, we used the exact same architecture as in this model. For the prior networks in our uncertainty estimators, the architecture for the prior network was the same as the mean network, but using a final linear layer instead of the softmax layer. We used squared error on that last layer to get the uncertainties. For the predictor networks in the uncertainty estimators, we added two additional layers at the end to make sure the prior functions are learnable (see Fig. 2).
|
| 319 |
+
|
| 320 |
+
We followed Burda et al. (2018) in choosing the output size to be $M = 5 1 2$ and using the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.0001. We optimized the initialization scale of our networks as a hyperparameter on the grid $\{ 0 . 0 1 , 0 . 1 , 1 . 0 , 2 . 0 , 1 0 . 0 \}$ and chose 2.0. We chose a scaling factor of $\beta = 1 . 0$ for the uncertainty bonus of the random priors and fixed it for all experiments.
|
| 321 |
+
|
| 322 |
+
Data For the CIFAR-10 experiment, we trained on the classes {bird, dog, frog, horse} and excluded {cat, deer, airplane, automobile, ship, truck}. For the small CIFAR-10 ablation experiment, we trained on 75 images sampled from the classes $\{ { \mathrm { s h i p } } , { \mathrm { t r u c k } } \}$ and excluded the remaining classes.
|
| 323 |
+
|
| 324 |
+
Training Error The training error was $0 . 5 7 \pm 0 . 2 0$ on the CIFAR experiment and $0 . 0 3 \pm 0 . 0 2$ on the sub-sampled ablation (the symbol $\pm$ denotes $90 \%$ confidence intervals).
|
| 325 |
+
|
| 326 |
+
Out-of-distribution classification For computing the areas under the receiver-operator characteristic curves (AUROC) in the OOD classification tables, we used the roc auc score function from the Python package sklearn (Pedregosa et al., 2011), using the predicted uncertainties as predicted label scores and binary labels for whether or not the samples were from the training set.
|
| 327 |
+
|
| 328 |
+
APPENDIX B ADDITIONAL RESULTS
|
| 329 |
+
|
| 330 |
+
# APPENDIX B.1 CONFIDENCE INTERVALS FOR AUROCS
|
| 331 |
+
|
| 332 |
+
We provide confidence intervals for AUROC measurements in Table 3.
|
| 333 |
+
|
| 334 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v. cat/deer</td><td>0.99 ± 0.002</td><td>0.83± 0.065</td><td>0.96± 0.008</td><td>0.81 ± 0.001</td></tr><tr><td>Train v. vehicles</td><td>1.00 ± 0.000</td><td>0.82 ± 0.070</td><td>0.96 ± 0.007</td><td>0.76 ± 0.001</td></tr><tr><td>Train v. excluded</td><td>1.00 ± 0.001</td><td>0.82 ± 0.069</td><td>0.96 ± 0.007</td><td>0.77 ± 0.002</td></tr><tr><td>Train v. SVHN</td><td>0.95 ± 0.013</td><td>0.88 ± 0.101</td><td>0.96 ± 0.009</td><td>0.86 ± 0.002</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 3: Out-of-distribution AUROC for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The errors are computed from ten samples each in the $B = 1$ case. The $\pm$ symbol denotes one standard error.
|
| 337 |
+
|
| 338 |
+
# APPENDIX B.2 OOD CLASSIFICATION ACCURACIES
|
| 339 |
+
|
| 340 |
+
In addition to AUROC results, we also provide accuracy figures on the same OOD tasks. The thresholding for classification was obtained by cross-validation.
|
| 341 |
+
|
| 342 |
+
They are in Table 4 and 5.
|
| 343 |
+
|
| 344 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.cat/deer</td><td>0.97 ± 0.001</td><td>0.83 ±0.008</td><td>0.97 ± 0.006</td><td>0.82±0.000</td></tr><tr><td>Train v.vehicles</td><td>0.99 ± 0.001</td><td>0.81 ± 0.008</td><td>0.96 ± 0.004</td><td>0.86 ± 0.000</td></tr><tr><td>Train v. excluded</td><td>0.98 ± 0.001</td><td>0.87 ± 0.022</td><td>0.97 ± 0.007</td><td>0.70 ± 0.002</td></tr><tr><td>Train v. SVHN</td><td>0.91 ± 0.006</td><td>0.91 ± 0.025</td><td>0.96 ± 0.008</td><td>0.78 ± 0.001</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv.cat/deer</td><td>0.98</td><td>0.88</td><td>0.96</td><td>0.82</td></tr><tr><td>Train v.vehicles</td><td>0.99</td><td>0.87</td><td>0.95</td><td>0.86</td></tr><tr><td>Train v. excluded</td><td>0.99</td><td>0.89</td><td>0.96</td><td>0.71</td></tr><tr><td>Train v. SVHN</td><td>0.92</td><td>0.88</td><td>0.96</td><td>0.78</td></tr></table>
|
| 345 |
+
|
| 346 |
+
Table 4: Out-of-distribution classification accuracy for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). These values augment the AUROC values reported in Table 1. The $\pm$ symbol denotes one standard error.
|
| 347 |
+
|
| 348 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.90</td><td>0.88</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.95</td><td>0.90</td><td>0.97</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv. excluded</td><td>1.00</td><td>0.95</td><td>0.89</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.97</td><td>0.95</td><td>0.96</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 5: Out-of-distribution accuracy for the same models as above (see Tab. 4) on subsampled data.
|
| 351 |
+
These values augment the AUROC values reported in Table 2.
|
| 352 |
+
|
| 353 |
+
APPENDIX B.3 SUPERVISED IN-DISTRIBUTION CLASSIFICATION ACCURACIES
|
| 354 |
+
|
| 355 |
+
<table><tr><td></td><td>RP*</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td>CIFAR-10</td><td>0.86</td><td>0.88</td><td>0.86</td><td>0.86</td></tr><tr><td>Subsampled CIFAR-10</td><td>0.82</td><td>0.81</td><td>0.82</td><td>0.75</td></tr><tr><td>CIFAR-100</td><td>0.90</td><td>0.91</td><td>0.90</td><td>0.89</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 6: In-distribution supervised classification accuracies on the respective test sets of the different data sets for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ ) and spatial concrete dropout (DR).
|
| 358 |
+
|
| 359 |
+
\*Since random priors do not have an intrinsic supervised prediction model, we used the predictions from the $\mathrm { D E + A T }$ model in all our experiments instead, setting $B = 1$ .
|
| 360 |
+
|
| 361 |
+
# APPENDIX B.4 CIFAR100 EXPERIMENT
|
| 362 |
+
|
| 363 |
+
As additional empirical support for our method, we ran experiments on another data set, namely CIFAR-100 (Krizhevsky et al., 2009). Again, we include 5 classes in the training set and exclude the remaining classes. The results are reported in the following (Figs. 8, 9; Tabs. 7, 8). They qualitatively and quantitatively support the same conclusions as our previous experiments.
|
| 364 |
+
|
| 365 |
+
# APPENDIX C BACKGROUND ON BAYES RISK
|
| 366 |
+
|
| 367 |
+
For completeness, we recall the definition of Bayes Risk. We are often interested in minimizing the Mean Squared Error $\mathrm { E } _ { f } \left[ ( f ( x _ { \star } ) - w ) ^ { 2 } \right]$ , where $x _ { \star }$ is a given test point and $w$ is a variable we are
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 8: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-100. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 - \operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 9: The relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B =$ 1, 5, 10 on samples from CIFAR-100. In well-calibrated models, accuracy increases as uncertainty declines.
|
| 374 |
+
|
| 375 |
+
allowed to adjust. A known result of Bayesian decision theory (Robert, 2007; Murphy, 2012) is that the minimizer of the MSE is given by the expected value of $f$ , i.e.
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\underset { w } { \arg \operatorname* { m i n } } \mathrm { E } _ { f } \left[ ( f ( x _ { \star } ) - w ) ^ { 2 } \right] = \mathrm { E } _ { f } \left[ f ( x _ { \star } ) \right] .
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Equation 12 holds for any stochastic process $f$ , including when $f$ is a posterior process obtained by conditioning on some dataset. A consequence of equation 12 is that it is impossible to obtain a MSE lower than the one obtained by computing the posterior mean of $f$ .
|
| 382 |
+
|
| 383 |
+
# APPENDIX D GAUSSIAN PROCESSES
|
| 384 |
+
|
| 385 |
+
A stochastic process is Gaussian (Williams & Rasmussen, 2006), if all its finite-dimensional distributions are Gaussian. The main advantage of GPs is that the posterior process can be expressed in a tractable way. GPs are often used for regression, where we are learning an unknown function4 $\phi : \mathbb { R } ^ { K } \mathbb { R }$ from noisy observations. Since a Gaussian distribution is completely identified by its first two moments, a GP can be defined by a mean function and a covariance function. Formally, the notation $\mathcal { G P } ( \mu , k )$ refers to a GP with with mean function $\mu : \mathbb { R } ^ { K } \mathbb { R }$ , a positive-definite kernel function $\boldsymbol { k } : \dot { \mathbb { R } ^ { K } } \times \mathbb { R } ^ { K } \mathbb { R }$ . GPs can be used to model two kinds of uncertainty: epistemic uncertainty, which reflects lack of knowledge about unobserved values of $\phi$ and aleatoric uncertainty, which reflects measurement noise. When performing regression, we start with a zero-mean prior $\mathcal { G P } ( 0 , k )$ and then observe $N$ training points $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ and labels $y = \{ y _ { i } \} _ { i = 1 , \dots , N }$ where $y _ { i } = \phi ( x _ { i } ) + \epsilon _ { i }$ . Here, the i.i.d. random variables $\epsilon _ { i } \sim \mathcal { N } ( 0 , \sigma _ { A } ^ { 2 } )$ model the aleatoric noise. We obtain the posterior process on $\mathcal { G P } ( \mu _ { X y } , k _ { X } )$ . For GPs, the mean and covariance of the posterior GP on $y$ evaluated at $x _ { \star }$ can be expressed as
|
| 386 |
+
|
| 387 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RP</td><td rowspan=1 colspan=1>DE</td><td rowspan=1 colspan=1>DE+AT</td><td rowspan=1 colspan=1>DR</td></tr><tr><td rowspan=1 colspan=5>B=1</td></tr><tr><td rowspan=1 colspan=1>Train v. excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.00± 0.0001.00 ± 0.000</td><td rowspan=1 colspan=1>0.93± 0.0030.96 ± 0.004</td><td rowspan=1 colspan=1>0.98 ± 0.0010.99 ± 0.001</td><td rowspan=1 colspan=1>0.88±0.0020.82 ±0.002</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Trainv.excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.001.00</td><td rowspan=1 colspan=1>0.960.99</td><td rowspan=1 colspan=1>0.991.00</td><td rowspan=1 colspan=1>0.900.82</td></tr></table>
|
| 388 |
+
|
| 389 |
+
Table 7: Out-of-distribution classification AUROCs on CIFAR-100 for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The $\pm$ symbol denotes one standard error.
|
| 390 |
+
Table 8: Out-of-distribution classification accuracy on CIFAR-100 for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The $\pm$ symbol denotes one standard error. These values augment the AUROC values reported in Table 7.
|
| 391 |
+
|
| 392 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded Train v. SVHN</td><td>1.00 ± 0.001 0.97 ± 0.003</td><td>0.91 ±0.002 0.95 ± 0.003</td><td>0.97 ± 0.001 0.99 ± 0.001</td><td>0.82±0.003 0.74 ± 0.003</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv.excluded</td><td>1.00</td><td>0.94</td><td>0.98</td><td>0.83</td></tr><tr><td>Train v. SVHN</td><td>0.98</td><td>0.98</td><td>0.99</td><td>0.74</td></tr></table>
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { r } { \mu _ { X y } ( x _ { \star } ) = k _ { \star } ^ { \top } ( K + \sigma _ { A } ^ { 2 } I ) ^ { - 1 } y \quad \mathrm { a n d } \qquad } \\ { \sigma _ { X } ^ { 2 } ( x _ { \star } ) \triangleq k _ { X } ( x _ { \star } , x _ { \star } ) + \sigma _ { A } ^ { 2 } = k _ { \star \star } - k _ { \star } ^ { \top } ( K + \sigma _ { A } ^ { 2 } I ) ^ { - 1 } k _ { \star } + \sigma _ { A } ^ { 2 } . } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
In particular, the posterior covariance does not depend on $y$ . In the formula above, we use the kernel matrix $K \in \mathbb { R } ^ { N } \times \mathbb { R } ^ { N }$ defined as $K _ { i j } = k ( x _ { i } , x _ { j } )$ , where $x _ { i }$ and $x _ { j }$ are in the training set. We also use the notation $\boldsymbol { k } _ { \star } \in \mathbb { R } ^ { N }$ for the vector of train-test correlations $\{ k _ { \star } \} _ { i } = k ( x _ { i } , x ^ { \star } )$ , where $x _ { i }$ is in the training set and $k ( x ^ { \star } , x ^ { \star } )$ is similarly defined. The shorthand $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ introduced in equation 14 denotes the posterior variance at a single point.
|
| 399 |
+
|
| 400 |
+
# APPENDIX E LIST OF SYMBOLS DENOTING VARIANCE
|
| 401 |
+
|
| 402 |
+
Below, we give a list of symbols used for variance of various random variables.
|
| 403 |
+
|
| 404 |
+
<table><tr><td>0 .2 O X 8</td><td>posterior variance of stochastic process posterior variance of Gaussian process prior variance of stochastic process sample-based estimate of prior GP variance combined uncertainty estimate (see equation 1) sample-based mean part of uncertainty estimate (see equation 2) Ef[o2]</td></tr></table>
|
| 405 |
+
|
| 406 |
+
# APPENDIX F PROOFS
|
| 407 |
+
|
| 408 |
+
We now give formal proofs for the results in the paper.
|
| 409 |
+
|
| 410 |
+
# APPENDIX F.1 PROOFS RELATING TO CONSERVATISM
|
| 411 |
+
|
| 412 |
+
Lemma 1. For any function $h : \mathbb { R } ^ { N \times ( K + 1 ) } \mathbb { R } ^ { M }$ , for any test point $\boldsymbol { x } _ { \star } ~ \in ~ \mathbb { R } ^ { K }$ and for any stochastic process $\{ f ( x ) \} _ { x \in \mathbb { R } ^ { K } }$ with all second moments finite and exchangeable outputs
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] . } \end{array}
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Proof. We prove the statement by re-writing the expression on the left.
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\begin{array} { r l r } { \bar { \sigma } _ { \mu } ^ { 2 } ( { \boldsymbol x } _ { \star } ) = \frac { 1 } { M } { \mathrm { ~ E } } _ { f } ( { \boldsymbol x } ) , f ( | | f ( { \boldsymbol x } _ { \star } ) - h _ { X } f ( { \boldsymbol x } _ { \star } ) | | ^ { 2 } ] } & { \mathrm { ( I 5 ) } } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
Here, the equality in (16) holds by definition of conditional probability. The equality in (19) holds by definition of posterior mean and the equality 21 follows by assumption that the process has exchangeable outputs. While this argument follows a similar pattern to a standard result about Bayesian Risk (see Appendix Appendix C), it is not identical because the function $h _ { X f }$ depends on $f$ . □
|
| 425 |
+
|
| 426 |
+
Proposition 1 (Strict Conservatism in Expectation). Assume that $f$ is a GP. Then for any function $h : \bar { \mathbb { R } } ^ { N \times K } \to \bar { \mathbb { R } } ^ { M }$ , we have
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \sigma _ { X } ^ { 2 } ( x _ { \star } ) + \underbrace { { \mathrm E } _ { f ( X ) } \left[ \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] } _ { \geq 0 } .
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
Moreover, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ .
|
| 433 |
+
|
| 434 |
+
Proof. We instantiate Lemma 1 by setting $f$ to be a GP. By equation 14, the posterior covariance of a GP does not depend on the target values, i.e. $\sigma _ { X f } ^ { 2 } ( x _ { \star } ) \dot { } = \dot { \sigma } _ { X } ^ { 2 } ( x _ { \star } )$ . The first part of the result can be shown by pulling $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ out of the expectation. Moreover, since $\| \cdot \|$ is a norm and hence positive semi-definite, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ . □
|
| 435 |
+
|
| 436 |
+
Lemma 3. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB.
|
| 437 |
+
With probability $1 - \delta$ , we have $\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \ge \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) } \end{array}$ .
|
| 438 |
+
|
| 439 |
+
Proof. The proof is standard, but we state it in our notation for completeness. Applying Chebyshev’s inequality to the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ , we have that $\begin{array} { r } { \mathrm { P r o b } \left( | \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) | \ge \frac { 1 } { \sqrt { \delta } } v _ { \mathrm { U B } } \right) \le \delta , } \end{array}$ , implying the statement. □
|
| 440 |
+
|
| 441 |
+
Corollary 1 (Strict Conservatism for Finite Bootstraps). Assume that $f$ is a GP. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB. Then with probability $1 - \delta$ , for any function $h : \mathbb { R } ^ { \dot { N } \times K } \to \mathbb { R } ^ { M }$ , we have
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \geq \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) . } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Proof. Combine Lemma 3 and Proposition 1.
|
| 448 |
+
|
| 449 |
+
Lemma 2. Assume that the GP $\{ f ( x ) \}$ is zero mean with exchangeable outputs and the function $h _ { X f }$ takes values in $[ - U , U ] ^ { M }$ . Assume that permuting the outputs of $f$ produces the same permutation in the outputs of $h _ { X f }$ . With probability $1 - \delta$ , we have
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\operatorname { V a r } _ { f _ { 1 } , \dots , f _ { B } } \left[ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq v _ { U B } ,
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where vUB is expressible in terms of observable quantities.
|
| 456 |
+
|
| 457 |
+
Proof. We seek to decompose the variance of $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ into the part that comes from the prior and the part that comes from the fitted function $h _ { X f ^ { m } }$ .
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\begin{array} { r l } & { \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { D } } \big [ \widehat { \mathcal { O } } _ { \sharp } ^ { \sharp } ( x , x ) \big ] } \\ & { = \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { D } } \bigg [ \sum _ { i = 1 } ^ { B } \frac { 1 } { M L ^ { D } } \big \lVert f ( x , x ) - h _ { X , f _ { i } } ( x , x ) \big \rVert ^ { 2 } \bigg ] } \\ & { = \frac { 1 } { R } \operatorname { V o r } _ { f } \Big [ \frac { 1 } { M } \big \lVert f ( x , x ) - h _ { X , f _ { i } } ( x , x ) \big \rVert ^ { 2 } \Big ] } \\ & { = \frac { 1 } { B } \frac { 1 } { M } \operatorname { V a r } _ { f } \Big [ \big ( \sum _ { m = 1 } ^ { M } \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \Big ] } \\ & { = \frac { 1 } { B } \frac { 1 } { M ^ { 2 } } \sum _ { m = 1 } ^ { M } \sum _ { i = 1 } ^ { M } \operatorname { C o r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } , ( f ^ { t } ( x , x ) - h _ { X , f ^ { i } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { \leq \frac { 1 } { B } \frac { 1 } { M ^ { 2 } } M ^ { 2 } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { \leq \frac { 1 } { B } \operatorname { E a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 3 } \big ] } \\ & = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ X , f \end{array}
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Here, line 27 holds by exchangeability of outputs and the Cauchy-Schwarz inequality.
|
| 464 |
+
|
| 465 |
+
Since $h _ { X f ^ { m } } ( x _ { \star } )$ is has support in $[ - U , U ]$ , we have
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\begin{array} { r } { \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } ) \right] \leq U ^ { 2 } , \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) \right) ^ { 4 } ) \right] \leq U ^ { 4 } , \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) \right) ^ { 6 } \right) \right] \leq U ^ { 6 } . } \end{array}
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
Moreover, since $f ( x _ { \star } )$ is Gaussian and zero mean, we can write out the moments explicitly.
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\begin{array} { r } { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } ) \right] = 3 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] ) ^ { 2 } } \\ { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 6 } ) \right] = 1 5 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] ) ^ { 3 } } \end{array}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
Since $f ( x _ { \star } )$ is Gaussian, we can use a sample-based estimate of the prior variance and obtain an probabilistic confidence interval. In particular, we know that $\begin{array} { r } { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] \leq \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ with probability $1 - \delta$ , where $\chi _ { I } ^ { 2 }$ denotes the inverse CDF of the Chi-Squared distribution with $B _ { 0 } - 1$ degrees of freedom. We denote this upper bound with $\begin{array} { r } { w _ { \mathrm { U B } } = \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ .
|
| 478 |
+
|
| 479 |
+
We proceed by bounding the individual terms in equation 30 separately.
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\begin{array} { r l } & { \quad \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } \right] = 3 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } \right] ) ^ { 2 } } \\ & { - \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 3 } h _ { X f ^ { m } } ( x _ { \star } ) \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 6 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } \right] } } \\ & { \quad \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 4 } \right] } } \\ & { - \mathrm { E } _ { f } \left[ f ^ { m } ( x _ { \star } ) ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 3 } \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 6 } \right] } } \end{array}
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
Combining the above, equation 30 and the bounds on individual moments in equations 31 and 32, we obtain
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array} { r } { \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { B } } \left[ \widehat \sigma _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq \underbrace { \frac { 1 } { B } \left( 3 w _ { \mathrm { U B } } ^ { 2 } + 4 \sqrt { 1 5 w _ { \mathrm { U B } } ^ { 3 } U ^ { 2 } } + 6 \sqrt { 3 w _ { \mathrm { U B } } ^ { 2 } U ^ { 4 } } + 4 \sqrt { w _ { \mathrm { U B } } U ^ { 6 } } + U ^ { 4 } \right) } _ { v _ { \mathrm { U B } } } . } \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
Here, $\begin{array} { r } { w _ { \mathrm { U B } } = \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ , $\hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } )$ is a sample-based estimate of the prior variance obtained with $B _ { 0 }$ samples, where $\chi _ { I } ^ { 2 }$ denotes the inverse CDF of the Chi-Squared distribution with $B _ { 0 } - 1$ degrees of freedom.
|
| 492 |
+
|
| 493 |
+
# APPENDIX F.2 PROOFS RELATING TO CONCENTRATION
|
| 494 |
+
|
| 495 |
+
We now proceed to the proofs showing concentration. We begin by formally defining a class of predictor networks.
|
| 496 |
+
|
| 497 |
+
Definition 1 (Class $\mathcal { H } _ { U }$ of Lipschitz networks). Consider functions $h ~ : ~ \mathbb { R } ^ { K } ~ \to ~ \mathbb { R } ^ { M }$ . Let $j , j ^ { \prime } \ = \ 1 , \ldots , M$ , index the outputs of the function. We define $\mathcal { H } _ { U }$ so that each $\textit { h } \in \ \mathcal { H } _ { U }$ has the following properties for each ${ j , j ^ { \prime } }$ . $\mathbf { ( P 1 }$ ) $h _ { j }$ is Lipschitz continuous with constant $L ,$ i.e. $\| h _ { j } ( x ) - h _ { j } ( x ^ { \prime } ) \| _ { 2 } \leq L \| x - x ^ { * } \| _ { 2 }$ for all $x , x ^ { \prime }$ with $\| x \| _ { \infty } \leq 1$ and $\| x ^ { \prime } \| _ { \infty } \leq 1$ , $( \mathbf { P } 2 )$ outputs are exchangeable, i.e. $\{ h _ { j } : h \in \mathcal { H } _ { U } \} = \{ h _ { j ^ { \prime } } : h \in \mathcal { H } _ { U } \}$ , (P3) the class is symmetric around zero, i.e. $h _ { j } \ \in \ \{ h _ { j } \ : \ \bar { h } \ \in \ \mathcal { H } _ { U } \}$ implies $- \bar { h } _ { j } \in \lbrace h _ { j } : h \in \rbrace { \mathcal { H } } _ { U } \rbrace$ . (P4) $h _ { j }$ is bounded, i.e. $\operatorname* { m a x } _ { \| x \| _ { \infty } \leq 1 } | h _ { j } ( x ) | \leq U$ .
|
| 498 |
+
|
| 499 |
+
While the conditions in Definition 1 look complicated, they are in fact easy to check for predictor networks that follow the architecture in Figure 2. In particular, Lipschitz continuity $( \mathbf { P 1 } )$ has to hold in practice because its absence would indicate extreme sensitivity to input perturbations. Output exchangeability $( \mathbf { P } 2 )$ holds since reordering the outputs does not change our architecture. Symmetry around zero $( { \bf P } { \bf 3 } )$ holds by flipping the sign in the last network layer. Boundedness $\mathbf { ( P 4 ) }$ is easy to ensure by clipping outputs. In the following Lemma, we obtain a bound on the expected uncertainty.
|
| 500 |
+
|
| 501 |
+
Lemma 4. Consider a target function $f : \mathbb { R } ^ { K } \to \mathbb { R } ^ { M }$ , where $j = 1 , \dots , M$ , with the domain restricted to $\| x \| _ { \infty } \leq 1$ . Introduce a constant $U$ such that $\operatorname* { m a x } _ { \| x \| \infty \leq 1 } | f _ { j } ( x ) | \leq U$ . Denote the data distribution with support on $\{ x : \| x \| _ { \infty } \leq 1 \}$ as $\mathcal { D }$ . Moreover, assume $K \geq 3 .$ . For $h _ { X f } \in \mathcal { H } _ { U }$ , with probability $1 - \delta$ we have
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\begin{array} { r } { \mathrm { E } _ { x _ { \star } \sim { D } } [ \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } ] \le \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } + L U { \cal O } \Big ( \frac { 1 } { \sqrt [ { k _ { \sqrt { N } } } ] { \frac { \log ( 1 / \delta ) } { N } } } \Big ) . } \end{array}
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
Proof. The proof uses standard Rademacher tools. To avoid confusion across several conventions, we explicitly define the Rademacher complexity of a function class $\mathcal { G }$ as:
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\begin{array} { r } { \hat { \mathfrak { R } } _ { N } ( \mathcal { G } ) \triangleq \mathrm { E } _ { u _ { i } } \left[ \operatorname* { s u p } _ { g \in \mathcal { G } } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } u _ { i } g ( x _ { i } ) \right] = \mathrm { E } _ { u _ { i } } \left[ \operatorname* { s u p } _ { g \in \mathcal { G } } \frac { 1 } { N } \left| \sum _ { i = 1 } ^ { N } u _ { i } ^ { j } g ( x _ { i } ) \right| \right] . } \end{array}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Here, the random variables $u _ { i }$ are sampled i.i.d. using a discrete distribution with $\mathrm { P r o b } ( u _ { i } ~ =$ $- 1 ) \ = \ \mathrm { P r o b } ( u _ { i } \ = \ 1 ) \ = \ { \textstyle { \frac { 1 } { 2 } } }$ and the the second equality follows by using property (P3). We start by applying the generic Rademacher bound (Mohri et al., 2018) to the function class $\mathcal { M } =$ $\begin{array} { r } { \{ x _ { 1 } , \ldots , \overset { \left. \right.} { x _ { N } } , t _ { 1 } \ldots , t _ { N } \frac { 1 } { U ^ { 2 } } \frac { 1 } { M } \| t _ { i } - h ( x _ { i } ) \| ^ { 2 } , h \in \mathcal { H } _ { U } \} . } \end{array}$ , which contains the possible errors of the predictor.
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\begin{array} { r l } & { \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \frac { 1 } { B ^ { 2 } } \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } ] } \\ & { \phantom { \frac { 1 } { \theta } } \leq \frac { 1 } { M N } \frac { 1 } { B ^ { 2 } } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } + \widehat { \mathfrak { R } } _ { N } ( \mathcal { M } ) + O \left( \sqrt { \frac { \log ( 1 / \delta ) } { N } } \right) . } \end{array}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
We now introduce the function class $\begin{array} { r } { \mathcal { M } ^ { \prime } = \{ x _ { 1 } , \ldots , x _ { N } , t _ { 1 } \ldots , t _ { N } \frac { 1 } { B ^ { 2 } } ( t _ { i } ^ { j } - h ^ { j } ( x _ { i } ) ) ^ { 2 } , h \in \mathcal { H } _ { U } \} } \end{array}$ which models the per-output squared error. Because of property (P2), ${ \bar { \mathcal { M } } } ^ { \prime }$ does not depend on the output index $j$ . By pulling out the sum outside the supremum in equation 35, we get
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\hat { \Re } _ { N } ( \mathcal { M } ) \leq \hat { \Re } _ { N } ( \mathcal { M } ^ { \prime } ) .
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
by Talagrand’s Lemma (Mohri et al., 2018; Duchi, 2009), we also have
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\hat { \mathfrak { R } } _ { N } ( \mathcal { M } ^ { \prime } ) \leq 4 \hat { \mathfrak { R } } _ { N } ( \mathcal { H } _ { 1 } ) .
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
Here, $\mathcal { H } _ { 1 } \ = \ \{ \frac { 1 } { \pi } h ^ { j } \ : \ h \in \ \mathcal { H } _ { U } \}$ . By property $( \mathbf { P 1 } )$ , functions in $\mathcal { H } _ { 1 }$ are Lipschitz continuous with constant $L / U$ . Instantiating a known bound for Lipschitz-continuous functions (Luxburg $\&$ Bousquet, 2004, Theorem 18 and Example 4), and using the assumption $K \geq 3$ , we get $\hat { \mathfrak { R } } _ { N } ( \varkappa _ { 1 } ) \leq$ $\begin{array} { r } { \frac { L } { U } O \left( \frac { 1 } { \sqrt [ K ] { N } } \right) } \end{array}$ . The Lemma follows by combining this with equation 37 and equation 38, plugging into equation 36 and re-scaling by $U ^ { 2 }$ . □
|
| 532 |
+
|
| 533 |
+
Lemma 4 allowed us to relate the error on the training set to the expected error on the test set. It also shows that the two will be closer for small values of the Lipschitz constant $L$ . We now use this Lemma to show our main concentration result (Proposition 2).
|
| 534 |
+
|
| 535 |
+
Proposition 2. If the training converges, i.e. the training loss $\begin{array} { r } { \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } = \sigma _ { A } ^ { 2 } } \end{array}$ for arbitrarily large training sets, then assuming the predictors $h _ { X f }$ are bounded and Lipschitz continuous with constant $L ,$ , then under technical conditions the uncertainties concentrate, i.e. $\hat { \sigma } ^ { 2 } ( x _ { \star } ) 0$ as $N \to \infty$ and $B \infty$ with probability $^ { l }$ .
|
| 536 |
+
|
| 537 |
+
Proof. We are assuming the technical conditions of Lemma 4. Instantiating Lemma 4, setting the training loss to $\sigma _ { A } ^ { 2 }$ in the RHS of equation 34 and letting $N \infty$ , we obtain the following with probability 1:
|
| 538 |
+
|
| 539 |
+
$$
|
| 540 |
+
\operatorname * { l i m } _ { N \infty } \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) ] = \sigma _ { A } ^ { 2 } .
|
| 541 |
+
$$
|
| 542 |
+
|
| 543 |
+
This implies:
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\operatorname* { l i m } _ { N \infty } \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \operatorname* { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) ] = 0 .
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
From the continuity of $f$ and $h _ { X f }$ we have that $\hat { \sigma } _ { \mu } ^ { 2 }$ is continuous in $x _ { \star }$ . Together with the property that the expression under the expectation is non-negative, this gives that for every $x _ { \star }$ .
|
| 550 |
+
|
| 551 |
+
$$
|
| 552 |
+
\operatorname * { l i m } _ { N \infty } \operatorname * { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) = 0 .
|
| 553 |
+
$$
|
| 554 |
+
|
| 555 |
+
Since the right-hand side does not depend on $B$ , we also have
|
| 556 |
+
|
| 557 |
+
$$
|
| 558 |
+
\operatorname * { l i m } _ { B \to \infty } \operatorname * { l i m } _ { N \to \infty } \operatorname * { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) = 0 .
|
| 559 |
+
$$
|
| 560 |
+
|
| 561 |
+
From the definition of $\hat { v } _ { \sigma }$ , we have that
|
| 562 |
+
|
| 563 |
+
$$
|
| 564 |
+
\operatorname * { l i m } _ { B \infty } \operatorname * { l i m } _ { N \infty } \hat { v } _ { \sigma } = 0 .
|
| 565 |
+
$$
|
| 566 |
+
|
| 567 |
+
We show the Lemma by combining equation 42 and equation 43 with equation 1.
|
md/train/BJuysoFeg/BJuysoFeg.md
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REVISITING BATCH NORMALIZATION FORPRACTICAL DOMAIN ADAPTATION
|
| 2 |
+
|
| 3 |
+
Yanghao $\mathbf { L i } ^ { \dagger }$ , Naiyan Wang‡, Jianping $\mathbf { S h i } ^ { \circ }$ , Jiaying $\mathbf { L } \mathbf { i } \mathbf { u } ^ { \dagger }$ , Xiaodi Hou‡
|
| 4 |
+
|
| 5 |
+
† Institute of Computer Science and Technology, Peking University
|
| 6 |
+
‡ TuSimple SenseTime
|
| 7 |
+
lyttonhao@pku.edu.cn winsty@gmail.com shijianping5000@gmail.com
|
| 8 |
+
liujiaying@pku.edu.cn xiaodi.hou@gmail.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Deep neural networks (DNN) have shown unprecedented success in various computer vision applications such as image classification and object detection. However, it is still a common annoyance during the training phase, that one has to prepare at least thousands of labeled images to fine-tune a network to a specific domain. Recent study (Tommasi et al., 2015) shows that a DNN has strong dependency towards the training dataset, and the learned features cannot be easily transferred to a different but relevant task without fine-tuning. In this paper, we propose a simple yet powerful remedy, called Adaptive Batch Normalization (AdaBN) to increase the generalization ability of a DNN. By modulating the statistics from the source domain to the target domain in all Batch Normalization layers across the network, our approach achieves deep adaptation effect for domain adaptation tasks. In contrary to other deep learning domain adaptation methods, our method does not require additional components, and is parameter-free. It archives stateof-the-art performance despite its surprising simplicity. Furthermore, we demonstrate that our method is complementary with other existing methods. Combining AdaBN with existing domain adaptation treatments may further improve model performance.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Training a DNN for a new image recognition task is expensive. It requires a large amount of labeled training images that are not easy to obtain. One common practice is to use labeled data from other related source such as a different public dataset, or harvesting images by keywords from a search engine. Because 1) the distributions of the source domains (third party datasets or Internet images) are often different from the target domain (testing images); and 2) DNN is particularly good at capturing dataset bias in its internal representation (Torralba & Efros, 2011), which eventually leads to overfitting, imperfectly paired training and testing sets usually leads to inferior performance.
|
| 17 |
+
|
| 18 |
+
Known as domain adaptation, the effort to bridge the gap between training and testing data distributions has been discussed several times under the context of deep learning (Tzeng et al., 2014; Long et al., 2015; Tzeng et al., 2015; Ganin & Lempitsky, 2015). To make the connection between the domain of training and the domain of testing, most of these methods require additional optimization steps and extra parameters. Such additional computational burden could greatly complicate the training of a DNN which is already intimidating enough for most people.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a simple yet effective approach called AdaBN for batch normalized DNN domain adaptation. We hypothesize that the label related knowledge is stored in the weight matrix of each layer, whereas domain related knowledge is represented by the statistics of the Batch Normalization (BN) (Ioffe & Szegedy, 2015) layer. Therefore, we can easily transfer the trained model to a new domain by modulating the statistics in the BN layer. This approach is straightforward to implement, has zero parameter to tune, and requires minimal computational resources. Moreover, our AdaBN is ready to be extended to more sophisticated scenarios such as multi-source domain adaptation and semi-supervised settings. Fig. 1 illustrates the flowchart of AdaBN. To summarize, our contributions are as follows:
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Illustration of the proposed method. For each convolutional or fully connected layer, we use different bias/variance terms to perform batch normalization for the training domain and the test domain. The domain specific normalization mitigates the domain shift issue.
|
| 24 |
+
|
| 25 |
+
1. We propose a novel domain adaptation technique called Adaptive Batch Normalization (AdaBN). We show that AdaBN can naturally dissociate bias and variance of a dataset, which is ideal for domain adaptation tasks.
|
| 26 |
+
2. We validate the effectiveness of our approach on standard benchmarks for both single source and multi-source domain adaptation. Our method outperforms the state-of-the-art methods.
|
| 27 |
+
3. We conduct experiments on the cloud detection for remote sensing images to further demonstrate the effectiveness of our approach in practical use.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Domain transfer in visual recognition tasks has gained increasing attention in recent literature (Beijbom, 2012; Patel et al., 2015). Often referred to as covariate shift (Shimodaira, 2000) or dataset bias (Torralba & Efros, 2011), this problem poses a great challenge to the generalization ability of a learned model. One key component of domain transfer is to model the difference between source and target distributions. In Khosla et al. (2012), the authors assign each dataset with an explicit bias vector, and train one discriminative model to handle multiple classification problems with different bias terms. A more explicit way to compute dataset difference is based on Maximum Mean Discrepancy (MMD) (Gretton et al., 2012). This approach projects each data sample into a Reproducing Kernel Hilbert Space, and then computes the difference of sample means. To reduce dataset discrepancies, many methods are proposed, including sample selections (Huang et al., 2006; Gong et al., 2013), explicit projection learning (Pan et al., 2011; Gopalan et al., 2011; Baktashmotlagh et al., 2013) and principal axes alignment (Fernando et al., 2013; Gong et al., 2012; Aljundi et al., 2015).
|
| 32 |
+
|
| 33 |
+
All of these methods face the same challenge of constructing the domain transfer function – a highdimensional non-linear function. Due to computational constraints, most of the proposed transfer functions are in the category of simple shallow projections, which are typically composed of kernel transformations and linear mapping functions.
|
| 34 |
+
|
| 35 |
+
In the field of deep learning, feature transferability across different domains is a tantalizing yet generally unsolved topic (Yosinski et al., 2014; Tommasi et al., 2015). To transfer the learned representations to a new dataset, pre-training plus fine-tuning (Donahue et al., 2014) have become de facto procedures. However, adaptation by fine-tuning is far from perfect. It requires a considerable amount of labeled data from the target domain, and non-negligible computational resources to retrain the whole network.
|
| 36 |
+
|
| 37 |
+
A series of progress has been made in DNN to facilitate domain transfer. Early works of domain adaptation either focus on reordering fine-tuning samples (Chopra et al., 2013), or regularizing MMD (Gretton et al., 2012) in a shallow network (Ghifary et al., 2014). It is only until recently that the problem is directly attacked under the setting of classification of unlabeled target domain using modern convolutional neural network (CNN) architecture. DDC (Tzeng et al., 2014) used the classical MMD loss to regularize the representation in the last layer of CNN. DAN (Long et al., 2015) further extended the method to multiple kernel MMD and multiple layer adaptation. Besides adapting features using MMD, RTN (Long et al., 2016) also added a gated residual layer for classifier adaptation. RevGrad (Ganin & Lempitsky, 2015) devised a gradient reversal layer to compensate the back-propagated gradients that are domain specific. Recently, by explicitly modeling both private and shared components of the domain representations in the network, Bousmalis et al. (2016) proposed a Domain Separation Network to extract better domain-invariant features.
|
| 38 |
+
|
| 39 |
+
Another related work is CORAL (Sun et al., 2016). This model focuses on the last layer of CNN. CORAL whitens the data in source domain, and then re-correlates the source domain features to target domain. This operation aligns the second order statistics of source domain and target domain distributions. Surprisingly, such simple approach yields state-of-the-arts results in various text classification and visual recognition tasks. Recently, Deep CORAL (Sun & Saenko, 2016) also extends the method into DNN by incorporating a CORAL loss.
|
| 40 |
+
|
| 41 |
+
# 2.1 BATCH NORMALIZATION
|
| 42 |
+
|
| 43 |
+
In this section, we briefly review Batch Normalization (BN) (Ioffe & Szegedy, 2015) which is closely related to our AdaBN. The BN layer is originally designed to alleviate the issue of internal covariate shifting – a common problem while training a very deep neural network. It first standardizes each feature in a mini-batch, and then learns a common slope and bias for each mini-batch. Formally, given the input to a BN layer $\mathbf { X } \in \mathbb { R } ^ { n \times p }$ , where $n$ denotes the batch size, and $p$ is the feature dimension, BN layer transforms a feature $j \in \{ 1 \ldots p \}$ into:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l } & { \hat { x } _ { j } = \frac { x _ { j } - \mathbb { E } \left[ \mathbf { X } _ { \cdot j } \right] } { \sqrt { \operatorname { V a r } [ \mathbf { X } _ { \cdot j } ] } } , } \\ & { y _ { j } = \gamma _ { j } \hat { x } _ { j } + \beta _ { j } , } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $x _ { j }$ and $y _ { j }$ are the input/output scalars of one neuron response in one data sample; $\mathbf { X } _ { \cdot j }$ denotes the $j ^ { t h }$ column of the input data; and $\gamma _ { j }$ and $\beta _ { j }$ are parameters to be learned. This transformation guarantees that the input distribution of each layer remains unchanged across different mini-batches. For Stochastic Gradient Descent (SGD) optimization, a stable input distribution could greatly facilitate model convergence, leading to much faster training speed for CNN. Moreover, if training data are shuffled at each epoch, the same training sample will be applied with different transformations, or in other words, more comprehensively augmented throughout the training. During the testing phase, the global statistics of all training samples is used to normalize every mini-batch of test data.
|
| 50 |
+
|
| 51 |
+
Extensive experiments have shown that Batch Normalization significantly reduces the number of iteration to converge, and improves the final performance at the same time. BN layer has become a standard component in recent top-performing CNN architectures, such as deep residual network (He et al., 2016), and Inception V3 (Szegedy et al., 2015).
|
| 52 |
+
|
| 53 |
+
# 3 THE MODEL
|
| 54 |
+
|
| 55 |
+
In Sec. 3.1, we first analyze the domain shift in deep neural network, and reveal two key observations. Then in Sec. 3.2, we introduce our Adaptive Batch Normalization (AdaBN) method based on these observations.
|
| 56 |
+
|
| 57 |
+
# 3.1 A PILOT EXPERIMENT
|
| 58 |
+
|
| 59 |
+
The Batch Normalization (BN) technique is originally proposed to help SGD optimization by aligning the distribution of training data. From this perspective, it is interesting to examine the BN parameters (batch-wise mean and variance) over different dataset at different layers of the network.
|
| 60 |
+
|
| 61 |
+
In this pilot experiment, we use MXNet implementation (Chen et al., 2016b) of the Inception-BN model (Ioffe & Szegedy, 2015) pre-trained on ImageNet classification task (Russakovsky et al., 2015) as our baseline DNN model. Our image data are drawn from (Bergamo & Torresani, 2010), which contains the same classes of images from both Caltech-256 dataset (Griffin et al., 2007) and Bing image search results. For each mini-batch sampled from one dataset, we concatenate the mean and variance of all neurons from one layer to form a feature vector. Using linear SVM, we can almost perfectly classify whether the mini-batch feature vector is from Caltech-256 or Bing dataset. Fig. 2 visualizes the distributions of mini-batch feature vectors from two datasets in 2D. It is clear that BN statistics from different domains are separated into clusters.
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
(a) Shallow layer distributions
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
(b) Deep layer distributions
|
| 68 |
+
Figure 2: t-SNE (Van der Maaten & Hinton, 2008) visualization of the mini-batch BN feature vector distributions in both shallow and deep layers, across different datasets. Each point represents the BN statistics in one mini-batch. Red dots come from Bing domain, while the blue ones are from Caltech-256 domain. The size of each mini-batch is 64.
|
| 69 |
+
|
| 70 |
+
This pilot experiment suggests:
|
| 71 |
+
|
| 72 |
+
1. Both shallow layers and deep layers of the DNN are influenced by domain shift. Domain adaptation by manipulating the output layer alone is not enough.
|
| 73 |
+
2. The statistics of BN layer contain the traits of the data domain.
|
| 74 |
+
|
| 75 |
+
Both observations motivate us to adapt the representation across different domains by BN layer.
|
| 76 |
+
|
| 77 |
+
# 3.2 ADAPTIVE BATCH NORMALIZATION
|
| 78 |
+
|
| 79 |
+
Given the pre-trained DNN model and a target domain, our Adaptive Batch Normalization algorithm is as follows1:
|
| 80 |
+
|
| 81 |
+
<table><tr><td>Algorithm1 Adaptive Batch Normalization (AdaBN)</td></tr><tr><td>for neuron jinDNN do Concatenate neuron responses on all images of tar-</td></tr><tr><td>get domain t: xj =[...,xj(m),...] Compute the mean and variance of the target do-</td></tr><tr><td>main: μ =E(x),=√Var(x).</td></tr><tr><td>end for</td></tr><tr><td>for neuron j in DNN, testing image m in target domain do</td></tr><tr><td>(aj(m)-μ) Compute BN output yj(m) := γj +βj</td></tr><tr><td>g end for</td></tr></table>
|
| 82 |
+
|
| 83 |
+
The intuition behind our method is straightforward: The standardization of each layer by domain ensures that each layer receives data from a similar distribution, no matter it comes from the source domain or the target domain. Although modulating statistics in one BN layer by AdaBN is a simple translation and scaling operation, such linear transformation in one layer can achieve a highly nonlinear transformation through the whole deep CNN architecture. Thus, we believe this AdaBN process could approximate the intrinsically non-linear domain transfer function.
|
| 84 |
+
|
| 85 |
+
For $K$ domain adaptation where $K > 2$ , we standardize each sample by the statistics in its own domain. During training, the statistics are calculated for every mini-batch, the only thing that we need to make sure is that the samples in every mini-batch are from the same domain. For (semi)supervised domain adaptation, we may use the labeled data to fine-tune the weights as well. As a result, our method could fit in all different settings of domain adaptation with minimal effort.
|
| 86 |
+
|
| 87 |
+
Compared with CORAL (Sun et al., 2016), one natural question is why we transform the neuron responses independently, not decorrelate and then re-correlate the responses together as suggested in Sun et al. (2016). Under certain conditions, decorrelation could improve the performance. However, in CNN, the mini-batch size is usually smaller than the feature dimension, leading to singular covariance matrices that is hard to be inversed. As a result, the covariance matrix is always singular. In addition, decorrelation requires to compute the inverse of the covariance matrix which is computationally intensive, especially if we plan to apply AdaBN to all layers of the network.
|
| 88 |
+
|
| 89 |
+
# 4 EXPERIMENTS
|
| 90 |
+
|
| 91 |
+
In this section, we demonstrate the effectiveness of AdaBN on standard domain adaptation datasets, and empirically analyze our AdaBN model. We also evaluation our method on a practical application with remote sensing images.
|
| 92 |
+
|
| 93 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 94 |
+
|
| 95 |
+
We first introduce our experiments on two standard datasets: Office (Saenko et al., 2010) and Caltech-Bing (Bergamo & Torresani, 2010).
|
| 96 |
+
|
| 97 |
+
Office (Saenko et al., 2010) is a standard benchmark for domain adaptation, which is a collection of 4652 images in 31 classes from three different domains: Amazon $\mathbf { \Pi } ^ { ( \mathbf { A } ) }$ , $D S R L ( \mathbf { D } )$ and Webcam(W). Similar to (Tzeng et al., 2014; Sun et al., 2016; Long et al., 2015), we evaluate the pairwise domain adaption performance of AdaBN on all six pairs of domains. For the multi-source setting, we evaluate our method on three transfer tasks $\{ \mathbf { A } , \bar { \mathbf { W } } \} \to \mathbf { D }$ , $\{ \mathbf { A } , \mathbf { D } \} \to \mathbf { W }$ , $\{ \mathbf { D } , \mathbf { W } \} \mathbf { A }$ .
|
| 98 |
+
|
| 99 |
+
Caltech-Bing (Bergamo & Torresani, 2010) is a much larger domain adaptation dataset, which contains 30,607 and 121,730 images in 256 categories from two domains Caltech-256(C) and Bing(B). The images in the Bing set are collected from Bing image search engine by keyword search. Apparently Bing data contains noise, and its data distribution is dramatically different from that of Caltech-256.
|
| 100 |
+
|
| 101 |
+
We compare our approach with a variety of methods, including four shallow methods: SA (Fernando et al., 2013), LSSA (Aljundi et al., 2015), GFK (Gong et al., 2012), CORAL (Sun et al., 2016), and four deep methods: DDC (Tzeng et al., 2014), DAN (Long et al., 2015), RevGrad (Ganin & Lempitsky, 2015), Deep CORAL (Sun & Saenko, 2016). Specifically, GFK models domain shift by integrating an infinite number of subspaces that characterize changes in statistical properties from the source to the target domain. SA, LSSA and CORAL align the source and target subspaces by explicit feature space transformations that would map source distribution into the target one. DDC and DAN are deep learning based methods which maximize domain invariance by adding to AlexNet one or several adaptation layers using MMD. RevGrad incorporates a gradient reversal layer in the deep model to encourage learning domain-invariant features. Deep CORAL extends CORAL to perform end-to-end adaptation in DNN. It should be noted that these deep learning methods have the adaptation layers on top of the output layers of DNNs, which is a sharp contrast to our method that delves into early convolution layers as well with the help of BN layers.
|
| 102 |
+
|
| 103 |
+
We follow the full protocol (Donahue et al., 2014) for the single source setting; while for multiple sources setting, we use all the samples in the source domains as training data, and use all the samples in the target domain as testing data. We fine-tune the Inception-BN (Ioffe & Szegedy, 2015) model on source domain in each task for 100 epochs. The learning rate is set to 0.01 initially, and then is dropped by a factor 0.1 every 40 epochs. Since the office dataset is quite small, following the best practice in Long et al. (2015), we freeze the first three groups of Inception modules, and set the learning rate of fourth and fifth group one tenth of the base learning rate to avoid overfitting. For Caltech-Bing dataset, we fine-tune the whole model with the same base learning rate.
|
| 104 |
+
|
| 105 |
+
Table 1: Single source domain adaptation results on Office-31 (Saenko et al., 2010) dataset with standard unsupervised adaptation protocol.
|
| 106 |
+
|
| 107 |
+
<table><tr><td colspan="7">Method A→W D→W W→D A→D D→A W→A Avg</td></tr><tr><td>AlexNet (Krizhevsky et al.,2012)</td><td>61.6</td><td>95.4</td><td>99.0</td><td>63.8</td><td>51.1</td><td>49.8 70.1</td></tr><tr><td>DDC (Tzeng et al., 2014)</td><td>61.8</td><td>95.0</td><td>98.5</td><td>64.4 52.1</td><td>52.2</td><td>70.6</td></tr><tr><td>DAN (Long et al., 2015)</td><td>68.5</td><td>96.0</td><td>99.0</td><td>67.0 54.0</td><td>53.1</td><td>72.9</td></tr><tr><td>Deep CORAL (Sun & Saenko, 2016)</td><td>66.4</td><td>95.7</td><td>99.2</td><td>66.8</td><td>52.8 51.5</td><td>72.1</td></tr><tr><td>RevGrad (Ganin & Lempitsky,2015)</td><td>73.0</td><td>96.4</td><td>99.2</td><td>1 1</td><td>1</td><td>1</td></tr><tr><td>Inception BN (Ioffe & Szegedy, 2015)</td><td>70.3</td><td>94.3</td><td>100</td><td>70.5</td><td>60.1 57.9</td><td>75.5</td></tr><tr><td>SA (Fernando et al., 2013)</td><td>69.8</td><td>95.5</td><td>99.0</td><td>71.3</td><td>59.4 56.9</td><td>75.3</td></tr><tr><td>GFK (Gong et al., 2012)</td><td>66.7</td><td>97.0</td><td>99.4</td><td>70.1</td><td>58.0 56.9</td><td>74.7</td></tr><tr><td>LSSA (Aljundi et al., 2015)</td><td>67.7</td><td>96.1</td><td>98.4</td><td>71.3</td><td>57.8 57.8</td><td>74.9</td></tr><tr><td>CORAL (Sun et al., 2016)</td><td>70.9</td><td>95.7</td><td>99.8</td><td>71.9</td><td>59.0 60.2</td><td>76.3</td></tr><tr><td>AdaBN</td><td>74.2</td><td>95.7</td><td>99.8</td><td>73.1</td><td>59.8 57.4</td><td>76.7</td></tr><tr><td> AdaBN + CORAL</td><td>75.4</td><td>96.2</td><td>99.6</td><td>72.7</td><td>59.0 60.5</td><td>77.2</td></tr></table>
|
| 108 |
+
|
| 109 |
+
# 4.2 RESULTS
|
| 110 |
+
|
| 111 |
+
# 4.2.1 OFFICE DATASET
|
| 112 |
+
|
| 113 |
+
Our results on Office dataset is reported in Table 1 and Table 2 for single/multi source(s), respectively. Note that the first 5 models of the Table 1 are pre-trained on AlexNet (Krizhevsky et al., 2012) instead of the Inception-BN (Ioffe & Szegedy, 2015) model, due to the lack of publicly available pre-trained Inception BN model in Caffe (Jia et al., 2014). Thus, the relative improvements over the baseline (AlexNet/Inception BN) make more sense than the absolute numbers of each algorithm.
|
| 114 |
+
|
| 115 |
+
From Table 1, we first notice that the Inception-BN indeed improves over the AlexNet on average, which means that the CNN pre-trained on ImageNet has learned general features, the improvements on ImageNet can be transferred to new tasks. Among the methods based on Inception-BN features, our method improves the most over the baseline. Moreover, since our method is complementary to other methods, we can simply apply CORAL on the top of AdaBN. Not surprisingly, this simple combination exhibits $0 . 5 \%$ increase in performance. This preliminary test reveals further potential of AdaBN if combined with other advanced domain adaptation methods. Finally, we could improve $1 . 7 \%$ over the baseline, and advance the state-of-the-art results for this dataset.
|
| 116 |
+
|
| 117 |
+
None of the compared methods has reported their performance on multi-source domain adaptation. To demonstrate the capacity of AdaBN under multi-domain settings, we compare it against CORAL, which is the best performing algorithm in the single source setting. The result is reported in Table 2. We find that simply combining two domains does not lead to better performance. The result is generally worse compared to the best performing single domain between the two. This phenomenon suggests that if we cannot properly cope with domain bias, the increase of training samples may be reversely affect to the testing performance. This result confirms the necessity of domain adaptation. In this more challenging setting, AdaBN still outperforms the baseline and CORAL on average. Again, when combined with CORAL, our method demonstrates further improvements. At last, our method archives $2 . 3 \%$ gain over the baseline.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Method</td><td>A,D→WA,W→D D,W→A</td><td></td><td></td><td>Avg</td></tr><tr><td>Inception BN (Ioffe & Szegedy,2015)</td><td>90.8</td><td>95.4</td><td>60.2</td><td>82.1</td></tr><tr><td>CORAL (Sun et al., 2016)</td><td>92.1</td><td>96.4</td><td>61.4</td><td>83.3</td></tr><tr><td>AdaBN</td><td>94.2</td><td>97.2</td><td>59.3</td><td>83.6</td></tr><tr><td>AdaBN + CORAL</td><td>95.0</td><td>97.8</td><td>60.5</td><td>84.4</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Table 2: Multi-source domain adaptation results on Office-31 (Saenko et al., 2010) dataset with standard unsupervised adaptation protocol.
|
| 122 |
+
|
| 123 |
+
# 4.2.2 CALTECH-BING DATASET
|
| 124 |
+
|
| 125 |
+
To further evaluate our method on the large-scale dataset, we show our results on Caltech-Bing Dataset in Table 3. Compared with CORAL, AdaBN achieves better performance, which improves $1 . 8 \%$ over the baseline. Note that all the domain adaptation methods show minor improvements over the baseline in the task $\mathbf { C } \mathbf { B }$ . One of the hypotheses to this relatively small improvement is that the images in Bing dataset are collected from Internet, which are more diverse and noisier (Bergamo & Torresani, 2010). Thus, it is not easy to adapt on the Bing dataset from the relatively clean dataset Caltech-256. Combining CORAL with our method does not offer further improvements. This might be explained by the noise of the Bing dataset and the imbalance of the number of images in the two domains.
|
| 126 |
+
|
| 127 |
+
Table 3: Single source domain adaptation results on Caltech-Bing (Bergamo & Torresani, 2010) dataset.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Method</td><td>C→B B→C Avg</td><td></td><td></td></tr><tr><td>Inception BN (Ioffe& Szegedy,2015)35.1</td><td></td><td>64.6</td><td>49.9</td></tr><tr><td>CORAL (Sun et al., 2016)</td><td>35.3</td><td>67.2 </td><td> 51.3</td></tr><tr><td>AdaBN</td><td>35.2</td><td>68.1</td><td>51.7</td></tr><tr><td> AdaBN + CORAL</td><td>35.0</td><td>67.551.2</td><td></td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 4.3 EMPIRICAL ANALYSIS
|
| 132 |
+
|
| 133 |
+
In this section, we investigate the influence of the number of samples in target domain to the performance and empirically analyze the adaptation effect of different BN layers.
|
| 134 |
+
|
| 135 |
+
# 4.3.1 SENSITIVITY TO TARGET DOMAIN SIZE.
|
| 136 |
+
|
| 137 |
+
Since the key of our method is to calculate the mean and variance of the target domain on different BN layers, it is very natural to ask how many target images is necessary to obtain stable statistics. In this experiment, we randomly select a subset of images in target domain to calculate the statistics and then evaluate the performance on the whole target set. Fig. 3 illustrates the effect of using different number of batches. The results demonstrate that our method can obtain good results when using only a small part of the target examples. It should also be noted that in the extremal case of one batch of target images, our method still achieves better results than the baseline. This is valuable in practical use since a large number of target images are often not available.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: Accuracy when varying the number of mini-batches used for calculating the statistics of BN layers in $\mathbf A \to \mathbf W$ and $\mathbf { B } \mathbf { C }$ , respectively. For $\mathbf B \to \mathbf C$ , we only show the results of using less than 100 batches, since the results are very stable when adding more examples. The batch size is 64 in this experiment. For even smaller number of examples, the performance may be not consistent and drop behind the baseline (e.g. 0.652 with 16 samples, 0.661 with 32 samples).
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 4: Accuracy when adapting with different BN blocks in $\mathbf B \to \mathbf C$ . $x = 0$ corresponds to the result with non-adapt method, and 1, 2, 3a, $_ { 3 b }$ , 4a, $4 b$ , 4c, 5a, $5 b$ correspond to the nine different blocks in Inception-BN network..
|
| 144 |
+
|
| 145 |
+
# 4.3.2 ADAPTATION EFFECT FOR DIFFERENT BN LAYERS.
|
| 146 |
+
|
| 147 |
+
In this experiment, we analyze the effect of adapting on different BN layers with our AdaBN method. According to the structure of Inception-BN network Ioffe & Szegedy (2015), we categorize the BN layers into 9 blocks: 1, 2, 3a, 3b, 4a, 4b, 4c, 5a, 5b. Since the back BN layers are influenced by the outputs of previous BN layers, when adapting a specific block we adapted all the blocks before it. Fig. 4 illustrates the adaptation effect for different BN layers. It shows that adapting BN layers consistently improves the results over the baseline method in most cases. Specifically, when incorporating more BN layers in the adaptation, we could achiever better transfer results.
|
| 148 |
+
|
| 149 |
+
# 4.4 PRACTICAL APPLICATION FOR CLOUD DETECTION IN REMOTE SENSING IMAGES
|
| 150 |
+
|
| 151 |
+
In this section, we further demonstrate the effectiveness of AdaBN on a practical problem: Cloud Detection in Remote Sensing Images. Since remote sensing images are taken by different satellites with different sensors and resolutions, the captured images are visually different in texture, color, and value range distributions, as shown in Fig. 5. How to adapt a model trained on one satellite to another satellite images is naturally a domain adaptation problem.
|
| 152 |
+
|
| 153 |
+
Our task here is to identify cloud from the remote sensing images, which can be regarded as a semantic segmentation task. The experiment is taken under a self-collected dataset, which includes three image sets, from GF2, GF1 and Tianhui satellites. Each image set contains 635, 324 and 113 images with resolution over $6 0 0 0 { \times } 6 0 0 0$ pixels respectively. We name the three different datasets following the satellite names. GF2 dataset is used as the training dataset while GF1 and Tianhui datasets are for testing. We use a state-of-art semantic segmentation method (Chen et al., 2016a) as our baseline model.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Method</td><td>GF1</td><td>Tianhui</td></tr><tr><td>Baseline</td><td>38.95%</td><td>14.54%</td></tr><tr><td> AdaBN</td><td>64.50%</td><td>29.66%</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 4: Domain adaptation results (mIOU) on GF1 and Tianhui datasets training on GF2 datasets.
|
| 158 |
+
|
| 159 |
+
The results on GF1 and Tianhui datasets are shown in Table 4. The relatively low results of the baseline method indicate that there exists large distribution disparity among images from different satellites. Thus, the significant improvement after applying AdaBN reveals the effectiveness of our method. Some of the visual results are shown in Fig. 6. Since other domain adaptation methods require either additional optimization steps and extra components (e.g. MMD) or post-processing distribution alignment (like CORAL), it is very hard to apply these methods from image classification to this large-size $( 6 0 0 0 \times 6 0 0 0 )$ segmentation problem. Comparatively, besides the effective performance, our method needs no extra parameters and very few computations over the whole adaptation process.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 5: Remote sensing images in different domains.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 6: Visual cloud detection results on GF1 dataset. White pixels in (b) and (c) represent the detected cloud regions.
|
| 166 |
+
|
| 167 |
+
# 5 CONCLUSION AND FUTURE WORKS
|
| 168 |
+
|
| 169 |
+
In this paper, we have introduced a simple yet effective approach for domain adaptation on batch normalized neural networks. Besides its original uses, we have exploited another functionality of Batch Normalization (BN) layer: domain adaptation. The main idea is to replace the statistics of each BN layer in source domain with those in target domain. The proposed method is easy to implement and parameter-free, and it takes almost no effort to extend to multiple source domains and semi-supervised settings. Our method established new state-of-the-art results on both single and multiple source(s) domain adaptation settings on standard benchmarks. At last, the experiments on cloud detection for large-size remote sensing images further demonstrate the effectiveness of our method in practical use. We believe our method opens up a new direction for domain adaptation.
|
| 170 |
+
|
| 171 |
+
In contrary to other methods that use Maximum Mean Discrepancy (MMD) or domain confusion loss to update the weights in CNN for domain adaptation, our method only modifies the statistics of BN layer. Therefore, our method is fully complementary to other existing deep learning based methods. It is interesting to see how these different methods can be unified under one framework.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Rahaf Aljundi, Remi Emonet, Damien Muselet, and Marc Sebban. Landmarks-based kernelized ´ subspace alignment for unsupervised domain adaptation. In CVPR, 2015.
|
| 176 |
+
Mahsa Baktashmotlagh, Mehrtash Harandi, Brian Lovell, and Mathieu Salzmann. Unsupervised domain adaptation by domain invariant projection. In ICCV, pp. 769–776, 2013.
|
| 177 |
+
Oscar Beijbom. Domain adaptations for computer vision applications. arXiv preprint arXiv:1211.4860, 2012.
|
| 178 |
+
Alessandro Bergamo and Lorenzo Torresani. Exploiting weakly-labeled web images to improve object classification: a domain adaptation approach. In NIPS, pp. 181–189, 2010.
|
| 179 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. NIPS, 2016.
|
| 180 |
+
Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. arXiv preprint arXiv:1606.00915, 2016a.
|
| 181 |
+
Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. MXNet: A flexible and efficient machine learning library for heterogeneous distributed systems. NIPS Workshop on Machine Learning Systems, 2016b.
|
| 182 |
+
Sumit Chopra, Suhrid Balakrishnan, and Raghuraman Gopalan. DLID: Deep learning for domain adaptation by interpolating between domains. In ICML Workshop on Challenges in Representation Learning, volume 2, 2013.
|
| 183 |
+
Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. DeCAF: A deep convolutional activation feature for generic visual recognition. In ICML, pp. 647–655, 2014.
|
| 184 |
+
E Knuth Donald. The art of computer programming. Sorting and searching, 3:426–458, 1999.
|
| 185 |
+
Basura Fernando, Amaury Habrard, Marc Sebban, and Tinne Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In ICCV, pp. 2960–2967, 2013.
|
| 186 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, pp. 1180–1189, 2015.
|
| 187 |
+
Muhammad Ghifary, W Bastiaan Kleijn, and Mengjie Zhang. Domain adaptive neural networks for object recognition. In PRICAI: Trends in Artificial Intelligence, pp. 898–904. 2014.
|
| 188 |
+
Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In CVPR, pp. 2066–2073, 2012.
|
| 189 |
+
|
| 190 |
+
Boqing Gong, Kristen Grauman, and Fei Sha. Connecting the dots with landmarks: Discriminatively learning domain-invariant features for unsupervised domain adaptation. In ICML, pp. 222–230, 2013.
|
| 191 |
+
|
| 192 |
+
Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Domain adaptation for object recognition: An unsupervised approach. In ICCV, pp. 999–1006, 2011.
|
| 193 |
+
|
| 194 |
+
Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola. ¨ A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723–773, 2012.
|
| 195 |
+
|
| 196 |
+
Gregory Griffin, Alex Holub, and Pietro Perona. Caltech-256 object category dataset. 2007.
|
| 197 |
+
|
| 198 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, 2016.
|
| 199 |
+
|
| 200 |
+
Jiayuan Huang, Arthur Gretton, Karsten M Borgwardt, Bernhard Scholkopf, and Alex J Smola. ¨ Correcting sample selection bias by unlabeled data. In NIPS, pp. 601–608, 2006.
|
| 201 |
+
|
| 202 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pp. 448–456, 2015.
|
| 203 |
+
|
| 204 |
+
Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. In ACM MM, pp. 675–678, 2014.
|
| 205 |
+
|
| 206 |
+
Aditya Khosla, Tinghui Zhou, Tomasz Malisiewicz, Alexei A Efros, and Antonio Torralba. Undoing the damage of dataset bias. In ECCV, pp. 158–171. 2012.
|
| 207 |
+
|
| 208 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1097–1105, 2012.
|
| 209 |
+
|
| 210 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In ICML, pp. 97–105, 2015.
|
| 211 |
+
|
| 212 |
+
Mingsheng Long, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. In NIPS, 2016.
|
| 213 |
+
|
| 214 |
+
Sinno Jialin Pan, Ivor W Tsang, James T Kwok, and Qiang Yang. Domain adaptation via transfer component analysis. IEEE Transactions on Neural Networks, 22(2):199–210, 2011.
|
| 215 |
+
|
| 216 |
+
Vishal M Patel, Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Visual domain adaptation: A survey of recent advances. IEEE Signal Processing Magazine, 32(3):53–69, 2015.
|
| 217 |
+
|
| 218 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 219 |
+
|
| 220 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In ECCV, pp. 213–226. 2010.
|
| 221 |
+
|
| 222 |
+
Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of statistical planning and inference, 90(2):227–244, 2000.
|
| 223 |
+
|
| 224 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. arXiv preprint arXiv:1607.01719, 2016.
|
| 225 |
+
|
| 226 |
+
Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. AAAI, 2016.
|
| 227 |
+
|
| 228 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015.
|
| 229 |
+
|
| 230 |
+
Tatiana Tommasi, Novi Patricia, Barbara Caputo, and Tinne Tuytelaars. A deeper look at dataset bias. German Conference on Pattern Recognition, 2015.
|
| 231 |
+
|
| 232 |
+
Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In CVPR, pp. 1521–1528, 2011.
|
| 233 |
+
|
| 234 |
+
Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014.
|
| 235 |
+
|
| 236 |
+
Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In ICCV, pp. 4068–4076, 2015.
|
| 237 |
+
|
| 238 |
+
Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(2579-2605):85, 2008.
|
| 239 |
+
|
| 240 |
+
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In NIPS, pp. 3320–3328, 2014.
|
md/train/BJxH22EKPS/BJxH22EKPS.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING ARCHITECTURES LEARNT BY CELL-BASED NEURAL ARCHITECTURE SEARCH
|
| 2 |
+
|
| 3 |
+
Yao Shu, Wei Wang & Shaofeng Cai
|
| 4 |
+
|
| 5 |
+
School of Computing
|
| 6 |
+
National University of Singapore
|
| 7 |
+
{shuyao,wangwei,shaofeng}@comp.nus.edu.sg
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Neural architecture search (NAS) searches architectures automatically for given tasks, e.g., image classification and language modeling. Improving the search efficiency and effectiveness has attracted increasing attention in recent years. However, few efforts have been devoted to understanding the generated architectures. In this paper, we first reveal that existing NAS algorithms (e.g., DARTS, ENAS) tend to favor architectures with wide and shallow cell structures. These favorable architectures consistently achieve fast convergence and are consequently selected by NAS algorithms. Our empirical and theoretical study further confirms that their fast convergence derives from their smooth loss landscape and accurate gradient information. Nonetheless, these architectures may not necessarily lead to better generalization performance compared with other candidate architectures in the same search space, and therefore further improvement is possible by revising existing NAS algorithms.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Various neural network architectures (Krizhevsky et al., 2012; Simonyan & Zisserman, 2015; He et al., 2016; Huang et al., 2017) have been devised over the past decades, achieving superhuman performance for a wide range of tasks. Designing these neural networks typically takes substantial efforts from domain experts by trial and error. Recently, there is a growing interest in neural architecture search (NAS), which automatically searches for high-performance architectures for the given task. The searched NAS architectures (Zoph et al., 2018; Real et al., 2019; Pham et al., 2018; Liu et al., 2019; Xie et al., 2019b; Luo et al., 2018; Cai et al., 2019; Akimoto et al., 2019; Nayman et al., 2019) have outperformed best expert-designed architectures on many computer vision and natural language processing tasks.
|
| 16 |
+
|
| 17 |
+
Mainstream NAS algorithms typically search for the connection topology and transforming operation accompanying each connection from a predefined search space. Tremendous efforts have been exerted to develop efficient and effective NAS algorithms (Liu et al., 2019; Xie et al., 2019b; Luo et al., 2018; Akimoto et al., 2019; Nayman et al., 2019). However, less attention has been paid to these searched architectures for further insight. To our best knowledge, there is no related work in the literature examining whether these NAS architectures share any pattern, and how the pattern may impact the architecture search if there exists the pattern. These questions are fundamental to understand and improve existing NAS algorithms. In this paper, we endeavour to address these questions by examining the popular NAS architectures1.
|
| 18 |
+
|
| 19 |
+
The recent work (Xie et al., 2019a) shows that the architectures with random connection topologies can achieve competitive performance on various tasks compared with expert-designed architectures. Inspired by this result, we examine the connection topologies of the architectures generated by popular NAS algorithms. In particular, we find a connection pattern of the popular NAS architectures. These architectures tend to favor wide and shallow cells, where the majority of intermediate nodes are directly connected to the input nodes.
|
| 20 |
+
|
| 21 |
+
To appreciate this particular connection pattern, we first visualize the training process of the popular NAS architectures and their randomly connected variants. Fast and stable convergence is observed for the architectures with wide and shallow cells. We further empirically and theoretically show that the architectures with wider and shallower cells consistently enjoy a smoother loss landscape and smaller gradient variance than their random variants, which helps explain their better convergence and consequently the selection of these NAS architectures during the architecture search.
|
| 22 |
+
|
| 23 |
+
We finally evaluate the generalization performance of the popular NAS architectures and their randomly connected variants. We find that the architectures with wide and shallow cells may not generalize better than other candidate architectures despite their faster convergence. We therefore believe that rethinking NAS from the perspective of the true generalization performance rather than the convergence of candidate architectures should potentially help generate better architectures.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORKS
|
| 26 |
+
|
| 27 |
+
Neural Architecture Search Neural architecture search (NAS) searches for best-performing architectures automatically for a given task. It has received increasing attention in recent years due to its outstanding performance and the demand for automated machine learning (AutoML). There are three major components in NAS as summarized by Elsken et al. (2019), namely search space, search policy (or strategy, algorithm), and performance evaluation (or estimation). To define the search space, the prior knowledge extracted from expert-designed architectures is typically exploited. As for the search policy, different algorithms are proposed to improve the effectiveness (Zoph et al., 2018; Real et al., 2019; Tan et al., 2019; Cai et al., 2019) and the efficiency (Pham et al., 2018; Liu et al., 2019; Xie et al., 2019b; Luo et al., 2018; Nayman et al., 2019; Akimoto et al., 2019) of the architecture search. However, no effort has been devoted to understanding the best architectures generated by various NAS approaches. Detailed analysis of these architectures may give insights about the further improvement of existing NAS algorithms.
|
| 28 |
+
|
| 29 |
+
Evaluation of NAS algorithms Recent works evaluate NAS algorithms by comparing them with random search. Li & Talwalkar (2019) and Sciuto et al. (2019) compare the generalization performance of architectures generated from random search and existing NAS algorithms. Interestingly, the random search can find architectures with comparable or even better generalization performance. Particularly, Sciuto et al. (2019) show empirically that the ineffectiveness of some NAS algorithms (Pham et al., 2018) could be the consequence of the weight sharing mechanism during the architecture search. While these evaluations help understand the general disadvantages of NAS algorithms, what kind of architectures the NAS algorithms are learning and why they learn these specific architectures are still not well understood.
|
| 30 |
+
|
| 31 |
+
# 3 THE CONNECTION PATTERN OF POPULAR NAS CELLS
|
| 32 |
+
|
| 33 |
+
Mainstream NAS algorithms (Zoph et al., 2018; Real et al., 2019; Pham et al., 2018; Liu et al., 2019; Xie et al., 2019b; Luo et al., 2018) typically search for the cell structure, including the connection topology and the corresponding operation (transformation) coupling each connection. The generated cell is then replicated to construct the entire neural network. We therefore mainly investigate these cell-based NAS architectures. In this section, we first introduce the commonly adopted cell representation, which is useful to understand the connection and computation in a cell space. We then sketch the connection topologies of popular cell-based NAS architectures to investigate their connection patterns. By comparison, we show that there is a common connection pattern among the cells learned by different NAS algorithms; particularly, these cells tend to be wide and shallow.
|
| 34 |
+
|
| 35 |
+
# 3.1 CELL REPRESENTATION
|
| 36 |
+
|
| 37 |
+
Following DARTS (Liu et al., 2019), we represent the cell topology as a directed acyclic graph (DAG) consisting of $N$ nodes, including $M$ input nodes, one output node and $( N - M - 1 )$ intermediate nodes. Each node forms a latent representation of the input instance. The input nodes consist of the outputs from $M$ preceding cells. And the output node aggregates (e.g., concatenate) the representations from all intermediate nodes. Each intermediate node is connected to $M$ proceeding nodes in the same cell. Each connection transforms the representation from one node via an operation from a predefined operation set, e.g., $3 \times 3$ convolution, $3 \times 3$ max pooling, etc. The target of NAS algorithm is to search for the best $M$ source nodes for each intermediate node and the best operation for each of the connections between nodes. In the literature, the searched cell is then replicated by $L$ times to build the entire neural network architecture2.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Cell topologies of popular NAS architectures. Each sub-figure has three sets of nodes from left to right, i.e., the input nodes, intermediate nodes, and output node. The arrows (i.e., operations of the cell) represent the direction of information flow. The caption of each sub-figure reports the name of the architecture, width and depth of a cell following our definition. The width of a cell is computed with the assumption that all intermediate nodes share the same width $c$ .
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 2: Topologies of DARTS (Liu et al., 2019) cell (leftmost) and its variants with random connections. The cell depth is increasing and width decreasing from left to right. In particular, the original DARTS cell $C ^ { d \bar { a } r t s }$ is widest and shallowest among these cells.
|
| 44 |
+
|
| 45 |
+
We abuse the notation $C$ to denote a cell and also the architecture built with the specific cell in the following sections. Besides, we shall use $C ^ { A }$ to denote the best architecture (or cell) searched with the NAS algorithm $A$ (e.g., DARTS (Liu et al., 2019), ENAS (Pham et al., 2018)). Details on how to build the architecture with given cells are provided in Appendix A.3.
|
| 46 |
+
|
| 47 |
+
# 3.2 THE COMMON CONNECTION PATTERN
|
| 48 |
+
|
| 49 |
+
Recently, Xie et al. (2019a) shows that neural networks constructed by cells with random connection patterns can achieve compelling performance on multiple tasks. Taking this a step further, we wonder whether cells generated from popular NAS algorithms share any connection patterns, which may explain why these cells are chosen during the architecture search. To investigate the connection patterns, we sketch the topologies of the popular NAS cells with detailed operations omitted.
|
| 50 |
+
|
| 51 |
+
Figure 1 illustrates topologies of 5 popular NAS cells3. To examine the connection pattern formally, we introduce the concept of ‘depth’ and ‘width’ for a cell. The depth of a cell is defined as the number of connections along the longest path from input nodes to the output node. The width of a cell is defined as the total width of the intermediate nodes that are connected to the input nodes. In particular, if some intermediate nodes are only partially connected to input nodes (i.e., have connections to other intermediate nodes), their width is reduced by the percentage of the number of connections to intermediate nodes over all connections. The width of a node is the number of channels for convolution operations; and the width is the dimension of the features for linear operations. Supposing that the width of each intermediate node is $c$ , as shown in Figure 1, the width and depth of the DARTS (Liu et al., 2019) cell are $3 . 5 c$ and 3 respectively, and the width and depth of the AmoebaNet (Real et al., 2019) cell are $_ { 4 c }$ and 4 correspondingly.
|
| 52 |
+
|
| 53 |
+
Following the above definitions, the smallest depth and largest width for a cell with $N = 7$ and $M = 2$ are 2 and $_ { 4 c }$ respectively. Similarly, for a cell with $N = 8$ and $M = 2$ , the smallest depth and largest width are 2 and $5 c$ respectively. In Figure 1, we can observe that cells from popular NAS architectures tend to be the widest and shallowest ones (with width close to $4 c / 5 c$ and depth close to 2) among all candidate cells in the same search space. Regarding this as the common connection pattern, we have the following observation:
|
| 54 |
+
|
| 55 |
+
Observation 3.1 (The Common Connection Pattern) NAS architectures generated by popular NAS algorithms tend to have the widest and shallowest cells among all candidate cells in the same search space.
|
| 56 |
+
|
| 57 |
+
# 4 THE IMPACTS OF CELL WIDTH AND DEPTH ON OPTIMIZATION
|
| 58 |
+
|
| 59 |
+
Given that popular NAS cells share the common connection pattern, we then explore the impact of this common connection pattern from the optimization perspective to answer the question: why the wide and shallow cells are selected during the architecture search? We sample and train variants of popular NAS architectures with random connections. Comparing randomly connected variants with the popular NAS architectures, we find that architectures with wider and shallower cells indeed converge faster so that they are selected by NAS algorithms (Section 4.1). To understand why the wider and shallower cell contributes to faster convergence, we further investigate the loss landscape and gradient variance of popular NAS architectures and their variants via both empirical experiments (Section 4.2) and theoretical analysis (Section 4.3).
|
| 60 |
+
|
| 61 |
+
# 4.1 CONVERGENCE
|
| 62 |
+
|
| 63 |
+
Popular NAS algorithms typically evaluate the performance of a candidate architecture prematurely before the convergence of its model parameters during the search process. For instance, DARTS (Liu et al., 2019), SNAS (Xie et al., 2019b) and ENAS (Pham et al., 2018) optimize hyper-parameters of architectures and model parameters concurrently. The amortized training time of each candidate architecture is insufficient and therefore far from the requirement for the full convergence. Likewise, AmoebaNet (Real et al., 2019) evaluates the performance of candidate architectures with the training of only a few epochs. In other words, these candidate architectures are not evaluated based on their generalization performance at convergence. As a result, architectures with faster convergence rates are more likely to be selected by existing NAS algorithms because they can obtain better evaluation performance given the same training budget. We therefore hypothesize that the popular NAS architectures may converge faster than other candidate architectures, which largely contributes to the selection of these architectures during the search.
|
| 64 |
+
|
| 65 |
+
To support the hypothesis above, we compare the convergence of original NAS architectures and their variants with random connections via empirical studies. We first sample variants of popular NAS cells following the sampling method in Appendix A.2. Then, we train both original NAS architectures and their random variants on CIFAR-10 and CIFAR-100 following the training details in Appendix A.3. During training, we evaluate the testing loss and accuracy of these architectures. Since the convergence is dependent on optimization settings, we also evaluate the convergence performance under different learning rates.
|
| 66 |
+
|
| 67 |
+
Take DARTS (Liu et al., 2019) for example, Figure 2 shows the connection topology of the original DARTS cell and its random variants. Figure 3 reports the test loss and accuracy curves of these architectures during training. As illustrated in Figure 3, the original cell $C ^ { d a r t s }$ , known as the widest and shallowest cell, has the fastest and most stable convergence compared with its variants. Further, as the width of a cell increases and the depth decreases (i.e., from $C _ { 4 }$ to $C _ { 1 }$ ), the convergence becomes faster. The results of other popular NAS architectures and their randomly connected variants are reported in Appendix B.2.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Test loss and test accuracy $( \% )$ curves of DARTS and its randomly connected variants on CIFAR-10 and CIFAR-100 during training. The default learning rate is 0.025.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 4: Test accuracy $( \% )$ curves of DARTS and its randomly connected variants on CIFAR-10 and CIFAR-100 during training under different learning rates (0.0025 and 0.25). We only evaluate $C ^ { d a r t s }$ , $C _ { 1 } ^ { d a r t s }$ and $C _ { 3 } ^ { \breve { d } a r t s }$ for illustration. The caption of each sub-figure reports the dataset and the learning rate.
|
| 74 |
+
|
| 75 |
+
Figure 4 further validates the difference of convergence under different learning rates. The original cell $C ^ { d a r t s }$ enjoys the fastest and the most stable convergence among these cells under various learning rates. The difference in terms of convergence rate and stability is more obvious between $C ^ { d a r t s }$ and its variants with a larger learning rate as shown in Figure 4. Interestingly, $C _ { 3 } ^ { d a r t s }$ completely fails to converge on both CIFAR-10 and CIFAR-100 with a larger learning rate of 0.25. While there is a minor difference among these cells with a lower learning rate of 0.0025, we still find that there is a decreasing performance of convergence (i.e., convergence rate and stability) from $C ^ { d a r t s }$ , $C _ { 1 } ^ { d a r t s }$ $C _ { 3 } ^ { d a r t s }$ . Overall, the observations are consistent with the results in Figure 3.
|
| 76 |
+
|
| 77 |
+
We have also compared the convergence of popular NAS architectures and their random variants of different operations. Similarly, we sample and train the random variants of operations for popular NAS architectures following the details in Appendix A.2 and Appendix A.3. Figure 5 illustrates the convergence of these architectures. Surprisingly, with the same connection topologies as the popular NAS cells but different operations, all random variants achieve nearly the same convergence as these popular NAS architectures. Consistent results can be found in Figure 12 of Appendix B.2. We therefore believe that the types of operations have limited impacts on the convergence of NAS architectures and the connection topologies affect the convergence more significantly.
|
| 78 |
+
|
| 79 |
+
With these observations, we conclude that the popular NAS architectures with wider and shallower cells indeed converge faster and more stably, which explains why these popular NAS cells are selected during the architecture search. The next question is then why the wider and shallower cell leads to a faster and more stable convergence?
|
| 80 |
+
|
| 81 |
+
# 4.2 EMPIRICAL STUDY OF FACTORS AFFECTING CONVERGENCE
|
| 82 |
+
|
| 83 |
+
Since the wide and shallow cell is related to fast convergence, we further conduct the theoretical convergence analysis to investigate the cause of fast convergence. In this section, we first introduce the convergence analysis (i.e., Theorem 4.1) of non-convex optimization with the randomized stochastic gradient method (Ghadimi & Lan, 2013). Based on the analysis, we introduce the possible factors related to the common connection pattern that may affect the convergence. We then examine these factors empirically in the following subsections.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 5: Test accuracy $( \% )$ curves of DARTS, ENAS, AmoebaNet, NASNet and their random variants of operations on CIFAR-10 during training. The parameter size is attached in Table 3 of Appendix B.2.
|
| 87 |
+
|
| 88 |
+
Theorem 4.1 (Ghadimi & Lan, 2013) Let $f$ be a $L$ -smooth non-convex function, and let $f ^ { * }$ be the minimal. Given repeated, independent accesses to stochastic gradients with variance bound $\sigma ^ { 2 }$ for $f ( w )$ , SGD with initial ${ \pmb w } _ { 0 }$ , total iterations $N > 0$ and learning rate $\begin{array} { r } { \gamma _ { k } \ < \ \frac { 1 } { L } } \end{array}$ achieves the following convergence by randomly choosing ${ \pmb w } _ { k }$ as the final output ${ \pmb w } _ { R }$ with probability $\frac { \gamma _ { k } } { H }$ where $\begin{array} { r } { H = \sum _ { k = 1 } ^ { N } \gamma _ { k } } \end{array}$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbb { E } [ \nabla f ( { \pmb w } _ { R } ) ^ { 2 } ] \le \frac { 2 ( f ( { \pmb w } _ { 0 } ) - f ^ { * } ) } { H } + \frac { L \sigma ^ { 2 } } { H } \sum _ { k = 1 } ^ { N } \gamma _ { k } ^ { 2 }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
In this paper, $f$ and $\pmb { w }$ denote the objective (loss) function and model parameters respectively. Based on the above theorem, Lipschitz smoothness $L$ and gradient variance $\bar { \sigma } ^ { 2 }$ significantly affect the convergence, including the rate and the stability of convergence. Particularly, given a specific number of iterations $N$ , a smaller Lipschitz constant $L$ or smaller gradient variance $\bar { \sigma } ^ { 2 }$ would lead to a smaller convergence error and less damped oscillations, which indicates a faster and more stable convergence. Since the Lipschitz constant $L$ and gradient variance $\sigma ^ { 2 }$ are highly related to the objective function, different NAS architectures result in different $L$ and $\sigma ^ { 2 }$ . In the following subsections, we therefore conduct empirical analysis for the impacts of the cell with and depth on the Lipschitz smoothness and gradient variance.
|
| 95 |
+
|
| 96 |
+
# 4.2.1 LOSS LANDSCAPE
|
| 97 |
+
|
| 98 |
+
The constant $L$ of Lipschitz smoothness is closely correlated with the Hessian matrix of the objective function as shown by Nesterov (2004), which requires substantial computation and can only represent the global smoothness. The loss contour, which has been widely adopted to visualize the loss landscape of neural networks by Goodfellow & Vinyals (2015); Li et al. (2018), is instead computationally efficient and is able to report the local smoothness of the objective function. To explore the loss landscape of different architectures, we adopt the method in Li et al. (2018) to plot the loss contour $s ( \alpha , \beta ) \ = \mathbb { E } _ { i \sim P } \big [ f _ { i } ( \pmb { w } ^ { * } + \alpha \pmb { w } _ { 1 } + \beta \pmb { w } _ { 2 } ) \big ]$ . The notation $f _ { i } ( \cdot )$ denotes the loss evaluated at $i _ { t h }$ instance in the dataset and $P$ denotes the distribution of dataset. The notation $\pmb { w } ^ { * }$ , ${ \pmb w } _ { 1 }$ and ${ \pmb w } _ { 2 }$ denote the (local) optimal and two direction vectors randomly sampled from Gaussian distribution respectively. And $\alpha$ , $\beta$ , which are the $x$ and $y$ axis of the plots, denote the step sizes to perturb $\boldsymbol { w } ^ { * }$ . The loss contour plotted here is therefore a two-dimensional approximation of the truly highdimensional loss contour. However, as shown in Li et al. (2018), the approximation is valid and effective to characterize the property of the true loss contour.
|
| 99 |
+
|
| 100 |
+
To study the impact of the cell width and depth on Lipschitz smoothness, we compare the loss landscape between popular NAS architectures and their randomly connected variants trained in Section 4.1 on CIFAR-10 and CIFAR-100. Due to the space limitation, we only plot the loss landscape of DARTS (Liu et al., 2019) and its randomly connected variants in Figure 6. We observe that the connection topology has a significant influence on the smoothness of the loss landscape. With the widest and shallowest cell, $\bar { C } ^ { d a r t s }$ has a fairly benign and smooth landscape along with the widest near-convex region around the optimal. With a deeper and narrower cell, $\dot { C } _ { 1 } ^ { d a r t s }$ and $C _ { 2 } ^ { d a r t s }$ have a more agitated loss landscape compared with $C ^ { d \bar { a } r t s }$ . Further, $C _ { 3 } ^ { d a r t s }$ , with the smallest width and largest depth among these cells, has the most complicated loss landscape and the narrowest and steepest near-convex region around the optimum. The largest eigenvalue of the Hessian matrix, which indicates the maximum curvature of the objective function, is positively correlated with Lipschitz constant as shown by Nesterov (2004). A smoother loss landscape therefore corresponds to a smaller Lipschitz constant $L$ . $C ^ { d a r t s }$ is likely to achieve the smallest Lipschitz constant among these cells.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 6: Loss contours of DARTS and its variants with random connections on the test dataset of CIFAR-10. The lighter color of the contour lines indicates a larger loss. Notably, the loss of the blank area, around the corners of each plot, is extremely large. Besides, the area with denser contour lines indicates a steeper loss surface.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 7: Heat maps of the gradient variance from DARTS and its randomly connected variants around the optimal on the test dataset of CIFAR-10. The lighter color indicates a larger gradient variance. Notably, the gradient variance of the yellow area, around the corners of each plot, is extremely large. Obviously, the region with relatively small gradient variance becomes smaller from left to right.
|
| 107 |
+
|
| 108 |
+
Consistent results can be found in Appendix B.3 for the loss landscape of other popular NAS cells and their variants. Based on these results, we conclude that increasing the width and decreasing the depth of a cell widens the near-convex region around the optimal and smooths the loss landscape. The constant $L$ of Lipschitz smoothness therefore becomes smaller locally and globally. Following Theorem 4.1, architectures with wider and shallower cells shall converge faster and more stably.
|
| 109 |
+
|
| 110 |
+
# 4.2.2 GRADIENT VARIANCE
|
| 111 |
+
|
| 112 |
+
The gradient variance indicates the noise level of gradient by randomly selecting training instances in stochastic gradient descent (SGD) method. Large gradient variance indicates large noise in the gradient, which typically results in unstable updating of model parameters. Following Ghadimi $\&$ Lan (2013), gradient variance is defined as $\mathbf { \bar { V } a r } ( \bar { \nabla } f _ { i } ( \pmb { w } ) )$ . Similar to the visualization of loss landscape in Section 4.2.1, we visualize the gradient variance by $g ( \alpha , \beta ) = \mathrm { V a r } ( \nabla f _ { i } ( { \pmb w } ^ { * } + \alpha { \pmb w } _ { 1 } +$ $\beta \pmb { w } _ { 2 } )$ ). All other notations follow Section 4.2.1.
|
| 113 |
+
|
| 114 |
+
To study the impact of the width and depth of a cell on the gradient variance, we compare the gradient variance between popular NAS architectures and their randomly connected variants trained in Section 4.1 on CIFAR-10 and CIFAR-100. We visualize the gradient variance of DARTS (Liu et al., 2019) and its randomly connected variants in Figure 7 and Figure 8. For better visualization, we plot the figures using the standard deviation (i.e., $\sqrt { g ( \alpha , \beta ) } )$ to avoid extremely large values in the visualization of DARTS. Obviously, as the cell width decreases and the cell depth increases (i.e., from $C ^ { d a r t s }$ to $C _ { 4 } ^ { d a r t s }$ ), the region with relatively small gradient variance becomes smaller as shown in Figure 7. Consistently, the gradient variance generally shows an increasing trend from $C ^ { d a r t s }$ to
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 8: 3D surfaces of the gradient variance from DARTS and its randomly connected variants around the optimal on the test dataset of CIFAR-100. The height of the surface indicates the value of gradient variance. Notably, the height of the gradient variance surface is gradually increasing from left to right. Especially, $C ^ { d a r t s }$ has the smoothest and lowest surface of gradient variance among these architectures.
|
| 118 |
+
|
| 119 |
+
$C _ { 4 } ^ { d a r t s }$ in Figure 8. Consequently, the gradient becomes noisier in the neighborhood of the optimal, which typically makes the optimization harder and unstable.
|
| 120 |
+
|
| 121 |
+
Similar results from other popular NAS architectures and their random variants are provided in Appendix B.4. Based on these results, we conclude that the increase in width and the decrease in depth of a cell result in a smaller gradient variance, which makes the optimization process less noisy and more efficient. The convergence of wide and shallow cells therefore shall be fast and stable following Theorem 4.1.
|
| 122 |
+
|
| 123 |
+
# 4.3 THEORETICAL ANALYSIS OF FACTORS AFFECTING CONVERGENCE
|
| 124 |
+
|
| 125 |
+
Our empirical study so far suggests that larger cell width and smaller cell depth smooth the loss landscape and decrease the gradient variance. Consequently, popular NAS architectures with wide and shallow cells converge fast. In this section, we investigate the impacts of the cell width and depth on Lipschitz smoothness and gradient variance from a theoretical perspective.
|
| 126 |
+
|
| 127 |
+
# 4.3.1 SETUP
|
| 128 |
+
|
| 129 |
+
We analyze the impact of the cell width and depth by comparing architectures with the widest cell and the narrowest cell as shown in Figure 26 of Appendix C. To simplify the analysis, the cells we investigate contain only one input node $_ { \textbf { \em x } }$ and one output node. The input node may be training instances or output node from any proceeding cell. All operations in the cell are linear operations without any non-linearity. Suppose there are $n$ intermediate nodes in a cell, the $i _ { t h }$ intermediate node and its associated weight matrix are denoted as $\mathbf { \boldsymbol { y } } ^ { ( i ) }$ and $W ^ { ( i ) } ( i = 1 , \cdots , n )$ respectively. The output node $_ z$ denotes the concatenation of all intermediate nodes. Both cells have the same arbitrary objective function $f$ following the output node, which shall consist of the arbitrary number of activation functions and cells. For clarity, we refer to the objective function, intermediate nodes and output node of the architecture with the narrowest cell as $\hat { \widehat { f } } , \widehat { \pmb { y } } ^ { ( i ) }$ and $\widehat { z }$ respectively. As shown in Figure 26, the intermediate node $\mathbf { \boldsymbol { y } } ^ { ( i ) }$ and $\widehat { \pmb y } ^ { ( i ) }$ bcan be computed by $\mathbf { \boldsymbol { y } } ^ { ( i ) } \equiv W ^ { ( i ) } \dot { \mathbf { \boldsymbol { x } } }$ and $\begin{array} { r } { \widehat { \pmb y } ^ { ( i ) } = \prod _ { k = 1 } ^ { i } W ^ { ( k ) } \pmb x } \end{array}$ b respectively. Particularly, we set $\begin{array} { r } { \prod _ { k = 1 } ^ { i } W ^ { ( k ) } = W ^ { ( i ) } W ^ { ( i - 1 ) } \cdot \cdot \cdot W ^ { ( 1 ) } } \end{array}$ . And ball the related proofs of following theorems can be found in Appendix C.
|
| 130 |
+
|
| 131 |
+
# 4.3.2 THEORETICAL RESULTS
|
| 132 |
+
|
| 133 |
+
Due to the complexity of the standard Lipschitz smoothness, we instead investigate the block-wise Lipschitz smoothness (Beck & Tetruashvili, 2013) of the two cases shown in Figure 26. In Theo$\mathrm { r e m } 4 . 2$ , we show that the block-wise Lipschitz constant of the narrowest cell is scaled by the largest eigenvalues of the model parameters (i.e., $W ^ { ( i ) } ( i = 1 , \cdots , n ) )$ . Notably, the Lipschitz constant of the narrowest cell can be significantly larger than the one of the widest cell while most of the largest eigenvalues are larger than 1, which slows down the convergence substantially. The empirical study in Section 4.2.1 has validated the results.
|
| 134 |
+
|
| 135 |
+
Theorem 4.2 (The impact of cell width and depth on block-wise Lipschitz smoothness ) Let $\lambda ^ { ( i ) }$ be the largest eigenvalue of $W ^ { ( i ) }$ . Given the widest cell with objective function $f$ and the narrowest cell with objective function ${ \widehat { f } } ,$ , by assuming the block-wise Lipschitz smoothness of the widest cell as $\begin{array} { r l r } { \left\| \frac { \partial f } { \partial W _ { 1 } ^ { ( i ) } } - \frac { \partial f } { \partial W _ { 2 } ^ { ( i ) } } \right\| } & { { } \le L ^ { ( i ) } \left\| W _ { 1 } ^ { ( i ) } - W _ { 2 } ^ { ( i ) } \right\| } & { } \end{array}$ for any $W _ { 1 } ^ { ( i ) }$ and $W _ { 2 } ^ { ( i ) }$ , the block-wise Lipschitz smoothness of the narrowest cell then can be represented as
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 9: Comparison of the test accuracy at the convergence between popular NAS architectures and their randomly connected variants on CIFAR-10. Each popular NAS architecture (index 0 on the $x$ -axis) is followed by 13 randomly connected variants (from index 1 to index 13 on the $x$ -axis), corresponding to $C _ { 1 }$ to $C _ { 1 3 }$ respectively. The width and depth of these random variants are shown in Table 2 in Appendix B.2. The dashed lines report the accuracy of the popular NAS architectures.
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\left\| \frac { \partial \widehat { f } } { \partial W _ { 1 } ^ { ( i ) } } - \frac { \partial \widehat { f } } { \partial W _ { 2 } ^ { ( i ) } } \right\| \leq ( \prod _ { j = 1 } ^ { i - 1 } \lambda ^ { ( j ) } ) L ^ { ( i ) } \left\| W _ { 1 } ^ { ( i ) } - W _ { 2 } ^ { ( i ) } \right\|
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
We then compare the gradient variance of the two cases shown in Figure 26. Interestingly, gradient variance suggests a similar but more significant difference between the two cases compared with their difference in Lipschitz smoothness. As shown in Theorem 4.3, the gradient variance of the narrowest cell is not only scaled by the square of the largest eigenvalue of the weight matrix but also is scaled by the number of intermediate nodes (i.e., $n$ ). Moreover, the upper bound of its gradient variance has numbers of additional terms, leading to a significantly larger gradient variance. The empirical study in Section 4.2.2 has confirmed the results.
|
| 145 |
+
|
| 146 |
+
Theorem 4.3 (The impact of cell width and depth on gradient variance ) Let $\lambda ^ { ( i ) }$ be the largest eigenvalue of $\dot { W } ^ { ( i ) }$ . Given the widest cell with objective function $f$ and the narrowest cell with objective function $\widehat { f } _ { \mathrm { i } }$ , by assuming the gradient variance of the widest cell as $\begin{array} { r } { \mathbb { E } \left\| \frac { \partial f } { \partial W ^ { ( i ) } } - \mathbb { E } \frac { \partial f } { \partial W ^ { ( i ) } } \right\| ^ { 2 } \leq } \end{array}$ $( \sigma ^ { ( i ) } ) ^ { 2 }$ for any $W ^ { ( i ) }$ , the gradient variance of the narrowest cell is then bounded by
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\mathbb { E } \left\| \frac { \partial \widehat { f } } { \partial W ^ { ( i ) } } - \mathbb { E } \frac { \partial \widehat { f } } { \partial W ^ { ( i ) } } \right\| ^ { 2 } \leq n \sum _ { k = i } ^ { n } ( \frac { \sigma ^ { ( k ) } } { \lambda ^ { ( i ) } } \prod _ { j = 1 } ^ { k } \lambda ^ { ( j ) } ) ^ { 2 }
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
# 5 GENERALIZATION BEYOND THE COMMON CONNECTIONS
|
| 153 |
+
|
| 154 |
+
Our empirical and theoretical results so far have demonstrated that the common connection pattern helps to smooth the loss landscape and make the gradient more accurate. Popular NAS architectures with wider and shallower cells therefore converge faster, which explains why popular NAS architectures are selected by the NAS algorithms. Nonetheless, we have ignored the generalization performance obtained by popular NAS architectures and their random variants. We therefore wonder whether popular NAS architectures with wide and shallow cells generalize better.
|
| 155 |
+
|
| 156 |
+
In Figure 9, we visualize the test accuracy of popular NAS architectures and their randomly connected variants trained in Section 4.1. Notably, the popular NAS architectures can achieve competitive accuracy compared with most of the random variants. However, there are some random variants, which achieve higher accuracy than the popular architectures. Interestingly, there seems to be an optimal choice of depth and width for a cell to achieve higher test accuracy (i.e., $C _ { 7 }$ for DARTS and $C _ { 4 }$ for ENAS). Popular NAS architectures with wide and shallow cells therefore are not guaranteed to generalize better, although they typically converge faster than other random variants.
|
| 157 |
+
|
| 158 |
+
We also adapt the connections of popular NAS architectures to obtain their widest and shallowest variants. The adaption is possible due to the fact that the cells (including normal and reduction cell)
|
| 159 |
+
|
| 160 |
+
Table 1: Comparison of the test error at the convergence between the original and the adapted NAS architectures on CIFAR-10/100 and Tiny-ImageNet-200. The entire networks are constructed and trained following the experimental settings reported in Appendix A.3, which may slightly deviate from the original ones. The test errors (or the parameter sizes) of original and adapted architectures are reported on the left and right hand-side of slash respectively.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Architecture</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td><td colspan="2">Tiny-ImageNet-200</td></tr><tr><td>Error(%)</td><td>Params(M)</td><td>Error(%)</td><td>Params(M)</td><td>Error(%)</td><td>Params(M)</td></tr><tr><td>NASNet (Zoph et al., 2018)</td><td>2.65/2.80</td><td>4.29/4.32</td><td>17.06/16.86</td><td>4.42/4.45</td><td>31.88/32.05</td><td>4.57/4.60</td></tr><tr><td>AmoebaNet (Real etal.,2019)</td><td>2.76/2.91</td><td>3.60/3.60</td><td>17.55/17.28</td><td>3.71/3.71</td><td>32.22/33.16</td><td>3.83/3.83</td></tr><tr><td>ENAS (Pham et al., 2018)</td><td>2.64/2.76</td><td>4.32/4.32</td><td>16.67/16.04</td><td>4.45/4.45</td><td>30.68/31.36</td><td>4.60/4.60</td></tr><tr><td>DARTS (Liu et al., 2019)</td><td>2.67/2.73</td><td>3.83/3.90</td><td>16.41/16.15</td><td>3.95/4.03</td><td>30.58/31.33</td><td>4.08/4.16</td></tr><tr><td>SNAS (Xie et al., 2019b)</td><td>2.88/2.69</td><td>3.14/3.19</td><td>17.78/17.20</td><td>3.26/3.31</td><td>32.40/32.61</td><td>3.39/3.45</td></tr></table>
|
| 163 |
+
|
| 164 |
+
of popular NAS architectures are generally not widest and narrowest as shown in Figure 1. While there are various widest and shallowest cells following our definition of cell width and depth, we apply the connection pattern of SNAS cell shown in Figure 1(e) to obtain the widest and shallowest cells. The adapted topologies are shown in Figure 25 of Appendix B.5.
|
| 165 |
+
|
| 166 |
+
Table 1 illustrates the comparison of the test accuracy between our adapted NAS architectures and the original ones. As shown in Table 1, the adapted architectures achieve smaller test error on CIFAR-100. Nevertheless, most of the adapted architectures, obtain larger test error than the original NAS architectures on both CIFAR-10 and Tiny-ImageNet- $2 0 0 ^ { 4 }$ . The results again suggest that the widest and shallowest cells may not help architectures generalize better, while these architectures typically achieve compelling generalization performance.
|
| 167 |
+
|
| 168 |
+
The results above have revealed that the architectures with wide and shallow cells may not generalize better despite their fast convergence. To improve current NAS algorithms, we therefore need to rethink the evaluation of the performance of candidate architectures during architecture search since the current NAS algorithms are not based on the generalization performance at convergence as mentioned in Section 4.1. Nonetheless, architectures with the wide and shallow cells usually guarantee a stable and fast convergence along with competitive generalization performance, which should be good prior knowledge for designing architectures and NAS algorithms.
|
| 169 |
+
|
| 170 |
+
# 6 CONCLUSION AND DISCUSSION
|
| 171 |
+
|
| 172 |
+
Recent works have been focusing on the design and evaluation of NAS algorithms. We instead endeavour to examine the architectures selected by the various popular NAS algorithms. Our study is the first to explore the common structural patterns selected by existing algorithms, why these architectures are selected, and why these algorithms may be flawed. In particular, we reveal that popular NAS algorithms tend to favor architectures with wide and shallow cells, which typically converge fast and consequently are likely be selected during the search process. However, these architectures may not generalize better than other candidates of narrow and deep cells.
|
| 173 |
+
|
| 174 |
+
To further improve the performance of the selected NAS architectures, one promising direction for the current NAS research is to evaluate the generalization performance of candidate architectures more accurately and effectively. While popular NAS architectures appreciate fast and stable convergence along with competitive generalization performance, we believe that the wide and shallow cells are still useful prior knowledge for the design of the search space. We hope this work can attract more attention to the interpretation and understanding of existing popular NAS algorithms.
|
| 175 |
+
|
| 176 |
+
# ACKNOWLEDGEMENT
|
| 177 |
+
|
| 178 |
+
This research is supported by the National Research Foundation Singapore under its AI Singapore Programme [Award No. AISG-GC-2019-002] and Singapore Ministry of Education Academic Research Fund Tier 3 under MOEs official grant number MOE2017-T3-1-007.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Youhei Akimoto, Shinichi Shirakawa, Nozomu Yoshinari, Kento Uchida, Shota Saito, and Kouhei Nishida. Adaptive stochastic natural gradient method for one-shot neural architecture search. In ICML, volume 97 of Proceedings of Machine Learning Research, pp. 171–180. PMLR, 2019.
|
| 183 |
+
|
| 184 |
+
Amir Beck and Luba Tetruashvili. On the convergence of block coordinate descent type methods. SIAM Journal on Optimization, 23(4):2037–2060, 2013.
|
| 185 |
+
|
| 186 |
+
Han Cai, Ligeng Zhu, and Song Han. Proxylessnas: Direct neural architecture search on target task and hardware. In ICLR (Poster). OpenReview.net, 2019.
|
| 187 |
+
|
| 188 |
+
Terrance Devries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. CoRR, abs/1708.04552, 2017.
|
| 189 |
+
|
| 190 |
+
Thomas Elsken, Jan Hendrik Metzen, and Frank Hutter. Neural architecture search: A survey. Journal of Machine Learning Research, 20(55):1–21, 2019.
|
| 191 |
+
|
| 192 |
+
Saeed Ghadimi and Guanghui Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013.
|
| 193 |
+
|
| 194 |
+
Ian J. Goodfellow and Oriol Vinyals. Qualitatively characterizing neural network optimization problems. In ICLR, 2015.
|
| 195 |
+
|
| 196 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 197 |
+
|
| 198 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, pp. 2261–2269. IEEE Computer Society, 2017.
|
| 199 |
+
|
| 200 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 201 |
+
|
| 202 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pp. 1106–1114, 2012.
|
| 203 |
+
|
| 204 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. In ICLR (Poster). OpenReview.net, 2017.
|
| 205 |
+
|
| 206 |
+
Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, and Tom Goldstein. Visualizing the loss landscape of neural nets. In NeurIPS, pp. 6391–6401, 2018.
|
| 207 |
+
|
| 208 |
+
Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In UAI, pp. 129. AUAI Press, 2019.
|
| 209 |
+
|
| 210 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: differentiable architecture search. In ICLR (Poster). OpenReview.net, 2019.
|
| 211 |
+
|
| 212 |
+
Renqian Luo, Fei Tian, Tao Qin, Enhong Chen, and Tie-Yan Liu. Neural architecture optimization. In NeurIPS, pp. 7827–7838, 2018.
|
| 213 |
+
|
| 214 |
+
Niv Nayman, Asaf Noy, Tal Ridnik, Itamar Friedman, Rong Jin, and Lihi Zelnik-Manor. XNAS: neural architecture search with expert advice. CoRR, abs/1906.08031, 2019.
|
| 215 |
+
|
| 216 |
+
Yurii Nesterov. Introductory Lectures on Convex Optimization - A Basic Course, volume 87 of Applied Optimization. Springer, 2004.
|
| 217 |
+
|
| 218 |
+
Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In ICML, volume 80 of Proceedings of Machine Learning Research, pp. 4092–4101. PMLR, 2018.
|
| 219 |
+
|
| 220 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V. Le. Regularized evolution for image classifier architecture search. In AAAI, pp. 4780–4789. AAAI Press, 2019.
|
| 221 |
+
|
| 222 |
+
Christian Sciuto, Kaicheng Yu, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. arXiv preprint arXiv:1902.08142, 2019.
|
| 223 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 224 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In CVPR, pp. 1–9. IEEE Computer Society, 2015.
|
| 225 |
+
Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V. Le. Mnasnet: Platform-aware neural architecture search for mobile. In CVPR, pp. 2820– 2828. Computer Vision Foundation / IEEE, 2019.
|
| 226 |
+
Saining Xie, Alexander Kirillov, Ross Girshick, and Kaiming He. Exploring randomly wired neural networks for image recognition. arXiv preprint arXiv:1904.01569, 2019a.
|
| 227 |
+
Sirui Xie, Hehui Zheng, Chunxiao Liu, and Liang Lin. SNAS: stochastic neural architecture search. In ICLR (Poster). OpenReview.net, 2019b.
|
| 228 |
+
Zirui Zhou, Qi Zhang, and Anthony Man-Cho So. 1,p-norm regularization: Error bounds and convergence rate analysis of first-order methods. In ICML, pp. 1501–1510, 2015.
|
| 229 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V. Le. Learning transferable architectures for scalable image recognition. In CVPR, pp. 8697–8710. IEEE Computer Society, 2018.
|
| 230 |
+
|
| 231 |
+
# APPENDIX A EXPERIMENTAL SETUP
|
| 232 |
+
|
| 233 |
+
# A.1 DATA PRE-PROCESSING AND AUGMENTATION
|
| 234 |
+
|
| 235 |
+
Our experiments are conducted on CIFAR-10/100 (Krizhevsky et al., 2009) and Tiny-ImageNet200. CIFAR-10/100 contains 50,000 training images and 10,000 test images of $3 2 \times 3 2$ pixels in 10 and 100 classes respectively. Tiny-ImageNet-200 consists of 100,000 training images, 10,000 validation images and 10,000 test images5 in 200 classes. We adopt the same data pre-processing and argumentation as described in DARTS (Liu et al., 2019): zero padding the training images with 4 pixels on each side and then randomly cropping them back to $3 2 \times 3 2$ on CIFAR-10/100 and $6 4 \times 6 4$ on Tiny-ImageNet-200; randomly flipping training images horizontally; normalizing training images with the means and standard deviations along the channel dimension.
|
| 236 |
+
|
| 237 |
+
# A.2 SAMPLING OF RANDOM VARIANTS
|
| 238 |
+
|
| 239 |
+
For a $N$ -node NAS cell, there are $\frac { ( N - 2 ) ! } { ( M - 1 ) ! }$ possible connections with $M$ input nodes and one output node. There are therefore hundreds to thousands of possible randomly connected variants for each popular NAS cell. The random variants of operations consist of a similar or even higher amount of architectures. Due to the prohibitive cost of comparing popular NAS cells with all variants, we randomly sample some variants to understand why the popular NAS cells are selected.
|
| 240 |
+
|
| 241 |
+
Given a NAS cell $C$ , we fix the partial order of intermediate nodes and their accompanying operations. We then replace the source node of their associated operations by uniformly randomly sampling a node from their proceeding nodes in the same cell to get their randomly connected variants. Similarly, given a NAS cell $C$ , we fix the partial order of intermediate nodes and their connection topologies. We then replace the operations couping each connection by uniformly randomly sampling from candidate operations to get their random variants of operations.
|
| 242 |
+
|
| 243 |
+
# A.3 ARCHITECTURES AND TRAINING DETAILS
|
| 244 |
+
|
| 245 |
+
For experiments on CIFAR-10/100 and Tiny-ImageNet-200, the neural network architectures are constructed by stacking $L = 2 0$ cells. Feature maps are down-sampled at the $L / 3$ -th and $2 L / 3$ -th cell of the entire architecture with stride 2. For Tiny-ImageNet-200, the stride of the first convolutional layer is adapted to 2 to reduce the input resolution from $6 4 \times 6 4$ to $3 2 \times 3 2$ . A more detailed building scheme can be found in DARTS (Liu et al., 2019).
|
| 246 |
+
|
| 247 |
+
In the default training setting, we apply stochastic gradient descent (SGD) with learning rate 0.025, momentum 0.9, weight decay $3 \times \bar { 1 0 ^ { - 4 } }$ and batch size 80 to train the models for 600 epochs on CIFAR10/100 and 300 epochs on Tiny-ImageNet-200 to ensure the convergence. The learning rate is gradually annealed to zero following the standard cosine annealing schedule. To compare the convergence under different learning rates in Section 4.1, we change the initial learning rate from 0.025 to 0.25 and 0.0025 respectively.
|
| 248 |
+
|
| 249 |
+
# A.4 REGULARIZATION
|
| 250 |
+
|
| 251 |
+
Since regularization mechanisms shall affect the convergence (Zhou et al., 2015), architectures are trained without regularization for a neat empirical study in Section 4. The regularization mechanisms are only used in Section 5 to get the converged generalization performance of the original and adapted NAS architectures on CIFAR-10/100 and Tiny-ImageNet-200 as shown in Table 1.
|
| 252 |
+
|
| 253 |
+
There are three adopted regularization mechanisms on CIFAR-10/100 and Tiny-ImageNet-200 in this paper: cutout (Devries & Taylor, 2017), auxiliary tower (Szegedy et al., 2015) and drop path (Larsson et al., 2017). We apply standard cutout regularization with cutout length 16. Moreover, the auxiliary tower is located at $2 L / 3$ -th cell of the entire architecture with weight 0.4. We apply the same linearly-increased drop path schedule as in NASNet (Zoph et al., 2018) with the maximum probability of 0.2.
|
| 254 |
+
|
| 255 |
+
# APPENDIX B MORE RESULTS
|
| 256 |
+
|
| 257 |
+
# B.1 NAS ARCHITECTURES AND THEIR VARIANTS
|
| 258 |
+
|
| 259 |
+
We compare the width and depth of popular NAS architectures and their variants of random connections in Table 2. The random variants are sampled following the method in Appendix A.2. We further show the connection topologies of popular NAS and their partial random variants of connections in Figure 10 and Figure 11.
|
| 260 |
+
|
| 261 |
+
Table 2: Comparison of the width and depth of popular NAS cells and their randomly variants of connections. The name of the popular NAS cell is followed by its width and depth, which is separated by a comma. The width of a cell is conventionally computed by assuming that each intermediate node shares the same width $c$ . Notably, the width and depth of random variants are in ascending and descending order respectively from $C _ { 1 }$ to $C _ { 1 3 }$ . Moreover, the popular NAS architectures achieve the largest width and nearly the smallest depth among all the variants.
|
| 262 |
+
|
| 263 |
+
<table><tr><td>Base Cell</td><td>C</td><td>C</td><td>C3</td><td>C4</td><td>C5</td><td>C6</td><td>C7</td><td>C8</td><td>Cg</td><td>C10</td><td>C11</td><td>C12</td><td>C13</td></tr><tr><td>DARTS (3.5c,3)</td><td>2c,4</td><td>2c,4</td><td>2c,4</td><td>2.5c,4</td><td>2.5c,4</td><td>2.5c,3</td><td>2.5c,3</td><td>2.5c,3</td><td>3c,3</td><td>3c,3</td><td>3c,3</td><td>3.5c,3</td><td>3.5c,3</td></tr><tr><td>ENAS (5c,2)</td><td>1.5c,6</td><td>1.5c,5</td><td>2c,6</td><td>2c,6</td><td>2.5c,5</td><td>2.5c,5</td><td>3c,4</td><td>3c,3</td><td>3.5c,5</td><td>3.5c,4</td><td>3.5c,4</td><td>3.5c,3</td><td>3.5c,3</td></tr><tr><td>AmoebaNet (4c,4)</td><td>1.5c,6</td><td>1.5c,5</td><td>1.5c,5</td><td>1.5c,3</td><td>2c,6</td><td>2c,6</td><td>2c,4</td><td>2.5c,5</td><td>2.5c,3</td><td>2.5c,3</td><td>3c,3</td><td>3.5c,4</td><td>3.5c,3</td></tr><tr><td>NASNet (5c,2)</td><td>1.5c,6</td><td>1.5c,5</td><td>2c,6</td><td>2c,6</td><td>2.5c,5</td><td>2.5c,5</td><td>3c,4</td><td>3c,3</td><td>3.5c,5</td><td>3.5c,4</td><td>3.5c,4</td><td>3.5c,3</td><td>3.5c,3</td></tr></table>
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 10: Connection topology of AmoebaNet cell (Real et al., 2019) and its part of randomly connected variants. Each sub-figure reports the width and depth of a cell separated by a comma. The leftmost one is the original connection from AmoebaNet normal cell and others are the ones randomly sampled. The width of a cell is also computed by assuming that each intermediate node shares the same width $c$ . Notably, the original AmoebaNet cell has the largest width and almost the smallest depth among these cells.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 11: Connection topology of SNAS cell under mild constraint (Xie et al., 2019b) and its part of randomly connected variants. The width and depth of a cell are reported in the title of each plot. The leftmost one is the original connection from SNAS normal cell and others are the ones randomly sampled. The width of a cell is conventionally computed by assuming that each intermediate node shares the same width $c$ . Notably, the original SNAS cell has the largest width and the smallest depth among these cells.
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 12: More test accuracy $( \% )$ curves of DARTS, ENAS, AmoebaNet, NASNet and their random variants of operations on CIFAR-10 during training.
|
| 273 |
+
|
| 274 |
+
Table 3: Comparison of the parameter size (MB) of popular NAS cells and their randomly variants of operations. $C _ { 0 }$ denotes the original NAS cell and $C _ { 1 }$ to $C _ { 1 0 }$ denote the random variants. Notably, there is a gap of $\sim 3 0 \%$ between the parameter size of the smallest architecture and one of the largest architecture.
|
| 275 |
+
|
| 276 |
+
<table><tr><td>Base cell</td><td>C</td><td>C1</td><td>C</td><td>C3</td><td>C4</td><td>C5</td><td>C6</td><td>C7</td><td>C8</td><td>C</td><td>C10</td></tr><tr><td>DARTS</td><td>3.35</td><td>3.37</td><td>2.84</td><td>2.70</td><td>2.98</td><td>3.19</td><td>2.43</td><td>3.49</td><td>2.88</td><td>3.31</td><td>2.81</td></tr><tr><td>ENAS</td><td>3.86</td><td>3.45</td><td>3.19</td><td>2.98</td><td>2.70</td><td>3.67</td><td>3.03</td><td>3.85</td><td>3.26</td><td>3.81</td><td>3.29</td></tr><tr><td>AmoebaNet</td><td>3.15</td><td>2.86</td><td>2.62</td><td>2.41</td><td>2.10</td><td>3.10</td><td>2.46</td><td>3.28</td><td>2.69</td><td>3.42</td><td>2.75</td></tr><tr><td>NASNet</td><td>3.83</td><td>3.45</td><td>3.19</td><td>2.98</td><td>2.70</td><td>3.67</td><td>3.03</td><td>3.85</td><td>3.26</td><td>3.81</td><td>3.29</td></tr></table>
|
| 277 |
+
|
| 278 |
+
# B.2 CONVERGENCE
|
| 279 |
+
|
| 280 |
+
In this section, we plot more test loss curves on CIFAR-10 (Krizhevsky et al., 2009) for original popular NAS architectures and their (12) randomly connected variants, as shown in Figure 13, Figure 14 and Figure 16. The depth and width of these 12 randomly connected variants can be found in Table 2. Notably, the width and depth of random variants (from $C _ { 1 }$ to $C _ { 1 2 }$ ) are in ascending and descending order respectively. Moreover, the popular NAS architectures achieve the largest width and nearly the smallest depth among all the variants. As shown in the following figures, the popular NAS cells, with larger width and smaller depth, typically achieve faster and more stable convergence than the random variants. Furthermore, with the increasing width and the decreasing depth, the convergence of random variants approaches to the original NAS architecture.
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 13: Test loss curves of DARTS and its variants on CIFAR-10 during training.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 14: Test loss curves of AmoebaNet and its variants on CIFAR-10 during training.
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 15: Test loss curves of ENAS and its variants on CIFAR-10 suring training.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 16: Test loss curves of NASNet and its variants on CIFAR-10 suring training.
|
| 293 |
+
|
| 294 |
+
# B.3 LOSS LANDSCAPE
|
| 295 |
+
|
| 296 |
+
In this section, we visualize loss landscapes for popular NAS architectures and their randomly connected variants. The depth and width of a cell are highly correlated. For example, the depth and width cannot reach their maximum simultaneously. With the increasing width, the average depth of cells grouped by the same width is decreasing as shown in Table 2. We therefore only group the results (including the ones from original NAS architectures) with various width levels of a cell for a better comparison. Notably, the architectures with wider and shallower cells have a smoother and benigner loss landscape, as shown in Figure 17, Figure 18, Figure 19 and Figure 20, which further supports the results in Section 4.2.1.
|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
Figure 17: Loss contours of DARTS and its variants with random connections on the test dataset of CIFAR-10.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
Figure 18: Loss contours of AmoebaNet and its randomly connected variants on the test dataset of CIFAR-10.
|
| 303 |
+
|
| 304 |
+
(a) 1.5c (b) 2c (c) 2.5c (d) 3c (e) 3.5c (a) 1.5c (b) 2c (c) 2.5c (d) 3c (e) 3.5c (a) 1.5c (b) 2c (c) 2.5c (d) 3c (e) 3.5c
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 19: Loss contours of ENAS and its randomly connected variants on the test dataset of CIFAR10.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 20: Loss contours of NASNet and its randomly connected variants on the test dataset of CIFAR-10.
|
| 311 |
+
|
| 312 |
+
# B.4 GRADIENT VARIANCE
|
| 313 |
+
|
| 314 |
+
In this section, we visualize the gradient variance (i.e., $g ( \alpha , \beta )$ as defined in Section 4.2.2) for the popular NAS architectures as well as their variants with random connection, such as AmoebaNet in Figure 21, DARTS in Figure 22, ENAS in Figure 23 and NASNet in Figure 23. The $z$ -axis has been scaled by $1 0 ^ { - 5 }$ for a better visualization. Similarly, we group the results based on the width of cells. Notably, architectures with wider and shallower cells achieve relatively smaller gradient variance, which further confirms the results in Section 4.2.2.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 21: 3D surfaces of the gradient variance from AmoebaNet and its randomly connected variants on the test dataset of CIFAR-10.
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure 22: 3D surfaces of the gradient variance from DARTS and its randomly connected variants on the test dataset of CIFAR-10.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 23: 3D surfaces of the gradient variance from ENAS and its randomly connected variants on the test dataset of CIFAR-10.
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 24: 3D surfaces of the gradient variance from NASNet and its randomly connected variants on the test dataset of CIFAR-10.
|
| 327 |
+
|
| 328 |
+
# B.5 ADAPTED TOPOLOGIES
|
| 329 |
+
|
| 330 |
+
In this section, we visualize the adapted architectures (in Figure 25) we investigate on in Section 5. Notably, The adapted connection topologies are not only applied in the normal cell but also the reduction cell. The adapted architectures are compared with popular NAS architectures to examine the impacts of the common connection pattern on generalization.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 25: Adapted topologies of cells from popular NAS architectures. The title of each sub-figure includes the name of the architecture, width and depth of the cell following our definition. Notably, these cells achieve the largest width and smallest depth in their original search space.
|
| 334 |
+
|
| 335 |
+
# APPENDIX C THEORETICAL ANALYSIS
|
| 336 |
+
|
| 337 |
+
# C.1 SETUP
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 26: Two architectures to compare in the theoretical analysis: (a) architecture with widest cell; (b) architecture with narrowest cell. The notation $l$ and $\widehat { l }$ denote the values of objective function $f$ and $\widehat { f }$ evaluated at input $_ { \textbf { \em x } }$ respectively.
|
| 341 |
+
|
| 342 |
+
# C.2 BASICS
|
| 343 |
+
|
| 344 |
+
We firstly compare the gradient of case I and case $\mathrm { I I }$ shown in Figure 26. For case I, since $\begin{array} { r l } { \mathbf { \boldsymbol { y } } ^ { ( i ) } = } & { { } } \end{array}$ $W ^ { ( i ) } { \pmb x }$ , the gradient to each weight matrix $W ^ { ( i ) }$ is denoted by
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\frac { \partial f } { \partial W ^ { ( i ) } } = \frac { \partial f } { \partial \pmb { y } ^ { ( i ) } } \pmb { x } ^ { T }
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Similarly, since $\begin{array} { r } { \widehat { \pmb { y } } ^ { ( i ) } = \prod _ { k = 1 } ^ { i } W ^ { ( k ) } \pmb { x } } \end{array}$ for the case II, the gradient to each weight matrix $W ^ { ( i ) }$ is denoted by
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array} { l } { \displaystyle \frac { \partial \widehat { f } } { \partial W ^ { ( i ) } } = \sum _ { k = i } ^ { n } ( \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } \displaystyle \frac { \partial \widehat { f } } { \partial \widehat { y } ^ { ( k ) } } ( \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } { \pmb x } ) ^ { T } } \\ { = \sum _ { k = i } ^ { n } ( \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } \displaystyle \frac { \partial \widehat { f } } { \partial \widehat { y } ^ { ( k ) } } { \pmb x } ^ { T } ( \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } } \\ { = \displaystyle \sum _ { k = i } ^ { n } ( \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } \displaystyle \frac { \partial { f } } { \partial W ^ { ( k ) } } ( \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } } \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
Exploring the fact that $\begin{array} { r } { \frac { \partial \widehat { f } } { \partial \widehat { \pmb { y } } ^ { ( i ) } } = \frac { \partial f } { \partial \pmb { y } ^ { ( i ) } } } \end{array}$ ∂f∂y(i) , we get (4) by inserting (1) into (3).
|
| 357 |
+
|
| 358 |
+
# C.3 PROOF OF THEOREM 4.2
|
| 359 |
+
|
| 360 |
+
Due to the complexity of comparing the standard Lipschitz constant of the smoothness for these two cases, we instead investigate the block-wise Lipschitz constant (Beck & Tetruashvili, 2013). In other words, we evaluate the Lipschitz constant for each weight matrix $W ^ { ( i ) }$ while fixing all other matrices. Formally, we assume the block-wise Lipschitz smoothness of case I as
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
\left\| \frac { \partial f } { \partial W _ { 1 } ^ { ( i ) } } - \frac { \partial f } { \partial W _ { 2 } ^ { ( i ) } } \right\| \leq L ^ { ( i ) } \left\| W _ { 1 } ^ { ( i ) } - W _ { 2 } ^ { ( i ) } \right\| \quad \forall W _ { 1 } ^ { ( i ) } , W _ { 2 } ^ { ( i ) }
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
The default matrix norm we adopted is 2-norm. And $W _ { 1 } ^ { ( i ) } , W _ { 2 } ^ { ( i ) }$ denote possible assignments for $W ^ { ( i ) }$ .
|
| 367 |
+
|
| 368 |
+
Denoting that $\lambda ^ { ( i ) } = \left\| W ^ { ( i ) } \right\|$ , which is the largest eigenvalue of matrix $W ^ { ( i ) }$ , we can get the smoothness of case $\mathrm { I I }$ as
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\begin{array} { r l } { \left| \frac { \partial \hat { f } } { \partial W _ { 1 } ^ { ( i ) } } - \frac { \partial \hat { f } } { \partial W _ { 2 } ^ { ( i ) } } \right| \Bigg | = \left| \displaystyle \sum _ { k = i } ^ { n } ( \displaystyle \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } \big ( \frac { \partial f } { \partial W _ { 1 } ^ { ( k ) } } - \frac { \partial f } { \partial W _ { 2 } ^ { ( k ) } } ) ( \displaystyle \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } \right| } & { } \\ { \displaystyle } & { \leq \displaystyle \sum _ { k = i } ^ { n } \left\| \big ( \displaystyle \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } \big ) ^ { T } \big ( \frac { \partial f } { \partial W _ { 1 } ^ { ( k ) } } - \frac { \partial f } { \partial W _ { 2 } ^ { ( k ) } } \big ) ( \displaystyle \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } \right| } \\ & { \displaystyle \leq \displaystyle \sum _ { k = i } ^ { n } ( \displaystyle \frac { 1 } { \lambda ^ { ( i ) } } \displaystyle \prod _ { j = 1 } ^ { k } \lambda ^ { ( j ) } ) L ^ { ( k ) } \left\| W _ { 1 } ^ { ( k ) } - W _ { 2 } ^ { ( k ) } \right\| } \\ & { \displaystyle \leq ( \displaystyle \prod _ { j = 1 } ^ { i - 1 } \lambda ^ { ( j ) } ) L ^ { ( i ) } \left\| W _ { 1 } ^ { ( i ) } - W _ { 2 } ^ { ( k ) } \right\| } \end{array}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
We get the equality in (6) since $j > i$ and $W ^ { ( j ) }$ keeps the same for the computation of block-wise Lipschitz constant of $W ^ { ( i ) }$ . Based on the triangle inequality of norm, we get (7) from (6). We get (8) from (7) based on the inequality $\lVert W V \rVert \leq \lVert W \rVert \lVert V \rVert$ and the assumption of the smoothness for case I in (5). Finally, since we are evaluating the block-wise Lipschitz constant for $W ^ { ( i ) }$ , $W _ { 1 } ^ { ( k ) } = W _ { 2 } ^ { ( k ) }$ while $k \neq i$ , which leads to the final inequality (9).
|
| 375 |
+
|
| 376 |
+
# C.4 PROOF OF THEOREM 4.3
|
| 377 |
+
|
| 378 |
+
Similarly, we assume the gradient variance of case I is bounded as
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\mathbb { E } \left\| \frac { \partial f } { \partial W ^ { ( i ) } } - \mathbb { E } \frac { \partial f } { \partial W ^ { ( i ) } } \right\| ^ { 2 } \leq ( \sigma ^ { ( i ) } ) ^ { 2 }
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
The gradient variance of case $\mathrm { I I }$ is then bounded by
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\begin{array} { r l } { \mathbb { E } \left\| \displaystyle \frac { \partial \hat { f } } { \partial W ^ { ( i ) } } - \mathbb { E } \frac { \partial \hat { f } } { \partial W ^ { ( i ) } } \right\| ^ { 2 } = \mathbb { E } \left\| \displaystyle \sum _ { k = i } ^ { n } ( \displaystyle \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } ( \displaystyle \frac { \partial f } { \partial W ^ { ( k ) } } - \mathbb { E } \frac { \partial f } { \partial W ^ { ( k ) } } ) ( \displaystyle \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } \right\| ^ { 2 } } & { } \\ { \leq n \mathbb { E } \displaystyle \sum _ { k = i } ^ { n } \left\| ( \displaystyle \prod _ { j = i + 1 } ^ { k } W ^ { ( j ) } ) ^ { T } ( \displaystyle \frac { \partial f } { \partial W ^ { ( k ) } } - \mathbb { E } \frac { \partial f } { \partial W ^ { ( k ) } } ) ( \displaystyle \prod _ { j = 1 } ^ { i - 1 } W ^ { ( j ) } ) ^ { T } \right\| ^ { 2 } } & { } \\ { \leq n \displaystyle \sum _ { k = i } ^ { n } ( \displaystyle \frac { \sigma ^ { ( k ) } } { \lambda ^ { ( i ) } } \displaystyle \prod _ { j = 1 } ^ { k } \lambda ^ { ( j ) } ) ^ { 2 } } & { } \end{array}
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
We get (12) from (11) based on Cauchy-Schwarz inequality. Based on the inequality $\| W V \| \leq$ $\| W \| \| V \|$ and the assumption of bounded gradient variance for case I in (10), we get the final inequality.
|
md/train/BJxpIJHKwB/BJxpIJHKwB.md
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ATTENTIVE WEIGHTS GENERATION FOR FEW SHOTLEARNING VIA INFORMATION MAXIMIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Few shot image classification aims at learning a classifier from limited labeled data. Generating the classification weights has been applied in many metalearning approaches for few shot image classification due to its simplicity and effectiveness. However, we argue that it is difficult to generate the exact and universal classification weights for all the diverse query samples from very few training samples. In this work, we introduce Attentive Weights Generation for few shot learning via Information Maximization (AWGIM), which addresses current issues by two novel contributions. i) AWGIM generates different classification weights for different query samples by letting each of query samples attends to the whole support set. ii) To guarantee the generated weights adaptive to different query sample, we re-formulate the problem to maximize the lower bound of mutual information between generated weights and query as well as support data. As far as we can see, this is the first attempt to unify information maximization into few shot learning. Both two contributions are proved to be effective in the extensive experiments and we show that AWGIM is able to achieve state-of-the-art performance on benchmark datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
While deep learning methods achieve great success in domains such as computer vision (He et al., 2016), natural language processing (Devlin et al., 2018), reinforcement learning (Silver et al., 2018), their hunger for large amount of labeled data limits the application scenarios where only a few data are available for training. Humans, in contrast, are able to learn from limited data, which is desirable for deep learning methods. Few shot learning is thus proposed to enable deep models to learn from very few samples (Fei-Fei et al., 2006).
|
| 12 |
+
|
| 13 |
+
Meta learning is by far the most popular and promising approach for few shot problems (Vinyals et al., 2016; Finn et al., 2017; Snell et al., 2017; Ravi & Larochelle, 2016; Rusu et al., 2019). In meta learning approaches, the model extracts high level knowledge across different tasks so that it can adapt itself quickly to a new-coming task (Schmidhuber, 1987; Andrychowicz et al., 2016). There are several kinds of meta learning methods for few shot learning, such as gradient-based (Finn et al., 2017; Ravi & Larochelle, 2016) and metric-based (Snell et al., 2017; Sung et al., 2018). Weights generation, among these different methods, has shown effectiveness with simple formulation (Qi et al., 2018; Qiao et al., 2018; Gidaris & Komodakis, 2018; 2019). In general, weights generation methods learn to generate the classification weights for different tasks conditioned on the limited labeled data. However, fixed classification weights for different query samples within one task might be sub-optimal, due to the few shot challenge.
|
| 14 |
+
|
| 15 |
+
We introduce Attentive Weights Generation for few shot learning via Information Maximization (AWGIM) in this work to address these limitations. In AWGIM, the classification weights are generated for each query sample specifically. This is done by two encoding paths where the query sample attends to the task context. However, we show in experiments that simple cross attention between query samples and support set fails to guarantee classification weights fitted to diverse query data since the query-specific information is lost during weights generation. Therefore, we propose to maximize the lower bound of mutual information between generated weights and query, support data. As far as we know, AWGIM is the first work introducing Variational Information Maximization in few shot learning. The induced computational overhead is minimal due to the nature of few shot problems. Furthermore, by maximizing the lower bound of mutual information, AWGIM gets rid of inner update without compromising performance.
|
| 16 |
+
|
| 17 |
+
AWGIM is evaluated on two benchmark datasets and shows state-of-the-art performance. We also conducted detailed analysis to validate the contribution of each component in AWGIM.
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORKS
|
| 20 |
+
|
| 21 |
+
# 2.1 FEW SHOT LEARNING
|
| 22 |
+
|
| 23 |
+
Learning from few labeled training data has received growing attentions recently. Most successful existing methods apply meta learning to solve this problem and can be divided into several categories. In the gradient-based approaches, an optimal initialization for all tasks is learned (Finn et al., 2017). Ravi & Larochelle (2016) learned a meta-learner LSTM directly to optimize the given fewshot classification task. Sun et al. (2019) learned the transformation for activations of each layer by gradients to better suit the current task.
|
| 24 |
+
|
| 25 |
+
In the metric-based methods, a similarity metric between query and support samples is learned. (Koch et al., 2015; Vinyals et al., 2016; Snell et al., 2017; Sung et al., 2018; Li et al., 2019a). Spatial information or local image descriptors are also considered in some works to compute richer similarities (Lifchitz et al., 2019; Li et al., 2019b; Wertheimer & Hariharan, 2019).
|
| 26 |
+
|
| 27 |
+
Generating the classification weights directly has been explored by some works. Gidaris & Komodakis (2018) generated classification weights as linear combinations of weights for base and novel classes. Similarly, Qiao et al. (2018) and Qi et al. (2018) both generated the classification weights from activations of a trained feature extractor. Graph neural network denoising autoencoders are used in (Gidaris & Komodakis, 2019). Munkhdalai & Yu (2017) proposed to generate “fast weights” from the loss gradient for each task. All these methods do not consider generating different weights for different query examples, nor maximizing the mutual information.
|
| 28 |
+
|
| 29 |
+
There are some other methods for few-shot classification. Generative models are used to generate or hallucinate more data in (Zhang et al., 2018; Wang et al., 2018; Chen et al., 2019). Bertinetto et al. (2019) and Lee et al. (2019) used the closed-form solutions directly for few shot classification. Liu et al. (2019) integrated label propagation on a transductive graph to predict the query class label.
|
| 30 |
+
|
| 31 |
+
# 2.2 ATTENTION
|
| 32 |
+
|
| 33 |
+
Attention mechanism shows great success in computer vision (Xu et al., 2015; Parmar et al., 2018) and natural language processing (Bahdanau et al., 2015; Vaswani et al., 2017). It is effective in modeling the interaction between queries and key-value pairs from certain context. Based on the fact that keys and queries point to the same entities or not, people refer to attention as self attention or cross attention. In this work, we use both types of attention to encode the task and query-task information. The work most similar to ours is Attentive Neural Processes (Kim et al., 2019), which also employs self and cross attention. However, we are using attention for few-shot image classification via maximizing the mutual information. In stark contrast, Kim et al. (2019) worked on regression from the perspective of a stochastic process and the variational objective is optimized.
|
| 34 |
+
|
| 35 |
+
# 2.3 MUTUAL INFORMATION
|
| 36 |
+
|
| 37 |
+
Given two random variables $\mathbf { X }$ and $\mathsf { y }$ , mutual information $I ( { \bf x } ; { \bf y } )$ measures the decrease of uncertainty in one random variable when another is known. It is defined as the Kullback-Leibler divergence between joint distribution $p ( \mathbf { x } , \mathbf { y } )$ and product of marginal distributions $p ( \mathbf { x } ) \otimes p ( \mathbf { y } )$ ,
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
I ( \mathbf { x } ; \mathbf { y } ) = D _ { \mathrm { K L } } ( p ( \mathbf { x } , \mathbf { y } ) \| p ( \mathbf { x } ) \otimes p ( \mathbf { y } ) ) .
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
When x and y are independent, $p ( \mathbf { x } , \mathbf { y } ) = p ( \mathbf { x } ) \otimes p ( \mathbf { y } )$ so that $I ( { \bf x } , { \bf y } ) = 0$ , indicating that knowing $\mathbf { X }$ does not reveal any information about y. When y is a deterministic function of $\mathbf { X }$ , $I ( \mathbf { x } , \mathbf { y } )$ achieves its maximum value. Mutual information has been widely applied in applications such as Generative Adversarial Networks(Chen et al., 2016), self-supervised learning(Hjelm et al., 2019), visual question generation Krishna et al. (2019) and so on.
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: The overview of our proposed AWGIM. The input task is 5-way 1-shot with $\mathbf { X }$ as support set and $\hat { \bf x }$ as one query example. Different colors of the data in support set indicate different categories. The encoding process in contextual path produces context-aware support representations $\mathbf { X } ^ { c p }$ . Similarly, the attentive path enables the query sample $\hat { \bf x }$ to be equipped with task knowledge. Both paths are achieved by attention mechanism. $\hat { \mathbf { x } } ^ { a p }$ is repeated to concatenate with $\mathbf { X } ^ { c p }$ . The weight generator $g$ takes these concatenated representations as input to generate classification weights W specific for $\hat { \bf x }$ , denoted by the colorful matrix with slash. It can be used to predict the class label for $\hat { \bf x }$ and X. W is also used to reconstruct the inputs of the generator $g$ by two networks $r _ { 1 }$ and $r _ { 2 }$ . In this way, the lower bound of mutual information is maximized and $g$ is forced to generate classification weights sensitive to different query samples.
|
| 47 |
+
|
| 48 |
+
# 3 PROPOSED METHOD
|
| 49 |
+
|
| 50 |
+
In this section, we provide the problem formulation first. Then the proposed model is described in Sec. 3.3. The objective function, which maximizes the mutual information between certain variables, and theoretical analysis are provided in Sec. 3.4.
|
| 51 |
+
|
| 52 |
+
# 3.1 PROBLEM FORMULATION
|
| 53 |
+
|
| 54 |
+
Following many popular meta-learning methods for few shot classification, we formulate the problem under episodic training paradigm (Vinyals et al., 2016; Finn et al., 2017). One $N$ -way $K$ -shot task sampled from an unknown task distribution $P ( \tau )$ includes support set and query set:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
{ \mathcal { T } } = ( { \mathcal { S } } , { \mathcal { Q } } ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $\mathcal { S } = \{ ( \mathbf { x } ^ { c _ { n } ; k } , \mathbf { y } ^ { c _ { n } ; k } ) | k = 1 , . . . , K ; n = 1 , . . . , N \}$ , $\mathcal { Q } = \{ ( \hat { \mathbf { x } } _ { 1 } , . . . , \hat { \mathbf { x } } _ { | \mathcal { Q } | } ) \}$ . Support set $s$ contains $N K$ labeled samples. Query set $\mathcal { Q }$ includes $\hat { \bf x }$ and we need to predict label $\hat { \mathbf { y } }$ for $\hat { \bf x }$ based on $s$ . During meta-training, the meta-loss is estimated on $\mathcal { Q }$ to optimize the model. During metatesting, the performance of meta-learning method is evaluated on $\mathcal { Q }$ , provided the labeled $s$ . The classes used in meta-training and meta-testing are disjoint so that the meta-learned model needs to learn the knowledge transferable across tasks and adapt itself quickly to novel tasks.
|
| 61 |
+
|
| 62 |
+
Our proposed approach follows the general framework to generate the classification weights (Qi et al., 2018; Qiao et al., 2018; Rusu et al., 2019; Gidaris & Komodakis, 2018; 2019). In this framework, there is a feature extractor to output image feature embeddings. The meta-learner needs to generate the classification weights for different tasks.
|
| 63 |
+
|
| 64 |
+
# 3.2 LATENT EMBEDDING OPTIMIZATION
|
| 65 |
+
|
| 66 |
+
Latent Embedding Optimization (LEO) (Rusu et al., 2019) is one of the weights generation methods that is most related to our work. In LEO, the latent code $_ z$ is generated by $h$ conditioned on support set $s$ , described as $z = h ( S )$ . $h$ is instantiated as relation networks (Santoro et al., 2017). Classification weights $\pmb { w }$ can be decoded from $_ { z }$ with $l$ , $w = l ( z )$ . In the inner loop, we use $\pmb { w }$ to compute the loss (usually cross entropy) on the support set and then update $_ z$ :
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r } { z ^ { \prime } = z - \eta \nabla _ { z } \mathcal { L } _ { \mathcal { S } } ( \pmb { w } ) , } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\mathcal { L } _ { S }$ indicates that the loss is evaluated on $s$ only. The updated latent code $z ^ { \prime }$ is used to decode new classification weights $\mathbf { \Delta } \mathbf { w ^ { \prime } }$ with generating function $l$ . $\mathbf { \Delta } _ { \mathbf { \ b { w } } ^ { \prime } }$ is adopted in the outer loop for query set $\mathcal { Q }$ and the objective function of LEO then can be written as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\operatorname* { m i n } _ { \theta } \mathcal { L } _ { \mathcal { Q } } ( w ^ { \prime } ) .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Here $\theta$ stands for the parameters of $h$ and $l$ and we omit the regularization terms for clarity. LEO avoids updating high-dimensional $\textbf { \em w }$ in the inner loop by learning a lower-dimensional latent space, from which sampled $_ z$ can be used to generate $\pmb { w }$ . The most significant difference between LEO and AWGIM is that we do not need inner updates to adapt the model. Instead, AWGIM is a feedforward network trained to maximize the mutual information so that it fits to different tasks well. On the other hand, AWGIM learns to generate optimal classification weights for each query sample while LEO generates fixed weights conditioned on the support set within one task. In Section 3.4 we will show LEO can be casted as a special case of AWGIM under certain conditions.
|
| 79 |
+
|
| 80 |
+
# 3.3 ATTENTIVE WEIGHTS GENERATION
|
| 81 |
+
|
| 82 |
+
The framework of our proposed method is shown in Figure 1. Assume that we have a feature extractor, which can be a simple 4-layer Convnet or a deeper Resnet. All the images included in the sampled task $\tau$ are processed by this feature extractor and represented as $d$ -dimensional vectors afterwards, i.e., $\mathbf { x } ^ { c _ { n } ; k } , \hat { \mathbf { x } } \in \mathbb { R } ^ { d }$ . There are two paths to encode the task context and the individual query sample respectively, which are called contextual path and attentive path. The outputs of both paths are concatenated together as input to the generator for classification weights. Generated classification weights are used to not only predict the label of $\hat { \bf x }$ , but also maximize the lower bound of mutual information between itself and other variables, which will be discussed in the following section 3.4.
|
| 83 |
+
|
| 84 |
+
# 3.3.1 CONTEXTUAL AND ATTENTIVE PATHS
|
| 85 |
+
|
| 86 |
+
The encoding process includes two paths, namely the contextual path and attentive path. The contextual path aims at learning representations for only the support set with a multi-head self-attention network $f _ { s a } ^ { c p }$ (Vaswani et al., 2017). The outputs of contextual path ${ \bf X } ^ { c p } \in \mathbb { R } ^ { N K \times d _ { h } }$ 1 thus contain richer information about the task and can be used later for weights generation.
|
| 87 |
+
|
| 88 |
+
Existing weights generation methods generate the classification weights conditioned on the support set only, which is equivalent to using contextual path. However, the classification weights generated in this way might be sub-optimal. This is because estimating the exact and universal classification weights from very few labeled data in the support set is difficult and sometimes impossible. The generated weights are usually in lack of adaptation to different query samples. We address this issue by introducing attentive path, where the individual query example attends to the task context and then is used to generate the classification weights. Therefore, the classification weights are adaptive to different query samples and aware of the task context as well.
|
| 89 |
+
|
| 90 |
+
In the attentive path, a new multi-head self-attention network $f _ { s a } ^ { a p }$ on the support set is employed to encode the global task information. $f _ { s a } ^ { a p }$ is different from $f _ { s a } ^ { c p }$ in contextual path because the selfattention network in contextual path emphasizes on generating the classification weights. On the contrary, outputs of self-attention here plays the role of providing the V alue context for different query samples to attend in the following cross attention. Sharing the same self-attention networks might limit the expressiveness of learned representations in both paths. The cross attention network $f _ { c a } ^ { a p }$ applied on each query sample and task-aware support set is followed to produce $\hat { \bf X } ^ { a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times d _ { h } }$ .
|
| 91 |
+
|
| 92 |
+
We use multi-head attention with $h$ heads in both paths. In one attention block, we produce $h$ different sets of queries, keys and values. Multi-head attention is claimed to be able to learn more comprehensive and expressive representations from $h$ different subspaces (Vaswani et al., 2017; Voita et al., 2019). More details of these two paths can be found in A.2.
|
| 93 |
+
|
| 94 |
+
# 3.3.2 WEIGHTS GENERATOR
|
| 95 |
+
|
| 96 |
+
We replicate them afterwa ${ \bf X } ^ { c p } \in \mathbb { R } ^ { N K \times d _ { h } }$ anve $\hat { \bf X } ^ { a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times d _ { h } }$ r $| \mathcal { Q } |$ $N K$ ectively and reshape. These two tensors $\pmb { \chi } ^ { c p } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times d _ { h } }$ $\hat { \pmb { \mathsf { X } } } ^ { a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times d _ { h } }$
|
| 97 |
+
|
| 98 |
+
$d _ { h } < d$ is the hidden dimension. We use matrix form here to be consistent with the description in 3.3.2.
|
| 99 |
+
|
| 100 |
+
are concatenated to become $\pmb { \chi } ^ { c p \oplus a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times 2 d _ { h } }$ . $\mathbf { \pmb { \chi } } ^ { c p \oplus a p }$ can be interpreted that each query sample has its own latent representations for support set to generate specific classification weights, which are both aware of the task-context and adaptive to individual query sample.
|
| 101 |
+
|
| 102 |
+
$\mathbf { X } ^ { c p \oplus a p }$ is decoded by the weights generator $g : \mathbb { R } ^ { 2 d _ { h } } \mathbb { R } ^ { 2 d }$ . We assume that the classification weights follow Gaussian distribution with diagonal covariance. $g$ outputs the distribution parameters and we sample the weights from learned distribution during meta-training. The sampled classification weights are represented as $\pmb { \mathsf { W } } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times d }$ . To reduce complexity, we compute the mean value on $K$ classification weights for each class to have ${ \pmb W } ^ { f i n a l } \in \mathbb { R } ^ { | \mathcal { Q } | \times N \times d }$ . Therefore, ith query sample has its specifican be computed by c classifica Wf inali,:,: tion weight matrix . The support data $\pmb { \mathsf { W } } _ { i , : , : } ^ { f i n a l } \in \mathbb { R } ^ { N \times d }$ . Th for rediction for query datatimes and reshaped as $\hat { \mathbf { X } } \mathbf { W } ^ { f i n a l \mathbf { T } }$ $\mathbf { X }$ $| \mathcal { Q } |$ $\pmb { \chi } _ { s } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times d }$ . So the prediction for support data can also be computed as ${ \pmb x } _ { s } { \pmb w } ^ { f i n a l { \bf T } }$ .
|
| 103 |
+
|
| 104 |
+
Besides the weights generator $g$ , we have another two decoders $r _ { 1 } : \mathbb { R } ^ { d } \mathbb { R } ^ { d _ { h } }$ and $r _ { 2 } : \mathbb { R } ^ { d } $ $\mathbb { R } ^ { d _ { h } }$ . They both take the generated weights $\boldsymbol { \mathsf { W } }$ as inputs and learn to reconstruct $\mathbf { X } ^ { c p }$ and ${ \hat { \mathbf { X } } } ^ { a p }$ respectively. The outputs of $r _ { 1 }$ and $r _ { 2 }$ are denoted as $\bar { \pmb { \chi } } _ { r e } ^ { c p } , \hat { \pmb { \chi } } _ { r e } ^ { a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times N K \times d _ { h } }$ . The reason we are using reconstruction as auxiliary tasks will be discussed in following Sec. 3.4.
|
| 105 |
+
|
| 106 |
+
# 3.4 INFORMATION MAXIMIZATION
|
| 107 |
+
|
| 108 |
+
In this section, we perform the analysis for one query sample without loss of generality. The subscripts for classification weights are omitted for clarity. In general, we use $\displaystyle ( \mathbf { x } , \mathbf { y } )$ and $( \hat { \mathbf { x } } , \hat { \mathbf { y } } )$ to represent support and query samples respectively.
|
| 109 |
+
|
| 110 |
+
Since the classification weights w generated from $g$ are encoded with attentive path and contextual path, it is expected that we can directly have the query-specific weights. However, we show in the experiments that simply doing this does not outperform a weight generator conditioned only on the $s$ significantly, which implies that the generated classification weights from two paths are not sensitive to different query samples. In other words, the information from attentive path is not kept well during the weights generation.
|
| 111 |
+
|
| 112 |
+
To address this limitation, we propose to maximize the mutual information between generated weights w and support as well as query data. The objective function can be described as
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\operatorname* { m a x } I ( ( \hat { \mathbf { x } } , \hat { \mathbf { y } } ) ; \mathbf { w } ) + \sum _ { ( \mathbf { x } , \mathbf { y } ) \in S } I ( ( \mathbf { x } , \mathbf { y } ) ; \mathbf { w } )
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
According to the chain rule of mutual information, we have
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
I ( ( \hat { \mathbf { x } } , \hat { \mathbf { y } } ) ; \mathbf { w } ) = I ( \hat { \mathbf { x } } ; \mathbf { w } ) + I ( \hat { \mathbf { y } } ; \mathbf { w } | \hat { \mathbf { x } } ) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Equation 6 stands for both terms in 5. So the objective function can be written as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\operatorname* { m a x } I ( \hat { \mathbf { x } } ; \mathbf { w } ) + I ( \hat { \mathbf { y } } ; \mathbf { w } | \hat { \mathbf { x } } ) + \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \mathcal { S } } [ I ( \mathbf { x } ; \mathbf { w } ) + I ( \mathbf { y } ; \mathbf { w } | \mathbf { x } ) ] .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Directly computing the mutual information in Equation 7 is intractable since the true posteriori distributions like $p ( \hat { \mathbf { y } } | \hat { \mathbf { x } } , \mathbf { w } )$ , $p ( \hat { \mathbf { x } } | \mathbf { w } )$ are still unknown. Therefore, we use Variational Information Maximization (Barber & Agakov, 2003; Chen et al., 2016) to compute the lower bound of Equation 5. We use $p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } )$ to approximate the true posteriori distribution, where $\theta$ represents the model parameters. As a result, we have
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r c l } { I ( \hat { \mathbf { x } } ; \mathbf { w } ) } & { = } & { H ( \hat { \mathbf { x } } ) - H ( \hat { \mathbf { x } } | \mathbf { w } ) } \\ & { = } & { H ( \hat { \mathbf { x } } ) + \mathbb { E } _ { \mathbf { w } \sim p ( \mathbf { w } | \hat { \mathbf { x } } , S ) } [ \mathbb { E } _ { \hat { \mathbf { x } } \sim p ( \hat { \mathbf { x } } | \mathbf { w } ) } [ \log p ( \hat { \mathbf { x } } | \mathbf { w } ) ] ] } \\ & { = } & { H ( \hat { \mathbf { x } } ) + \mathbb { E } _ { \mathbf { w } \sim p ( \mathbf { w } | \hat { \mathbf { x } } , S ) } [ D _ { \mathrm { K L } } ( p ( \hat { \mathbf { x } } | \mathbf { w } ) | | p \theta ( \hat { \mathbf { x } } | \mathbf { w } ) ) + \mathbb { E } _ { \hat { \mathbf { x } } \sim p ( \hat { \mathbf { x } } | \mathbf { w } ) } [ \log p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } ) ] ] } \\ & { \geq } & { H ( \hat { \mathbf { x } } ) + \mathbb { E } _ { \mathbf { w } \sim p ( \mathbf { w } | \hat { \mathbf { x } } , S ) } [ \mathbb { E } _ { \hat { \mathbf { x } } \sim p ( \hat { \mathbf { x } } | \mathbf { w } ) } [ \log p \theta ( \hat { \mathbf { x } } | \mathbf { w } ) ] ] } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
$H ( \cdot )$ is the entropy of a random variable. $H ( { \hat { \mathbf { x } } } )$ is a constant value for given data. We can maximize this lower bound as the proxy for the true mutual information.
|
| 137 |
+
|
| 138 |
+
Similar to $I ( \hat { \mathbf { x } } ; \mathbf { w } )$
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
I ( \hat { \mathbf { y } } ; \mathbf { w } | \hat { \mathbf { x } } ) \geq H ( \hat { \mathbf { y } } | \hat { \mathbf { x } } ) + \mathbb { E } _ { \mathbf { w } \sim p ( \mathbf { w } | \hat { \mathbf { x } } , S ) } [ \mathbb { E } _ { \hat { \mathbf { y } } \sim p ( \hat { \mathbf { y } } | \hat { \mathbf { x } } , \mathbf { w } ) } [ \log p _ { \theta } ( \hat { \mathbf { y } } | \hat { \mathbf { x } } , \mathbf { w } ) ] ] ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\begin{array} { r } { \displaystyle \sum _ { \mathbf { x } , \mathbf { y } ) \in S } I ( ( \mathbf { x } , \mathbf { y } ) ; \mathbf { w } ) \geq \displaystyle \sum _ { ( \mathbf { x } , \mathbf { y } ) \in S } H ( ( \mathbf { x } , \mathbf { y } ) ) + \mathbb { E } _ { \mathbf { w } \sim p ( \mathbf { w } | \hat { \mathbf { x } } , S ) } [ \mathbb { E } _ { ( \mathbf { x } , \mathbf { y } ) \sim p ( ( \mathbf { x } , \mathbf { y } ) | \mathbf { w } ) } [ \log p _ { \theta } ( \mathbf { x } | \mathbf { w } ) + \log p _ { \theta } ( \mathbf { y } | \mathbf { x } , \mathbf { w } ) ] , } \end{array}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } ) , p _ { \theta } ( \mathbf { x } , \mathbf { y } | \mathbf { w } )$ are used to approximate the true posteriori distribution $p ( \hat { \mathbf { x } } | \mathbf { w } )$ and $p ( \mathbf { x } , \mathbf { y } | \mathbf { w } )$ .
|
| 149 |
+
|
| 150 |
+
Put the lower bounds back into Equation 7. Omit the constant entropy terms and the expectation subscripts for clarity, we have the new objective function as
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\operatorname* { m a x } _ { \theta } \mathbb { E } [ \log p _ { \theta } ( \hat { \mathbf { y } } | \hat { \mathbf { x } } , \mathbf { w } ) + \log p _ { \theta } ( \mathbf { y } | \mathbf { x } , \mathbf { w } ) + \log p _ { \theta } ( \mathbf { x } | \mathbf { w } ) + \log p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } ) ] .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
The first two terms are maximizing the log likelihood of label for both support and query data with respective to the network parameters, given the generated classification weights. This is equivalent to minimizing the cross entropy between prediction and ground-truth. We assume that $p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } )$ and $p _ { \theta } ( \mathbf { x } | \mathbf { w } )$ are Gaussian distributions. $r _ { 1 }$ and $r _ { 2 }$ are used to approximate the mean of these two Gaussian distributions. Therefore maximizing the log likelihood is equivalent to reconstruct $\mathbf { x } ^ { c p }$ and $\hat { \mathbf { x } } ^ { a p }$ with $L 2$ loss. Thus the loss function to train the network can be written as
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
L = \mathrm { C E } ( \hat { \bf y } _ { p r e d } , \hat { \bf y } ) + \lambda _ { 1 } \sum _ { { \bf y } \in \mathcal { S } } \mathrm { C E } ( { \bf y } _ { p r e d } , { \bf y } ) + \lambda _ { 2 } \sum _ { { \bf x } ^ { c p } \in \mathcal { S } } | | { \bf x } ^ { c p } - { \bf x } _ { r e } ^ { c p } | | _ { 2 } + \lambda _ { 3 } | | \hat { \bf x } ^ { a p } - \hat { \bf x } _ { r e } ^ { a p } | | _ { 2 } .
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
CE here stands for cross entropy. $\mathbf { x } ^ { c p }$ and $\hat { \mathbf { x } } ^ { a p }$ are the inputs to weights generator $g$ . $\mathbf { x } _ { r e } ^ { c p } \sim p _ { \theta } ( \mathbf { x } | \mathbf { w } )$ and $\hat { \mathbf { x } } _ { r e } ^ { a p } \sim p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { w } )$ are the reconstruction of $\mathbf { x } ^ { c p }$ and $\hat { \mathbf { x } } ^ { a p }$ . Since we convert the log likelihood in Equation 14 to mean square error or cross entropy in Equation 15 to optimize, the value of each term in Equation 15 is not equal to real log likelihood and we have to decide the weightage for each one. $\lambda _ { 1 } , \lambda _ { 2 } , \lambda _ { 3 }$ are thus hyper-parameters for trade-off of different terms. With the help of last three terms, the generated classification weights are forced to carry information about the support data and the specific query sample.
|
| 163 |
+
|
| 164 |
+
In LEO (Rusu et al., 2019), the inner update loss is computed as cross entropy on support data. If we merge the inner update into outer loop, then the loss becomes the summation of first two terms in Equation 15. However, the weight generation in LEO does not involve specific query samples, thus making reconstructing $\hat { \mathbf { x } } ^ { a p }$ impossible. In this sense, LEO can be regarded as a special case of our proposed method, where (1) only contextual path exits and (2) $\lambda _ { 2 } = \lambda _ { 3 } = 0$ .
|
| 165 |
+
|
| 166 |
+
# 3.5 COMPLEXITY ANALYSIS
|
| 167 |
+
|
| 168 |
+
The encoding process in contextual path results in computational complexity $O ( ( N K ) ^ { 2 } )$ due to self-attention. Similarly, the computational complexity of attentive path is $O ( ( N K ) ^ { 2 } + | \mathcal { Q } | ( N K ) )$ . In total, the complexity is ${ \cal O } ( ( \bar { N } K ) ^ { 2 } + | \mathcal { Q } | ( \bar { N ^ { } } K ) )$ . However, because of the nature of few-shot learning problem, the value of $( N K ) ^ { 2 }$ is usually negligible. The value of $| \mathcal { Q } |$ depends on the setting and the cross attention can be implemented parallelly via matrix multiplication. Therefore, the induced computational overhead will be negligible. AWGIM avoids the inner update without compromising the performance, which furthers reduces both training and inference time significantly. The empirical evaluation is presented in A.3.4.
|
| 169 |
+
|
| 170 |
+
# 4 EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
# 4.1 DATASETS AND PROTOCOLS
|
| 173 |
+
|
| 174 |
+
We conduct experiments on miniImageNet (Vinyals et al., 2016) and tieredImageNet (Ren et al., 2018), two commonly used benchmark datasets, to compare with other methods and analyze our model. Both datasets are subsets of ILSVRC-12 dataset (Russakovsky et al., 2015). miniImageNet contains 100 randomly sampled classes with 600 images per class. We follow the train/test split in (Ravi & Larochelle, 2016), where 64 classes are used for meta-training, 16 for meta-validation and 20 for meta-testing. tieredImageNet is a larger dataset compared to miniImageNet. There are 608 classes and 779,165 images in total. They are selected from 34 higher level nodes in ImageNet (Deng et al., 2009) hierarchy. 351 classes from 20 high level nodes are used for meta-training, 97 from 6 nodes for meta-validation and 160 from 8 nodes for meta-testing.
|
| 175 |
+
|
| 176 |
+
We use the image features in LEO (Rusu et al., 2019) provided by the authors 2. They trained a 28-layer Wide Residual Network (Zagoruyko & Komodakis, 2016) on the meta-training set. Each image then is represented by a 640 dimensional vector, which is used as the input to our model.
|
| 177 |
+
|
| 178 |
+
For $N$ -way $K$ -shot experiments, we randomly sample $N$ classes from meta-training set and each of them contains $K$ samples as the support set and 15 as query set. Similar to other works, we train 5-way 1-shot and 5-shot models on two dataset. During meta-testing, 600 $N$ -way $K$ -shot tasks are sampled from meta-testing set and the average accuracy for query set is reported with $9 5 \%$ confidence interval, as done in recent works (Finn et al., 2017; Snell et al., 2017; Rusu et al., 2019).
|
| 179 |
+
|
| 180 |
+
# 4.2 IMPLEMENTATION DETAILS
|
| 181 |
+
|
| 182 |
+
We use TensorFlow (Abadi et al., 2016) to implement our method and the code will be made available. $d = 6 4 0$ is the dimension of feature embeddings. $d _ { h }$ is set to be 128. The number of heads $h$ in attention module is set to be 4. $g , r _ { 1 }$ and $r _ { 2 }$ are 2-layer MLPs with 256 hidden units. We decide $\lambda _ { 1 } = 1$ , $\lambda _ { 2 } = \lambda _ { 3 } = 0 . 0 0 1$ by meta-validation performance.
|
| 183 |
+
|
| 184 |
+
Table 1: Accuracy comparison with other approaches on miniImageNet. The results are averaged on 600 tasks from meta-testing set with $9 5 \%$ confidence interval. Best results are highlighted.
|
| 185 |
+
|
| 186 |
+
<table><tr><td>Model</td><td>Feature Extractor</td><td>5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>Matching Networks (Vinyals et al., 2016)</td><td>Conv-4</td><td>46.60</td><td>60.00</td></tr><tr><td>MAML(Finn et al.,2017)</td><td>Conv-4</td><td>48.70 ± 1.84%</td><td>63.11 ± 0.92%</td></tr><tr><td>Meta LSTM (Ravi & Larochelle, 2016)</td><td>Conv-4</td><td>43.44 ± 0.77%</td><td>60.60 ± 0.71%</td></tr><tr><td>Prototypical Nets (Snell et al.,2017)</td><td>Conv-4</td><td>49.42 ± 0.78%</td><td>68.20 ± 0.66%</td></tr><tr><td>Relation Nets (Sung et al.,2018)</td><td>Conv-4</td><td>50.44 ± 0.82%</td><td>65.32 ± 0.70%</td></tr><tr><td>SNAIL (Mishra et al., 2018)</td><td>Resnets-12</td><td>55.71 ± 0.99%</td><td>68.88 ± 0.92%</td></tr><tr><td>TPN (Liu et al., 2019)</td><td>Resnets-12</td><td>59.46</td><td>75.65</td></tr><tr><td>MTL (Sun et al., 2019)</td><td>Resnets-12</td><td>61.20 ± 1.80%</td><td>75.50 ± 0.80</td></tr><tr><td>Dynamic (Gidaris & Komodakis,2018)</td><td>WRN-28-10</td><td>60.06 ± 0.14%</td><td>76.39 ± 0.11%</td></tr><tr><td>Prediction (Qiao et al., 2018)</td><td>WRN-28-10</td><td>59.60 ± 0.41%</td><td>73.74 ± 0.19%</td></tr><tr><td>DAE-GNN (Gidaris & Komodakis,2019)</td><td>WRN-28-10</td><td>62.96 ± 0.15%</td><td>78.85 ± 0.10%</td></tr><tr><td>LEO (Rusu et al., 2019)</td><td>WRN-28-10</td><td>61.76 ± 0.08%</td><td>77.59 ± 0.12%</td></tr><tr><td>AWGIM (ours)</td><td>WRN-28-10</td><td>63.12 ± 0.08%</td><td>78.40 ± 0.11%</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Table 2: Accuracy comparison with other approaches on tieredImageNet. The results are averaged on 600 tasks from meta-testing set with $9 5 \%$ confidence interval. Best results are highlighted.
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Model</td><td>Feature Extractor</td><td>5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>Conv-4</td><td>51.67 ± 1.81%</td><td>70.30 ± 1.75%</td></tr><tr><td>Prototypical Nets (Snell et al., 2017)</td><td>Conv-4</td><td>53.31± 0.89%</td><td>72.69 ± 0.74%</td></tr><tr><td>Relation Nets (Sung et al., 2018)</td><td>Conv-4</td><td>54.48 ± 0.93%</td><td>71.32 ± 0.78%</td></tr><tr><td>TPN (Liu et al., 2019)</td><td>Conv-4</td><td>59.91 ± 0.96%</td><td>72.85 ± 0.74%</td></tr><tr><td>MetaOptNet (Lee et al., 2019)</td><td>Resnets-12</td><td>65.81 ± 0.74%</td><td>81.75 ± 0.53%</td></tr><tr><td>LEO (Rusu et al., 2019)</td><td>WRN-28-10</td><td>66.33 ± 0.05%</td><td>81.44 ± 0.09%</td></tr><tr><td>AWGIM (ours)</td><td>WRN-28-10</td><td>67.69 ± 0.11%</td><td>82.82 ± 0.13%</td></tr></table>
|
| 191 |
+
|
| 192 |
+
ADAMW Loshchilov & Hutter (2017) is used to optimize the network with weight decay $1 \times 1 0 ^ { - 6 }$ . The initial learning rate is set to 0.0002 for 5-way 1-shot and 0.001 for 5-way 5-shot, which is decayed by 0.2 for every 15,000 iterations. We train the model for 50,000 iterations. Batch size is 64 for 5-way 1-shot and 32 for 5-way 5-shot. Similar to LEO (Rusu et al., 2019), we first train the model on meta-training set and choose the optimal hyper-parameters by validation results. Then we train the model on meta-training and meta-validation sets together using fixed hyper-parameters.
|
| 193 |
+
|
| 194 |
+
# 4.3 COMPARISON WITH OTHER METHODS
|
| 195 |
+
|
| 196 |
+
We compare the performance of our approach AWGIM on two datasets with several state-of-theart methods proposed in recent years. The results of MAML, Prototypical Nets, Relation Nets on tieredImageNet are evaluated by Liu et al. (2019). The results of Dynamic on miniImageNet with WRN-28-10 as the feature extractor is reported in (Gidaris & Komodakis, 2019). The other results are reported in the corresponding original papers. We also include the backbone network structure of the used feature extractor for reference. The results on miniImageNet and tieredImageNet are shown in Table 1 and 2 respectively.
|
| 197 |
+
|
| 198 |
+
The top half parts of Table 1 and 2 display the methods belonging with different meta learning categories, such as metric-based(Matching Networks, Prototypical Nets), gradient-based (MAML, MTL), graph-based (TPN). The bottom part shows the classification weights generation approaches including Dynamic, Prediction, DAE-GNN, LEO and our proposed AWGIM.
|
| 199 |
+
|
| 200 |
+
AWGIM can outperform all the methods in top parts of two table. Comparing with other classification weights generation methods in the bottom part, AWGIM still shows very competitive performance, namely the best on tieredImageNet and close to the state-of-the-art on miniImageNet. We note that all the classification weights generation methods are using WRN-28-10 as backbone network, which makes the comparison fair. In particular, AWGIM can outperform LEO in all settings.
|
| 201 |
+
|
| 202 |
+
# 4.4 ANALYSIS
|
| 203 |
+
|
| 204 |
+
Table 3: Analysis of our proposed AWGIM. In the top half, the attentive path is removed to compare with LEO. In the bottom part, ablation analysis with respective to different components is provided. We also shuffle the generated classification weights randomly to show that they are indeed optimal for different query samples.
|
| 205 |
+
|
| 206 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>5-way 1-shot</td><td>5-way 5-shot</td><td> 5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>LEO</td><td>61.76 %</td><td>77.59 %</td><td>66.33%</td><td>81.44 %</td></tr><tr><td>Generator in LEO</td><td>60.33 %</td><td>74.53 %</td><td>65.17%</td><td>78.77 %</td></tr><tr><td>Generator conditioned on S only</td><td>61.02%</td><td>74.33%</td><td>66.22%</td><td>79.66%</td></tr><tr><td>Generator conditioned on S with IM</td><td>62.04%</td><td>77.54%</td><td>66.43%</td><td>81.73%</td></tr><tr><td>MLP encoding,入1 = 入2= 入3=0</td><td>58.95%</td><td>71.68%</td><td>63.92%</td><td>75.80%</td></tr><tr><td>MLP encoding</td><td>62.26%</td><td>76.91%</td><td>65.84%</td><td>79.24%</td></tr><tr><td>入1=λ2=λ3=0</td><td>61.61%</td><td>74.14%</td><td>65.65%</td><td>79.93%</td></tr><tr><td>入1=入2=0</td><td>62.06%</td><td>74.18%</td><td>65.85%</td><td>80.42%</td></tr><tr><td>入3=0</td><td>62.91%</td><td>77.88%</td><td>67.27%</td><td>81.67%</td></tr><tr><td>入1=0</td><td>62.19%</td><td>74.21%</td><td>66.82%</td><td>80.61%</td></tr><tr><td>2=入g=0</td><td>62.12%</td><td>77.65%</td><td>66.86%</td><td>81.03%</td></tr><tr><td>random shuffle in class</td><td>62.87%</td><td>77.48%</td><td>67.52%</td><td>82.55%</td></tr><tr><td>random shuffle between classes</td><td>61.20%</td><td>77.48%</td><td>66.55%</td><td>82.53%</td></tr><tr><td>AWGIM (ours)</td><td>63.12%</td><td>78.40%</td><td>67.69 %</td><td>82.82%</td></tr></table>
|
| 207 |
+
|
| 208 |
+
We perform detailed analysis on AWGIM, shown in Table 3. We include the results of LEO Rusu et al. (2019) for reference. “Generator in LEO” means that there is no inner update in LEO. In the upper part of the table, we first studied the effect of attentive path. We implemented two generators including only the contextual path during encoding. “Generator conditioned on $s$ with IM” indicates that we add the cross entropy loss and reconstruction loss for support set. It can be observed that “Generator conditioned on $s$ only” is trained with cross entropy on query set, which is similar to “Generator in LEO” without inner update. It is able to achieve similar or slightly better results than “Generator in LEO”, which implies that self-attention is no worse than relation networks used in LEO to model task-context. With information maximization, our generator is able to obtain slightly better performance than LEO.
|
| 209 |
+
|
| 210 |
+
The effect of attention is investigated by replacing the attention modules with 2-layer MLPs, which is shown as “MLP encoding”. More specifically, one MLP in contextual path is used for support set and another MLP in attentive path for query samples. We can see that even without attention to encode the task-contextual information, “MLP encoding” can achieve accuracy close to LEO, for the sake of information maximization. However, if we let $\lambda _ { 1 } = \lambda _ { 2 } = \lambda _ { 3 } = 0$ for MLP encoding, the performance drops significantly, which demonstrates the importance of maximizing the information.
|
| 211 |
+
|
| 212 |
+
We conducted ablation analysis with respective to $\lambda _ { 1 } , \lambda _ { 2 }$ and $\lambda _ { 3 }$ to investigate the effect of information maximization. First, $\lambda _ { 1 }$ , $\lambda _ { 2 }$ and $\lambda _ { 3 }$ are all set to be 0. In this case, the accuracy is similar to “generator conditioned on $s$ only”, showing that the generated classification weights are not fitted for different query samples, even with the attentive path. It can also be observed that maximizing the mutual information between weights and support is more crucial since $\lambda _ { 1 } = \lambda _ { 2 } = 0$ degrades accuracy significantly, comparing with $\lambda _ { 3 } = 0$ . We further investigate the relative importance of the classification on support as well as reconstruction. $\lambda _ { 1 } = 0$ affects the performance noticeably. We conjecture that the support label prediction is more critical for information maximization.
|
| 213 |
+
|
| 214 |
+
The classification weights are generated specifically for each query sample in AWGIM. To this point, we shuffle the classification weights between query samples within the same classes and between different classes as well to study whether the classification weights are adapted for different query samples. Assume there are T query samples per class in one task. Wf inal ∈ R|Q|×N×d can be reshaped into Wf inal $\mathbf { W } ^ { f i n a l } \in \mathbb { R } ^ { N \times T \times N \times \bar { d } }$ . Then we shuffle this weight tensor along the first and second axis randomly. The results are shown as “random shuffle between classes” and “random shuffle in class” in Table 3. For 5-way 1-shot experiments, the random shuffle between classes degrades the accuracy noticeably while the random shuffle in class dose not affect too much. This indicates that when the support data are very limited, the generated weights for query samples from the same class are very similar to each other while distinct for different classes. When there are more labeled data in support set, two kinds of random shuffle show very close or even the same results in 5-way 5-shot experiments, which are both worse than the original ones. This implies that the generated classification weights are more diverse and specific for each query sample in 5-way 5-shot setting. The possible reason is that larger support set provides more knowledge to estimate the optimal classification weights for each query example.
|
| 215 |
+
|
| 216 |
+
More analysis is provided in Appendix A.3.
|
| 217 |
+
|
| 218 |
+
# 5 CONCLUSION
|
| 219 |
+
|
| 220 |
+
In this work, we introduce Attentive Weights Generation via Information Maximization (AWGIM) for few shot image classification. AWGIM learns to generate optimal classification weights for each query sample within the task by two encoding paths. To guarantee this, the lower bound of mutual information between generated weights and query, support data is maximized. As far as we know, AWGIM is the first work utilizing mutual information techniques for few shot learning. The effectiveness of AWGIM is demonstrated by state-of-the-art performance on two benchmark datasets and extensive analysis.
|
| 221 |
+
|
| 222 |
+
# REFERENCES
|
| 223 |
+
|
| 224 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 225 |
+
Marcin Andrychowicz, Misha Denil, Sergio Gomez, Matthew W Hoffman, David Pfau, Tom Schaul, Brendan Shillingford, and Nando De Freitas. Learning to learn by gradient descent by gradient descent. In NeurIPS, 2016.
|
| 226 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
|
| 227 |
+
David Barber and Felix V Agakov. The im algorithm: a variational approach to information maximization. In NeurIPS, 2003.
|
| 228 |
+
Luca Bertinetto, Joao F Henriques, Philip Torr, and Andrea Vedaldi. Meta-learning with differentiable closed-form solvers. In ICLR, 2019.
|
| 229 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NeurIPS, 2016.
|
| 230 |
+
Zitian Chen, Yanwei Fu, Yu-Xiong , Lin Ma, Wei Liu, and Martial Hebert. Image deformation meta-networks for one-shot learning. In CVPR, 2019.
|
| 231 |
+
|
| 232 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 233 |
+
|
| 234 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 235 |
+
|
| 236 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. TPAMI, 2006.
|
| 237 |
+
|
| 238 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 239 |
+
|
| 240 |
+
Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018.
|
| 241 |
+
|
| 242 |
+
Spyros Gidaris and Nikos Komodakis. Generating classification weights with gnn denoising autoencoders for few-shot learning. In CVPR, 2019.
|
| 243 |
+
|
| 244 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 245 |
+
|
| 246 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. ICLR, 2019.
|
| 247 |
+
|
| 248 |
+
Hyunjik Kim, Andriy Mnih, Jonathan Schwarz, Marta Garnelo, Ali Eslami, Dan Rosenbaum, Oriol Vinyals, and Yee Whye Teh. Attentive neural processes. In ICLR, 2019.
|
| 249 |
+
|
| 250 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, 2015.
|
| 251 |
+
|
| 252 |
+
Ranjay Krishna, Michael Bernstein, and Li Fei-Fei. Information maximizing visual question generation. In CVPR, 2019.
|
| 253 |
+
|
| 254 |
+
Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In CVPR, 2019.
|
| 255 |
+
|
| 256 |
+
Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang. Finding taskrelevant features for few-shot learning by category traversal. In CVPR, 2019a.
|
| 257 |
+
|
| 258 |
+
Wenbin Li, Lei Wang, Jinglin Xu, Jing Huo, Yang Gao, and Jiebo Luo. Revisiting local descriptor based image-to-class measure for few-shot learning. In CVPR, 2019b.
|
| 259 |
+
|
| 260 |
+
Yann Lifchitz, Yannis Avrithis, Sylvaine Picard, and Andrei Bursuc. Dense classification and implanting for few-shot learning. In CVPR, 2019.
|
| 261 |
+
|
| 262 |
+
Yanbin Liu, Juho Lee, Minseop Park, Saehoon Kim, Eunho Yang, Sung Ju Hwang, and Yi Yang. Learning to propagate labels: Transductive propagation network for few-shot learning. In ICLR, 2019.
|
| 263 |
+
|
| 264 |
+
Ilya Loshchilov and Frank Hutter. Fixing weight decay regularization in adam. arXiv preprint arXiv:1711.05101, 2017.
|
| 265 |
+
|
| 266 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. JMLR, 2008.
|
| 267 |
+
|
| 268 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive metalearner. In ICLR, 2018.
|
| 269 |
+
|
| 270 |
+
Tsendsuren Munkhdalai and Hong Yu. Meta networks. In ICML, 2017.
|
| 271 |
+
|
| 272 |
+
Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Łukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. ICML, 2018.
|
| 273 |
+
|
| 274 |
+
Hang Qi, Matthew Brown, and David G Lowe. Low-shot learning with imprinted weights. In CVPR, 2018.
|
| 275 |
+
|
| 276 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In CVPR, 2018.
|
| 277 |
+
|
| 278 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2016.
|
| 279 |
+
|
| 280 |
+
Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B Tenenbaum, Hugo Larochelle, and Richard S Zemel. Meta-learning for semi-supervised few-shot classification. In ICLR, 2018.
|
| 281 |
+
|
| 282 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 2015.
|
| 283 |
+
|
| 284 |
+
Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In ICLR, 2019.
|
| 285 |
+
|
| 286 |
+
Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In NeurIPS, 2017.
|
| 287 |
+
|
| 288 |
+
Jurgen Schmidhuber. Evolutionary principles in self-referential learning, or on learning how to¨ learn: the meta-meta-... hook. PhD thesis, 1987.
|
| 289 |
+
|
| 290 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140– 1144, 2018.
|
| 291 |
+
|
| 292 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NeurIPS, 2017.
|
| 293 |
+
|
| 294 |
+
Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for few-shot learning. In CVPR, 2019.
|
| 295 |
+
|
| 296 |
+
Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learning. In CVPR, 2018.
|
| 297 |
+
|
| 298 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 299 |
+
|
| 300 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NeurIPS, 2016.
|
| 301 |
+
|
| 302 |
+
Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418, 2019.
|
| 303 |
+
|
| 304 |
+
Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018.
|
| 305 |
+
|
| 306 |
+
Davis Wertheimer and Bharath Hariharan. Few-shot learning with localization in realistic settings. In CVPR, 2019.
|
| 307 |
+
|
| 308 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015.
|
| 309 |
+
|
| 310 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 311 |
+
|
| 312 |
+
Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In NeurIPS, 2018.
|
| 313 |
+
|
| 314 |
+
# A APPENDIX
|
| 315 |
+
|
| 316 |
+
# A.1 MUTLI-HEAD ATTENTION IN AWGIM
|
| 317 |
+
|
| 318 |
+
The multi-head attention can be described as
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
M u l t i H e a d ( Q , K , V ) = C o n c a t ( h e a d _ { 1 } , . . . , h e a d _ { H } ) W ^ { O } ,
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
h e a d _ { i } ( Q ^ { i } , K ^ { i } , V ^ { i } ) = A t t e n t i o n ( Q ^ { i } , K ^ { i } , V ^ { i } ) ,
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
A t t e n t i o n ( Q , K , V ) = s o f t m a x ( \frac { Q K ^ { T } } { \sqrt { d _ { k } } } V ) ,
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
Q ^ { i } = Q W _ { Q } ^ { i } , K ^ { i } = K W _ { K } ^ { i } , V ^ { i } = V W _ { V } ^ { i } ,
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
Here $Q , K , V$ are query, key, value matrices. $W _ { Q } ^ { i } , W _ { K } ^ { i } , W _ { V } ^ { i }$ are the weight matrices for $i$ th head. $W ^ { O }$ is the weight matrix for output. $d _ { k }$ is the dimension of keys. Original $Q$ is added to the output of Equation 16 to stabilize the training as residual learning.
|
| 337 |
+
|
| 338 |
+
# A.2 MODEL DETAILS
|
| 339 |
+
|
| 340 |
+
# A.2.1 CONTEXTUAL PATH
|
| 341 |
+
|
| 342 |
+
The encoding process in contextual path is realized by a simple multi-head self-attention network on support data. First, ${ \bf x } ^ { c _ { n } ; k }$ are mapped to a lower dimensional hidden space by a MLP $f _ { 1 } : \mathbb { R } ^ { d } $ $\mathbb { R } ^ { d _ { h } }$ to reduce the computation complexity. Then the low-dimensional representations $\mathbf { x } _ { h 1 } ^ { c _ { n } ; k }$ are processed by the -head self-attention network $f _ { c p } ^ { s a } : \mathbb { R } ^ { d _ { h } } \mathbb { R } ^ { d _ { h } }$ ,
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
{ \bf X } ^ { c p } = M u l t i H e a d A t t e n t i o n ( Q = { \bf X } _ { h 1 } , K = { \bf X } _ { h 1 } , V = { \bf X } _ { h 1 } ) .
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
$\mathbf { X } _ { h 1 } \in \mathbb { R } ^ { N K \times d _ { h } }$ is the matrix where each row stands for one support sample $\mathbf { x } _ { h 1 } ^ { c _ { n } ; k }$ . For one $N$ -way $K$ -shot task, the outputs of $f _ { c p } ^ { s a }$ .
|
| 349 |
+
|
| 350 |
+
# A.2.2 ATTENTIVE PATH
|
| 351 |
+
|
| 352 |
+
The attentive path is instantiated by attention, similar to contextual path. First, a MLP $f _ { 2 } : \mathbb { R } ^ { d } $ $\mathbb { R } ^ { d _ { h } }$ is used to map both ${ \bf x } ^ { c _ { n } ; k }$ and $\hat { \bf x }$ to $\mathbf { x } _ { h 2 } ^ { c _ { n } ; k }$ and $\hat { \mathbf { x } } _ { h 2 }$ . Then we employ another $H$ -head selfattention network $f _ { a p } ^ { s a } : \mathbb { R } ^ { d _ { h } } \mathbb { R } ^ { d _ { h } }$ on $\mathbf { x } _ { h 2 } ^ { c _ { n } ; k }$ to encode the global task information to each support sample,
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
{ \bf X } ^ { a p } = M u l t i H e a d A t t e n t i o n ( Q = { \bf X } _ { h 2 } , K = { \bf X } _ { h 2 } , V = { \bf X } _ { h 2 } ) .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
The cross attention between query and context-aware support samples are computed as
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
{ \hat { \bf X } } ^ { a p } = M u l t i H e a d A t t e n t i o n ( Q = { \hat { \bf X } } _ { h 2 } , K = { \bf X } _ { h 2 } , V = { \bf X } ^ { a p } ) .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Here $\hat { \mathbf { X } } ^ { a p } \in \mathbb { R } ^ { | \mathcal { Q } | \times d _ { h } }$ is the matrix form of $\hat { \mathbf { x } } _ { q }$ , where each query sample is context-aware.
|
| 365 |
+
|
| 366 |
+
# A.2.3 WEIGHT GENERATOR
|
| 367 |
+
|
| 368 |
+
Assume $\mathbf { x } ^ { c p \oplus a p } = \mathbf { X } _ { i , j , : } ^ { c p \oplus a p } \in \mathbb { R } ^ { 2 d _ { h } }$ , where $i , j$ stands for $i$ th query sample and $j$ th support sample. $\mathbf { x } ^ { c p \oplus a p }$ is decoded by the weights generator $g : \mathbb { R } ^ { 2 d _ { h } } \mathbb { R } ^ { 2 d }$ . We assume that the classification weights follow Gaussian distribution with diagonal covariance and we sample the weights from this distribution during meta-training, shown in Equation 23 and 24.
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\mu _ { \mathbf { w } } , \sigma _ { \mathbf { w } } = g ( \mathbf { z } )
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\mathbf { w } \sim \mathcal { N } ( \mu _ { \mathbf { w } } , \pmb { \Sigma } _ { \mathbf { w } } )
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
# A.3 EXPERIMENTAL ANALYSIS
|
| 379 |
+
|
| 380 |
+
# A.3.1 FEW SHOT REGRESSION
|
| 381 |
+
|
| 382 |
+
AWGIM can be applied to few shot regression task by slight modification. During meta-training, we set the number of classes $N$ equal to 1 and adapt the cross entropy loss to mean square error. We use the data points $( x , y )$ as inputs to AWGIM and generate weight as well as bias parameters for a three layer MLP with hidden dimension 40. This is consistent with few shot regression experimental setting in LEO.
|
| 383 |
+
|
| 384 |
+
The few shot regression tasks are constructed as either sinusoidal or linear regression tasks. For sinusoidal regression tasks, the amplitude range is [0.1, 5], phase range $[ 0 , 2 \pi ]$ , frequency range [0.5, 2.0]. For linear regression tasks, the slope range is $[ - 1 , 1 ]$ , intercept range $[ - 5 , 5 ]$ . Input $x$ is randomly sample from $[ - 5 , 5 ]$ . Gaussian noise with standard deviation 0.3 is added to $y$ during meta-training. We show some qualitative results in Figure 2. (a) and (b) are examples that can be tackled easily. For some non-trivial cases such as (c) and (d), AWGIM produces predictions slightly mixing with another regression family, despite that overall results are still faithful.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 2: 5-shot regression results for a multi-modal task distribution. Regression targets are plotted in red and prediction in black. 5 training samples per task are plotted with blue solid circles.
|
| 388 |
+
|
| 389 |
+
# A.3.2 EFFECT OF MULTI-HEAD ATTENTION
|
| 390 |
+
|
| 391 |
+
We replace the multi-head attention in the two paths with single-head attention and conduct the 5- way 1-shot and 5-way 5-shot experiments on miniImageNet dataset. The results are shown in Table 4. We can see clearly that multi-head attention improve the performance. In particular, for 5-way 1-shot experiment, single head attention gives results close to MLP encoding, which indicates that single head attention struggles when data are extremely scarce.
|
| 392 |
+
|
| 393 |
+
Table 4: Accuracy results on miniImageNet with 4 heads or single head in attention networks.
|
| 394 |
+
|
| 395 |
+
<table><tr><td>Method</td><td>5-way 1 -shot</td><td> 5-way 5-shot</td></tr><tr><td>4 heads</td><td>63.12%</td><td>78.40%</td></tr><tr><td>single head</td><td>62.35%</td><td>77.75%</td></tr></table>
|
| 396 |
+
|
| 397 |
+
# A.3.3 CONVERGENCE
|
| 398 |
+
|
| 399 |
+
We compare AWGIM with LEO in terms of convergence speed. The batch size is set to be 16 for both methods. We use the hyper-parameters tuned by authors to train LEO. The accuracy of metavalidation set during meta-training on 5-way 1-shot miniImageNet is plotted, shown in Figure 3. we can see clearly that AWGIM converges faster than LEO and outperforms LEO except for the first few iterations.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 3: The meta-validation accuracy during meta-training.
|
| 403 |
+
|
| 404 |
+
# A.3.4 INFERENCE TIME
|
| 405 |
+
|
| 406 |
+
We measure the inference time of AWGIM to show that it induces minimal computational overhead. In comparison, we use “MLP encoding” in two paths, which has time complexity $O ( N K + | \mathcal { Q } | )$ . We use two set-ups on miniImageNet and the batch size is set to be 64. 100 batches are processed and we report the average consumed time for one batch. All these experiments on done with the same GPU and workstation. The results are shown in Table 5. It can be observed that the usage of self-attention and cross attention in AWGIM occurs negligible overhead, compared with MLP encoding. This is because the values of $N , K , | \mathcal { Q } |$ are all relatively small and matrix multiplication further can be processed very fast by GPU.
|
| 407 |
+
|
| 408 |
+
Table 5: The comparison of inference time between AWGIM and MLP encoding.
|
| 409 |
+
|
| 410 |
+
<table><tr><td>Method</td><td>5-way 1 -shot</td><td>5-way 5-shot</td></tr><tr><td>AWGIM</td><td>0.036s</td><td>0.093s</td></tr><tr><td>MLP encoding</td><td>0.033s</td><td>0.093s</td></tr></table>
|
| 411 |
+
|
| 412 |
+
# A.3.5 VISUALIZATION
|
| 413 |
+
|
| 414 |
+
We visualize the generated classification weights by t-SNE (Maaten & Hinton, 2008). First we sample 400 tasks from meta-validation set of 5-way 1-shot miniImageNet experiment. Each task contains 5 query samples from 5 different classes. Thus in total there are $4 0 0 \times 5 \times 5 = 1 0 , 0 0 0$ weight vectors to visualize. As comparison, inputs to the generator $g$ are also plotted. The visualization results are shown in Figure 4. The inputs to $g$ are displayed in (a, b) and the generated classification weights in (c, d). From the comparison between (a) and (c), we can see the decoded weights for each class in (c) are clustered closer than (a) in general. Red and blue dots in (b, d) denotes the classification weights for two query samples from two classes within one task. It can be observed that $g$ can generate adapted weights for different query samples. This is consistent with Table 3, where the results of “random shuffle between classes” suggest that query samples from different class have distinct classification weights.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 4: t-SNE visualization of the inputs to $g$ in (a, b) and the generated classification weights in (c, d). Blue and red dots in (b) and (d) are the classification weights for two query samples in the same task.
|
md/train/BklIxyHKDr/BklIxyHKDr.md
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP K-NN FOR NOISY LABELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Modern machine learning models are often trained on examples with noisy labels that hurt performance and are hard to identify. In this paper, we provide an empirical study showing that a simple $k$ -nearest neighbor-based filtering approach on the logit layer of a preliminary model can remove mislabeled training data and produce more accurate models than some recently proposed methods. We also provide new statistical guarantees into its efficacy.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Machine learned models can only be as good as the data they were used to train on. With increasingly large modern datasets and automated and indirect labels like clicks, it is becoming ever more important to investigate and provide effective techniques to handle noisy labels.
|
| 12 |
+
|
| 13 |
+
We revisit the classical method of filtering out suspicious training examples using $k$ -nearest neighbors ( $k$ -NN) (Wilson, 1972). Like Papernot & McDaniel (2018), we apply $k$ -NN on the learned intermediate representation of a preliminary model, which adds robustness. In fact, the $k$ -nearest neighbor approach has recently been receiving attention for its robustness properties (Wang et al., 2018; Reeve & Kaban, 2019) and as an auxiliary strategy for modern machine learning (Jiang et al., 2018).
|
| 14 |
+
|
| 15 |
+
The main contributions of this paper are:
|
| 16 |
+
|
| 17 |
+
• Experimentally showing that identifying mislabeled examples by $k$ -NN executed on an intermediate layer of a preliminary deep model works well compared to state-of-art methods for handling noisy labels across noise levels, and is robust to the choice of $k$ . • Theoretically showing that $k$ -NN’s predictions will only identify a training example as clean if its label is the Bayes-optimal label. We also provide finite-sample analysis in terms of the margin and how spread out the corrupted labels are (Theorem 1), rates of convergence for the margin (Theorem 2) and rates under Tsybakov’s noise condition (Theorem 3) with all rates matching minimax-optimal rates in the noiseless setting.
|
| 18 |
+
|
| 19 |
+
Our work shows that even though the preliminary neural network is trained with corrupted labels, it still yields intermediate representations that are useful for $k$ -nearest neighbor filtering. Given labels which are in high disagreement, one can either automatically remove them and retrain on the remaining, or send to a human operator for further review. This strategy is also be useful in human-in-the-loop systems where one can warn the human annotator that a label is suspicious, and automatically propose new labels based on its nearest neighbors’ labels.
|
| 20 |
+
|
| 21 |
+
In addition to strong empirical performance, deep $k$ -NN filtering has a couple of advantages. Firstly, many methods require a clean set of samples whose labels can be trusted. Here we show that the $k$ -NN based method is robust and does not require such a clean set of samples. Second, while $k$ -NN does introduce the hyperparameter $k$ , we will show that deep $k$ -NN filtering is stable to the choice of $k$ : such robustness to hyperparameters is highly desirable as optimal tuning for this problem is often not available in practice (i.e. when no clean validation set is available).
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
We review relevant prior work in training on noisy labels and related $k$ -NN theory.
|
| 26 |
+
|
| 27 |
+
# 2.1 TRAINING WITH NOISY LABELS
|
| 28 |
+
|
| 29 |
+
Methods to handle label noise can be classified into two main strategies: (i) explicitly identify and remove the noisy examples, and (ii) indirectly handle the noise with robust training methods.
|
| 30 |
+
|
| 31 |
+
Data Cleaning This proposal fits into the broad family of data cleaning methods, in that our proposal detects and filters dirty data (see Chu et al. (2016) for a recent survey). The use of $k$ -NN to “edit” training data has been popular since Wilson (1972) used it to throw away training examples that were not consistent with their $k = 3$ nearest neighbors. The idea of using a preliminary model to help identify mislabeled examples dates to at least Guyon et al. (1994), who proposed using the model to compute an information gain for each example and then suspecting ones with high gain. Other early work used a cross-validation set-up to train a classifier on part of the data, then use it to make a prediction on held-out training examples, and remove any examples if the prediction disagrees with the label; ensembles of models can also be used for the predictions. (Brodley & Freidl, 1999).
|
| 32 |
+
|
| 33 |
+
Noise Corruption Estimation For multi-class problems, a popular approach is to account for noisy labels by applying a confusion matrix after the model’s softmax layer (Sukhbaatar et al., 2014). Such methods rely on a confusion matrix which is often unknown and must be estimated. Patrini et al. (2017) suggest deriving it from the softmax distribution of the model trained on noisy data while Goldberger & Ben-Reuven (2016); Jindal et al. (2016); Han et al. (2018) give alternatives. Accurate estimates are generally hard to attain when only untrusted data is available. Hendrycks et al. (2018) achieves more accurate estimates in the setting where some amount of known clean, trusted data is available. Xiao et al. (2015); Khetan et al. (2017); Vahdat (2017) use EM-type algorithms to estimate the clean label distribution.
|
| 34 |
+
|
| 35 |
+
Noise-Robust Training Natarajan et al. (2013) propose a method to make any surrogate loss function noise-robust given knowledge of the corruption rates. Ghosh et al. (2017) proves that losses like mean absolute error (MAE) are inherently robust under symmetric or uniform label noise while Zhang & Sabuncu (2018) shows that training with MAE results in poor convergence and accuracy. They propose a new loss function based on the negative Box-Cox transformation that trades off the noise-robustness of MAE with the training efficiency of cross-entropy. Lastly, the ramp, unhinged, and savage losses have been proposed and theoretically justified to be noise-robust for support vector machines (Brooks, 2011; Van Rooyen et al., 2015; Masnadi-Shirazi & Vasconcelos, 2009). Rolnick et al. (2017) empirically shows that deep learning models are robust to noise when there are enough correctly labeled examples and when the model capacity and training batch size are sufficiently large.
|
| 36 |
+
|
| 37 |
+
Auxiliary Models Veit et al. (2017) propose learning a label cleaning network on trusted data by predicting the differences between clean and noisy labels. Li et al. (2017) suggests training on a weighted average between noisy labels and distilled predictions of an auxiliary model trained on trusted data.
|
| 38 |
+
|
| 39 |
+
Example Weighting Here we make a hard decision about whether to keep a training example, but one can also adapt the weights on training examples based on the confidence in their labels. Liu & Tao (2015) provides an importance-weighting scheme for binary classification. Ren et al. (2018) suggests upweighting examples whose loss gradient is aligned with those of trusted examples at every step in training. Jiang et al. (2017) investigates a recurrent network that learns a sample weighting scheme to give to the base model.
|
| 40 |
+
|
| 41 |
+
# 2.2 $k$ -NEAREST NEIGHBOR THEORY
|
| 42 |
+
|
| 43 |
+
The theory of $k$ -nearest neighbor classification has a long history, for example: Fix & Hodges Jr (1951); Cover (1968); Stone (1977); Devroye et al. (1994); Chaudhuri & Dasgupta (2014). Much of the prior work focuses on $k$ -NN’s statistical consistency properties. However, with the growing interest in adversarial examples and learning with noisy labels, there have recently been analyses of $k$ -nearest neighbor methods in these settings. Wang et al. (2018) analyze the robustness of $k$ -NN classification and provide a robust variant of 1-NN classification where their notion of robustness is that predictions of nearby points should be similar. Gao et al. (2016) provides an analysis of the $k$ -NN classifier under noisy labels and like us, show that $k$ -NN can attain similar rates in the noisy setting as in the noiseless setting. Gao et al. (2016) assumes a noise model where labels are corrupted uniformly at random, while we assume an arbitrary corruption pattern and provide results based on a notion of how spread out the corrupted points are. Moreover, we provide finite-sample bounds borrowing recent advances in $k$ -NN convergence theory in the noiseless setting (Jiang, 2019) while the guarantees of Gao et al. (2016) are asymptotic. Reeve & Kaban (2019) provide stronger guarantees on a robust modification of $k$ -NN proposed by Gao et al. (2016). To the best of our knowledge, we provide the first finite-sample rates of consistency for the classical $k$ -NN method in the noisy setting with very little assumptions on the label noise.
|
| 44 |
+
|
| 45 |
+
# 3 ALGORITHM
|
| 46 |
+
|
| 47 |
+
We first define the $k$ -nearest neighbor classifier:
|
| 48 |
+
|
| 49 |
+
Definition 1 ( $k$ -NN). Let the $k$ -NN radius of $x \in \mathcal { X }$ be $r _ { k } ( x ) : = \operatorname* { i n f } \{ r : | B ( x , r ) \cap X | \geq k \}$ where $B ( x , r ) : = \{ x ^ { \prime } \in \mathcal { X } : | x - x ^ { \prime } | \leq r \}$ and the $k$ -NN set of $x \in \mathcal { X }$ be $N _ { k } ( x ) : = B ( x , r _ { k } ( x ) ) \cap X$ . Then for all $x \in \mathcal { X }$ , the $k$ -NN classifier function w.r.t. $X$ has discriminant function
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\eta _ { k } ( y ; x ) : = \frac { 1 } { \vert N _ { k } ( x ) \vert } \sum _ { i = 1 } ^ { n } 1 \left[ y _ { i } = y , x _ { i } \in N _ { k } ( x ) \right] ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
with prediction $\eta _ { k } ( x ) : = \arg \operatorname* { m a x } _ { y } \eta _ { k } ( y ; x )$ .
|
| 56 |
+
|
| 57 |
+
Our method Algorithm 1 assumes a dataset $\mathcal { D } _ { \mathrm { n o i s y } }$ with potentially noisy labels, along with a dataset $\mathcal { D } _ { \mathrm { c l e a n } }$ consisting of clean or trusted labels. Note that we allow $\mathcal { D } _ { \mathrm { c l e a n } }$ to be empty (i.e. in instances where no such trusted data is available). We have found that having $\mathcal { D } _ { \mathrm { c l e a n } }$ becomes important when $\mathcal { D } _ { \mathrm { n o i s y } }$ has a high corruption rate; otherwise the representations learned by training on $\mathcal { D } _ { \mathrm { n o i s y } }$ alone are often reasonable enough. The procedure begins by training on either $\mathcal { D } _ { \mathrm { n o i s y } } \cup \mathcal { D } _ { \mathrm { c l e a n } }$ or $\mathcal { D } _ { \mathrm { c l e a n } }$ . For our experiments, we partition $\mathcal { D } _ { \mathrm { c l e a n } }$ into a training set $\mathcal { D } _ { c t }$ and validation set $\mathcal { D } _ { c v }$ and train models on $\mathcal { D } _ { c t }$ and $\mathcal { D } _ { \mathrm { n o i s y } } \cup \mathcal { D } _ { c t }$ and choose the one that performs better on $\mathcal { D } _ { c v }$ .
|
| 58 |
+
|
| 59 |
+
We then filter examples that disagree with the $k$ -NN classifier prediction, where the $k$ -NN is computed on the final logit layer of the trained model (i.e. the layer right before softmax).
|
| 60 |
+
|
| 61 |
+
# Algorithm 1 Filtering datapoints via deep $k$ -NN.
|
| 62 |
+
|
| 63 |
+
<table><tr><td>Inputs: Dnoisy, Dclean, k</td></tr><tr><td>Train model M on either Dnoisy U Dclean Or Dclean·</td></tr><tr><td>Let N be the activations of Dnoisy U Dclean on the logit layer of M.</td></tr><tr><td>Dfiltered := {(x,y) ∈ N : nk(x) = y},where nk is computed w.r.t. N. Train final model on Dfiltered UDc.</td></tr></table>
|
| 64 |
+
|
| 65 |
+
# 4 THEORETICAL ANALYSIS
|
| 66 |
+
|
| 67 |
+
For the theoretical analysis, we assume the binary classification problem with the features defined on compact set $\mathcal { X } \subseteq \mathbb { R } ^ { D }$ . We assume that points are drawn according to distribution $\mathcal { F }$ as follows: the features come from distribution $\mathbb { P } _ { \mathcal { X } }$ on $\mathcal { X }$ and the labels are distributed according to the measurable conditional probability function $\eta : \mathcal { X } [ 0 , 1 ]$ . That is, a sample $( X , Y )$ is drawn from $\mathcal { F }$ as follows: $X$ is drawn according to $\mathbb { P } _ { \mathcal { X } }$ and $Y$ is chosen according to $\mathbb { P } ( Y = 1 | X = x ) = \eta ( x )$ .
|
| 68 |
+
|
| 69 |
+
The goal will be to show that given corrupted examples, the $k$ -NN disagreement method is still able to identify the examples whose labels do not match that of the Bayes-optimal label.
|
| 70 |
+
|
| 71 |
+
We will make a few regularity assumptions for our analysis to hold. The first regularity assumption ensures that the support $\mathcal { X }$ does not become arbitrarily thin anywhere. This is a standard nonparametric assumption (e.g. Singh et al. (2009); Jiang (2019)).
|
| 72 |
+
|
| 73 |
+
Assumption 1 (Support Regularity). There exists $\omega > 0$ and $r _ { 0 } > 0$ such that ${ V o l } ( \mathcal { X } \cap B ( x , r ) ) \geq$ $\boldsymbol { \omega } \cdot V o l ( B ( x , r ) )$ for all $x \in \mathcal { X }$ and $0 < r < r _ { 0 }$ , where $B ( x , r ) : = \{ x ^ { \prime } \in \mathcal { X } : | x - x ^ { \prime } | \leq r \}$ .
|
| 74 |
+
|
| 75 |
+
Let $p _ { \mathcal { X } }$ be the density function corresponding to $\mathbb { P } _ { \mathcal { X } }$ . The next assumption ensures that with a sufficiently large sample, we will obtain a good covering of the input space.
|
| 76 |
+
|
| 77 |
+
Assumption 2 $\overset { \cdot } { p } _ { \mathcal { X } }$ bounded from below). $p _ { X , 0 } : = \operatorname* { i n f } _ { x \in \mathcal { X } } p _ { X } ( x ) > 0 .$ .
|
| 78 |
+
|
| 79 |
+
Finally, we make a smoothness assumption on $\eta$ , as done in other analyses of $k$ -NN classification (e.g. Chaudhuri & Dasgupta (2014); Reeve & Kaban (2019))
|
| 80 |
+
|
| 81 |
+
Assumption 3 $\overline { { \eta } }$ Holder continuous) ¨ . There exists $0 \textless \alpha \leq 1$ and $C _ { \alpha } \ > \ 0$ such that $| \eta ( x ) -$ $\eta ( x ^ { \prime } ) \vert \leq C _ { \alpha } \vert x - x ^ { \prime } \vert ^ { \alpha }$ for all $x , x ^ { \prime } \in { \mathcal { X } }$ .
|
| 82 |
+
|
| 83 |
+
We propose a notion of how spread out a set of points is based on the minimum pairwise distance between the points. This will be a quantity in the finite-sample bounds we will present. Intuitively, the more spread out a contaminated set of points is, the less clean samples we will be needed to overcome the contamination of that set.
|
| 84 |
+
|
| 85 |
+
Definition 2 (Minimum pairwise distance).
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
S _ { 2 } ( C ) : = \operatorname* { m i n } _ { \substack { x , x ^ { \prime } \in C , x \neq x ^ { \prime } } } | x - x ^ { \prime } | .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Also define the $\Delta$ -interior region of $\mathcal { X }$ where there is at least $\Delta$ margin in the probabilistic label:
|
| 92 |
+
|
| 93 |
+
Definition 3. Let $\Delta \geq 0$ . Define $\begin{array} { r } { \mathcal { X } ^ { \Delta } : = \{ x \in \mathcal { X } : \left| \frac { 1 } { 2 } - \eta ( x ) \right| \geq \Delta \} . } \end{array}$
|
| 94 |
+
|
| 95 |
+
We now state the result, which says that with high probability uniformly on $\chi ^ { \Delta }$ when $\Delta > 0$ is known, we have that the label disagrees with the $k$ -NN classifier if and only if the label is not the Bayes-optimal prediction. Due to space, all of the proofs have been deferred to the Appendix.
|
| 96 |
+
|
| 97 |
+
Theorem 1 (Fixed $\Delta$ ). Let $\Delta , \delta \ > \ 0$ and suppose Assumptions 1, 2, and $^ 3$ hold. There exists constants $K _ { l } , K _ { u } > 0$ depending only on $\mathcal { F }$ such that the following holds with probability at least $1 - \delta$ . Let $X _ { [ n ] }$ be $n$ (uncorrupted) examples drawn from the $\mathcal { F }$ and $C$ be a set of points with corrupted labels and denote our sample $X : = X _ { [ n ] } \cup C$ . Suppose $k$ lies in the following range
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
K _ { l } \cdot \frac { 1 } { \Delta ^ { 2 } } \cdot \log ^ { 2 } ( 1 / \delta ) \cdot \log n \leq k \leq K _ { u } \cdot \operatorname* { m i n } \{ S _ { 2 } ( C ) ^ { D } , \Delta ^ { D / \alpha } \} \cdot n ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
then the following holds uniformly over $x \in \mathcal { X } ^ { \Delta }$ : the $k$ -NN prediction computed w.r.t. $X$ agrees with the label if and only if the label is the Bayes-optimal label $\eta ^ { * } ( x ) : = 1 [ \eta ( x ) \geq \frac { 1 } { 2 } ]$ .
|
| 104 |
+
|
| 105 |
+
In the last result, we assumed that $\Delta$ was fixed. We next show how we can make a similar guarantee but show that we can take $\Delta 0$ as we choose $k , n \infty$ appropriately and provide rates of convergence.
|
| 106 |
+
|
| 107 |
+
Theorem 2 (Rates of convergence for $\Delta$ ). Let $\delta > 0$ and suppose Assumptions 1, 2, and 3 hold. There exist constants $K _ { l } , K _ { u } , K ~ > ~ 0$ depending only on $\mathcal { F }$ such that the following holds with probability at least $1 - \delta$ . Let $X _ { [ n ] }$ be $n$ (uncorrupted) examples drawn from $\mathcal { F }$ , and $C$ be a set of points with corrupted labels and denote our sample $X : = X _ { [ n ] } \cup C$ . Suppose $k$ lies in the following range
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
K _ { l } \cdot \log ^ { 2 } ( 1 / \delta ) \cdot n ^ { \frac { \alpha } { \alpha + D } } \leq k \leq K _ { u } \cdot S _ { 2 } ( C ) ^ { D } \cdot n ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
then the following holds uniformly over $x \in \mathcal { X } ^ { \Delta }$ : the $k$ -NN prediction computed w.r.t. $X$ agrees with the label if and only if the label is the Bayes-optimal label $\eta ^ { * } ( x ) : = 1 [ \eta ( x ) \geq \frac { 1 } { 2 } ]$ where
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\Delta = K \cdot \left( \sqrt { \frac { \log n + \log ( 1 / \delta ) } { k } } + \left( \frac { k } { n } \right) ^ { \alpha / D } \right) .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Remark 1. Choosing $k = { \cal { O } } ( n ^ { 2 \alpha / ( 2 \alpha + D ) } )$ in the above result gives us $\Delta = \widetilde { \cal O } ( n ^ { - \alpha / ( 2 \alpha + D ) } )$ . This rate for $\Delta$ is the minimax-optimal rate for $k$ -nearest neighbor classification on $\chi ^ { \Delta }$ given a sample of size $n$ (Chaudhuri $\&$ Dasgupta, 2014) in the uncorrupted setting. Thus, our analysis is tight up to logarithmic factors.
|
| 120 |
+
|
| 121 |
+
We next give results with an additional margin assumption, also known as Tsybakov’s noise condition (Mammen et al., 1999; Tsybakov et al., 2004):
|
| 122 |
+
|
| 123 |
+
Assumption 4 (Tsybakov Noise Condition). The following holds for some $C _ { \beta }$ and $\beta$ and all $\Delta > 0$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathbb { P } _ { \mathcal { X } } ( x \notin \mathcal { X } ^ { \Delta } ) \le C _ { \beta } \cdot \Delta ^ { \beta } .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 1: Left: training samples. We observe that test accuracy improves as $S _ { 2 } ( C )$ increases (middle) and that fewer clean training samples are needed to achieve an accuracy of $90 \%$ (right).
|
| 131 |
+
|
| 132 |
+
Theorem 3 (Rates under Tsybakov Noise Condition). Let $\delta > 0$ and suppose Assumptions 1, 2, 3 and 4 hold. There exists constants $K _ { l } , K _ { u } , K , K ^ { \prime } > 0$ depending only on $\mathcal { F }$ such that the following holds with probability at least $1 - \delta$ . Let $X _ { [ n ] }$ be $n$ (uncorrupted) examples drawn from the $\mathcal { F }$ and $C$ be a set of points with corrupted labels and denote our sample $X : = X _ { [ n ] } \cup C$ . Suppose $k$ lies in the following range
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
K _ { l } \cdot \log ^ { 2 } ( 1 / \delta ) \cdot n ^ { \frac { \alpha } { \alpha + D } } \leq k \leq K _ { u } \cdot S _ { 2 } ( C ) ^ { D } \cdot n ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
and define $\eta _ { k } ( x ) : = \arg \operatorname* { m a x } _ { y } \eta _ { k } ( y ; x )$ . Then,
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r } { \mathbb { P } \left( \eta _ { k } ( x ) \neq \eta ^ { * } ( x ) \right) \leq K \cdot \left( \sqrt { \frac { \log n + \log ( 1 / \delta ) } { k } } + \left( \frac { k } { n } \right) ^ { \alpha / D } \right) ^ { \beta } , } \\ { \quad R _ { X } - R ^ { * } \leq K ^ { \prime } \cdot \left( \sqrt { \frac { \log n + \log ( 1 / \delta ) } { k } } + \left( \frac { k } { n } \right) ^ { \alpha / D } \right) ^ { \beta + 1 } } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where $R _ { X } : = \mathbb { E } _ { \mathcal { F } } [ g _ { k } ( x ) \neq y ]$ and $R ^ { * } : = \mathbb { E } _ { \mathcal { F } } [ g ^ { * } ( x ) \neq y ]$ denote the risk of the $k$ -NN method and Bayes optimal classifier, respectively.
|
| 145 |
+
|
| 146 |
+
Remark 2. Choosing $k = { \cal { O } } ( n ^ { 2 \alpha / ( 2 \alpha + D ) } )$ in the above gives us a rate of $\widetilde { O } ( n ^ { - \alpha ( \beta + 1 ) / ( 2 \alpha + D ) } ) f o r$ the excess risk. This matches the lower bounds of Audibert et al. (2007) up to logarithmic factors.
|
| 147 |
+
|
| 148 |
+
# 4.1 IMPACT OF MINIMUM PAIRWISE DISTANCE
|
| 149 |
+
|
| 150 |
+
The minimum pairwise distance across corrupted samples, $S _ { 2 } ( C )$ , is a key quantity in the theory presented in the previous section. We now empirically study its significance in a simulated binary classification task in 2 dimensions. Clean samples with label $L$ are generated by sampling i.i.d from $\mathcal { N } ( \mu _ { L } , I _ { 2 \times 2 } )$ , where $\mu _ { 0 } = ( 0 , - 2 )$ and $\mu _ { 1 } = ( 0 , 2 )$ . The decision boundary is the line $y = 0$ . We take 100 samples uniformly spaced on a square grid centered about $( 0 , 0 )$ and corrupt them by flipping their true label. With this construction, $S _ { 2 } ( C )$ is precisely the grid width, which we let vary. The training set is a union of 100 clean samples and the 100 corrupted samples. Using 1000 clean samples as a test set we study the classification performance of a majority vote $k$ -NN classifier, where $k = 1 0$ . Results are shown in Figure 1. As expected, we see that as $S _ { 2 } ( C )$ decreases, so does test accuracy and we need more clean training samples to compensate.
|
| 151 |
+
|
| 152 |
+
# 5 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
We evaluate the effectiveness of our algorithm as follows. We split each dataset’s training set into two parts, $\mathcal { D } _ { \mathrm { c l e a n } }$ and $\mathcal { D } _ { \mathrm { n o i s y } }$ . We then corrupt the labels of some fraction of examples in $\mathcal { D } _ { \mathrm { n o i s y } }$ by applying a corruption matrix prescribed by one of the following methods.
|
| 155 |
+
|
| 156 |
+
• Uniform: The label is flipped to any one of the labels (including itself) with equal probability.
|
| 157 |
+
• Flip: The label is flipped to any other label with equal probability.
|
| 158 |
+
• Hard Flip: With probability $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ , we flip the label $m$ to $\pi ( m )$ where $\pi$ is some predefined permutation of the labels.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 2: UCI Results. Error plots against amount of noise applied to the labels of $\mathcal { D } _ { \mathrm { n o i s y } }$ . $\mathcal { D } _ { \mathrm { c l e a n } }$ contains $5 \%$ of the data. Each column is a different corruption and each row is for a different dataset. We see that the $k$ -NN method consistently chooses the best datapoints to filter leading to lower error. More results are in the Appendix.
|
| 162 |
+
|
| 163 |
+
We compare against the following baselines:
|
| 164 |
+
|
| 165 |
+
• Gold Loss Correction (GLC) (Hendrycks et al., 2018) estimates the corruption matrix by averaging the softmax outputs of the clean examples on a model trained on noisy data.
|
| 166 |
+
• Distill (Li et al., 2017) assigns each example in the combined dataset a “soft” label that is a convex combination of its label and its softmax output from a model trained solely on clean data.
|
| 167 |
+
• Forward (Patrini et al., 2017), similar in spirit to GLC, estimates the corruption matrix by training a model on noisy data and using the softmax output for prototype examples for each class. It does not require a clean dataset like other methods.
|
| 168 |
+
• Clean. We define this as training on the clean data only.
|
| 169 |
+
• Full. We define this as training on the full (clean and noisy) data.
|
| 170 |
+
• $k$ -NN Classify is like “Full” except we use $k$ -NN majority voting on the logits layer for classification at test time.
|
| 171 |
+
|
| 172 |
+
We report test errors and show the average across multiple runs with standard error bands shaded. Errors are computed on 11 uniformly distributed noise rates between 0 and 1 inclusive. For the results shown in the main text, we have that $\mathcal { D } _ { \mathrm { c l e a n } }$ is randomly selected and is $5 \%$ of the data. In the Appendix, we show results over different sizes of $\mathcal { D } _ { \mathrm { c l e a n } }$ . We implement all methods using the Tensorflow 2.0 Keras API and Scikit-Learn. We use the Adam optimizer with default learning rate 0.001 and a batch size of 128 across all experiments. For the UCI datasets, we set $k = 5 0$ and set $k = 5 0 0$ for all other datasets. We chose $k = 5 0$ for the UCI datasets because some of the datasets were of small size. However, we found that the $k$ -NN method’s performance was quite stable to the choice of $k$ , which we show in Section 5.4. We describe the permutations used for hard flipping in the Appendix.
|
| 173 |
+
|
| 174 |
+
# 5.1 UCI AND MNIST RESULTS
|
| 175 |
+
|
| 176 |
+
We show the results for one of the UCI datasets in Figure 2 and Fashion MNIST in Figure 3. Due to space, results for MNIST and the remaining UCI datasets are in the Appendix. For UCI, we use a fully-connected neural network with a single hidden layer of dimension 100 with ReLU activations and train for 100 epochs. For both MNIST datasets, we use is a two hidden-layer fully-connected neural network where each layer has 256 hidden units with ReLU activations. We train the model for 20 epochs. We see that the $k$ -NN approach attains models with a low error rate across noise rates and either outperforms or is competitive with the next best method, GLC.
|
| 177 |
+
|
| 178 |
+
# 5.2 CIFAR RESULTS
|
| 179 |
+
|
| 180 |
+
For CIFAR10/100 we use ResNet-20, which we train from scratch on single NVIDIA P100 GPUs. We train CIFAR10 for 100 epochs and CIFAR100 for 150 epochs. We show results for CIFAR10 in Figure 4 and results for CIFAR100 in the Appendix, due to space. We see that the $k$ -NN method performs competitively. It generally outperforms on the uniform and flip noise types but performs worse for the hard flip noise type. It is not too surprising that $k$ -NN would be weaker in the presence of hard flip noise (i.e. where labels are mapped based on a pre-determined mapping between labels) as the noise is much more structured in that case making it more difficult to be filtered out by majority vote among the neighbors. In other words, unlike the uniform and flip noise types, we are no longer dealing with white label noise in the hard flip noise type.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 3: Fashion MNIST. Each column is a different corruption method. We see that the $k$ -NN approach performs competitively. More results are in the Appendix.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: CIFAR10. Each column is a different corruption method. We see that our $k$ -NN method performs competitively or outperforms on the uniform and flip noise types but performs worse for the hard flip noise type. More results are in the Appendix.
|
| 187 |
+
|
| 188 |
+
# 5.3 SVHN RESULTS
|
| 189 |
+
|
| 190 |
+
We show the results in Figure 5. We train ResNet-20 from scratch on NVIDIA P100 GPUs for 100 epochs. As in the CIFAR experiments, we see that the $k$ -NN method tends to be competitive in the uniform and flip noise types but does slightly worse in the hard flip.
|
| 191 |
+
|
| 192 |
+
# 5.4 ROBUSTNESS TO $k$
|
| 193 |
+
|
| 194 |
+
In this section, we show that our procedure is stable in its hyperparameter $k$ . The theoretical results suggest that a wide range of $k$ can give us statistical consistency guarantees and we show that in practice a wide range of $k$ gives us similar results for Algorithm 1 (Figure 6). Such robustness in
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 5: SVHN. We see that the $k$ -NN method performs competitively on the uniform and flip noise types but performs worse for the hard flip noise type. More results in the Appendix.
|
| 198 |
+
|
| 199 |
+
<table><tr><td rowspan=1 colspan=1>Letters</td><td rowspan=1 colspan=1>1020</td><td rowspan=1 colspan=1>4.554.283.77</td><td rowspan=1 colspan=1>22.06</td><td rowspan=1 colspan=1>2.482.051.76</td><td rowspan=1 colspan=1>2.331.911.57</td><td rowspan=1 colspan=1>2.051.781.56</td><td rowspan=1 colspan=1>2.191.791.34</td><td rowspan=1 colspan=1>21.85</td><td rowspan=1 colspan=1>4.834.453.85</td><td rowspan=1 colspan=1>3.162.522.07</td><td rowspan=1 colspan=1>2.962.121.78</td><td rowspan=1 colspan=1>2.351.921.56</td><td rowspan=1 colspan=1>2.11.81.58</td><td rowspan=1 colspan=1>2.522.061.42</td><td rowspan=1 colspan=1>21.93</td><td rowspan=1 colspan=1>3.63.35</td><td rowspan=1 colspan=1>3.172.522.05</td><td rowspan=1 colspan=1>2.11.851.62</td><td rowspan=1 colspan=1>1.831.61.38</td><td rowspan=1 colspan=1>1.821.61.41</td><td rowspan=1 colspan=1>1.821.641.42</td><td rowspan=1 colspan=1>2.522.362.04</td></tr><tr><td rowspan=1 colspan=1>Phonemes</td><td rowspan=1 colspan=1>51020</td><td rowspan=1 colspan=1>7.897.867.72</td><td rowspan=1 colspan=1>1.911.541.34</td><td rowspan=1 colspan=1>1.791.531.33</td><td rowspan=1 colspan=1>2.121.671.35</td><td rowspan=1 colspan=1>1.261.161.13</td><td rowspan=1 colspan=1>2.582.281.76</td><td rowspan=1 colspan=1>32.852.24</td><td rowspan=1 colspan=1>7.917.957.89</td><td rowspan=1 colspan=1>1.931.541.34</td><td rowspan=1 colspan=1>3.212.751.97</td><td rowspan=1 colspan=1>2.161.691.35</td><td rowspan=1 colspan=1>1.341.221.16</td><td rowspan=1 colspan=1>3.973.642.87</td><td rowspan=1 colspan=1>4.313.963.28</td><td rowspan=1 colspan=1>6.66.736.36</td><td rowspan=1 colspan=1>1.921.551.33</td><td rowspan=1 colspan=1>1.771.611.45</td><td rowspan=1 colspan=1>1.961.61.3</td><td rowspan=1 colspan=1>1.21.151.14</td><td rowspan=1 colspan=1>1.781.621.38</td><td rowspan=1 colspan=1>2.72.582.28</td></tr><tr><td rowspan=1 colspan=1>Wilt</td><td rowspan=1 colspan=1>1020</td><td rowspan=1 colspan=1>5.184.684.31</td><td rowspan=1 colspan=1>0.560.430.36</td><td rowspan=1 colspan=1>0.850.750.86</td><td rowspan=1 colspan=1>0.540.450.35</td><td rowspan=1 colspan=1>0.390.320.32</td><td rowspan=1 colspan=1>0.930.770.57</td><td rowspan=1 colspan=1>1.861.771.5</td><td rowspan=1 colspan=1>5.275.635.18</td><td rowspan=1 colspan=1>0.560.440.34</td><td rowspan=1 colspan=1>3.893.142.67</td><td rowspan=1 colspan=1>0.530.430.35</td><td rowspan=1 colspan=1>0.520.410.34</td><td rowspan=1 colspan=1>5.154.864.23</td><td rowspan=1 colspan=1>4.954.844.32</td><td rowspan=1 colspan=1>4.64.785.63</td><td rowspan=1 colspan=1>0.550.430.34</td><td rowspan=1 colspan=1>0.730.660.61</td><td rowspan=1 colspan=1>0.580.430.36</td><td rowspan=1 colspan=1>0.390.310.3</td><td rowspan=1 colspan=1>0.980.780.57</td><td rowspan=1 colspan=1>1.91.811.49</td></tr><tr><td rowspan=1 colspan=1>Seeds</td><td rowspan=1 colspan=1>1020</td><td rowspan=1 colspan=1>3.293.432.99</td><td rowspan=1 colspan=1>4.223.042.69</td><td rowspan=1 colspan=1>3.712.842.27</td><td rowspan=1 colspan=1>4.22.992.74</td><td rowspan=1 colspan=1>3.082.141.72</td><td rowspan=1 colspan=1>2.872.742.44</td><td rowspan=1 colspan=1>新2.2</td><td rowspan=1 colspan=1>5.135.024.41</td><td rowspan=1 colspan=1>4.333.382.56</td><td rowspan=1 colspan=1>5.564.583.57</td><td rowspan=1 colspan=1>4.393.192.65</td><td rowspan=1 colspan=1>3.642.652.09</td><td rowspan=1 colspan=1>5.114.94.23</td><td rowspan=1 colspan=1>4.884.733.86</td><td rowspan=1 colspan=1>2.942.752.85</td><td rowspan=1 colspan=1>4.063.422.53</td><td rowspan=1 colspan=1>3.632.962.25</td><td rowspan=1 colspan=1>3.913.142.57</td><td rowspan=1 colspan=1>2.992.251.62</td><td rowspan=1 colspan=1>2.842.692.43</td><td rowspan=1 colspan=1>3.012.862.49</td></tr><tr><td rowspan=1 colspan=1>Iris</td><td rowspan=1 colspan=1>1020</td><td rowspan=1 colspan=1>292.46</td><td rowspan=1 colspan=1>3.232.481.85</td><td rowspan=1 colspan=1>3.482.591.97</td><td rowspan=1 colspan=1>3.972.251.52</td><td rowspan=1 colspan=1>2.461.320.6</td><td rowspan=1 colspan=1>1.721.260.96</td><td rowspan=1 colspan=1>2.051.551.32</td><td rowspan=1 colspan=1>5.255.064.46</td><td rowspan=1 colspan=1>3.382.531.51</td><td rowspan=1 colspan=1>5.154.583.45</td><td rowspan=1 colspan=1>4.032.241.38</td><td rowspan=1 colspan=1>3.022.171.46</td><td rowspan=1 colspan=1>4.323.983.36</td><td rowspan=1 colspan=1>4.434.083.53</td><td rowspan=1 colspan=1>2.92.62.51</td><td rowspan=1 colspan=1>3.292.341.84</td><td rowspan=1 colspan=1>3.132.021.48</td><td rowspan=1 colspan=1>4.11.861.34</td><td rowspan=1 colspan=1>2.321.150.58</td><td rowspan=1 colspan=1>1.140.910.65</td><td rowspan=1 colspan=1>1.351.161</td></tr><tr><td rowspan=1 colspan=1>Parkinsons</td><td rowspan=1 colspan=1>51020</td><td rowspan=1 colspan=1>55.354.88</td><td rowspan=1 colspan=1>3.463.263.01</td><td rowspan=1 colspan=1>3.263.223.08</td><td rowspan=1 colspan=1>4.223.453.1</td><td rowspan=1 colspan=1>3.43.212.98</td><td rowspan=1 colspan=1>3.263.222.97</td><td rowspan=1 colspan=1>3.763.823.52</td><td rowspan=1 colspan=1>5.175.435.19</td><td rowspan=1 colspan=1>3.553.383.02</td><td rowspan=1 colspan=1>4.494.253.94</td><td rowspan=1 colspan=1>4.13.443.05</td><td rowspan=1 colspan=1>3.363.322.95</td><td rowspan=1 colspan=1>5.345.274.99</td><td rowspan=1 colspan=1>5.355.135.06</td><td rowspan=1 colspan=1>4.985.245.1</td><td rowspan=1 colspan=1>362.98</td><td rowspan=1 colspan=1>3.563.13.01</td><td rowspan=1 colspan=1>4.593.372.98</td><td rowspan=1 colspan=1>3.683.112.96</td><td rowspan=1 colspan=1>3.283.122.91</td><td rowspan=1 colspan=1>3.633.823.47</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>51020</td><td rowspan=1 colspan=1>22.07</td><td rowspan=1 colspan=1>0.690.50.35</td><td rowspan=1 colspan=1>1.030.850.69</td><td rowspan=1 colspan=1>0.50.410.34</td><td rowspan=1 colspan=1>0.40.330.27</td><td rowspan=1 colspan=1>2.722.421.97</td><td rowspan=1 colspan=1>2.752.452.03</td><td rowspan=1 colspan=1>32.48</td><td rowspan=1 colspan=1>0.690.50.35</td><td rowspan=1 colspan=1>1.911.50.86</td><td rowspan=1 colspan=1>0.50.420.34</td><td rowspan=1 colspan=1>0.440.350.27</td><td rowspan=1 colspan=1>3.463.12.36</td><td rowspan=1 colspan=1>3.493.142.41</td><td rowspan=1 colspan=1>2.031.861.54</td><td rowspan=1 colspan=1>0.690.50.35</td><td rowspan=1 colspan=1>0.780.670.53</td><td rowspan=1 colspan=1>0.220.210.2</td><td rowspan=1 colspan=1>0.290.260.22</td><td rowspan=1 colspan=1>0.650.480.36</td><td rowspan=1 colspan=1>2.141.981.67</td></tr><tr><td rowspan=1 colspan=1>Fashion MNIST</td><td rowspan=1 colspan=1>51020</td><td rowspan=1 colspan=1>22.07</td><td rowspan=1 colspan=1>1.881.711.56</td><td rowspan=1 colspan=1>1.731.61.48</td><td rowspan=1 colspan=1>1.591.521.45</td><td rowspan=1 colspan=1>1.561.521.44</td><td rowspan=1 colspan=1>2.532.211.95</td><td rowspan=1 colspan=1>2.542.32.05</td><td rowspan=1 colspan=1>3.553.142.38</td><td rowspan=1 colspan=1>1.871.711.56</td><td rowspan=1 colspan=1>2.552.131.54</td><td rowspan=1 colspan=1>1.591.531.46</td><td rowspan=1 colspan=1>1.61.541.46</td><td rowspan=1 colspan=1>3.32.922.17</td><td rowspan=1 colspan=1>3.312.992.27</td><td rowspan=1 colspan=1>21.92</td><td rowspan=1 colspan=1>1.871.711.56</td><td rowspan=1 colspan=1>1.621.521.43</td><td rowspan=1 colspan=1>1.441.411.38</td><td rowspan=1 colspan=1>1.481.461.41</td><td rowspan=1 colspan=1>2.312.192.04</td><td rowspan=1 colspan=1>2.42.221.97</td></tr><tr><td rowspan=1 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>5200</td><td rowspan=1 colspan=1>6.746.586.4</td><td rowspan=1 colspan=1>76.585.52</td><td rowspan=1 colspan=1>6.866.325.66</td><td rowspan=1 colspan=1>5.435.395.11</td><td rowspan=1 colspan=1>5.035.274.57</td><td rowspan=1 colspan=1>6.346.115.93</td><td rowspan=1 colspan=1>6.746.556.36</td><td rowspan=1 colspan=1>7.146.826.62</td><td rowspan=1 colspan=1>7.26.565.59</td><td rowspan=1 colspan=1>7.126.725.9</td><td rowspan=1 colspan=1>5.525.625.16</td><td rowspan=1 colspan=1>5.355.324.85</td><td rowspan=1 colspan=1>6.716.486.1</td><td rowspan=1 colspan=1>7.126.836.56</td><td rowspan=1 colspan=1>5.084.894.77</td><td rowspan=1 colspan=1>7.136.535.45</td><td rowspan=1 colspan=1>5.855.34.68</td><td rowspan=1 colspan=1>3.763.913.51</td><td rowspan=1 colspan=1>4.274.43.82</td><td rowspan=1 colspan=1>4.334.214.03</td><td rowspan=1 colspan=1>4.964.894.75</td></tr><tr><td rowspan=1 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>10.810.7910.78</td><td rowspan=1 colspan=1>10.229.949.38</td><td rowspan=1 colspan=1>9.989.79.15</td><td rowspan=1 colspan=1>9.599.42</td><td rowspan=1 colspan=1>9.579.63</td><td rowspan=1 colspan=1>9.179.098.92</td><td rowspan=1 colspan=1>9.299.259.07</td><td rowspan=1 colspan=1>10.7910.8110.8</td><td rowspan=1 colspan=1>10.249.899.44</td><td rowspan=1 colspan=1>10.039.689.13</td><td rowspan=1 colspan=1>9.649.468.97</td><td rowspan=1 colspan=1>9.669.639.17</td><td rowspan=1 colspan=1>9.29.18.92</td><td rowspan=1 colspan=1>9.299.259.09</td><td rowspan=1 colspan=1>10.6410.6510.66</td><td rowspan=1 colspan=1>10.239.899.41</td><td rowspan=1 colspan=1>9.889.388.65</td><td rowspan=1 colspan=1>8.588.568.07</td><td rowspan=1 colspan=1>8.989.198.81</td><td rowspan=1 colspan=1>7.487.447.33</td><td rowspan=1 colspan=1>8.047.997.9</td></tr><tr><td rowspan=1 colspan=1>SVHN</td><td rowspan=1 colspan=1>1020</td><td rowspan=1 colspan=1>5.044.984.32</td><td rowspan=1 colspan=1>3.522.21.83</td><td rowspan=1 colspan=1>3.563.22.67</td><td rowspan=1 colspan=1>1.992.272.14</td><td rowspan=1 colspan=1>1.621.341.2</td><td rowspan=1 colspan=1>4.644.513.96</td><td rowspan=1 colspan=1>4.954.824.41</td><td rowspan=1 colspan=1>34.85</td><td rowspan=1 colspan=1>281.83</td><td rowspan=1 colspan=1>4.093.723.09</td><td rowspan=1 colspan=1>2.172.291.9</td><td rowspan=1 colspan=1>2.051.481.19</td><td rowspan=1 colspan=1>5.234.964.34</td><td rowspan=1 colspan=1>5.525.294.82</td><td rowspan=1 colspan=1>82.7</td><td rowspan=1 colspan=1>4.172.411.85</td><td rowspan=1 colspan=1>2.162.011.54</td><td rowspan=1 colspan=1>0.890.880.98</td><td rowspan=1 colspan=1>1.351.040.98</td><td rowspan=1 colspan=1>2.322.161.83</td><td rowspan=1 colspan=1>3.042.982.74</td></tr></table>
|
| 200 |
+
|
| 201 |
+
hyperparameter is highly desirable because optimal tuning is often not available, especially when no sufficient clean validation set is available.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Table 1: Area under the test error vs noise rate curve. Each row corresponds to a dataset and size of clean dataset $\mathcal { D } _ { \mathrm { c l e a n } }$ pair, where the size is a percentage of the total training set $5 \%$ , $10 \%$ , $20 \%$ ). Each column shows the area under the error curve across noise rates for a particular method and noise type (Uniform, Flip, Hard Flip). We see that the $k$ -NN method consistently outperforms the other methods for Uniform and Flip and outperforms the other methods on Hard Flip on the smaller datasets.
|
| 205 |
+
Figure 6: Performance across different values of $k$ . Here we show that on a UCI dataset, the performance of Algorithm 1 is stable when varying its hyperparameter $k$ . Note that the $y$ -axis has been zoomed in to better see the differences between the curves.
|
| 206 |
+
|
| 207 |
+
# 5.5 AREA UNDER ERROR VS NOISE LEVEL CURVE ACROSS DATASETS
|
| 208 |
+
|
| 209 |
+
In the figures shown so far, it may be difficult to compare the curves in some cases so we report an area under the curve metric in Table 1.
|
| 210 |
+
|
| 211 |
+
Conclusions and Open Questions We conclude from our experiments and theory that the $k$ -NN based method (Algorithm 1) is a relatively safe method to remove problematic training examples before training. While $k$ -NN methods can be sensitive to the choice of $k$ when used with small datasets (Garcia et al., 2009), we hypothesize that with today’s large datasets one can blithely set $k$ to a fixed practically medium-sized value (e.g. $k = 5 0 0$ ) as done here and expect reasonable performance. Theoretically we provided some new results for how well $k$ -NN can identify clean versus corrupted labels. Open theoretical questions are whether there are alternate notions of how to characterize the difficulty of a particular configuration of corrupted examples and whether we can provide both upper and lower learning bounds under these noise conditions.
|
| 212 |
+
|
| 213 |
+
# REFERENCES
|
| 214 |
+
|
| 215 |
+
Jean-Yves Audibert, Alexandre B Tsybakov, et al. Fast learning rates for plug-in classifiers. The Annals of Statistics, 35(2):608–633, 2007.
|
| 216 |
+
|
| 217 |
+
Carla E. Brodley and Mark A. Freidl. Identifying mislabeled training data. Journal Artificial Intelligence Research, 1999.
|
| 218 |
+
|
| 219 |
+
J Paul Brooks. Support vector machines with the ramp loss and the hard margin loss. Operations Research, 59(2):467–479, 2011.
|
| 220 |
+
|
| 221 |
+
Kamalika Chaudhuri and Sanjoy Dasgupta. Rates of convergence for nearest neighbor classification. In Advances in Neural Information Processing Systems, pp. 3437–3445, 2014.
|
| 222 |
+
|
| 223 |
+
Xu Chu, Ilhab F. Ilyas, Sanjay Krishnan, and Jiannan Wan. Data cleaning: Overview and emerging challenges. In SIGMOD, 2016.
|
| 224 |
+
|
| 225 |
+
Thomas M Cover. Rates of convergence for nearest neighbor procedures. In Proceedings of the Hawaii International Conference on Systems Sciences, pp. 413–415, 1968.
|
| 226 |
+
|
| 227 |
+
Luc Devroye, Laszlo Gyorfi, Adam Krzyzak, Gabor Lugosi, et al. On the strong universal consis- ´ tency of nearest neighbor regression function estimates. The Annals of Statistics, 22(3):1371– 1385, 1994.
|
| 228 |
+
|
| 229 |
+
Evelyn Fix and Joseph L Hodges Jr. Discriminatory analysis-nonparametric discrimination: consistency properties. Technical report, California Univ Berkeley, 1951.
|
| 230 |
+
|
| 231 |
+
Wei Gao, Xin-Yi Niu, and Zhi-Hua Zhou. On the consistency of exact and approximate nearest neighbor with noisy data. arXiv preprint arXiv:1607.07526, 2016.
|
| 232 |
+
|
| 233 |
+
E. K. Garcia, S. Feldman, M. R. Gupta, and S. Srivastava. Completely lazy learning. IEEE Trans. on Knowledge and DataEngineering, 2009.
|
| 234 |
+
|
| 235 |
+
Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 236 |
+
|
| 237 |
+
Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. 2016.
|
| 238 |
+
|
| 239 |
+
I. Guyon, N. Matic, and V. Vapnik. Discovering informative patterns and data cleaning. In AAAI Workshop on Knowledge Discovery in Databases, 1994.
|
| 240 |
+
|
| 241 |
+
Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5836–5846, 2018.
|
| 242 |
+
|
| 243 |
+
Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In Advances in neural information processing systems, pp. 10456–10465, 2018.
|
| 244 |
+
|
| 245 |
+
H. Jiang, B. Kim, M. Y. Guan, and M. R. Gupta. To trust or not to trust a classifier. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 246 |
+
|
| 247 |
+
Heinrich Jiang. Non-asymptotic uniform rates of consistency for k-nn regression. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3999–4006, 2019.
|
| 248 |
+
|
| 249 |
+
Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Regularizing very deep neural networks on corrupted labels. arXiv preprint arXiv:1712.05055, 4, 2017.
|
| 250 |
+
|
| 251 |
+
Ishan Jindal, Matthew Nokleby, and Xuewen Chen. Learning deep networks from noisy labels with dropout regularization. In 2016 IEEE 16th International Conference on Data Mining (ICDM), pp. 967–972. IEEE, 2016.
|
| 252 |
+
|
| 253 |
+
Ashish Khetan, Zachary C Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. arXiv preprint arXiv:1712.04577, 2017.
|
| 254 |
+
|
| 255 |
+
Yuncheng Li, Jianchao Yang, Yale Song, Liangliang Cao, Jiebo Luo, and Li-Jia Li. Learning from noisy labels with distillation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1910–1918, 2017.
|
| 256 |
+
Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(3):447–461, 2015.
|
| 257 |
+
Enno Mammen, Alexandre B Tsybakov, et al. Smooth discrimination analysis. The Annals of Statistics, 27(6):1808–1829, 1999.
|
| 258 |
+
Hamed Masnadi-Shirazi and Nuno Vasconcelos. On the design of loss functions for classification: theory, robustness to outliers, and savageboost. In Advances in Neural Information Processing Systems, pp. 1049–1056, 2009.
|
| 259 |
+
Nagarajan Natarajan, Inderjit S Dhillon, Pradeep K Ravikumar, and Ambuj Tewari. Learning with noisy labels. In Advances in Neural Information Processing Systems, pp. 1196–1204, 2013.
|
| 260 |
+
Nicolas Papernot and Patrick McDaniel. Deep k-nearest neighbors: Towards confident, interpretable and robust deep learning. arXiv preprint arXiv:1803.04765, 2018.
|
| 261 |
+
Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1944–1952, 2017.
|
| 262 |
+
Henry WJ Reeve and Ata Kaban. Fast rates for a kNN classifier robust to unknown asymmetric label noise. arXiv preprint arXiv:1906.04542, 2019.
|
| 263 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018.
|
| 264 |
+
David Rolnick, Andreas Veit, Serge Belongie, and Nir Shavit. Deep learning is robust to massive label noise. arXiv preprint arXiv:1705.10694, 2017.
|
| 265 |
+
Aarti Singh, Clayton Scott, Robert Nowak, et al. Adaptive Hausdorff estimation of density level sets. The Annals of Statistics, 37(5B):2760–2782, 2009.
|
| 266 |
+
Charles J Stone. Consistent nonparametric regression. The Annals of Statistics, pp. 595–620, 1977.
|
| 267 |
+
Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
|
| 268 |
+
Alexander B Tsybakov et al. Optimal aggregation of classifiers in statistical learning. The Annals of Statistics, 32(1):135–166, 2004.
|
| 269 |
+
Arash Vahdat. Toward robustness against label noise in training deep discriminative neural networks. In Advances in Neural Information Processing Systems, pp. 5596–5605, 2017.
|
| 270 |
+
Brendan Van Rooyen, Aditya Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. In Advances in Neural Information Processing Systems, pp. 10–18, 2015.
|
| 271 |
+
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 839–847, 2017.
|
| 272 |
+
Yizhen Wang, Somesh Jha, and Kamalika Chaudhuri. Analyzing the robustness of nearest neighbors to adversarial examples. In International Conference on Machine Learning, pp. 5120–5129, 2018.
|
| 273 |
+
D. Wilson. Asymptotic properties of nearest neighbor rules using edited data. IEEE Trans. on Systems, Man and Cybernetics, 1972.
|
| 274 |
+
Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2691–2699, 2015.
|
| 275 |
+
Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in Neural Information Processing Systems, pp. 8778–8788, 2018.
|
| 276 |
+
|
| 277 |
+
# A PROOFS
|
| 278 |
+
|
| 279 |
+
A.1 SUPPORTING THEORETICAL RESULTS
|
| 280 |
+
|
| 281 |
+
The following bounds $r _ { k } ( x )$ uniformly in $x \in \mathcal { X }$ . Lemma 1 (Lemma 2 of Jiang (2019)). The following holds with probability at least $1 - \delta / 2$ . If
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
2 ^ { 8 } \cdot D \log ^ { 2 } ( 4 / \delta ) \cdot \log n \leq k \leq { \frac { 1 } { 2 } } \cdot \omega \cdot p _ { X , 0 } \cdot v _ { D } \cdot r _ { 0 } ^ { D } \cdot n ,
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
then $\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathcal { X } } r _ { k } ( x ) \leq \left( \frac { 2 k } { \omega \cdot v _ { D } \cdot n \cdot p _ { X , 0 } } \right) ^ { 1 / D } } \end{array}$ , where $v _ { D }$ is the volume of the unit ball in $\mathbb { R } ^ { D }$ .
|
| 288 |
+
|
| 289 |
+
The next result bounds the number of distinct $k$ -NN sets over $\mathcal { X }$ .
|
| 290 |
+
|
| 291 |
+
Lemma 2 (Lemma 3 of Jiang (2019)). Let $M$ be the number of distinct $k$ -NN sets over $\mathcal { X }$ , that is, $M : = | \{ N _ { k } ( x ) : x \in \mathcal { X } \} |$ . Then $M \leq D \cdot n ^ { D }$ .
|
| 292 |
+
|
| 293 |
+
# A.2 MINIMUM $k$ -NN SPREAD
|
| 294 |
+
|
| 295 |
+
We propose a more notion of how spread out a set of points is than $S _ { 2 }$ which will be used in the theoretical analysis. This will allow us to more precisely characterize how difficult a configuration of incorrectly labeled examples will be to work with in the $k$ -NN context. For example, if such examples are spread out far apart, then there will be many correctly labeled examples nearby for the $k$ -NN approach to identify the incorrectly labeled examples. On the other hand, if the corrupted examples are all close together, then it will be more difficult to identify them without many uncorrected examples in that region. To this end, we define the minimum $k$ -NN spread:
|
| 296 |
+
|
| 297 |
+
Definition 4 (minimum $k$ -NN spread).
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
S _ { k } ( C ) : = \operatorname* { m i n } _ { x \in C } r _ { k } ( x , C ) ,
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
where $r _ { k } ( x , C )$ denotes the distance from $x$ to the $k$ -th closest neighbor in $C$ .
|
| 304 |
+
|
| 305 |
+
Note that this definition is consistent with the earlier definition of $S _ { 2 }$ .
|
| 306 |
+
|
| 307 |
+
# A.3 PROOF OF THEOREM 1
|
| 308 |
+
|
| 309 |
+
Proof of Theorem $^ { l }$ . Let $\tau , \gamma , \epsilon > 0$ be quantities that will be determined later. Suppose that for some $\dot { x } \in \mathcal { X } ^ { \Delta }$ , we have $r _ { k } ( x ) \ \leq \ \tau$ and $S _ { \mathrm { \lfloor ( \frac { 1 } { 2 } - \gamma ) \cdot k \rfloor } } ( C ) \geq \tau$ . Then, at least $\textstyle { \frac { 1 } { 2 } } + \gamma$ fraction of the points within $x$ ’s $k$ -nearest neighbors are not in the corrupted set $C$ . Let $A _ { x } : = N _ { k } ( x ) \backslash C$ , that is, the $k$ -nearest neighbors of $x$ that are not in $C$ . Then it is clear that $A _ { x }$ is a $k _ { 0 }$ -nearest neighbor set of $x$ relative to $X \backslash C$ for some $k _ { 0 } \geq \lceil ( \frac { 1 } { 2 } + \gamma ) \cdot k \rceil$ . We have that $A _ { x } \subseteq \mathcal { X } ^ { \Delta } \oplus \tau$ where $\begin{array} { r } { A _ { \mathbf { \lambda } } \oplus { } r : = \{ x \in \mathcal { X } : \operatorname* { i n f } _ { a \in A } | x - a | \leq r \} . } \end{array}$ . Let us consider without loss of generality that $\eta ( x ) \ge \frac { 1 } { 2 } + \Delta$ (call this set $\chi \Delta , +$ ). The case $\begin{array} { r } { \mathring { \mathcal { X } } ^ { \Delta , - } : = \{ { x } \in \mathcal { X } ^ { \Delta } : \eta ( { x } ) \leq \frac { 1 } { 2 } - \breve { \Delta } \} } \end{array}$ follows by symmetry. Thus, we have $\eta ( x ^ { \prime } ) \geq \frac { 1 } { 2 } + \Delta - C _ { \alpha } \tau ^ { \alpha }$ for all $x ^ { \prime } \in A _ { x }$ . By Hoeffing’s inequality, we have
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\mathbb { P } \left( \frac { 1 } { \lvert A _ { x } \rvert } \sum _ { x ^ { \prime } \in A _ { x } } y ( x ^ { \prime } ) < \frac { 1 } { 2 } + \Delta - C _ { \alpha } \tau ^ { \alpha } - \epsilon \right) \le \exp ( - 2 \epsilon ^ { 2 } \cdot k _ { 0 } ) ,
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
where $y ( x )$ is the label corresponding to sample $x$ . By Lemma 2, we have that there are at most $\boldsymbol { D } \cdot \boldsymbol { n } ^ { D }$ such $k _ { 0 }$ -nearest neighbor sets across all $k _ { 0 }$ in $X \backslash C$ . That is, this is also a bound on the number of distinct $A _ { x }$ for $x \in \mathcal { X }$ . Therefore, if we set
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\epsilon = \sqrt { \frac { D \log n + \log ( 4 D / \delta ) } { ( 1 + 2 \gamma ) \cdot k } } ,
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
then by union bound, we have that
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\mathbb { P } \left( \operatorname* { i n f } _ { x \in \mathcal { X } ^ { \Delta , + } } \frac { 1 } { \left| A _ { x } \right| } \sum _ { x ^ { \prime } \in A _ { x } } y ( x ^ { \prime } ) < \frac { 1 } { 2 } + \Delta - C _ { \alpha } \tau ^ { \alpha } - \epsilon \right) \leq \frac { \delta } { 4 } .
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
and thus, with probability at least $1 - \delta / 4$ , we have that $\begin{array} { r } { \frac { 1 } { | A _ { x } | } \sum _ { x ^ { \prime } \in A _ { x } } y ( x ^ { \prime } ) \ \geq \ \frac { 1 } { 2 } + \Delta - } \end{array}$ $C _ { \alpha } \tau ^ { \alpha } - \epsilon$ uniformly over $x \in \mathcal { X } ^ { \Delta , + }$ . Similarly, with probability at least $1 - \delta / 4$ we have that 1|A | Px0∈A y(x0) ≤ 12 − ∆ + Cατ α + uniformly over x ∈ X ∆,−.
|
| 328 |
+
|
| 329 |
+
Hence, in order for $k$ -nearest neighbor prediction to predict the Bayes-optimal label on $\chi ^ { \Delta }$ , it suffices that
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
k _ { 0 } \left( \frac { 1 } { 2 } + \Delta - C _ { \alpha } { \tau } ^ { \alpha } - \epsilon \right) \geq \frac { k } { 2 } .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
Since $k _ { 0 } \geq ( \frac { 1 } { 2 } + \gamma ) \cdot k$ , we have that the above holds if
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\Delta \ge C _ { \alpha } \tau ^ { \alpha } + \epsilon + \frac { 1 - 2 \gamma } { 2 ( 1 + 2 \gamma ) } .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
We now choose the values of $\tau , \gamma , \epsilon$ to upper bound each of the terms on the R.H.S. by $\Delta / 3$ so that the above holds.
|
| 342 |
+
|
| 343 |
+
We can bound the last term by $\Delta / 3$ by setting:
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\gamma = \frac { 1 } { 2 } \cdot \frac { 3 - 2 \Delta } { 3 + 2 \Delta } .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Next, taking
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\displaystyle { k \geq \frac { 3 ( 3 + 2 \Delta ) } { 2 \Delta ^ { 2 } } \left( D \log n + \log ( 4 D / \delta ) \right) , }
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
we have that $\epsilon \leq \Delta / 3$ . Now, by Lemma 1, we have that setting
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\tau = \left( \frac { 2 k } { \omega \cdot v _ { D } \cdot n \cdot p _ { X , 0 } } \right) ^ { 1 / D }
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
gives us that $r _ { k } ( x ) \leq \tau$ for all $x \in \mathcal { X }$ with probability at least $1 - \delta / 2$ . It thus suffices to take
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
k \leq { \frac { 1 } { 2 } } \left( { \frac { \Delta } { 3 \cdot C _ { \alpha } } } \right) ^ { D / \alpha } \cdot \omega \cdot v _ { D } \cdot p _ { X , 0 } \cdot n
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
so that $C _ { \alpha } \tau ^ { \alpha } \leq \Delta / 3$ . Now in order for $S _ { \left\lfloor \left( { \frac { 1 } { 2 } } - \gamma \right) \cdot k \right\rfloor } ( C ) \geq \tau$ , it suffices to have $S _ { 2 } ( C ) \geq \tau$ . This can be accomplished by having the following hold:
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
k \leq \frac 1 2 \cdot S _ { 2 } ( C ) ^ { D } \cdot \omega \cdot v _ { D } \cdot p _ { X , 0 } \cdot n .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Thus, there exists positive constants $K _ { l }$ and $K _ { u }$ depending only on $\mathcal { F }$ such that if
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
K _ { u } \cdot \frac { 1 } { \Delta ^ { 2 } } \cdot ( \log ^ { 2 } ( 1 / \delta ) \cdot \log n ) \le k \le K _ { u } \cdot \operatorname* { m i n } \{ S _ { 2 } ( C ) ^ { D } , \Delta ^ { D / \alpha } \} \cdot n ,
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
then the desired conditions hold.
|
| 380 |
+
|
| 381 |
+
# A.4 PROOF OF THEOREM 2
|
| 382 |
+
|
| 383 |
+
Proof of Theorem 2. The proof begins in the same way as the proof of Theorem 1. As before, let $\tau , \gamma , \epsilon > 0$ be quantities that will be determined later. Like before, we are reduced to showing
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\Delta \ge C _ { \alpha } \tau ^ { \alpha } + \epsilon + \frac { 1 - 2 \gamma } { 2 ( 1 + 2 \gamma ) } ,
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
as long as the conditions for Lemma 1 and 2 hold and $S _ { 2 } ( x ) \geq \tau$ and $r _ { k } ( x ) \leq \tau$ where we choose
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\epsilon = \sqrt { \frac { D \log n + \log ( 4 D / \delta ) } { ( 1 + 2 \gamma ) \cdot k } } , \quad \gamma = \frac { 1 } { 2 } \cdot \frac { 3 - 2 \Delta } { 3 + 2 \Delta } , \quad \tau = \left( \frac { 2 k } { \omega \cdot v _ { D } \cdot n \cdot p _ { X , 0 } } \right) ^ { 1 / D } .
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
These conditions hold for some $K _ { u }$ and $K _ { l }$ depending on $\mathcal { F }$ . Then we are reduced to having
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\frac 2 3 \Delta \geq \sqrt { \frac { D \log n + \log ( 4 D / \delta ) } { ( 1 + 2 \gamma ) \cdot k } } + C _ { \alpha } \left( \frac { 2 k } { \omega \cdot v _ { D } \cdot n \cdot p _ { X , 0 } } \right) ^ { \alpha / D } .
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
Since $\gamma \geq 0$ , it suffices to have
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\frac 2 3 \Delta \geq \sqrt { \frac { D \log n + \log ( 4 D / \delta ) } { k } } + C _ { \alpha } \left( \frac { 2 k } { \omega \cdot v _ { D } \cdot n \cdot p _ { X , 0 } } \right) ^ { \alpha / D } .
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
The desired form for $\Delta$ clearly follows for some choice of $K$ depending only on $D , \omega , p _ { X , 0 } , C _ { \alpha }$ , all of which depend only on $\mathcal { F }$ .
|
| 408 |
+
|
| 409 |
+
Finally, we must ensure that $\begin{array} { r } { \lfloor \left( \frac { 1 } { 2 } - \gamma \right) \cdot k \rfloor \ge 2 } \end{array}$ so that $S _ { \lfloor ( \frac { 1 } { 2 } - \gamma ) \cdot k \rfloor } ( C ) \geq S _ { 2 } ( x )$ . Given the expression for $\gamma$ , it is equivalent to have $\begin{array} { r } { \lfloor \left( \frac { 2 \Delta } { 3 + 2 \Delta } \right) \cdot k \rfloor \ge 2 } \end{array}$ . It suffices to show that $k \geq \frac { 3 ( 3 + 2 \Delta ) } { 2 \Delta }$ . Given the form of $\Delta$ in terms of $n$ and $k$ , we see that it suffices to have that
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
k \geq \frac { 9 } { 2 } \cdot K \cdot \left( \left( \sqrt { \frac { \log n + \log ( 1 / \delta ) } { k } } + \left( \frac { k } { n } \right) ^ { \alpha / D } \right) \right) ^ { - 1 } + 3 ,
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
which holds when $k \geq K _ { 0 } \cdot n ^ { 2 \alpha / ( 2 \alpha + D ) }$ for some $K _ { 0 }$ depending only on $\mathcal { F }$ , as desired.
|
| 416 |
+
|
| 417 |
+
# A.5 PROOF OF THEOREM 3
|
| 418 |
+
|
| 419 |
+
Proof of Theorem 3. The first part follows from Theorem 2. For the second part, we have by Theorem 2 that if $x \in \mathcal { X } ^ { \Delta }$ , then the $k$ -NN classifier and the Bayes-optimal classifier match with probability $1 - \delta$ uniformly. Thus, we have
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l } & { { R _ { X } } - { R ^ { * } } \leq \mathbb { P } ( x \notin \mathcal { X } ^ { \Delta } ) \left( \mathbb { E } _ { \mathcal { F } } [ g _ { k } ( x ) \neq y | x \notin \mathcal { X } ^ { \Delta } ] - \mathbb { E } _ { \mathcal { F } } [ g ^ { * } ( x ) \neq y | x \notin \mathcal { X } ^ { \Delta } ] \right) } \\ & { \qquad \leq { C _ { \beta } } \cdot \Delta ^ { \beta } \cdot \left( \mathbb { E } _ { \mathcal { F } } [ g _ { k } ( x ) \neq y | x \notin \mathcal { X } ^ { \Delta } ] - \mathbb { E } _ { \mathcal { F } } [ g ^ { * } ( x ) \neq y | x \notin \mathcal { X } ^ { \Delta } ] \right) \leq { C _ { \beta } } \cdot \Delta ^ { \beta } \cdot 2 \Delta . } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
The result follows immediately from Theorem 2.
|
| 426 |
+
|
| 427 |
+
# B HARD FLIP PERMUTATIONS
|
| 428 |
+
|
| 429 |
+
For Fashion MNIST we hard flip by swapping the following classes: TSHIRT $\mathbf { \Gamma } \mathbf { S } \mathbf { H }$ IRT, TROUSER DRESS, PULLOVER $ { \mathrm { C O A T } }$ , SANDAL BAG, SNEAKER ANKLEBOOT. For CIFAR10 we swap the pairs: TRUCK AUTOMOBILE, BIRD AIRPLANE, DEER HORSE, $\mathrm { \Delta ^ { \circ } A T D O G , F R O G S H I P } .$ For CIFAR100, we hard flip circularly (i.e. $\pi ( i ) = ( i + 1 )$ mod $K$ ) within each of the 20 superclasses. For all other datasets, we hard flip circularly.
|
| 430 |
+
|
| 431 |
+
# C ADDITIONAL PLOTS
|
| 432 |
+
|
| 433 |
+
We provide the plots that were ommitted from the main text due to space constraints.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 7: Plots for UCI Phonemes dataset at 10, $20 \%$ clean data and all corruption types.
|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
Figure 8: Plots for UCI Letters dataset at 5, 10, $20 \%$ clean data and all corruption types.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure 9: Plots for UCI Wilt dataset at 5, 10, $20 \%$ clean data and all corruption types.
|
| 443 |
+
|
| 444 |
+

|
| 445 |
+
Figure 10: Plots for UCI Parkinsons dataset at 5, 10, $20 \%$ clean data and all corruption types.
|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
Figure 11: Plots for UCI Seeds dataset at 5, 10, $20 \%$ clean data and all corruption types.
|
| 449 |
+
|
| 450 |
+

|
| 451 |
+
Figure 12: Plots for UCI Iris dataset at 5, 10, $20 \%$ clean data and all corruption types.
|
| 452 |
+
|
| 453 |
+

|
| 454 |
+
Figure 13: Plots for MNIST at 5, 10, $20 \%$ clean data and all corruption types.
|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
Figure 14: Plots for Fashion MNIST at 10, $20 \%$ clean data and all corruption types.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
Figure 15: Plots for CIFAR10 at 10, $20 \%$ clean data and all corruption types.
|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
Figure 16: Plots for CIFAR100 at 5, 10, $20 \%$ clean data and all corruption types.
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
Figure 17: Plots for SVHN at 10, $20 \%$ clean data and all corruption types.
|
md/train/By4HsfWAZ/By4HsfWAZ.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEP LEARNING FOR PHYSICAL PROCESSES: INCORPORATING PRIOR SCIENTIFIC KNOWLEDGE
|
| 2 |
+
|
| 3 |
+
Emmanuel de Bezenac ´ ∗, Arthur Pajot ∗, Patrick Gallinari emmanuel.de-bezenac, arthur.pajot, patrick.gallinari @lip6.fr Sorbonne Universites, UMR 7606, LIP6, F-75005 Paris, France ´
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We consider the use of Deep Learning methods for modeling complex phenomena like those occurring in natural physical processes. With the large amount of data gathered on these phenomena the data intensive paradigm could begin to challenge more traditional approaches elaborated over the years in fields like maths or physics. However, despite considerable successes in a variety of application domains, the machine learning field is not yet ready to handle the level of complexity required by such problems. Using an example application, namely Sea Surface Temperature Prediction, we show how general background knowledge gained from the physics could be used as a guideline for designing efficient Deep Learning models. In order to motivate the approach and to assess its generality we demonstrate a formal link between the solution of a class of differential equations underlying a large family of physical phenomena and the proposed model. Experiments and comparison with series of baselines including a state of the art numerical approach is then provided.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
A physical process is a sustained phenomenon marked by gradual changes through a series of states occurring in the physical world. Physicists and environmental scientists attempt to model these processes in a principled way through analytic descriptions of the scientist’s prior knowledge of the underlying processes. Conservation laws, physical principles or phenomenological behaviors are generally formalized using differential equations. This physical paradigm has been, and still is the main framework for modeling complex natural phenomena like e.g. those involved in climate. With the availability of very large datasets captured via different types of sensors, this physical modeling paradigm is being challenged by the statistical Machine Learning (ML) paradigm, which offers a prior-agnostic approach. However, despite impressive successes in a variety of domains as demonstrated by the deployment of Deep Learning methods in fields such as vision, language, speech, etc, the statistical approach is not yet ready to challenge the physical paradigm for modeling complex natural phenomena, or at least it has not demonstrated how to. This is a new challenge for this field and an emerging research direction in the ML community. We believe that knowledge and techniques accumulated for modeling physical processes in well developed fields such as maths or physics could be useful as a guideline to design efficient learning systems and conversely, that the ML paradigm could open new directions for modeling such complex phenomena. In this paper we then raise two issues: 1) are modern ML techniques ready to be used to model complex physical phenomena, and 2) how general knowledge gained from the physical modeling paradigm could help designing efficient ML models.
|
| 12 |
+
|
| 13 |
+
In this work, we tackle these questions by considering a specific physical modeling problem: forecasting sea surface temperature (SST). SST plays a significant role in analyzing and assessing the dynamics of weather and other biological systems. Accurately modeling and predicting such dynamics is critical in various applications such as weather forecasting, or planning of coastal activities. Since 1982, weather satellites have made huge quantities of very high resolution SST data available Bernstein (1982). Standard physical methods for forecasting SST use coupled ocean-atmosphere prediction systems, based on the Navier Stokes equations. These models rely on multiple physical hypotheses and do not optimally exploit the information available in the data. On the other hand, despite the availability of large amounts of data, direct applications of ML methods do not lead to competitive state of the art results, as will be seen in section 4.
|
| 14 |
+
|
| 15 |
+
We use SST as a typical and representative problem of intermediate complexity. Our goal is not to offer one more solution to this problem, but to use it as an illustration for advancing on the challenges mentioned above. The way we handle this problem is general enough to be transfered to a more general class of transport problems.
|
| 16 |
+
|
| 17 |
+
We propose a Deep Neural Network (NN) model, inspired from general physical motivations which offers a new approach for solving this family of problems. We first motivate our approach by introducing in section 2 the solution of a general class of partial differential equations (PDE) which is a core component of a large family of transport and propagation phenomena in physics. This general solution is used as a guideline for introducing a Deep Learning architecture for SST prediction which is described in section 3. Experiments and comparison with a series of baselines is introduced in section 4. A review of related work is finally presented in section 5.
|
| 18 |
+
|
| 19 |
+
The main contributions of this work are: 1) an example showing how to incorporate general physical background for designing a NN aimed at modeling a relatively complex prediction task. We believe the approach to be general enough to be used for a family of transport problems obeying general advection-diffusion principles. 2) formal links between our model’s prediction and the solution of a general advection diffusion PDE 3) an unsupervised model for estimating motion fields, given a sequence of images. 4) a proof, on a relatively complex physical modeling problem, that full data intensive approaches based on deep architectures can be competitive with state of the art dedicated numerical methods.
|
| 20 |
+
|
| 21 |
+
# 2 PHYSICAL MOTIVATION
|
| 22 |
+
|
| 23 |
+
Forecasting consists in predicting future temperature maps using past records. Temperatures are acquired via satellite imagery. If we focus on a specific area, we can formulate the problem as prediction of future temperature images of this area using past images. The classical approach to forecasting SST consists in using numerical models representing prior knowledge on the conservation laws and physical principles, which take the form of PDEs. These models are then coupled with SST data using assimilation techniques in order to adjust to initial conditions. It is then integrated forward in time to predict SST evolution. For the sea surface, temperature variation is related to a fluid transport problem. In fluids, transport occurs through the combination of two principles: advection and diffusion. During advection, a fluid transports some conserved quantity $I$ (the temperature for SST) or material via bulk motion, i.e.for small variations $\Delta x , \Delta t$ , conservation is expressed as:
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
I ( x , t ) = I ( x + \Delta x , t + \Delta t )
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
applying a first order approximation of the right hand side and moving the resulting terms to the left hand side of equation 1, we obtain the advection equation, known also as the Brightness Constancy Constraint Equation (BCCE):
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\frac { \partial I } { \partial t } + ( w . \nabla ) I = 0
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
where $\nabla$ denotes the gradient operator, and $w$ the motion vector $\textstyle { \frac { \Delta x } { \Delta t } }$ . This equation describes the temporal evolution of quantity $I$ for displacement $w$ . Note that this equation is also the basis for many variational methods for Optical Flow. To retrieve the motion, numerical schemes are applied, and the resulting system of equations, along with a an additional constraint on $w$ is solved for $w$ . This motion can then be used to forecast the future value of $I$ .
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\frac { \partial I } { \partial t } + ( w . \nabla ) I = D \nabla ^ { 2 } I
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
$\nabla ^ { 2 }$ denotes the Laplacian operator and $D$ the diffusion coefficient. Note that when $D \to 0$ , we recover the advection equation 2.
|
| 42 |
+
|
| 43 |
+
This equation describes a large family of physical processes (e.g. fluid dynamics, heat conduction, wind dynamics, etc). Let us now state a result, characterizing the general solutions of equation 3.
|
| 44 |
+
|
| 45 |
+
Theorem 1. 1 For any initial condition $I _ { 0 } \in L ^ { 1 } ( \mathbb { R } ^ { 2 } )$ with $I _ { 0 } ( \pm \infty ) = 0$ , there exists a unique global solution $I ( x , t )$ to the advection-diffusion equation 3:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
I ( x , t ) = \int _ { \mathbb { R } ^ { 2 } } k ( x - w , y ) I _ { 0 } ( y ) d y
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\begin{array} { r } { k ( u , v ) = \frac { 1 } { 4 \pi D t } e ^ { - \frac { 1 } { 4 D t } \left. u - v \right. ^ { 2 } } } \end{array}$ is a radial basis function kernel, or alternatively, a 2 dimensional Gaussian probability density with mean $u$ and variance $2 D t$ .
|
| 52 |
+
|
| 53 |
+
Equation 4 provides a principled way to calculate $I ( x , t )$ for any time $t$ using the initial condition $I _ { 0 }$ , provided the motion $w$ and the diffusion coefficient $D$ are known. It states that quantity $I ( x , t )$ can be computed from the initial condition $I _ { 0 }$ via a convolution with a Gaussian probability density function. In other words, if $I$ was used as a model for the evolution of the SST and the surface’s underlying advecting mechanisms were known, future surface temperatures could be predicted from previous ones. Unfortunately neither the initial conditions, the motion vector nor the diffusion coefficient are known. They have to be estimated from the data. Inspired from the general form of solution 4, we propose a ML method, expressed as a Deep Learning architecture for predicting SST. This model will learn to predict a motion field analog to the $w$ in equation 4, which will be used to predict future images.
|
| 54 |
+
|
| 55 |
+
# 3 MODEL
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 1: Motion is estimated from the input images $( I _ { t - k - 1 : t } )$ with a convolutional neural network (top left CDNN component). A warping scheme then displaces the last input image along this motion estimate to produce the future image. The error signal is calculated using the target future image $I _ { t + 1 }$ , and is backprogated through the warping scheme to correct the CDNN. To produce multiple time-step forecasts, the predicted image is fed back in the CDNN in an autoregressive manner.
|
| 59 |
+
|
| 60 |
+
The model consists of two main components, as illustrated in Figure 1. One predicts the motion field from a sequence of past input images, this is convolutional-deconvolutional (CDNN) module on the top of figure 1, and the other warps the last input image using the motion field from the first component, in order to produce an image forecast. The entire system is trained in an end-to-end fashion, using only the supervision from the target SST image. By doing so, we are able to produce an interpretable latent state which corresponds in our problem to the velocity field advecting the temperatures.
|
| 61 |
+
|
| 62 |
+
Let us first introduce some notations. Each SST image $I _ { t }$ is acquired on a bounded rectangle of $\mathbb { R } ^ { 2 }$ , named $\Omega$ . We denote $I _ { t } ( x )$ and $w _ { t } ( x )$ the sea surface temperature and the two-dimensional motion vector at time $t \in \mathbb { R }$ at position $x \in \Omega$ . $I _ { t } : \Omega \to \mathbb { R }$ and $\dot { w } _ { t } : \Omega \to \mathbb { R } ^ { 2 }$ represent the temperatures and the motion vector field at time $t$ defined on $\Omega$ . When time $t$ and position $x$ are available from the context, we will drop the subscript $t$ from $w _ { t } ( x )$ and $I _ { t } ( x )$ , along with $x$ for clarity. Given a sequence of $k$ consecutive SST images $\{ I _ { t - k - 1 } , . . . , I _ { t } \}$ (also denoted as $I _ { t - k - 1 : t } )$ , our goal is to predict the next image $I _ { t + 1 }$ .
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 2: Architecture of the CDNN motion estimation component. For the estimated motion flow $\hat { w } _ { t }$ , colours correspond to the flow orientation and colour intensity to the flow intensity
|
| 66 |
+
|
| 67 |
+
As indicated in section 2, provided the underlying motion field is known, one can compute SST forecasts. Let us introduce how the motion field is estimated in our architecture. We are looking for a vector field $w$ which when applied to the geometric space $\Omega$ renders $I _ { t }$ close to $I _ { t + 1 }$ , i.e. $I _ { t + 1 } ( \bar { x } ) \simeq$ $I _ { t } ( x + w ( x ) )$ , $\forall x \in \Omega$ . If $I _ { t + 1 }$ were known, we could estimate $w$ , but $I _ { t + 1 }$ is precisely what we are looking for. Instead, we choose to use a convolutional-deconvolutional architecture to predict a motion vector for each pixel. As shown in figure 2, this network makes use of skip connections He et al. (2015), allowing fine grained information from the first layers to flow through in a more direct manner. We use a Batch Normalization layer between each convolution, and Leaky $R e L U$ (with parameter value set to 0.1) non-linearities between convolutions and transposed-convolutions. We used $k = 4$ concatenated images $I _ { t - k - 1 : t }$ as input for training. We have selected this architecture experimentally, testing different state-of-the-art convolution-deconvolution network architectures. Let $\hat { w } \in \mathbb { R } ^ { 2 \times \mathbf { \bar { W } } \times H }$ be the output of the network, where $W$ and $H$ are respectively the width and height of the images, and $\mathit { \Omega } ^ { , }$ corresponds to the two components of the flow at each point of the motion field.
|
| 68 |
+
|
| 69 |
+
Generally, and this is the case for our problem, we do not have a direct supervision on the motion vector field, since the target motion is usually not available. Using the warping scheme introduced below, we will nonetheless be able to (weakly) supervise $w$ , based on the discrepancy of the warped version of the $I _ { t }$ image and the target image $I _ { t + 1 }$ .
|
| 70 |
+
|
| 71 |
+
# 3.2 WARPING SCHEME
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: Warping scheme. To calculate the pixel value for time $t + 1$ at position $x$ , we first compute its previous position at time $t$ , i.e. $x - w$ . We then center a Gaussian in that position in order to obtain a weight value for each pixel in $I _ { t }$ based on its distance with $x - w$ , and compute a weighted average of the pixel values of $I _ { t }$ . This weighted average will correspond to the new pixel value at $x$ in $I _ { t + 1 }$ .
|
| 75 |
+
|
| 76 |
+
Discretizing the solution of the advection-diffusion equation in section 2 by replacing the integral with a sum, and setting image $I _ { t }$ as the initial condition, we obtain a method to calculate the future image, based on the motion field estimate $\hat { w }$ . The latter is used as a warping scheme:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\hat { I } _ { t + 1 } ( x ) = \sum _ { y \in \Omega } k ( x - \hat { w } ( x ) , y ) I _ { t } ( y )
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\begin{array} { r } { k ( x - \underset { . } { \hat { w } } , y ) = \underset { . } { \frac { 1 } { 4 \pi D \Delta t } } e ^ { - \frac { 1 } { 4 D \Delta t } \| x - \hat { w } - y \| ^ { 2 } } } \end{array}$ is a radial basis function kernel, as in equation 4, parameterized by the diffusion coefficient $D$ and the time step value $\Delta t$ between $t$ and $t + 1$ and $\hat { w }$ is the estimated value of the vector flow $w$ . To calculate the temperature for time $t + 1$ at position $x$ , we compute the scalar product between $k ( x - { \hat { w } } , . )$ , a Gaussian centered in $x - \hat { w }$ , and the previous image $I _ { t }$ . Simply put, it is a weighted average of the temperatures $I _ { t }$ , where the weight values are larger when the pixel’s positions that are closer to $x - \hat { w }$ . Informally, $x - \hat { w }$ corresponds to the pixel’s previous position at time $t$ . See figure 3.
|
| 83 |
+
|
| 84 |
+
As seen by the relation with the solution of the advection-diffusion equation, the proposed warping mechanism is then clearly adapted to the modeling of phenomena governed by the advectiondiffusion equation. SST forecasting is a particular case, but the proposed scheme can be used for any problems in which advection and diffusion are occurring. Moreover, this warping scheme is entirely differentiable, allowing backpropagation of the error signal to the motion fireld estimating module.
|
| 85 |
+
|
| 86 |
+
This warping mechanism has been inspired by the Spatial Transformer Network (STN) Jaderberg et al. (2015), originally designed to be incorporated as a layer in a convolutional neural network architecture in order to gain invariance under geometric transformations. Using the notations in Jaderberg et al. (2015), when the inverse geometric transformation $\mathcal { T } _ { \theta }$ of the grid generator step is set to $\mathcal { T } _ { \theta } ( x ) = x - \hat { w } ( x )$ , and the kernels $k ( . ; \Phi _ { x } )$ and $k ( . ; \Phi _ { y } )$ in the sampling step are radial basis function kernels, we recover our warping scheme. The latter can be seen as a specific case of the STN, without the localization step. This result theoretically grounds the use of the STN for Optical Flow in many recent articles Zhu et al. (2017), Yu et al. (2016), Patraucean et al. (2015), Finn et al. (2016): in equation 3, when $D \to 0$ , we recover the brightness constancy constraint equation, used in the latter.
|
| 87 |
+
|
| 88 |
+
For training, supervision is provided at the output of the warping module. It consists in minimizing the discrepancy between the warped image $\hat { I } _ { t + 1 }$ and the target image $I _ { t + 1 }$ . The loss is measured via a differentiable function and the gradient is back propagated through the warping function in order to adjust the parameters of the convolutional-deconvolutional module generating the vector field. This is detailed in the next section.
|
| 89 |
+
|
| 90 |
+
# 3.3 LOSS FUNCTION
|
| 91 |
+
|
| 92 |
+
At each iteration, the model aims at forecasting the next observation, given the previous ones. We evaluate the discrepancy between the warped image $\hat { I } _ { t + 1 }$ and the target image $I _ { t + 1 }$ using the Charbonnier penalty function $\rho ( x ) = ( x + \epsilon ) ^ { \frac { 1 } { \alpha } }$ , where $\epsilon$ and $\alpha$ are parameters to be set. Note that with $\epsilon = 0$ and $\alpha \stackrel { \cdot } { = } \frac { 1 } { 2 }$ , we recover the $\ell _ { 2 }$ loss. The Charbonnier penalty function is known to reduce the influence of outliers compared to an $l _ { 2 }$ norm. We have also tested the Laplacian pyramid loss Ling & Okada (2006), where we enforce convolutions of all deconvolutional layers to be close to down-sampled versions of the target image in the Charbonnier penalty sense, but we have observed an overall decrease in generalization performance.
|
| 93 |
+
|
| 94 |
+
The proposed NN model has been designed according to the intuition gained from general background knowledge of a physical phenomenon, here advection-diffusion equations. Additional prior knowledge – expressed as partial differential equations, or through constraints – can be easily incorporated in our model, by adding penalty terms in the loss function. As the displacement $w$ is explicitly part of our model, one strength of our model is its capacity to apply some regularization term directly on the motion field. In our experiments, we tested the influence of different terms: divergence $\nabla . w _ { t } ( x ) ^ { 2 }$ , magnitude $\| w _ { t } ( x ) \| ^ { 2 }$ and smoothness $\Vert \nabla w _ { t } ( x ) \Vert ^ { 2 }$ .
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
L _ { t } = \sum _ { x \in \Omega } \rho ( \hat { I } _ { t + 1 } ( x ) - I _ { t + 1 } ( x ) ) + \lambda _ { \mathrm { d i v } } ( \nabla . w _ { t } ( x ) ) ^ { 2 } + \lambda _ { \mathrm { m a g n } } \left\| w _ { t } ( x ) \right\| ^ { 2 } + \lambda _ { \mathrm { g r a d } } \left\| \nabla w _ { t } ( x ) \right\| ^ { 2 }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 4 EXPERIMENTS
|
| 101 |
+
|
| 102 |
+
# 4.1 DATASET DESCRIPTION
|
| 103 |
+
|
| 104 |
+
Since 1982, high resolution SST data has been made available by the NOAA6 weather satellite, Bernstein (1982). Dealing directly with these data requires a lot of preprocessing (e.g. some regions are not available due to clouds, hindering temperature acquisition). In order to avoid such complications which are beyond the scope of this work, we used synthetic but realistic SST data of the Atlantic ocean generated by a sophisticated simulation engine: NEMO (Nucleus for European Modeling of the Ocean) engine 2, Madec (2008). NEMO is a state-of-the-art modelling framework of ocean related engines. It is a primitive equation model adapted to the regional and global ocean circulation problems. Historical data is accumulated in the model to generate a synthesized estimate of the states of the system using data analysis, a specific data assimilation scheme, which means that the data does follow the true temperatures. The resulting dataset is constituted of daily temperature acquisitions of 481 by 781 pixels, from 2006-12-28 to 2017-04-05 (3734 acquisitions).
|
| 105 |
+
|
| 106 |
+
We extract 64 by 64 pixel sized sub-regions as indicated in figure 4.1. We use data from years 2006 to 2015 for training and validation (94743 training examples), and years 2016 to 2017 for testing. We withhold $20 \%$ of the training data for validation, selected uniformly at random at the beginning of each experiment. For the tests we used sub-regions enumerated 17 to 20 in figure 4.1, where the interactions between hot and cold waters make the dynamics interesting to study. All the regions numbered in figure 4.1, from 2006 to 2015 where used for training 3. Each sequence of images used for training or for evaluation corresponds to a specific numbered sub-region. We make the simplifying hypothesis that the data in a single sub-region contains enough information to forecast the future of the sub-region. As the forecast is for a small temporal horizon we can assume that the influence from outside the region is small enough.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: Sub regions extracted for the dataset. Test regions are regions 17 to 20.
|
| 110 |
+
|
| 111 |
+
We normalize the daily SST acquisitions of each sub region using the mean and the standard deviation of all the SST data of the sub-region acquired on the same day of the year for all the years in the training set, i.e. the SST acquisition of sub-region 2 on date September 8th 2017 is standardized using the data of all the September 8th available in the dataset. This removes the seasonal component from SST data.
|
| 112 |
+
|
| 113 |
+
# 4.2 BASELINE COMPARISON
|
| 114 |
+
|
| 115 |
+
We compare our model with several baselines. Each model is evaluated with a mean square error metric, forecasting images on a horizon of 6 (we forecast from $I _ { t + 1 }$ to $I _ { t + 6 }$ and then average the MSE). The hyperparameters are tuned using the validation set. Neural network based models are run on a Titan $\mathrm { X p }$ GPU, and runtime is given for comparison purpose.
|
| 116 |
+
|
| 117 |
+
Concerning the constraints on the vector field $w$ (equation 6. the regularization coefficients selected via validation are $\lambda _ { \mathrm { d i v } } = 1$ , $\lambda _ { \mathrm { { m a g n } } } = - 0 . 0 3$ and $\lambda _ { \mathrm { g r a d } } = 0 . 4$ . The coefficient diffusion $D$ was set to 0.45 by cross validation. We also compare the results with the model without any regularization.
|
| 118 |
+
|
| 119 |
+
Our reference model for forecasting is Ber´ eziat & Herlin (2015), a numerical assimilation model ´ which relies on data assimilation. In Ber´ eziat & Herlin (2015), the ocean’s dynamics are modeled ´ using shallow water equations Vallis (2017) and the initial conditions, along with other terms, are estimated using assimilation techniques Tremolet (2006). This is a state of the art assimilation model ´ for predicting ocean dynamics, here SST.
|
| 120 |
+
|
| 121 |
+
The other baselines are 1) an autoregressive convolutional-deconvolutional NN (ACNN), with an architecture similar to our CDNN module, but trained to predict the future image directly, without explicitly representing the motion vector field. Each past observation is used as an input channel (the 4 input images used in the experiments are concatenated), and the output is used as new input for multi step forecasting, 2) a ConvLSTM model Shi et al. (2015), which uses convolutional transitions in the inner LSTM module, and 3) the model in Mathieu et al. (2015) which is a multi-scale ACNN trained as a Generative Adversial Network (GAN). We have used a non-official code for Mathieu et al. (2015), which is made available at https://github.com/dyelax/Adversarial_ Video_Generation. For Ber´ eziat & Herlin (2015), the code has been provided by the authors ´ of the paper. We have implemented the ACNN and ConvLSTM models ourselves. The code for our models, along with these baselines will be made available.
|
| 122 |
+
|
| 123 |
+
# 4.3 QUANTITATIVE RESULTS
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Model</td><td>Average Score (MSE)</td><td>Average Time</td></tr><tr><td>Numerical model Béréziat & Herlin (2015)</td><td>1.99</td><td>4.8 s</td></tr><tr><td>ConvLSTM Shi et al. (2015)</td><td>5.76</td><td>0.018 s</td></tr><tr><td>ACNN</td><td>15.84</td><td>0.54 s</td></tr><tr><td>GAN Video Generation (Mathieu et al. (2015))</td><td>4.73</td><td>0.096 s</td></tr><tr><td>Proposed model with regularization</td><td>1.42</td><td>0.040 s</td></tr><tr><td>Proposed model without regularization</td><td>2.01</td><td>0.040 s</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Table 1: Average score and average time on test data. Average score is calculated using the mean square error metric (MSE), time is in seconds. The regularization coefficients for our model have been set using a validation set with $\lambda _ { \mathrm { d i v } } = 1$ , $\lambda _ { \mathrm { { m a g n } } } = - 0 . 0 3$ and $\lambda _ { \mathrm { g r a d } } = 0 . 4$ .
|
| 128 |
+
|
| 129 |
+
Quantitatively, our model performs well. The MSE score is better than any of the baselines. The closest NN baseline is Mathieu et al. (2015) which regularizes a regression convolutiondeconvolution model with a GAN. The performance is however clearly below the proposed model and it does not allow to easily incorporate prior constraints inspired from the physics of the phenomenon. ACNN is a direct predictor of the image sequence, implemented via a CDNN module identical to the one used in our model. Its performance is poor. Clearly, a straightforward use of prediction models is not adapted to the complexity of the phenomenon. ConvLSTM performs better: as opposed to the ACNN, it seems to be able to capture a dynamic, although not very accurately. Overall, direct prediction models are not able to capture the complex underlying dynamics and they produce blurry sequences of images. The GAN explicitly forces the network output to eliminate the blurring effect and then makes it able to capture short term dynamics. The state of the art numerical model Ber´ eziat & Herlin (2015), performs well but has a slighthly lower performance than our reg- ´ ularized model, although it incorporates more prior constraints. This shows that pure ML models, when conceived adequately and when trained with enough data, can be competitive with state of the art dedicated models. Regularizing the motion vector $w$ notably increases the performance w.r.t. to the unregularized model. The choice of the constraints (divergence, magnitude and smoothness) inspired here by physical background correspond to relevant priors on the dynamics of the model.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 5: From top to bottom: target, our model prediction, our model flow, numerical assimilation model , ACNN, ConvLSTM. Data correspond to daily temperatures from January 17 to January 23, 2017
|
| 133 |
+
|
| 134 |
+
As for the running time, the proposed model is extremely fast, being just above the ConvLSTM model of Shi et al. (2015). The running time of Ber´ eziat & Herlin (2015)’s model is not comparable ´ to the others. It was run on a CPU (no GPU code) when all the others were run on Titan $\mathrm { X p }$ GPU. However, an optimization procedure is required to estimate the motion field, and it is clearly slower than the straightforward NN predictions. Moreover, in order to prevent the numerical scheme from diverging, multiple intermediate forecasts are required.
|
| 135 |
+
|
| 136 |
+
Besides MSE, we need to analyze the prediction samples qualitatively. Figure 4.3 shows the predictions obtained by the different models. On the top row, the ground truth for a sequence of 4 temperature images corresponding to time $t .$ , $t + 1$ , $t + 3$ and $t + 6$ . The second row corresponds to our regularized model prediction at times $t + 1 , t + 3$ and $t + 6$ (time $t$ corresponds to the last input image, it is repeated on each row). The model seems to conserve temperatures. The prediction is close to the target for $t + 1 , t + 3$ and starts to move away at time $t + 6$ . The third row shows the motion flow estimated by the model. Each color in the flow images corresponds to a motion vector. There is clearly a strong evolving dynamic captured for this sequence. Row 4 is the numerical assimilation model of Ber´ eziat & Herlin (2015). It also clearly captures some dynamics and shows ´ interesting patterns, but it tends to diverge when the prediction horizon increases. The ACNN model (row 5) rapidly produces blurry images; it does not preserve the temperatures and does not seem to capture any dynamics. On row 6 are plotted the predictions of the ConvLSTM model. Temperature is not preserved and although a dynamic is captured, it does not correspond to the target. Overall, the proposed model seems to forecast SST quite accurately, while retrieving a coherent motion vector field.
|
| 137 |
+
|
| 138 |
+
# 5 RELATED WORK
|
| 139 |
+
|
| 140 |
+
ML for Physical modeling Close to this work is the field of spatio-temporal statistics. In their reference book Cressie & Wikle (2015) also advocate the use of physical background knowledge to build statistical models. They show how the design of statistical models can be inspired from partial differential equations linked to an observed physical phenomenon. They mainly consider auto-regressive models within a hierarchical Bayesian framework. In Raissi et al. (2017), Archambeau et al. (2007) and Alvarez et al. (2011) the author use PDE-inspired gaussian process to model physical process. Even if the methods and the application are different, the motivation and arguments are similar to the ones developed here.
|
| 141 |
+
|
| 142 |
+
Another interesting research direction is the use of NNs for reducing the complexity of numerical simulation for physical processes. Generally, in these approaches statistical models are used in place of a computational demanding component of the numerical simulation process. For example in the domain of fluid dynamics, Tompson et al. (2017) and Ladicky et al. (2015) propose to use regressors ´ for simulating fluid and smoke animation. Ladicky et al. (2015) use a random forest to compute ´ particle location and Tompson et al. (2017) use a CNN to approximate part of a numerical PDE scheme. In these approaches, ML is only a component of a numerical simulation scheme whereas we aim at modeling the whole physical process via a Deep Learning approach. Farther to our objective, Rudy et al. (2017) make use of a sparse regression method for discovering the governing partial differential equation(s) of a given system by time series measurements in the spatial domain. Other works have suggested using neural networks for physical process forecast, such as Brajard et al. (2017).
|
| 143 |
+
|
| 144 |
+
Our work is also related to recent developments in computer vision, in the related but distinct fields of video prediction and motion estimation in videos. Our goal and the domain of application are clearly different from video modeling, but since our solution involves predicting a motion field and the next SST image, the solutions share some similarities. Motion estimation and video predictions by deep architectures have motivated a series of work over the last two years. We briefly review them below and outline the differences.
|
| 145 |
+
|
| 146 |
+
Optical Flow Optical flow consists in retrieving the apparent motion of objects, surfaces, or particles between two consecutive frames of a video. The extracted motion can be used in many areas such as object detection, object tracking, movement detection, robot navigation and visual odometry. In the vision community, this is considered as a problem by itself and several papers are dedicated to this topic. Classical methods rely on the brightness constancy constrain equation (BCCE) (equation 2), derived from the observation that surfaces usually persist over time and hence the intensity value of a small region remains the same despite its position change Sun et al. (2008). Since using BCCE directly leads to complicated optimizing issues, classic approaches – namely differential methods – approximate BCCE using a first order Taylor expansion and develop variational methods.
|
| 147 |
+
|
| 148 |
+
As an alternative to these methods, Deep Learning models have been recently proposed for estimating the optical flow between 2 images. Fischer et al. (2015) formulate optical flow as a supervised regression problem, using a CNN to predict motion. Ilg et al. (2016) build on this approach and propose to use an ensemble of these CNN architectures. They assess results on par with state of the art methods for optical flow, while maintaining a small computational overhead. The difficulty here is that these methods require a notable quantity of target data, i.e. optical flow images, while because of the complexity of manually annotating flow images, there are only a few small annotated collections available. Fischer et al. (2015) and Ilg et al. (2016) chose to pretrain their model on a synthetic dataset made of computer animations and their associated motion and show that this information transfers well to real videos. Yu et al. (2016) demonstrate that it is possible to predict the optical flow between two input images in an unsupervised way using a CNN and a Spatial Transformer Network. This is however not extensible for prediction as is done in our setting since this requires the two images $I _ { t }$ and $I _ { t + 1 }$ as input while $I _ { t + 1 }$ is not available at inference time for prediction.
|
| 149 |
+
|
| 150 |
+
# Video prediction
|
| 151 |
+
|
| 152 |
+
It is only very recently that video prediction emerged as a task in the Deep Learning community. For this task, people are generally interested at predicting accurately the displacement/ emergence/ disappearing of objects in the video. In our application, the goal is clearly different since we are interested into modeling the whole dynamics behind image changes and not at following moving objects. Let us first introduce some methods that perform prediction by computing optical flow or a similar transformation. Both Patraucean et al. (2015) and Finn et al. (2016) use some form of motion flow estimation. For next frame prediction Patraucean et al. (2015) introduce a STN module at the hidden layer of a LSTM in order do estimate a motion field in this latent space. The resulting image is then decoded in the original image space for prediction. This approach clearly does not allow introducing prior knowledge on the field vector as this has been done in our work. Finn et al. (2016) learn affine transformations on image parts in order to predict object displacement and Van Amersfoort et al. (2017) proposed a similar model.
|
| 153 |
+
|
| 154 |
+
Let us now consider models that directly attempt to predict the next frame without estimating a motion field. As shown in the experimental section, plain application of autoregressive models produces blurred images. Mathieu et al. (2015), one of our baseline proposed to use different loss functions and a GAN regularization of a CDNN predictor which led to sharper and higher quality predictions. Significant improvements have been obtained with the Video Pixel Network of Kalchbrenner et al. (2016), which is a sophisticated architecture composed of resolution preserving CNN encoders, LSTM and PixelCNN decoders which form a conditional Spatio-temporal video autoencoder with differentiable memory. This model is probably state of the art today for video prediction, They reach a high accuracy on moving MNIST and good performance on a robot video dataset. A drawback is the complexity of the model and the number of parameters: they are using respectively $2 0 \bf { M }$ and $1 \textbf { M }$ frames on these two datasets. We did not test this model since up to our knowledge no code was available.
|
| 155 |
+
|
| 156 |
+
# 6 CONCLUSION AND FUTURE WORK
|
| 157 |
+
|
| 158 |
+
The evolution in time of the proposed model is deterministic. Predicting future observations should also deal with the inherent ambiguity and lack of information for the prediction task. A natural future direction would be to incorporate uncertainty in the model’s evolution in the proposed framework. We can extend the proposed model by incorporating a stochastic latent variable in the flow field generation process. A promising direction is the development of generative models which has become popular in Deep Learning, leading to different families of innovative models. For example, the Stochastic Gradient Variational Bayes algorithm (SGVB) Kingma & Welling (2014) provides a framework for learning stochastic latent variables with deep neural networks, and has recently been used by some authors to model time series Karl et al. (2016); Chung et al. (2015); Krishnan et al. (2015). A recent work where both spatial and temporal information are considered is Walker et al. (2016) who model pixel trajectories in a video. As a follow up of our work, we plan to consider such extensions in the future.
|
| 159 |
+
|
| 160 |
+
The data intensive paradigm offers alternative directions to the classical physical approaches for modeling complex natural processes. Our belief is that cross fertilization of both paradigms is essential for pushing further the frontier of complex data modeling. By using as an example application a relatively complex problem concerning ocean dynamics, we proposed a principled way to design Deep Learning models using inspiration from the physics. The proposed approach can be easily generalized to a class of problems for which the underlying dynamics follow advection-diffusion principles. We have compared the proposed approach to a series of baselines. It is able to reach performance comparable to a state of the art numerical model and clearly outperform alternative NN models used as baselines.
|
| 161 |
+
|
| 162 |
+
# ACKNOWLEDGMENTS
|
| 163 |
+
|
| 164 |
+
This work was partially funded by ANR project LOCUST - ANR-15-CE23-0027 and by CLEAR - Center for LEArning & data Retrieval - joint lab. With Thales (www.thalesgroup.com).
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
Mauricio A Alvarez, David Luengo, and Neil D Lawrence. Linear latent force models using gaussian processes. 2011.
|
| 169 |
+
|
| 170 |
+
Cedric Archambeau, Dan Cornford, Manfred Opper, and John Shawe-Taylor. Gaussian process approximations of stochastic differential equations. In Gaussian Processes in Practice, pp. 1–16, 2007.
|
| 171 |
+
|
| 172 |
+
Dominique Ber´ eziat and Isabelle Herlin. ´ Coupling Dynamic Equations and Satellite Images for Modelling Ocean Surface Circulation, pp. 191–205. Springer International Publishing, Cham, 2015. ISBN 978-3-319-25117-2. doi: 10.1007/978-3-319-25117-2 12. URL https://doi. org/10.1007/978-3-319-25117-2_12.
|
| 173 |
+
|
| 174 |
+
R. L. Bernstein. Sea surface temperature estimation using the noaa 6 satellite advanced very high resolution radiometer. Journal of Geophysical Research: Oceans, 87(C12):9455–9465, 1982. ISSN 2156-2202. doi: 10.1029/JC087iC12p09455. URL http://dx.doi.org/10.1029/ JC087iC12p09455.
|
| 175 |
+
|
| 176 |
+
Julien Brajard, Anastase Alexandre Charantonis, and F Jourdin. Predicting ocean dynamics through machine learning: Application on sea-surface suspended particulate mater. In American Meteorological Society Annual Meeting 2017, 2017.
|
| 177 |
+
|
| 178 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 29802988. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5653-a-recurrent-latent-variable-model-for-sequential-data.pdf.
|
| 179 |
+
|
| 180 |
+
N. Cressie and C.K. Wikle. Statistics for Spatio-Temporal Data. Wiley, 2015. ISBN 9781119243045. URL https://books.google.fr/books?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 4L_dCgAAQBAJ.
|
| 181 |
+
|
| 182 |
+
Chelsea Finn, Ian J. Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. CoRR, abs/1605.07157, 2016. URL http://arxiv.org/abs/ 1605.07157.
|
| 183 |
+
|
| 184 |
+
Philipp Fischer, Alexey Dosovitskiy, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, ¨ Patrick van der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. CoRR, abs/1504.06852, 2015. URL http://arxiv.org/abs/ 1504.06852.
|
| 185 |
+
|
| 186 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. URL http://arxiv.org/abs/1512.03385.
|
| 187 |
+
|
| 188 |
+
Eddy Ilg, Nikolaus Mayer, Tonmoy Saikia, Margret Keuper, Alexey Dosovitskiy, and Thomas Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. CoRR, abs/1612.01925, 2016. URL http://arxiv.org/abs/1612.01925.
|
| 189 |
+
|
| 190 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. CoRR, abs/1506.02025, 2015. URL http://arxiv.org/abs/1506.02025.
|
| 191 |
+
|
| 192 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex ¨ Graves, and Koray Kavukcuoglu. Video pixel networks. CoRR, abs/1610.00527, 2016. URL http://arxiv.org/abs/1610.00527.
|
| 193 |
+
|
| 194 |
+
Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. ICLR 2017, 2016.
|
| 195 |
+
|
| 196 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. ICLR 2014, 2014.
|
| 197 |
+
|
| 198 |
+
Rahul G Krishnan, Uri Shalit, and David Sontag. Deep kalman filters. arXiv preprint arXiv:1511.05121, 2015.
|
| 199 |
+
|
| 200 |
+
L’ubor Ladicky, SoHyeon Jeong, Barbara Solenthaler, Marc Pollefeys, and Markus Gross. Data- ´ driven fluid simulations using regression forests. ACM Trans. Graph., 34(6):199:1–199:9, October 2015. ISSN 0730-0301. doi: 10.1145/2816795.2818129. URL http://doi.acm.org/ 10.1145/2816795.2818129.
|
| 201 |
+
|
| 202 |
+
Haibin Ling and K. Okada. Diffusion distance for histogram comparison. In 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’06), volume 1, pp. 246– 253, June 2006. doi: 10.1109/CVPR.2006.99.
|
| 203 |
+
|
| 204 |
+
G. Madec. NEMO ocean engine. Note du Pole de mod ˆ elisation, Institut Pierre-Simon Laplace ´ (IPSL), France, No 27, ISSN No 1288-1619, 2008.
|
| 205 |
+
|
| 206 |
+
Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond ¨ mean square error. CoRR, abs/1511.05440, 2015. URL http://arxiv.org/abs/1511. 05440.
|
| 207 |
+
|
| 208 |
+
Viorica Patraucean, Ankur Handa, and Roberto Cipolla. Spatio-temporal video autoencoder with differentiable memory. CoRR, abs/1511.06309, 2015. URL http://arxiv.org/abs/ 1511.06309.
|
| 209 |
+
|
| 210 |
+
Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Numerical gaussian processes for time-dependent and non-linear partial differential equations. arXiv preprint arXiv:1703.10230, 2017.
|
| 211 |
+
|
| 212 |
+
Samuel H. Rudy, Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. Data-driven discovery of partial differential equations. SCIENCE ADVANCES —, 3(April), 2017. URL http://arxiv. org/abs/1607.01067.
|
| 213 |
+
|
| 214 |
+
Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. CoRR, abs/1506.04214, 2015. URL http://arxiv.org/abs/1506.04214.
|
| 215 |
+
|
| 216 |
+
Deqing Sun, Stefan Roth, J. P. Lewis, and Michael J. Black. Learning Optical Flow, pp. 83–97. Springer Berlin Heidelberg, Berlin, Heidelberg, 2008. ISBN 978-3-540-88690-7. doi: 10.1007/ 978-3-540-88690-7 7. URL https://doi.org/10.1007/978-3-540-88690-7_7.
|
| 217 |
+
|
| 218 |
+
Jonathan Tompson, Kristofer Schlachter, Pablo Sprechmann, and Ken Perlin. Accelerating Eulerian fluid simulation with convolutional networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3424–3433, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/ tompson17a.html.
|
| 219 |
+
|
| 220 |
+
Yannick Tremolet. Accounting for an imperfect model in 4d-var. ´ Quarterly Journal of the Royal Meteorological Society, 132(621):2483–2504, 2006.
|
| 221 |
+
|
| 222 |
+
Geoffrey K Vallis. Atmospheric and oceanic fluid dynamics. Cambridge University Press, 2017.
|
| 223 |
+
|
| 224 |
+
Joost Van Amersfoort, Anitha Kannan, Marc’Aurelio Ranzato, Arthur Szlam, Du Tran, and Soumith Chintala. Transformation-Based Models of Video Sequences. In CoRR abs/1701.08435 (2017), pp. 1–11, 2017. URL http://arxiv.org/abs/1701.08435.
|
| 225 |
+
|
| 226 |
+
Jacob Walker, Carl Doersch, Abhinav Gupta, and Martial Hebert. An uncertain future: Forecasting from static images using variational autoencoders. In European Conference on Computer Vision, 2016.
|
| 227 |
+
|
| 228 |
+
Jason J. Yu, Adam W. Harley, and Konstantinos G. Derpanis. Back to Basics: Unsupervised Learning of Optical Flow via Brightness Constancy and Motion Smoothness, pp. 3–10. Springer International Publishing, Cham, 2016. ISBN 978-3-319-49409-8. doi: 10.1007/978-3-319-49409-8 1. URL https://doi.org/10.1007/978-3-319-49409-8_1.
|
| 229 |
+
|
| 230 |
+
Yi Zhu, Zhen-Zhong Lan, Shawn D. Newsam, and Alexander G. Hauptmann. Guided optical flow learning. CoRR, abs/1702.02295, 2017. URL http://arxiv.org/abs/1702.02295.
|
| 231 |
+
|
| 232 |
+
# A PROOF OF THE THEOREM IN SECTION 2 1
|
| 233 |
+
|
| 234 |
+
Proof. In the following, bold $\mathbf { x }$ and $\mathbf { y }$ will denote vectors of $\mathbb { R } ^ { 2 }$ , while $x$ and $y$ will correspond to the first and second components of $\mathbf { x }$ , respectively. Analogously, $u$ and $v$ will correspond to the components of $w$ . The 2D Fourier Transformation $\mathcal { F }$ of $f : \bar { \mathbb { R } } ^ { 2 } \bar { \mathbb { R } }$ is defined as
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\begin{array} { l } { \displaystyle \mathcal { F } ( f ) = \int _ { \mathbb { R } ^ { 2 } } f ( \mathbf { x } ) e ^ { - i < \xi , \mathbf { x } > } d \mathbf { x } } \\ { \displaystyle \ = \int _ { \mathbb { R } } \int _ { \mathbb { R } } f ( x , y ) e ^ { - i x \xi _ { 1 } - i y \xi _ { 2 } } d x d y } \end{array}
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
We apply the Fourier Transform $\mathcal { F }$ to both sides of 3. As consequence of the linearity of the Fourier transform, we can calculate decompose the Fourier transform of the left hand side in the sum of the transforms of each term. We have three terms: $\begin{array} { r } { \frac { \partial I } { \partial t } , ( w . \nabla ) I } \end{array}$ and $- D \nabla ^ { 2 } I$ .
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\begin{array} { l } { \displaystyle \mathcal { F } ( \frac { \partial I } { \partial t } ) = \int _ { \mathbb { R } ^ { 2 } } \frac { \partial I } { \partial t } e ^ { - i < \mathbf { x } , \xi > } d \mathbf { x } } \\ { \displaystyle \ = \int _ { \mathbb { R } ^ { 2 } } \frac { \partial } { \partial t } ( I e ^ { - i < \mathbf { x } , \xi > } ) d \mathbf { x } } \\ { \displaystyle \ = \frac { \partial } { \partial t } \int _ { \mathbb { R } ^ { 2 } } I e ^ { - i < \mathbf { x } , \xi > } d \mathbf { x } } \\ { \displaystyle \ = \frac { \partial \mathcal { F } ( I ) } { \partial t } } \end{array}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\begin{array} { r l } { F ( ( w , \nabla ) I ) = \displaystyle \int _ { \mathbb { R } ^ { 2 } } ( w , \nabla ) I e ^ { - i \omega \cdot \xi } d x } \\ { = \displaystyle \int _ { \mathbb { R } } \int _ { \mathbb { R } } ( w \frac { \partial I } { \partial x } + v \frac { \partial I } { \partial y } ) e ^ { - i x \xi _ { 1 } - \mathrm { i } y \xi _ { 2 } } d x d y } \\ { = \displaystyle \mu \int _ { \mathbb { R } } e ^ { - i \psi \cdot \xi } \int _ { \mathbb { R } } \frac { \partial I } { \partial x } e ^ { - i \xi _ { 1 } } d x d y + v \displaystyle \int _ { \mathbb { R } } e ^ { - i \psi \xi _ { 1 } } \int _ { \mathbb { R } } \frac { \partial I } { \partial y } e ^ { - i y \xi _ { 2 } } d y d x } \\ { = \displaystyle i \xi _ { 1 } w \int _ { \mathbb { R } } e ^ { - i \psi \xi _ { 2 } } \int _ { x } [ e ^ { - i \psi \xi _ { 1 } } d x d y + i \xi _ { 2 } v \int _ { \mathbb { R } } e ^ { - i \psi \xi _ { 1 } } \int _ { \mathbb { R } } \frac { \partial I } { \partial y } e ^ { - i y \xi _ { 2 } } d y d x } \\ { = \displaystyle \tilde { U } _ { \mathbb { R } } \int _ { \mathbb { R } } \int _ { \mathbb { R } } e ^ { - i \psi \xi _ { 1 } - \mathrm { i } \psi _ { \xi } } d x d y + v \xi _ { 2 } v \int _ { \mathbb { R } } \int _ { \mathbb { R } } I _ { \mathbb { R } } e ^ { - i \omega \xi _ { 1 } - y \psi } d x d y } \\ { = ( \xi _ { 1 } w + i \xi _ { 2 } v ) \int _ { \mathbb { R } } \int _ { \mathbb { R } } \int _ { \mathbb { R } } \int _ { \mathbb { R } } - i \omega \xi _ { 1 } - i \psi \xi _ { 2 } d x d y } \\ { = i \ < \xi , w > F ( I ) } \end{array}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\begin{array} { r l } { \mathcal { F } ( - D \nabla ^ { 2 } I ) = - \int _ { \mathbb { R } ^ { 2 } } D \nabla ^ { 2 } I c ^ { - i \nu \xi } s c ^ { - \alpha } k s ^ { \zeta } d x } \\ { = - \int _ { \mathbb { R } ^ { 2 } } \int _ { \mathbb { R } ^ { 0 } } D \big ( \hat { \partial } \hat { \partial } ^ { 2 } I + \hat { \partial } \hat { \partial } ^ { 2 } I \big ) e ^ { - i \alpha \zeta _ { 1 } - i \psi \xi } d x d y } \\ { } & { = - D \int _ { \mathbb { R } ^ { 2 } } e ^ { - i \nu \xi } \int _ { \mathbb { R } ^ { 2 } } \frac { \partial ^ { 2 } I } { \partial x ^ { 2 } } e ^ { - i \alpha \zeta _ { 1 } } d x d y - D \int _ { \mathbb { R } ^ { \epsilon } } e ^ { - i \alpha \zeta _ { 1 } } \int _ { \mathbb { R } } \frac { \partial ^ { 2 } I } { \partial y ^ { 2 } } e ^ { - i \nu \xi \epsilon } d y d x } \\ { } & { = - ( \delta _ { 1 } ) ^ { 2 } D \int _ { \mathbb { R } ^ { 2 } } e ^ { - i \nu \zeta _ { 1 } } \int _ { \mathbb { R } } { F } ^ { - i \nu \zeta _ { 1 } } d x d y d y - ( \delta _ { 2 } ) ^ { 2 } D \int _ { \mathbb { R } ^ { \epsilon } } e ^ { - i \alpha \zeta _ { 1 } } \int _ { \mathbb { R } } { F } ^ { - i \nu \zeta _ { 2 } } d y d x } \\ { } & { = D \mathfrak { L } _ { 1 } ^ { 2 } \int _ { \mathbb { R } ^ { \epsilon } } e ^ { - i \alpha \zeta _ { 2 } } \int _ { \mathbb { R } } { F } ^ { - i \nu \zeta _ { 2 } } d x d y + D \mathfrak { L } _ { 2 } ^ { 2 } \int _ { \mathbb { R } ^ { \epsilon } } e ^ { - i \kappa \zeta _ { 1 } } \int _ { \mathbb { R } } { F } ^ { i \nu \zeta - i \psi \zeta _ { 2 } } d y d x } \\ { } & { = D \mathfrak { L } _ { 2 } ^ { 3 } \int _ { \mathbb { R } ^ { 2 } } \int _ { \mathbb { R } } { F } ^ { - i \nu \zeta _ { 2 } } d x d y + D \mathfrak { L } _ { 2 } ^ { 2 } \int _ { \mathbb { R } } { F } ^ { - i \nu \zeta _ { 1 } } d x d y d x } \\ { } & = D \mathfrak { L } _ { 1 } ^ { 3 } \int _ \mathbb \end{array}
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
Regrouping all three previously calculated terms, we obtain
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\frac { \partial \mathcal { F } ( I ) } { \partial t } + ( i < \xi , w > + D \left\| \xi \right\| ^ { 2 } ) \mathcal { F } ( I ) = 0
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
This is a first order ordinary differential equation of the form $f ^ { \prime } ( t ) + a f ( t ) = 0$ , which admits a known solution $f ( t ) = f ( 0 ) { e ^ { - a t } }$ . Thus, the solution of 11 is
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\begin{array} { r } { \mathcal { F } ( I ) = \mathcal { F } ( I ) _ { 0 } e ^ { - ( i < \xi , w > + D \| \xi \| ^ { 2 } ) t } } \\ { = \mathcal { F } ( I ) _ { 0 } e ^ { - i < \xi , w > t } e ^ { - D t \| \xi \| ^ { 2 } } } \end{array}
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
where $\mathcal { F } ( I ) _ { 0 }$ denotes the initial condition of the advection diffusion equation in the frequency domain. In order to obtain a solution of 3 in the spatial domain, we calculate the inverse Fourier Transform ${ \mathcal { F } } ^ { - 1 }$ of 12. The multiplication of two functions in the frequency domain is equivalent to their convolution in the spatial domain, i.e. ${ \mathcal { F } } ( f * g ) = { \mathcal { F } } ( f ) { \mathcal { F } } ( g )$ . Hence, the inverse of both terms $\mathcal { F } ( I ) _ { 0 } e ^ { - i < \xi , w > t }$ and $e ^ { - D t \| \boldsymbol { \xi } \| ^ { 2 } }$ can be calculated separately:
|
| 267 |
+
|
| 268 |
+
Multiplication by a complex exponential in the frequency domain is equivalent to a shift in the spatial domain : $\bar { e } ^ { - i < \xi , w \bar { > } } \mathcal { F } ( f ( \bar { \mathbf { x } } ) ) = \mathcal { F } ( f ( \mathbf { x } - w ) )$ , for $\boldsymbol { v } \in \mathbb { R } ^ { 2 }$ . Thus, for the first term,
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\mathcal { F } ^ { - 1 } ( \mathcal { F } ( I ) _ { 0 } e ^ { - ( i < \xi , w > ) t } ) = I _ { 0 } ( \mathbf { x } - w )
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
For the second term, we use the fact that the Fourier Transform of a Gaussian function also is a Gaussian function, i.e. $\begin{array} { r } { \mathcal { F } \big ( \frac { 1 } { 2 \pi \sigma ^ { 2 } } e ^ { - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { x } \| ^ { 2 } } \big ) = e ^ { - \frac { 1 } { 2 } \sigma ^ { 2 } \| \boldsymbol { \xi } \| ^ { 2 } } } \end{array}$ . Identifying $\sigma ^ { 2 }$ with $2 D t$ , we have:
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\mathcal { F } ^ { - 1 } ( e ^ { - D t \| \boldsymbol { \xi } \| ^ { 2 } } ) = \frac { 1 } { 4 \pi D t } e ^ { - \frac { 1 } { 4 D t } \| \mathbf { x } \| ^ { 2 } }
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
As has been stated above, the solution is a convolution of both previously calculated terms:
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\begin{array} { r } { I ( \mathbf { x } , t ) = \displaystyle \int _ { \mathbb { R } ^ { 2 } } \frac { 1 } { 4 \pi D t } e ^ { - \frac { 1 } { 4 D t } \| \mathbf { y } \| ^ { 2 } } I _ { 0 } ( \mathbf { x } - w - \mathbf { y } ) d y } \\ { = \displaystyle \int _ { \mathbb { R } ^ { 2 } } \frac { 1 } { 4 \pi D t } e ^ { - \frac { 1 } { 4 D t } \| \mathbf { x } - w - \mathbf { y } \| ^ { 2 } } I _ { 0 } ( \mathbf { y } ) d \mathbf { y } } \end{array}
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
# B ON THE GENERALIZATION IN SPACE AND TIME
|
| 287 |
+
|
| 288 |
+
The ability of the model to adapt to other conditions should be evaluated on other regions. This, however, requires a complete study by itself and is beyond the scope of this paper. We, however, present below complementary experiments aimed at assessing the potential of the proposed model for forecasting SST on sequences distant in time and space from the ones used for training.
|
| 289 |
+
|
| 290 |
+
# B.1 TEMPORAL DIMENSION
|
| 291 |
+
|
| 292 |
+
In section 4, training has been performed on data from 2006 - 2015 and testing on the period 2016- 2017. In order to provide some indication of the model behavior on more distant time intervals between train and test data, we have performed experiments using the same regions (17 to 20) as in section 4, but using the period 2011 to 2017 for training and period 2006 to 2010 for testing. Figure B.1 shows the MSE curve on this test set, each point corresponding to the mean MSE on predictions performed on 6 days ahead the current date. The most important conclusion is probably that the MSE error remains in the same range for all these years. All the yearly error curve show a clear seasonal phenomenon with a higher prediction error during summer. A similar behavior has been observed when exchanging train and test data.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 6: Evaluation of our model’s accuracy in time on data from 2006 to 2010 using data from 2011 to 2017 for training. Regions 17 to 20 were used for both periods. Each day, we produce daily forecasts for 6 days ahead and calculate the associated mean square error.
|
| 296 |
+
|
| 297 |
+
# B.2 SPATIAL DIMENSION
|
| 298 |
+
|
| 299 |
+
In the experiments, the models have been trained and evaluated on selected regions (numbered 17 to 20 in Figure 4.1), considered as the most interesting for the observed dynamics.
|
| 300 |
+
|
| 301 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Test Regions 17&18</td><td rowspan=1 colspan=1>Test Regions 8&9</td></tr><tr><td rowspan=1 colspan=1>Model trained on Regions 17 & 18</td><td rowspan=1 colspan=1>1.43</td><td rowspan=1 colspan=1>1.22</td></tr><tr><td rowspan=1 colspan=1>Model trained on Regions 8&9</td><td rowspan=1 colspan=1>1.90</td><td rowspan=1 colspan=1>1.19</td></tr></table>
|
| 302 |
+
|
| 303 |
+
Table 2: Evaluation of our model’s spatial generalization ability. We train our model on two distinct regions and calculate the MSE on both regions for each trained model.
|
| 304 |
+
|
| 305 |
+
We describe below some results providing indications on how the model performs on regions different from the training ones. For these experiments, the model has been trained on regions 17 and 18 in Figure 4.1 and tested on two other regions (regions 8 and 9), and vice versa (trained on 8 and 9 and tested on 17 and 18). The two couples of regions have been selected so as to have different latitude and longitude. The underlying physical processes generating the data are known to be different in these regions: the overall motion in regions 17 and 18 is greater, and the difference between extreme temperature is larger, compared to regions 8 and 9. Experimental conditions are similar to the one described in section 4, i.e. 2006-2015 have been used for training and 2016-1017 for testing.
|
| 306 |
+
|
| 307 |
+
Results in Table B.2 show that the model generalizes reasonably well to unseen data from distant spatial regions, with a slight decrease in performance when training and test regions do not correspond. The performance loss is 0.47 for regions (17, 18) which show a strong dynamics, whereas it is only 0.03 for regions (8, 9) for which the dynamics are more stable. Most notably, MSE performance depends more on the region itself than on the train/ test conditions. Error is always higher in regions with strong dynamics (17, 18) than on more stable regions (8, 9) whatever the train/ test conditions are. Note that to further improve the results on distant data, it is possible to fine-tune the model using data from the studied regions.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 7: Output for the 6 of May to the 9 of May 2016, Output , From top to bottom: target, our model prediction, our model flow
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 8: Output for the 6 of January to the 9 of January 2016. From top to bottom: target, our model prediction, our model flow
|
md/train/ByJWeR1AW/ByJWeR1AW.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DATA AUGMENTATION INSTEAD OFEXPLICIT REGULARIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Modern deep artificial neural networks have achieved impressive results through models with very large capacity—compared to the number of training examples— that control overfitting with the help of different forms of regularization. Regularization can be implicit, as is the case of stochastic gradient descent or parameter sharing in convolutional layers, or explicit. Most common explicit regularization techniques, such as dropout and weight decay, reduce the effective capacity of the model and typically require the use of deeper and wider architectures to compensate for the reduced capacity. Although these techniques have been proven successful in terms of results, they seem to waste capacity. In contrast, data augmentation techniques reduce the generalization error by increasing the number of training examples and without reducing the effective capacity. In this paper we systematically analyze the effect of data augmentation on some popular architectures and conclude that data augmentation alone—without any other explicit regularization techniques—can achieve the same performance or higher as regularized models, especially when training with fewer examples.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Regularization plays a central role in machine learning. Loosely defined, regularization is any modification applied to a learning algorithm that helps prevent overfitting and improve generalization. Whereas in simple machine learning algorithms the sources of regularization can be easily identified as explicit terms in the objective function, in modern deep neural networks the sources of regularization are multiple and some of them are not explicit, but implicit.
|
| 12 |
+
|
| 13 |
+
Although the terms explicit and implicit regularization have been used recently in the literature (Neyshabur et al., 2014; Zhang et al., 2017), their distinction is rather subjective. We propose the following definitions:
|
| 14 |
+
|
| 15 |
+
• Explicit regularization techniques are those specifically and solely designed to constrain the effective capacity of a given model in order to reduce overfitting. Furthermore, explicit regularizers are not a structural or essential part of the network architecture, the data or the learning algorithm and can typically be added or removed easily. Implicit regularization is the reduction of the generalization error or overfitting provided by characteristics of the network architecture, the training data or the learning algorithm, which are not specifically designed to constrain the effective capacity of the given model.
|
| 16 |
+
|
| 17 |
+
Examples of explicit regularizers are weight decay (Hanson & Pratt, 1989), which penalizes large parameters; dropout (Srivastava et al., 2014), which randomly removes a fraction of the neural connections during training; or stochastic depth (Huang et al., 2016), which drops whole layers instead. Implicit regularization effects are provided by the popular stochastic gradient descent (SGD) algorithm, which tends to converge to solutions with small norm (Zhang et al., 2017); convolutional layers, which impose parameter sharing based on prior knowledge about the data; batch normalization (Ioffe & Szegedy, 2015), whose main goal is reducing the the internal covariate shift, but also implicitly regularizes the model due to the noise in the batch estimates for mean and variance.
|
| 18 |
+
|
| 19 |
+
Driven by the efficient use and development of GPUs, much research efforts have been devoted to finding ways of training deeper and wider networks of larger capacity (Simonyan & Zisserman,
|
| 20 |
+
|
| 21 |
+
2014; He et al., 2016; Zagoruyko & Komodakis, 2016), Ironically, their effective capacity is eventually reduced in practice by the use of weight decay and dropout, among other explicit regularizers. It is known, for instance, that the gain in generalization provided by dropout comes at the cost of using larger models and training for longer (Goodfellow et al., 2016). Hence, it seems that with such an approach deep networks are wasting capacity (Dauphin & Bengio, 2013). As a matter of fact, unlike traditional machine learning models, deep neural networks seem not to need explicit regularizers to generalize well, as recently suggested by Zhang et al. (2017).
|
| 22 |
+
|
| 23 |
+
One popular technique that also improves generalization is data augmentation. Importantly, it differs from explicit regularizers mainly in that it does not reduce the effective capacity of the model. Data augmentation is a very old practice in machine learning (Simard et al., 1992) and it has been identified as a critical component of many models (Ciresan et al., 2010; Krizhevsky et al., 2012; LeCun et al., 2015). However, although some authors have reported the impact of data augmentation on the performance of their models and, in some cases, a comparison of different amount of augmentation (Graham, 2014) the literature lacks, to our knowledge, a systematic analysis of the impact of data augmentation on deep neural networks compared to the most popular regularization techniques.
|
| 24 |
+
|
| 25 |
+
# 1.1 OUR CONTRIBUTIONS
|
| 26 |
+
|
| 27 |
+
In this paper, we systematically analyze the role of data augmentation in deep neural networks for object recognition, compare it to some popular explicit regularization techniques, discuss its relationship with model capacity and test its potential to enhance learning from less training data and adapt to different architectures.
|
| 28 |
+
|
| 29 |
+
# 1.1.1 DATA AUGMENTATION AND EXPLICIT REGULARIZATION
|
| 30 |
+
|
| 31 |
+
Zhang et al. (2017) recently raised the thought-provoking idea that explicit regularization may improve generalization performance, but is neither necessary nor by itself sufficient for controlling generalization error. The authors came to this conclusion from the observation that turning off the explicit regularizers of a model does not prevent the model from generalizing—although the performance does become degraded. This contrasts with traditional machine learning involving convex optimization, where regularization is necessary to avoid overfitting and generalize.
|
| 32 |
+
|
| 33 |
+
However, Zhang et al. (2017) consider data augmentation an explicit form of regularization comparable to weight decay and dropout. We argue instead that data augmentation deserves a different classification due to some fundamental properties: Notably, data augmentation does not reduce the effective capacity of the model. Explicit regularizers are often used to counteract overfitting, but as a side effect the architecture needs to be larger and the training longer (Krizhevsky et al., 2012; Goodfellow et al., 2016). In contrast, data augmentation increases the number of training examples— although not in an independently distributed way—and the robustness against input variability. This has the welcome side-effect of implicitly regularizing the model and improving generalization.
|
| 34 |
+
|
| 35 |
+
Here, we build upon some of the ideas and procedures from Zhang et al. (2017) and perform some experiments to assess the role of data augmentation in deep neural networks and in particular in contrast to explicit regularizers (weight decay and dropout). In our experiments, we consider two levels of augmentation, light and heavier, as well as no augmentation at all. Then, we test them on two popular successful network architectures: the relatively shallow all convolutional network net (Springenberg et al., 2014) and the deeper wide residual network (Zagoruyko & Komodakis, 2016), trained on CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009), with and and without explicit regularization. Our central conclusion can be summarized as:
|
| 36 |
+
|
| 37 |
+
In a deep convolutional neural network trained with sufficient level of data augmentation, optimized by SGD, explicit regularizers (weight decay and dropout) might not provide any additional generalization improvement.
|
| 38 |
+
|
| 39 |
+
# 1.1.2 DATA AUGMENTATION AND TRAINING WITH FEWER EXAMPLES
|
| 40 |
+
|
| 41 |
+
Augmented data might be regarded as artificial and very similar to the source examples, therefore with limited contribution for making a network learn more useful representations. However, it has proven to be very useful in extreme cases such as one-shot learning, where only one or few training examples are available (Vinyals et al., 2016).
|
| 42 |
+
|
| 43 |
+
In order to provide a better insight of the usefulness of data augmentation, we train the networks with only $80 \%$ , $50 \%$ , $10 \%$ and $1 \%$ of the available training data and test the effect of data augmentation, again in contrast to explicit regularizers. The summary of our findings in this regard can be summarized as:
|
| 44 |
+
|
| 45 |
+
When a deep neural network is trained with a subset of the training data, heavier data augmentation achieves a smaller gap with respect to the baseline model, especially if no explicit regularization is used. Thus, data augmentation seems to serve as true data to a great extent.
|
| 46 |
+
|
| 47 |
+
# 1.1.3 DATA AUGMENTATION AND ADAPTABILITY
|
| 48 |
+
|
| 49 |
+
One of the disadvantages of explicit regularization is that the parameters highly depend on the network architecture, the amount of training data and other factors. Therefore, if the architecture or other factors change, one has to tune the regularization hyperparameters to achieve comparable results. In order to analyze how data augmentation adapts to different architectures, we test several augmentation schemes on shallower and deeper versions of the network, with and without explicit regularization. Our finding is the following:
|
| 50 |
+
|
| 51 |
+
Data augmentation easily adapts to different depths without tuning its parameters. If no explicit regularization is used, we observe that a shallower network achieves slightly worse results and a deeper architecture achieves better results.
|
| 52 |
+
|
| 53 |
+
# 1.2 RELATED WORK
|
| 54 |
+
|
| 55 |
+
Regularization is a central research topic in machine learning as it is a key component for ensuring good generalization (Girosi et al., 1995; Muller, 2012). In the case of deep learning, where networks ¨ tend to have several orders of magnitude more parameters than training examples, statistical learning theory (Vapnik & Chervonenkis, 1971) indicates that regularization becomes even more crucial. Accordingly, a myriad of tools and techniques have been proposed as regularizers: early stopping (Plaut et al., 1986), weight decay (Hanson & Pratt, 1989) and other $L ^ { p }$ penalties, dropout (Srivastava et al., 2014) and stochastic depth (Huang et al., 2016), to name a few examples. Besides, other successful techniques have been studied for their regularization effect, despite not being explicitly intended as such. That is the case of unsupervised pre-training (Erhan et al., 2010), multi-task learning (Caruana, 1998), convolutional layers (LeCun et al., 1990), batch normalization (Ioffe & Szegedy, 2015) or adversarial training (Szegedy et al., 2013).
|
| 56 |
+
|
| 57 |
+
Data augmentation is another almost ubiquitous technique in deep learning, especially for computer vision tasks, which can be regarded as an implicit regularizer because it improves regularization. It was already used in the late 80’s and early 90’s for handwritten digit recognition (Simard et al., 1992) and it has been identified as a very important element of many modern successful models, like AlexNet (Krizhevsky et al., 2012), All-CNN (Springenberg et al., 2014) or ResNet (He et al., 2016), for instance. In some cases, data augmentation has been applied heavily with successful results (Wu et al., 2015). In domains other than computer vision, data augmentation has also been proven effective, for example in speech recognition (Jaitly & Hinton, 2013), music source separation (Uhlich et al., 2017) or text categorization (Lu et al., 2006).
|
| 58 |
+
|
| 59 |
+
Bengio et al. (2011) focused on the importance of data augmentation for recognizing handwritten digits (MNIST) through greedy layer-wise unsupervised pre-training (Bengio et al., 2007). The main conclusion of that work was that deeper architectures benefit more from data augmentation than shallow networks. Zhang et al. (2017) included data augmentation in their analysis of the role of regularization in the generalization of deep networks, although it was considered an explicit regularizer similar to weight decay and dropout. A few works have reported the performance of their models when trained with different types of data augmentation levels, as is the case of Graham (2014). Recently, the deep learning community seems to have become more aware of the importance of data augmentation and new techniques, such as cutout (DeVries & Taylor, 2017a) or augmentation in the feature space (DeVries & Taylor, 2017b), have been proposed. Very interestingly, models that automatically learn useful data transformations have also been published recently (Hauberg et al., 2016; Lemley et al., 2017; Ratner et al., 2017).
|
| 60 |
+
|
| 61 |
+
# 2 EXPERIMENTS AND RESULTS
|
| 62 |
+
|
| 63 |
+
This section describes the experimental setup for systematically analyzing the role of data augmentation in modern deep neural networks and presents the most relevant and interesting results.
|
| 64 |
+
|
| 65 |
+
# 2.1 SETUP
|
| 66 |
+
|
| 67 |
+
All the experiments are performed on the neural networks API Keras (Chollet et al., 2015) on top of TensorFlow (Abadi et al., 2015) and on a single GPU NVIDIA GeForce GTX 1080 Ti.
|
| 68 |
+
|
| 69 |
+
# 2.1.1 NETWORK ACRCHITECTURES
|
| 70 |
+
|
| 71 |
+
We perform our experiments on two popular architectures that have achieved successful results in object recognition tasks: the all convolutional network, All-CNN (Springenberg et al., 2014) and the wide residual network, WRN (Zagoruyko & Komodakis, 2016). We choose these networks not only because of their effectiveness, but also because they have simple architectures, which is convenient for drawing clearer conclusions. All-CNN has a relatively small number of layers and parameters, whereas WRN is rather deep and has many more parameters.
|
| 72 |
+
|
| 73 |
+
All convolutional net. All-CNN consists of only convolutional layers with ReLU activations (Glorot et al., 2011), it is relatively shallow (12 layers) and has about $1 . 3 { \bf M }$ parameters. The architecture can be described as follows:
|
| 74 |
+
|
| 75 |
+
where $K C D ( S )$ is a $D \times D$ convolutional layer with $K$ channels and stride $S$ , followed by batch normalization and a ReLU non-linearity. $N . C l .$ is the number of classes and Gl.Avg. refers to global average pooling. The network is identical to the All-CNN-C architecture in the original paper, except for the introduction of the batch normalization layers. We set the same training parameters as in the original paper in the cases they are reported. Specifically, in all experiments the All-CNN networks are trained using stochastic gradient descent with batch size of 128, during 350 epochs, with fixed momentum 0.9 and learning rate of 0.01 multiplied by 0.1 at epochs 200, 250 and 300. The kernel parameters are initialized according to the Xavier uniform initialization (Glorot & Bengio, 2010).
|
| 76 |
+
|
| 77 |
+
Wide Residual Network. WRN is a modification of ResNet (He et al., 2016) that achieves better performance with fewer layers, but more units per layer. Although in the original paper several combinations of depth and width are tested, here we choose for our experiments the WRN-28-10 version (28 layers and about $3 6 . 5 \mathrm { ~ M ~ }$ parameters), which is reported to achieve the best results on CIFAR. It has the following architecture:
|
| 78 |
+
|
| 79 |
+
# 16C3(1)–4×160R–4×320R–4×640R–BN–ReLU–Avg.(8)–FC–Softmax
|
| 80 |
+
|
| 81 |
+
where $K \mathbf { R }$ is a residual block with residual function BN–ReLU–KC3(1)–BN–ReLU–KC3(1). BN is batch normalization, Avg.(8) is spatial average pooling of size 8 and FC is a fully connected layer. The stride of the first convolution within the residual blocks is 1 except in the first block of the series of 4, where it is 2 to subsample the feature maps. As before, we try to replicate the training parameters of the original paper: we use SGD with batch size of 128, during 200 epochs, with fixed Nesterov momentum 0.9 and learning rate of 0.1 multiplied by 0.2 at epochs 60, 120 and 160. The kernel parameters are initialized according to the He normal initialization (He et al., 2015).
|
| 82 |
+
|
| 83 |
+
# 2.1.2 DATA
|
| 84 |
+
|
| 85 |
+
We perform the experiments on the two highly benchmarked data sets CIFAR-10 and CIFAR-100 (Krizhevsky & Hinton, 2009), which are labeled according to 10 and 100 object classes respectively. Both data sets consist of $6 0 , 0 0 0 \ 3 2 \mathrm { ~ x ~ } \ 3 2$ color images split into 50,000 for training and 10,000 for testing. In all our experiments, the input images are fed into the network with pixel values normalized to the range $[ 0 , 1 ]$ and with floating precision of 32 bits. So as to analyze the role of data augmentation, we test the network architectures presented above with two different augmentation schemes as well as with no data augmentation at all:
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 1: Random images from CIFAR10 transformed according to the augmentation schemes used in our experiments, choosing extreme values from the augmentation parameters. Note that these images are very unlikely to be used during training.
|
| 89 |
+
|
| 90 |
+
Table 1: Description and range of possible values of the parameters used for the heavier augmentation. $B ( p )$ denotes a Bernouilli distribution and $\textstyle { \mathcal { U } } ( a , b )$ a uniform distribution.
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Parameter</td><td>Description</td><td>Range</td></tr><tr><td></td><td>Horizontal flip</td><td>1-2B(0.5)</td></tr><tr><td>fh t</td><td>Horizontal translation</td><td>u(-0.1,0.1)</td></tr><tr><td>ty</td><td>Vertical translation</td><td>u(-0.1,0.1)</td></tr><tr><td></td><td>Horizontal scale</td><td>u(0.85,1.15)</td></tr><tr><td>2x</td><td>Vertical scale</td><td>u(0.85,1.15)</td></tr><tr><td>福</td><td>Rotation angle</td><td></td></tr><tr><td>?</td><td>Shear angle</td><td>(22.5,22.5)</td></tr><tr><td>?</td><td>Contrast</td><td>u(-0.15,0.15)</td></tr><tr><td>8</td><td></td><td>u(0.5,1.5)</td></tr><tr><td></td><td>Brightness</td><td>U(-0.25,0.25)</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Light augmentation. This scheme is adopted from the literature, for example (Goodfellow et al., 2013; Springenberg et al., 2014), and performs only horizontal flips and horizontal and vertical translations of $10 \%$ of the image size.
|
| 95 |
+
|
| 96 |
+
Heavier augmentation. This scheme performs a larger range of affine transformations, as well as contrast and brightness adjustment:
|
| 97 |
+
|
| 98 |
+
• Affine transformatio $\operatorname { n s : } \left[ { y ^ { \prime } } \right] = { \left[ \begin{array} { l l l } { f _ { h } z _ { x } \cos ( \theta ) } & { - z _ { y } \sin ( \theta + \phi ) } & { t _ { x } } \\ { z _ { x } \sin ( \theta ) } & { \ : z _ { y } \cos ( \theta + \phi ) } & { t _ { y } } \\ { 0 } & { 0 } & { 1 } \end{array} \right] } { \left[ \begin{array} { l } { x } \\ { y } \\ { 1 } \end{array} \right] }$
|
| 99 |
+
• Contrast adjustment: $x ^ { \prime } = \gamma ( x - { \overline { { x } } } ) + { \overline { { x } } }$
|
| 100 |
+
• Brightness adjustment: $x ^ { \prime } = x + \delta$
|
| 101 |
+
|
| 102 |
+
The description and range of values of the parameters are specified in Table 1 and some examples of transformed images with extreme values of the parameters are provided in Figure 1. The choice of the parameters is arbitrary and the only criterion was that the objects are still recognizable, by visually inspecting a few images. We deliberately avoid designing a particularly successful scheme.
|
| 103 |
+
|
| 104 |
+
# 2.2 A SUBSTITUTE FOR EXPLICIT REGULARIZATION
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Test accuracy of the networks All-CNN and WRN on CIFAR-10 and CIFAR-100, trained without any explicit regularization (upper groups of bars) and with both dropout and weight decay (lower groups), as in the original papers. The different bars represent different models (original, deeper and shallower) and different percentage of training images (100, 50 and $10 \%$ ). The different shades within each bar show the result of training with each data augmentation scheme (none, light and heavier). In most cases, the models trained without regularization achieve the same performance as the explicitly regularized models, or even significantly higher accuracy, as is the case of the shallower and deeper models and when training with fewer examples.
|
| 108 |
+
|
| 109 |
+
In order to analyze the role of data augmentation and test the hypothesis that it might serve as a substitute for explicit regularization techniques, we first try to replicate the results of All-CNN and WRN provided in the original papers, achieved with both weight decay and dropout. Then, we train the models without weight decay and finally without neither weight decay nor dropout. We test all these different models with the three data augmentation schemes: light, heavier and no augmentation. Additionally, we test the effect of removing the batch normalization (see Appendix A).
|
| 110 |
+
|
| 111 |
+
As reported by previous works (Krizhevsky et al., 2012; Simonyan & Zisserman, 2014), when the models are trained with data augmentation, at test time slightly better results are obtained by augmenting the test set as well. Therefore, the test accuracy reported here comes from averaging the softmax posteriors over 10 random light augmentations.
|
| 112 |
+
|
| 113 |
+
The main results of the different experiments are shown in Figure 2 (blue bars) and the full report of all experiments can be found in Table 2 of the Appendix A. As expected, both explicit regularization —weight decay and dropout—and data augmentation are successful in reducing the generalization error. However, some relevant observations can be made. Most notably, it seems that data augmentation alone is able to regularize the model as much as in combination with weight decay and dropout and in some cases it clearly achieves better performance, as in the case of All-CNN. Another observation is that without explicit regularization, heavier augmentation always provides better results than light augmentation, whereas with regularization this effect is counterintuitively not consistent.
|
| 114 |
+
|
| 115 |
+
# 2.3 FEWER AVAILABLE TRAINING EXAMPLES
|
| 116 |
+
|
| 117 |
+
We extend the analysis of the data augmentation role by training the same networks with fewer training examples. Similarly, we also analyze the combination of data augmentation and explicit regularization in this case. All models are trained with the same random subset of data and tested in the same test set as the previous experiments in order to enable fairer comparisons. Figure 2 (green and red bars) shows the main results with $50 \%$ and $10 \%$ of the available data and the full report, as well as additional experiments with $80 \%$ and $1 \%$ of the data, is given in Table 3 of the Appendix A.
|
| 118 |
+
|
| 119 |
+
As expected, the performance decays with the number of available training examples. However, as the level of data augmentation increases, the difference with respect to the baseline performance (by training with all examples) significantly decreases. This indicates that data augmentation serves, to a great extent, as true data. Therefore, this confirms the effectiveness of this technique when not many training examples are available.
|
| 120 |
+
|
| 121 |
+
Furthermore, in all the experiments with a reduced set of the available data, the observations presented above become even clearer. It seems that if explicit regularization is removed, data augmentation alone better resists the lack of data. This can probably be explained by the fact that explicit regularization reduces the effective capacity, preventing the model from taking advantage of the augmented data.
|
| 122 |
+
|
| 123 |
+
# 2.4 SHALLOWER AND DEEPER ARCHITECTURES
|
| 124 |
+
|
| 125 |
+
Finally, we perform the same experiments on shallower and deeper versions of All-CNN, so as to analyze how data augmentation and regularization are handled by architectures of different depth. We test a shallower network with 9 layers instead of 12 and $3 7 4 \mathrm { K }$ parameters instead of $1 . 3 { \bf M }$ :
|
| 126 |
+
|
| 127 |
+
and a deeper network with 15 layers and $2 . 4 \mathbf { M }$ parameters:
|
| 128 |
+
|
| 129 |
+
2×96C3(1)–96C3(2)–2×192C3(1)–192C3(2)–2×192C3(1)–192C3(2)–192C3(1)–192C1(1) –N.Cl.C1(1)–Gl.Avg.–Softmax
|
| 130 |
+
|
| 131 |
+
The results in Figure 2 (purple and brown bars) together with the detailed report of results in Table 4 of the Appendix A show that if the explicit regularization is removed and data augmentation applied, the shallower network achieves slightly worse results and the deeper network slightly better results than the original network. This behavior can be explained by the reduced or increased depth and number of parameters. However, with the explicit regularization active, the results dramatically decrease in both cases. The most probable explanation is that the regularization parameters are not adjusted to the architecture, whereas in the original models the parameters where finely tuned by the authors to obtain state of the art results. This highlights another important advantage of data augmentation: the adjustment of its parameters depends mostly on the training data, rather than on the particular architecture, which offers much more flexibility compared to using explicit regularization. In Appendix B we provide ananalysis of the norm of the weight matrices that helps shed some more light on how the different levels of regularization and data augmentation affect the learned models.
|
| 132 |
+
|
| 133 |
+
# 3 DISCUSSION AND CONCLUSION
|
| 134 |
+
|
| 135 |
+
In this work, we have presented a systematic analysis of the role of data augmentation in deep neural networks for object recognition, focusing on the comparison with popular techniques of explicit regularization. We have built upon the work by Zhang et al. (2017), where the authors concluded that explicit regularization is not necessary, although it improves generalization performance. Here, we have shown that it is not only unnecessary, but also that the generalization gain provided by explicit regularization can be achieved by data augmentation alone.
|
| 136 |
+
|
| 137 |
+
The importance of these results lies in the fact that explicit regularization is the standard tool to enable the generalization of most machine learning methods. However, according to Zhang et al. (2017), explicit regularization plays a different role in deep learning, not explained by statistical learning theory (Vapnik & Chervonenkis, 1971). We argue instead that the theory still holds in deep learning, but one has to properly consider the crucial role of implicit regularization. Explicit regularization is no longer necessary because its contribution is already provided by the many elements that implicitly regularize the models: SGD, convolutional layers or data augmentation, among others.
|
| 138 |
+
|
| 139 |
+
Whereas explicit regularizers, such as weight decay and dropout, succeed in mitigating overfitting by blindly reducing the effective capacity of a model, implicit regularization operates more effectively at capturing important characteristics of the data (Neyshabur et al., 2014). For instance, convolutional layers successfully reduce the capacity of a model by imposing a parameter sharing strategy that incorporates some essential prior domain knowledge, as well as data augmentation by transforming the training examples in a meaningful and plausible way.
|
| 140 |
+
|
| 141 |
+
In this regard it is worth highlighting some of the advantages of data augmentation: Not only does it not reduce the effective capacity of the model, but it increases the number of training examples, which, according to statistical learning theories, reduces the generalization error. Furthermore, if the transformations are such that they reflect plausible variations of the real objects, it increases the robustness of the model and it can be regarded as a data-dependent prior, similarly to unsupervised pre-training (Erhan et al., 2010). Besides, unlike explicit regularization techniques, data augmentation does not increase the computational complexity because it can be performed in parallel to the gradient updates on the CPU, making it a computationally free operation. Finally, in Section 2.4 we have shown how data augmentation transparently adapts to architectures of different depth, whereas explicitly regularized models need manual adjustment of the regularization parameters.
|
| 142 |
+
|
| 143 |
+
Deep neural networks can especially benefit from data augmentation because they do not rely on precomputed features and because the large number of parameters allows them to shatter the augmented training set. Actually, if data augmentation is included for training, we might have to reconsider whether deep learning operates in an overparameterization regime, since the model capacity should take into account the amount of training data, which is exponentially increased by augmentation.
|
| 144 |
+
|
| 145 |
+
Some argue that despite these advantages, data augmentation is a highly limited approach because it depends on some prior expert knowledge and it cannot be applied to all domains. However, we argue instead that expert knowledge should not be disregarded but exploited. A single data augmentation scheme can be designed for a broad family of data, e.g. natural images, and effectively applied to a broad set of tasks, e.g. object recognition, segmentation, localization, etc. Besides, some recent works show that it is possible to learn the data augmentation strategies (Lemley et al., 2017; Ratner et al., 2017) and future research will probably yield even better results in different domains.
|
| 146 |
+
|
| 147 |
+
Finally, it is important to note that, due to computational limitations, we have performed a systematic analysis only on CIFAR-10 and CIFAR-100, which consist of very small images. These data sets do not allow performing more agressive data augmentation since the low resolution images can easily show distortions that hinder the recognition of the object. However, some previous works (Graham, 2014; Springenberg et al., 2014) have shown impressive results by performing heavier data augmentation on higher resolution versions on CIFAR-10. We plan to extend this analysis to higher resolution data sets such as ImageNet and one could expect even more benefits from data augmentation compared to explicit regularization techniques.
|
| 148 |
+
|
| 149 |
+
# ACKNOWLEDGMENTS
|
| 150 |
+
|
| 151 |
+
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No 641805.
|
| 152 |
+
|
| 153 |
+
# REFERENCES
|
| 154 |
+
|
| 155 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Watten- ´ berg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
|
| 156 |
+
|
| 157 |
+
Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in neural information processing systems, pp. 153–160, 2007.
|
| 158 |
+
|
| 159 |
+
Yoshua Bengio, Arnaud Bergeron, Nicolas Boulanger-Lewandowski, Thomas Breuel, Youssouf Chherawala, Moustapha Cisse, Dumitru Erhan, Jeremy Eustache, Xavier Glorot, Xavier Muller, et al. Deep learners benefit more from out-of-distribution examples. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 164–172, 2011.
|
| 160 |
+
|
| 161 |
+
Rich Caruana. Multitask learning. In Learning to learn, pp. 95–133. Springer, 1998.
|
| 162 |
+
|
| 163 |
+
Franc¸ois Chollet et al. Keras. https://github.com/fchollet/keras, 2015.
|
| 164 |
+
|
| 165 |
+
Dan Claudiu Ciresan, Ueli Meier, Luca Maria Gambardella, and Jurgen Schmidhuber. Deep big¨ simple neural nets excel on handwritten digit recognition. arXiv preprint arXiv:1003.0358, 2010.
|
| 166 |
+
|
| 167 |
+
Yann N Dauphin and Yoshua Bengio. Big neural networks waste capacity. In International Conference on Learning Representations, ICLR, arXiv: 1301.3583, 2013.
|
| 168 |
+
|
| 169 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017a.
|
| 170 |
+
|
| 171 |
+
Terrance DeVries and Graham W Taylor. Dataset augmentation in feature space. In International Conference on Learning Representations, ICLR, arXiv:1702.05538, 2017b.
|
| 172 |
+
|
| 173 |
+
Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010.
|
| 174 |
+
|
| 175 |
+
Federico Girosi, Michael Jones, and Tomaso Poggio. Regularization theory and neural networks architectures. Neural computation, 7(2):219–269, 1995.
|
| 176 |
+
|
| 177 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In JMLR W&CP: Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics (AISTATS 2010), volume 9, pp. 249–256, may 2010.
|
| 178 |
+
|
| 179 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, pp. 315–323, 2011.
|
| 180 |
+
|
| 181 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
|
| 182 |
+
|
| 183 |
+
Ian J. Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron C. Courville, and Yoshua Bengio. Maxout networks. In Proceedings of the 30th International Conference on Machine Learning, ICML, pp. 1319–1327, 2013.
|
| 184 |
+
|
| 185 |
+
Benjamin Graham. Fractional max-pooling. arXiv preprint arXiv:1412.6071, 2014.
|
| 186 |
+
|
| 187 |
+
Stephen Jose Hanson and Lorien Y Pratt. Comparing biases for minimal network construction with´ back-propagation. In Advances in neural information processing systems, pp. 177–185, 1989.
|
| 188 |
+
|
| 189 |
+
Søren Hauberg, Oren Freifeld, Anders Boesen Lindbo Larsen, John Fisher, and Lars Hansen. Dreaming more data: Class-dependent distributions over diffeomorphisms for learned data augmentation. In Artificial Intelligence and Statistics, pp. 342–350, 2016.
|
| 190 |
+
|
| 191 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
|
| 192 |
+
|
| 193 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 194 |
+
|
| 195 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In European Conference on Computer Vision, pp. 646–661. Springer, 2016.
|
| 196 |
+
|
| 197 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 198 |
+
|
| 199 |
+
Navdeep Jaitly and Geoffrey E Hinton. Vocal tract length perturbation (vtlp) improves speech recognition. In Proc. ICML Workshop on Deep Learning for Audio, Speech and Language, pp. 625– 660, 2013.
|
| 200 |
+
|
| 201 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
|
| 202 |
+
|
| 203 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 204 |
+
|
| 205 |
+
Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pp. 396–404, 1990.
|
| 206 |
+
|
| 207 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 208 |
+
|
| 209 |
+
Joseph Lemley, Shabab Bazrafkan, and Peter Corcoran. Smart augmentation-learning an optimal data augmentation strategy. IEEE Access, 2017.
|
| 210 |
+
|
| 211 |
+
Xinghua Lu, Bin Zheng, Atulya Velivelli, and ChengXiang Zhai. Enhancing text categorization with semantic-enriched representation and training data augmentation. Journal of the American Medical Informatics Association, 13(5):526–535, 2006.
|
| 212 |
+
|
| 213 |
+
Klaus-Robert Muller. Regularization techniques to improve generalization. In ¨ Neural Networks: Tricks of the Trade, pp. 49–51. Springer, 2012.
|
| 214 |
+
|
| 215 |
+
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. In International Conference on Learning Representations, ICLR, arXiv: 1412.6614, 2014.
|
| 216 |
+
|
| 217 |
+
D. C. Plaut, S. J. Nowlan, and G. E Hinton. Experiments on learning by back propagation. ERIC, 1986.
|
| 218 |
+
|
| 219 |
+
Alexander J Ratner, Henry R Ehrenberg, Zeshan Hussain, Jared Dunnmon, and Christopher Re.´ Learning to compose domain-specific transformations for data augmentation. In Advances in Neural Information Processing Systems, pp. 3239–3249, 2017.
|
| 220 |
+
|
| 221 |
+
Patrice Simard, Bernard Victorri, Yann LeCun, and John Denker. Tangent prop-a formalism for specifying selected invariances in an adaptive network. In Advances in neural information processing systems, pp. 895–903, 1992.
|
| 222 |
+
|
| 223 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 224 |
+
|
| 225 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. In International Conference on Learning Representations, ICLR, arXiv:1412.6806, 2014.
|
| 226 |
+
|
| 227 |
+
Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929–1958, 2014.
|
| 228 |
+
|
| 229 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 230 |
+
|
| 231 |
+
Stefan Uhlich, Marcello Porcu, Franck Giron, Michael Enenkl, Thomas Kemp, Naoya Takahashi, and Yuki Mitsufuji. Improving music source separation based on deep neural networks through data augmentation and network blending. Submitted to ICASSP, 2017.
|
| 232 |
+
|
| 233 |
+
V. N. Vapnik and A. Y. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probab. and its Applications, 16(2):264–280, 1971.
|
| 234 |
+
|
| 235 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, koray kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems 29, pp. 3630–3638, 2016.
|
| 236 |
+
|
| 237 |
+
Ren Wu, Shengen Yan, Yi Shan, Qingqing Dang, and Gang Sun. Deep image: Scaling up image recognition. arXiv preprint arXiv:1501.02876, 7(8), 2015.
|
| 238 |
+
|
| 239 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In Proceedings of the British Machine Vision Conference, BMVC, pp. 87.1–87.12, 2016.
|
| 240 |
+
|
| 241 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations, ICLR, arXiv:1611.03530, 2017.
|
| 242 |
+
|
| 243 |
+
# A DETAILED AND EXTENDED EXPERIMENTAL RESULTS
|
| 244 |
+
|
| 245 |
+
This appendix details the results of the main experiments shown in Figure 2 and provides the results of many other experiments. For example, the results of the models trained with dropout, but without weight decay and the results of training with $80 \%$ and $1 \%$ of the data are not shown in Figure 2 in order not to clutter the visualization.
|
| 246 |
+
|
| 247 |
+
Additionally, for most experiments we train a version of the network without batch normalization. These results are provided within brackets in the tables. Note that the original All-CNN results published by Springenberg et al. (2014) did not include batch normalization. In the case of WRN, we remove all batch normalization layers except the top-most one, before the spatial average pooling, since otherwise many models would not converge.
|
| 248 |
+
|
| 249 |
+
Table 2: Test accuracy of the networks All-CNN and WRN on CIFAR-10 and CIFAR-100, comparing the performance with and without explicit regularizers and the different augmentation schemes. Results within brackets show the performance of the models without batch normalization
|
| 250 |
+
|
| 251 |
+
<table><tr><td>Network</td><td>WD</td><td>Dropout</td><td>Aug.scheme</td><td>Test CIFAR-10</td><td>Test CIFAR-100</td></tr><tr><td rowspan="9">All-CNN</td><td>yes</td><td>yes</td><td>no</td><td>90.04 (88.35)</td><td>66.50 (60.54)</td></tr><tr><td>yes</td><td>yes</td><td>light</td><td>93.26 (91.97)</td><td>70.85 (65.57)</td></tr><tr><td>yes</td><td>yes</td><td>heavier</td><td>93.08 (92.44)</td><td>70.59 (68.62)</td></tr><tr><td>no</td><td>yes</td><td>no</td><td>77.99 (87.59)</td><td>52.39 (60.96)</td></tr><tr><td>no</td><td>yes</td><td>light</td><td>77.20 (92.01)</td><td>69.71 (68.01)</td></tr><tr><td>no</td><td>yes</td><td>heavier</td><td>88.29 (92.18)</td><td>70.56 (68.40)</td></tr><tr><td>no</td><td>no</td><td>no</td><td>84.53 (71.98)</td><td>57.99 (39.03)</td></tr><tr><td>no</td><td>no</td><td>light</td><td>93.26 (90.10)</td><td>69.26 (63.00)</td></tr><tr><td>no</td><td>no</td><td>heavier</td><td>93.55 (91.48)</td><td>71.25 (71.46)</td></tr><tr><td rowspan="8">WRN</td><td>yes</td><td>yes</td><td>no</td><td>91.44 (89.30)</td><td>71.67 (67.42)</td></tr><tr><td>yes</td><td>yes</td><td>light</td><td>95.01 (93.48)</td><td>77.58 (74.23)</td></tr><tr><td>yes</td><td>yes</td><td>heavier</td><td>95.60 (94.38)</td><td>76.96 (74.79)</td></tr><tr><td>no</td><td>yes</td><td>no</td><td>91.47 (89.38)</td><td>71.31 (66.85)</td></tr><tr><td>no</td><td>yes</td><td>light</td><td>94.76 (93.52)</td><td>77.42 (74.62)</td></tr><tr><td>no</td><td>yes</td><td>heavier</td><td>95.58 (94.52)</td><td>77.47 (73.96)</td></tr><tr><td>no</td><td>no</td><td>no</td><td>89.56 (85.45)</td><td>68.16 (59.90)</td></tr><tr><td>no</td><td>no</td><td>light</td><td>94.71 (93.69)</td><td>77.08 (75.27)</td></tr><tr><td></td><td>no</td><td>no</td><td>heavier</td><td>95.47 (94.95)</td><td>77.30 (75.69)</td></tr></table>
|
| 252 |
+
|
| 253 |
+
An important observation from Table 2 is that the interaction of weight decay and dropout is not always consistent, since in some cases better results are obtained with both explicit regularizers active and in other cases, only dropout achieves better generalization. However, the effect of data augmentation seems to be clearer: just some light augmentation achieves much better results than training only with the original data set and performing heavier augmentation almost always further improves the test accuracy, without the need for explicit regularization.
|
| 254 |
+
|
| 255 |
+
Not surprisingly, batch normalization also contributes to improve the generalization of All-CNN and it seems to combine well with data augmentation. On the contrary, when combined with explicit regularization the results are interestingly not consistent in the case of All-CNN: it seems to improve the generalization of the model trained with both weight decay and dropout, but it drastically reduces the performance with only dropout, in the case of CIFAR-10 and CIFAR-100 without augmentation. A probable explanation is, again, that the regularization hyperparameteres would need to be readjusted with a change of the architecture.
|
| 256 |
+
|
| 257 |
+
Furthermore, it seems that the gap between the performance of the models trained with and without batch normalization is smaller when they are trained without explicit regularization and when they include heavier data augmentation. This can be observed in both Table 2 and Table 3, which contains the results of the models trained with fewer examples. It is important to note as well the benefits of batch normalization for obtaining better results when training with fewer examples. However, it is surprising that there is only a small drop in the performance of WRN— $9 5 . 4 7 \ \%$ to $9 4 . 9 5 ~ \%$ without regularization— from removing the batch normalization layers of the residual blocks, given
|
| 258 |
+
|
| 259 |
+
that they were identified as key components for training deep residual networks (He et al., 2016;
|
| 260 |
+
Zagoruyko & Komodakis, 2016).
|
| 261 |
+
|
| 262 |
+
Table 3: Test accuracy when training with only $80 \%$ , $50 \%$ , $10 \%$ and $1 \%$ of the available training examples. Results within brackets show the performance of the models without batch normalization
|
| 263 |
+
|
| 264 |
+
<table><tr><td>Network</td><td>Pct. Data</td><td>Explicit Reg.</td><td>Aug. scheme</td><td>Test CIFAR-10 89.41 (86.61)</td><td>Test CIFAR-100</td></tr><tr><td rowspan="18"></td><td rowspan="4">80 %</td><td>yes yes</td><td>no light</td><td>92.20 (91.25)</td><td>63.93 (52.51) 67.63 (63.24)</td></tr><tr><td>yes</td><td>heavier</td><td>92.83 (91.42)</td><td>68.01 (65.89)</td></tr><tr><td>no</td><td>no</td><td>83.04 (75.00)</td><td>55.78 (35.95)</td></tr><tr><td>no</td><td>light</td><td>92.25 (88.75)</td><td>69.05 (56.81)</td></tr><tr><td rowspan="6"></td><td>no</td><td>heavier</td><td>92.80 (90.55)</td><td>69.40 (63.57)</td></tr><tr><td>yes</td><td>no</td><td>85.88 (82.33)</td><td>58.24 (44.94)</td></tr><tr><td>yes</td><td>light</td><td>90.30 (87.37)</td><td>61.03 (54.68)</td></tr><tr><td></td><td>heavier</td><td>90.09 (88.94)</td><td>63.25 (57.91)</td></tr><tr><td>yes no</td><td>no</td><td>78.61 (69.46)</td><td>48.62 (31.81)</td></tr><tr><td>no</td><td>light</td><td>90.21 (84.38)</td><td>62.83 (47.84)</td></tr><tr><td rowspan="6">All-CNN 10 %</td><td></td><td>heavier</td><td>90.76 (87.44)</td><td>64.41 (55.27)</td></tr><tr><td>no yes</td><td>no</td><td></td><td></td></tr><tr><td></td><td>light</td><td>67.19 (61.61)</td><td>33.77 (19.79) 38.51 (22.79)</td></tr><tr><td>yes</td><td>heavier</td><td>76.03 (69.18)</td><td>38.34 (26.29)</td></tr><tr><td>yes no</td><td></td><td>78.69 (64.14) 60.97 (41.07)</td><td>26.05 (17.55)</td></tr><tr><td>no</td><td>no light</td><td>78.29 (67.65)</td><td>37.84 (24.34)</td></tr><tr><td rowspan="6">1%</td><td>no</td><td>heavier</td><td>79.87 (70.64)</td><td>39.85 (26.31)</td></tr><tr><td>yes</td><td>no</td><td></td><td>9.16 (3.60)</td></tr><tr><td></td><td>light</td><td>27.53 (29.90) 37.18 (26.85)</td><td>9.64 (3.65)</td></tr><tr><td>yes yes</td><td>heavier</td><td>42.73 (26.87)</td><td>9.14 (2.52)</td></tr><tr><td>no</td><td>no</td><td>38.89 (35.68)</td><td>9.50 (5.51)</td></tr><tr><td>no</td><td>light</td><td>44.35 (29.29)</td><td>9.87 (5.36)</td></tr><tr><td rowspan="10">80% 50%</td><td></td><td>heavier</td><td>47.60 (33.72)</td><td>11.45 (3.57)</td></tr><tr><td>yes</td><td>no</td><td>90.27</td><td>70.41</td></tr><tr><td>yes</td><td>light</td><td>94.07</td><td>75.66</td></tr><tr><td>yes</td><td>heavier</td><td>94.57</td><td>75.51</td></tr><tr><td>no</td><td>no</td><td>88.98</td><td>66.10</td></tr><tr><td></td><td>no light</td><td>93.97</td><td>75.07</td></tr><tr><td></td><td>no heavier</td><td>94.84</td><td>75.38</td></tr><tr><td></td><td>yes no</td><td>86.96</td><td>63.60</td></tr><tr><td>yes</td><td>light</td><td>92.65</td><td>70.83</td></tr><tr><td>yes no</td><td>heavier</td><td>92.86</td><td>70.33</td></tr><tr><td rowspan="6">WRN</td><td></td><td>no</td><td>85.56</td><td>60.64</td></tr><tr><td>no</td><td></td><td></td><td>69.97</td></tr><tr><td>no</td><td>light</td><td>91.87</td><td>70.72</td></tr><tr><td></td><td>heavier</td><td>92.77</td><td></td></tr><tr><td>yes</td><td>no</td><td>70.73</td><td>34.11</td></tr><tr><td>yes</td><td>light</td><td>76.00</td><td>36.65</td></tr><tr><td rowspan="6">10 %</td><td>yes</td><td>heavier</td><td>78.10</td><td>38.93</td></tr><tr><td>no</td><td>no</td><td>60.39</td><td>23.65</td></tr><tr><td>no</td><td>light</td><td>79.19</td><td>39.24</td></tr><tr><td>no</td><td>heavier</td><td>80.29</td><td>41.44</td></tr><tr><td>yes</td><td></td><td>33.45</td><td>7.47</td></tr><tr><td></td><td>no</td><td>34.13</td><td>7.50</td></tr><tr><td rowspan="5">1%</td><td>yes</td><td>light</td><td></td><td></td></tr><tr><td>yes</td><td>heavier</td><td>41.02</td><td>8.37</td></tr><tr><td>no</td><td>no</td><td>38.63</td><td>9.47</td></tr><tr><td>no</td><td>light</td><td>43.84</td><td>9.91</td></tr><tr><td>no</td><td>heavier</td><td>47.14</td><td>11.03</td></tr></table>
|
| 265 |
+
|
| 266 |
+
The results in Table 3 clearly support the conclusion presented in Section 2.3: data augmentation alone resists better the lack of training data compared to explicit regularizers. Already with $80 \%$ and
|
| 267 |
+
|
| 268 |
+
Table 4: Test accuracy of the shallower and deeper versions of the All-CNN network on CIFAR-10 and CIFAR-100. Results in parentheses show the difference with respect to the original model.
|
| 269 |
+
|
| 270 |
+
<table><tr><td>Network</td><td>Explicit Reg.</td><td>Aug. scheme</td><td>Test CIFAR-10</td><td>Test CIFAR-100</td></tr><tr><td rowspan="5">All-CNN shallower</td><td>yes</td><td>no</td><td>76.45 (-13.59)</td><td>51.31 (-9.23)</td></tr><tr><td>yes</td><td>light</td><td>82.02 (-11.24)</td><td>56.81 (-8.76)</td></tr><tr><td>yes</td><td>heavier</td><td>86.66 (-6.42)</td><td>58.64 (-9.98)</td></tr><tr><td>no</td><td>no</td><td>85.22 (+0.69)</td><td>58.95 (+0.96)</td></tr><tr><td>no</td><td>light</td><td>90.02 (-3.24)</td><td>65.51 (-3.75)</td></tr><tr><td rowspan="6">All-CNN deeper</td><td>no</td><td>heavier</td><td>90.34 (-3.21)</td><td>65.87 (-5.38)</td></tr><tr><td>yes</td><td>no</td><td>86.26 (-3.78)</td><td>49.06 (-11.48)</td></tr><tr><td>yes</td><td>light</td><td>85.04 (-8.22)</td><td>52.03 (-13.54)</td></tr><tr><td>yes</td><td>heavier</td><td>88.46 (-4.62)</td><td>51.78 (-16.84)</td></tr><tr><td>no</td><td>no</td><td>83.30 (-1.23)</td><td>54.22 (-3.77)</td></tr><tr><td>no no</td><td>light heavier</td><td>93.46 (+0.20) 94.19 (+0.64)</td><td>72.16 (+2.90) 73.30 (+2.35)</td></tr></table>
|
| 271 |
+
|
| 272 |
+
$50 \%$ of the data better results are obtained in some cases, but the differences become much bigger when training with only $10 \%$ and $1 \%$ of the available data. It seems that explicit regularization prevents the model from both fitting the data and generalizing well, whereas data augmentation provides useful transformed examples. Interestingly, with only $1 \%$ of the data, even without data augmentation the models without explicit regularization perform better.
|
| 273 |
+
|
| 274 |
+
The same effect can be observed in Table 4, where both the shallower and deeper versions of AllCNN perform much worse when trained with explicit regularization, even when trained without data augmentation. This is another piece of evidence that explicit regularization needs to be used very carefully, it requires a proper tuning of the hyperparameters and is not always benefitial.
|
| 275 |
+
|
| 276 |
+
# B NORM OF THE WEIGHT MATRIX
|
| 277 |
+
|
| 278 |
+
Table 5: Frobenius norm of the weight matrices learned by the networks All-CNN and WRN on CIFAR-10 and CIFAR-100, trained with and without explicit regularizers and the different augmentation schemes. Norms within brackets correspond to the models without batch normalization
|
| 279 |
+
|
| 280 |
+
<table><tr><td>Network</td><td>WD</td><td>Dropout</td><td>Aug. scheme</td><td>Norm CIFAR-10</td><td>Norm( CIFAR-100</td></tr><tr><td rowspan="9">All-CNN</td><td>yes</td><td>yes</td><td>no</td><td>48.7 (64.9)</td><td>76.5 (97.9)</td></tr><tr><td>yes</td><td>yes</td><td>light</td><td>52.7 (63.2)</td><td>77.6 (86.8)</td></tr><tr><td>yes</td><td>yes</td><td>heavier</td><td>57.6 (62.8)</td><td>78.1 (83.1)</td></tr><tr><td>no</td><td>yes</td><td>no</td><td>52.4 (70.5)</td><td>79.7 (103.3)</td></tr><tr><td>no</td><td>yes</td><td>light</td><td>57.0 (67.9)</td><td>83.6 (93.0)</td></tr><tr><td>no</td><td>yes</td><td>heavier</td><td>62.8 (67.5)</td><td>84.0 (88.0)</td></tr><tr><td>no</td><td>no</td><td>no</td><td>37.3 (63.7)</td><td>47.6 (102.7)</td></tr><tr><td>no</td><td>no</td><td>light</td><td>47.0 (69.5)</td><td>80.0 (108.9)</td></tr><tr><td>no</td><td>no</td><td>heavier</td><td>62.0 (71.7)</td><td>91.7 (91.7)</td></tr><tr><td rowspan="8">WRN</td><td>yes</td><td>yes</td><td>no</td><td>101.4 (122.6)</td><td>134.8 (126.5)</td></tr><tr><td>yes</td><td>yes</td><td>light</td><td>106.1 (123.9)</td><td>140.8 (129.3)</td></tr><tr><td>yes</td><td>yes</td><td>heavier</td><td>119.3 (125.3)</td><td>164.2 (132.5)</td></tr><tr><td>no</td><td>yes</td><td>no</td><td>153.3 (122.5)</td><td>185.1 (126.5)</td></tr><tr><td>no</td><td>yes</td><td>light</td><td>160.6 (123.9)</td><td>199.0 (129.4)</td></tr><tr><td>no</td><td>yes</td><td>heavier</td><td>175.1 (125.2)</td><td>225.4 (132.5)</td></tr><tr><td>no</td><td>no</td><td>no</td><td>139.0 (120.4)</td><td>157.9 (122.0)</td></tr><tr><td>no</td><td>no</td><td>light</td><td>153.6 (123.2)</td><td>187.0 (127.2)</td></tr><tr><td></td><td>no</td><td>no</td><td>heavier</td><td>170.4 (125.4)</td><td>217.6 (132.9)</td></tr></table>
|
| 281 |
+
|
| 282 |
+
One of the simplest way of getting a rough idea of the complexity of the learned models is computing the norm of the weight matrix. Table 5 shows the Frobenius norm of the weight matrices of the models trained with different levels of explicit regularization and data augmentation. The clearest conclusion is that heavier data augmentation seems to yield solutions with larger norm. This is always true except in some All-CNN models trained without batch normalization. Another observation is that, as expected, weight decay constrains the norm of the learned function. Besides, the models trained without batch normalization exhibit smaller differences between different levels of regularization and augmentation and, in the case of All-CNN, less consistency.
|
| 283 |
+
|
| 284 |
+
Table 6: Frobenius norm of the weight matrices learned by the shallower and deeper versions of the All-CNN network on CIFAR-10 and CIFAR-100.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Network</td><td>Explicit Reg.</td><td>Aug.scheme</td><td>Norm CIFAR-10</td><td>Norm CIFAR-100</td></tr><tr><td rowspan="6">All-CNN shallower</td><td>yes</td><td>no</td><td>47.9</td><td>68.9</td></tr><tr><td>yes</td><td>light</td><td>49.7</td><td>67.1</td></tr><tr><td>yes</td><td>heavier</td><td>51.9</td><td>66.2</td></tr><tr><td>no</td><td>no</td><td>34.8</td><td>64.7</td></tr><tr><td>no</td><td>light</td><td>45.6</td><td>68.8</td></tr><tr><td>no</td><td>heavier</td><td>53.1</td><td>68.3</td></tr><tr><td rowspan="6">All-CNN deeper</td><td>yes</td><td>no</td><td>62.3</td><td>92.1</td></tr><tr><td>yes</td><td>light</td><td>66.5</td><td>95.7</td></tr><tr><td>yes</td><td>heavier</td><td>71.5</td><td>96.9</td></tr><tr><td>no</td><td>no</td><td>45.4</td><td>53.4</td></tr><tr><td>no</td><td>light</td><td>57.3</td><td>77.3</td></tr><tr><td>no</td><td>heavier</td><td>70.7</td><td>97.5</td></tr></table>
|
| 287 |
+
|
| 288 |
+
One of the relevant results presented in this paper is the poor performance of the regularized models on the shallower and deeper versions of All-CNN, compared to the models without explicit regularization (see Table 4). One hypothesis is that the amount of regularization is not properly adjusted through the hyperparameters. This could be reflected in the norm of the learned weights, shown in Table 6. However, the norm alone does not seem to fully explain the large performance differences between the different models. Finding the exact reasons why the regularized models not able to generalize well might require a much thourough analysis and we leave it as future work.
|
md/train/Byg9A24tvB/Byg9A24tvB.md
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RETHINKING SOFTMAX CROSS-ENTROPY LOSS FOR ADVERSARIAL ROBUSTNESS
|
| 2 |
+
|
| 3 |
+
Tianyu Pang, Kun Xu, Yinpeng Dong, Chao Du, Ning Chen, Jun Zhu∗ Dept. of Comp. Sci. & Tech., BNRist Center, Institute for AI, Tsinghua University; RealAI {pty17,xu-k16,dyp17,du-c14}@mails.tsinghua.edu.cn, {ningchen,dcszj}@tsinghua.edu.cn
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Previous work shows that adversarially robust generalization requires larger sample complexity, and the same dataset, e.g., CIFAR-10, which enables good standard accuracy may not suffice to train robust models. Since collecting new training data could be costly, we focus on better utilizing the given data by inducing the regions with high sample density in the feature space, which could lead to locally sufficient samples for robust learning. We first formally show that the softmax cross-entropy (SCE) loss and its variants convey inappropriate supervisory signals, which encourage the learned feature points to spread over the space sparsely in training. This inspires us to propose the Max-Mahalanobis center (MMC) loss to explicitly induce dense feature regions in order to benefit robustness. Namely, the MMC loss encourages the model to concentrate on learning ordered and compact representations, which gather around the preset optimal centers for different classes. We empirically demonstrate that applying the MMC loss can significantly improve robustness even under strong adaptive attacks, while keeping high accuracy on clean inputs comparable to the SCE loss with little extra computation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The deep neural networks (DNNs) trained by the softmax cross-entropy (SCE) loss have achieved state-of-the-art performance on various tasks (Goodfellow et al., 2016). However, in terms of robustness, the SCE loss is not sufficient to lead to satisfactory performance of the trained models. It has been widely recognized that the DNNs trained by the SCE loss are vulnerable to adversarial attacks (Carlini & Wagner, 2017a; Goodfellow et al., 2015; Kurakin et al., 2017; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016), where human imperceptible perturbations can be crafted to fool a high-performance network. To improve adversarial robustness of classifiers, various kinds of defenses have been proposed, but many of them are quickly shown to be ineffective to the adaptive attacks, which are adapted to the specific details of the proposed defenses (Athalye et al., 2018).
|
| 12 |
+
|
| 13 |
+
Besides, the methods on verification and training provably robust networks have been proposed (Dvijotham et al., 2018a;b; Hein & Andriushchenko, 2017; Wong & Kolter, 2018). While these methods are exciting, the verification process is often slow and not scalable. Among the previously proposed defenses, the adversarial training (AT) methods can achieve state-of-the-art robustness under different adversarial settings (Madry et al., 2018; Zhang et al., 2019b). These methods either directly impose the AT mechanism on the SCE loss or add additional regularizers. Although the AT methods are relatively strong, they could sacrifice accuracy on clean inputs and are computationally expensive (Xie et al., 2019). Due to the computational obstruction, many recent efforts have been devoted to proposing faster verification methods (Wong et al., 2018; Xiao et al., 2019) and accelerating AT procedures (Shafahi et al., 2019; Zhang et al., 2019a). However, the problem still remains.
|
| 14 |
+
|
| 15 |
+
Schmidt et al. (2018) show that the sample complexity of robust learning can be significantly larger than that of standard learning. Given the difficulty of training robust classifiers in practice, they further postulate that the difficulty could stem from the insufficiency of training samples in the commonly used datasets, e.g., CIFAR-10 (Krizhevsky & Hinton, 2009). Recent work intends to solve this problem by utilizing extra unlabeled data (Carmon et al., 2019; Stanforth et al., 2019), while we focus on the complementary strategy to exploit the labeled data in hand more efficiently. Note that although the samples in the input space are unchangeable, we could instead manipulate the local sample distribution, i.e., sample density in the feature space via appropriate training objectives. Intuitively, by inducing high-density feature regions, there would be locally sufficient samples to train robust classifiers and return reliable predictions (Schmidt et al., 2018).
|
| 16 |
+
|
| 17 |
+
Similar to our attempt to induce high-density regions in the feature space, previous work has been proposed to improve intra-class compactness. Contrastive loss (Sun et al., 2014) and triplet loss (Schroff et al., 2015) are two classical objectives for this purpose, but the training iterations will dramatically grow to construct image pairs or triplets, which results in slow convergence and instability. The center loss (Wen et al., 2016) avoids the pair-wise or triplet-wise computation by minimizing the squared distance
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Intuitive illusion of how training data moves and how sample density varies in a two-dimensional feature space during the training procedure.
|
| 21 |
+
|
| 22 |
+
between the features and the corresponding class centers. However, since the class centers are updated w.r.t. the learned features during training, the center loss has to be jointly used with the SCE loss to seek for a trade-off between inter-class dispersion and intra-class compactness. Therefore, the center loss cannot concentrate on inducing strong intra-class compactness to construct high-density regions and consequently could not lead to reliable robustness, as shown in our experiments.
|
| 23 |
+
|
| 24 |
+
In this paper, we first formally analyze the sample density distribution induced by the SCE loss and its other variants (Pang et al., 2018; Wan et al., 2018) in Sec. 3.2, which demonstrates that these previously proposed objectives convey unexpected supervisory signals on the training points, which make the learned features tend to spread over the space sparsely. This undesirable behavior mainly roots from applying the softmax function in training, which makes the loss function only depend on the relative relation among logits and cannot directly supervise on the learned representations.
|
| 25 |
+
|
| 26 |
+
We further propose a novel training objective which can explicitly induce high-density regions in the feature space and learn more structured representations. To achieve this, we propose the MaxMahalanobis center (MMC) loss (detailed in Eq. (8)) as the substitute of the SCE loss. Specifically, in the MMC loss, we first preset untrainable class centers with optimal inter-class dispersion in the feature space according to Pang et al. (2018), then we encourage the features to gather around the centers by minimizing the squared distance similar with the center loss. The MMC loss can explicitly control the inter-class dispersion by a single hyperparameter, and further concentrate on improving intra-class compactness in the training procedure to induce high-density regions, as intuitively shown in Fig. 1. Behind the simple formula, the MMC loss elegantly combines the favorable merits of the previous methods, which leads to a considerable improvement on the adversarial robustness.
|
| 27 |
+
|
| 28 |
+
In experiments, we follow the suggestion by Carlini et al. (2019) that we test under different threat models and attacks, including the adaptive attacks (Athalye et al., 2018) on MNIST, CIFAR-10, and CIFAR-100 (Krizhevsky & Hinton, 2009; LeCun et al., 1998). The results demonstrate that our method can lead to reliable robustness of the trained models with little extra computation, while maintaining high clean accuracy with faster convergence rates compared to the SCE loss and its variants. When combined with the existing defense mechanisms, e.g., the AT methods (Madry et al., 2018), the trained models can be further enhanced under the attacks different from the one used to craft adversarial examples for training.
|
| 29 |
+
|
| 30 |
+
# 2 PRELIMINARIES
|
| 31 |
+
|
| 32 |
+
This section first provides the notations, then introduces the adversarial attacks and threat models.
|
| 33 |
+
|
| 34 |
+
# 2.1 NOTATIONS
|
| 35 |
+
|
| 36 |
+
In this paper, we use the lowercases to denote variables and the uppercases to denote mappings. Let $L$ be the number of classes, we define the softmax function softmax ${ \bf \Phi } : \mathbb { R } ^ { L } \to \dot { \mathbb { R } } ^ { L }$ as so $\mathrm { \ t m a x } ( h ) _ { i } = \exp ( h _ { i } ) / { \sum _ { l = 1 } ^ { L } \exp ( h _ { l } ) } , i \in [ L ]$ , where $[ L ] : = \{ 1 , \cdots , L \}$ and $h$ is termed as logit.
|
| 37 |
+
|
| 38 |
+
A deep neural network (DNN) learns a non-linear mapping from the input $x \in \mathbb { R } ^ { p }$ to the feature $z = \dot { Z ( x ) } \in \mathbb { R } ^ { d }$ . One common training objective for DNNs is the softmax cross-entropy (SCE) loss:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\mathcal { L } _ { \mathrm { S C E } } ( Z ( x ) , y ) = - 1 _ { y } ^ { \top } \log { [ \mathrm { s o f t m a x } ( W z + b ) ] } ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
for a single input-label pair $( x , y )$ , where $1 _ { y }$ is the one-hot encoding of $y$ and the logarithm is defined as element-wise. Here $W$ and $b$ are the weight matrix and bias vector of the SCE loss, respectively.
|
| 45 |
+
|
| 46 |
+
# 2.2 ADVERSARIAL ATTACKS AND THREAT MODELS
|
| 47 |
+
|
| 48 |
+
Previous work has shown that adversarial examples can be easily crafted to fool DNNs (Biggio et al., 2013; Nguyen et al., 2015; Szegedy et al., 2014). A large amount of attacking methods on generating adversarial examples have been introduced in recent years (Carlini & Wagner, 2017a; Chen et al., 2017; Dong et al., 2018; Goodfellow et al., 2015; Ilyas et al., 2018; Kurakin et al., 2017; Madry et al., 2018; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016; Uesato et al., 2018). Given the space limit, we try to perform a comprehensive evaluation by considering five different threat models and choosing representative attacks for each threat model following Carlini et al. (2019):
|
| 49 |
+
|
| 50 |
+
White-box $l _ { \infty }$ distortion attack: We apply the projected gradient descent (PGD) (Madry et al., 2018) method, which is efficient and widely studied in previous work (Pang et al., 2019).
|
| 51 |
+
|
| 52 |
+
White-box $l _ { 2 }$ distortion attack: We apply the C&W (Carlini & Wagner, 2017a) method, which has a binary search mechanism on its parameters to find the minimal $l _ { 2 }$ distortion for a successful attack.
|
| 53 |
+
|
| 54 |
+
Black-box transfer-based attack: We use the momentum iterative method (MIM) (Dong et al., 2018) that is effective on boosting adversarial transferability (Kurakin et al., 2018).
|
| 55 |
+
|
| 56 |
+
Black-box gradient-free attack: We choose SPSA (Uesato et al., 2018) since it has broken many previously proposed defenses. It can still perform well even when the loss is difficult to optimize.
|
| 57 |
+
|
| 58 |
+
General-purpose attack: We also evaluate the general robustness of models when adding Gaussian noise (Gilmer et al., 2019) or random rotation (Engstrom et al., 2019) on the input images.
|
| 59 |
+
|
| 60 |
+
Furthermore, to exclude the false robustness caused by, e.g., gradient mask (Athalye et al., 2018), we modify the above attacking methods to be adaptive attacks (Carlini & Wagner, 2017b; Carlini et al., 2019; Herley & Van Oorschot, 2017) when evaluating on the robustness of our method. The adaptive attacks are much more powerful than the non-adaptive ones, as detailed in Sec. 4.2.
|
| 61 |
+
|
| 62 |
+
# 3 METHODOLOGY
|
| 63 |
+
|
| 64 |
+
Various theoretical explanations have been developed for adversarial examples (Fawzi et al., 2016; 2018; Ilyas et al., 2019; Papernot et al., 2018). In particular, Schmidt et al. (2018) show that training robust classifiers requires significantly larger sample complexity compared to that of training standard ones, and they further postulate that the difficulty of training robust classifiers stems from, at least partly, the insufficiency of training samples in the common datasets. Recent efforts propose alternatives to benefit training with extra unlabeled data (Carmon et al., 2019; Stanforth et al., 2019), while we explore the complementary way to better use the labeled training samples for robust learning.
|
| 65 |
+
|
| 66 |
+
Although a given sample is fixed in the input space, we can instead manipulate the local sample distribution, i.e., sample density in the feature space, via designing appropriate training objectives. Intuitively, by inducing high-density regions in the feature space, it can be expected to have locally sufficient samples to train robust models that are able to return reliable predictions. In this section, we first formally define the notion of sample density in the feature space. Then we provide theoretical analyses of the sample density induced by the SCE loss and its variants. Finally, we propose our new Max-Mahalanobis center (MMC) loss and demonstrate its superiority compared to previous losses.
|
| 67 |
+
|
| 68 |
+
# 3.1 SAMPLE DENSITY IN THE FEATURE SPACE
|
| 69 |
+
|
| 70 |
+
Given a training dataset $\mathcal { D }$ with $N$ input-label pairs, and the feature mapping $Z$ trained by the objective $\bar { \mathcal { L } } ( Z ( \bar { x } ) , y )$ on this dataset, we define the sample density nearby the feature point $z = Z ( x )$
|
| 71 |
+
|
| 72 |
+
following the similar definition in physics (Jackson, 1999) as
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbb { S D } ( z ) = \frac { \Delta N } { \mathrm { V o l } ( \Delta B ) } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Here $\operatorname { v o l } ( \cdot )$ denotes the volume of the input set, $\Delta B$ is a small neighbourhood containing the feature point $z$ , and $\Delta N = | Z ( \mathcal { D } ) \cap \Delta B |$ is the number of training points in $\Delta B$ , where $Z ( \mathcal { D } )$ is the set of all mapped features for the inputs in $\mathcal { D }$ . Note that the mapped feature $z$ is still of the label $y$ .
|
| 79 |
+
|
| 80 |
+
In the training procedure, the feature distribution is directly induced by the training loss $\mathcal { L }$ , where minimizing the loss value is the only supervisory signal for the feature points to move (Goodfellow et al., 2016). This means that the sample density varies mainly along the orthogonal direction w.r.t. the loss contours, while the density along a certain contour could be approximately considered as the same. For example, in the right panel of Fig. 1, the sample density induced by our MMC loss (detailed in Sec. 3.3) changes mainly along the radial direction, i.e., the directions of red arrows, where the loss contours are dashed concentric circles. Therefore, supposing $\mathcal { L } ( z , y ) = C$ , we choose $\Delta B = \{ \mathbf { z } \in \mathbb { R } ^ { d } | { \mathcal { L } } ( \mathbf { z } , y ) \in [ C , C + \Delta C ] \}$ , where $\Delta C > 0$ is a small value. Then $\mathrm { V o l } ( \Delta B )$ is the volume between the loss contours of $C$ and $C + \Delta C$ for label $y$ in the feature space.
|
| 81 |
+
|
| 82 |
+
# 3.2 THE SAMPLE DENSITY INDUCED BY THE GENERALIZED SCE LOSS
|
| 83 |
+
|
| 84 |
+
Generalized SCE loss. To better understand how the SCE loss and its variants (Pang et al., 2018; Wan et al., 2018) affect the sample density of features, we first generalize the definition in Eq. (1) as:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathcal { L } _ { \mathrm { g - S C E } } ( Z ( x ) , y ) = - 1 _ { y } ^ { \top } \log { [ \mathrm { s o f t m a x } ( h ) ] } ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where the logit $h = H ( z ) \in \mathbb { R } ^ { L }$ is a general transformation of the feature $z$ , for example, $h = W z + b$ in the SCE loss. We call this family of losses as the generalized SCE $\scriptstyle ( { \bf g } - { \bf S } { \bf C } { \bf E } )$ loss. Wan et al. (2018) propose the large-margin Gaussian Mixture (L-GM) loss, where $h _ { i } = { \breve { - } } ( z - \mu _ { i } ) ^ { \top } \Sigma _ { i } ( z - \mu _ { i } ) - m \delta _ { i , y }$ under the assumption that the learned features $z$ distribute as a mixture of Gaussian. Here $\mu _ { i }$ and $\Sigma _ { i }$ are extra trainable means and covariance matrices respectively, $m$ is the margin, and $\delta _ { i , y }$ is the indicator function. Pang et al. (2018) propose the Max-Mahalanobis linear discriminant analysis (MMLDA) loss, where $h _ { i } = - \| z - \mu _ { i } ^ { * } \| _ { 2 } ^ { 2 }$ under the similar mixture of Gaussian assumption, but the main difference is that $\mu _ { i } ^ { * }$ are not trainable, but calculated before training with optimal inter-class dispersion. These two losses both fall into the family of the $\mathbf { g }$ -SCE loss with quadratic logits:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
h _ { i } = - ( z - \mu _ { i } ) ^ { \top } \Sigma _ { i } ( z - \mu _ { i } ) + B _ { i } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $B _ { i }$ are the bias variables. Besides, note that for the SCE loss, there is
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathrm { s o f t m a x } ( W z + b ) _ { i } = \frac { \exp ( W _ { i } ^ { \top } z + b _ { i } ) } { \sum _ { l \in [ L ] } \exp ( W _ { l } ^ { \top } z + b _ { l } ) } = \frac { \exp ( - \| z - \frac { 1 } { 2 } W _ { i } \| _ { 2 } ^ { 2 } + b _ { i } + \frac { 1 } { 4 } \| W _ { i } \| _ { 2 } ^ { 2 } ) } { \sum _ { l \in [ L ] } \exp ( - \| z - \frac { 1 } { 2 } W _ { l } \| _ { 2 } ^ { 2 } + b _ { l } + \frac { 1 } { 4 } \| W _ { l } \| _ { 2 } ^ { 2 } ) } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
According to Eq. (4), the SCE loss can also be regraded as a special case of the $\mathrm { g - S C E }$ loss with quadratic logits, where $\begin{array} { r } { \mu _ { i } = \frac { 1 } { 2 } W _ { i } } \end{array}$ , $\begin{array} { r } { B _ { i } = b _ { i } + \frac 1 4 \| \dot { W _ { i } } \| _ { 2 } ^ { 2 } } \end{array}$ and $\Sigma _ { i } = I$ are identity matrices. Therefore, later when we refer to the g-SCE loss, we assume that the logits are quadratic as in Eq. (4) by default.
|
| 103 |
+
|
| 104 |
+
The contours of the g-SCE loss. To provide a formal representation of the sample density induced by the $\mathrm { g - S C E }$ loss, we first derive the formula of the contours, i.e., the closed-form solution of $\mathcal { L } _ { \mathrm { g - S C E } } ( Z ( x ) , y ) = C$ in the space of $z$ , where $C \in ( 0 , + \infty )$ is a given constant. Let $C _ { e } = \exp ( C ) \in$ $( 1 , + \infty )$ , from Eq. (3), we can represent the contours as the solution of
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\log \left( 1 + \frac { \sum _ { l \neq y } \exp ( h _ { l } ) } { \exp ( h _ { y } ) } \right) = C \implies h _ { y } = \log \left[ \sum _ { l \neq y } \exp ( h _ { l } ) \right] - \log ( C _ { e } - 1 ) .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
The function in Eq. (5) does not provide an intuitive closed-form solution for the contours, since the existence of the term $\begin{array} { r } { \log \left[ \sum _ { l \neq y } \exp ( h _ { l } ) \right] } \end{array}$ . However, note that this term belongs to the family of Log-Sum-Exp (LSE) function, which is a smooth approximation to the maximum function (Nesterov, 2005; Nielsen & Sun, 2016). Therefore, we can locally approximate the function in Eq. (5) with
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
h _ { y } - h _ { \tilde { y } } = - \log ( C _ { e } - 1 ) ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: Intuitive illustration on the inherent limitations of the $\mathbf { g } { - } \mathbf { S } \mathbf { C } \mathbf { E }$ loss. Reasonably learned features for a classification task should distribute in clusters, so it is counter-intuitive that the feature points tend to move to infinity to pursue lower loss values when applying the $\mathbf { g }$ -SCE loss. In contrast, MMC induces models to learn more structured and orderly features.
|
| 118 |
+
|
| 119 |
+
where $\tilde { y } = \mathrm { a r g } \operatorname* { m a x } _ { l \neq y } h _ { l }$ . In the following text, we apply colored characters with tilde like $\tilde { y }$ to better visually distinguish them. According to Eq. (6), we can define $\mathcal { L } _ { y , \tilde { y } } ( z ) = \log [ \exp ( h _ { \tilde { y } } - h _ { y } ) + 1 ]$ as the local approximation of the $\mathrm { g - S C E }$ loss nearby the feature point $z$ , and substitute the neighborhood ∆B by ∆By,y˜ $\Delta \bar { B } _ { y , \mathrm { ~ \scriptsize ~ = ~ } } \{ \mathbf { z } \in \mathbb { R } ^ { d } | \mathcal { L } _ { y , \mathrm { ~ \scriptsize ~ ( ~ \mathbf { z } ) ~ \in ~ } [ C , C \dot { ~ } + \Delta C ] \} }$ . For simplicity, we assume scaled identity covariance matrix in Eq. (4), i.e., $\Sigma _ { i } = \sigma _ { i } I$ , where $\sigma _ { i } > 0$ are scalars. Through simple derivations (detailed in Appendix A.1), we show that if $\sigma _ { y } \neq \sigma$ , the solution of $\mathcal { L } _ { y , \textit { \textbf { ( z ) } } } = C$ is a $( d - 1 )$ - dimensional hypersphere with the center $\mathbf { M } _ { y , \mathbf { \Omega } } = ( \sigma _ { y } - \sigma \mathbf { \Omega } ) ^ { - 1 } ( \sigma _ { y } \mu _ { y } - \sigma \mathbf { \Omega } \mu \mathbf { \Sigma } )$ ; otherwise if $\sigma _ { y } = \sigma$ , the hypersphere-shape contour will degenerate to a hyperplane.
|
| 120 |
+
|
| 121 |
+
The induced sample density. Since the approximation in Eq. (6) depends on the specific $y$ and $\cdot$ , we define the training subset $\mathcal { D } _ { k , \tilde { k } } = \{ ( x , y ) \in \mathcal { D } | y = k$ , $\tilde { y } = \tilde { k } \}$ and $N _ { k , \tilde { k } } = | \mathcal { D } _ { k , \tilde { k } } |$ . Intuitively, Dk,k˜ includes the data with the true label of class $k$ , while the highest prediction returned by the classifier is class $\tilde { k }$ among other classes. Then we can derive the approximated sample density in the feature space induced by the $\mathbf { g }$ -SCE loss, as stated in the following theorem:
|
| 122 |
+
|
| 123 |
+
Theorem 1. (Proof in Appendix A.1) Given $( x , y ) \in \mathcal { D } _ { k , \tilde { k } }$ , $z = Z ( x )$ and $\mathcal { L } _ { g - S C E } ( z , y ) = C$ , if there are $\Sigma _ { k } = \sigma _ { k } I$ , $\Sigma _ { \tilde { k } } = \sigma _ { \tilde { k } } I$ , and $\sigma _ { k } \neq \sigma _ { \tilde { k } }$ , then the sample density nearby the feature point $z$ based on the approximation in Eq. (6) is
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r } { \mathbb { S } \mathbb { D } ( z ) \propto \frac { N _ { k , \tilde { k } } \cdot p _ { k , \tilde { k } } ( C ) } { \left[ \mathbf { B } _ { k , \tilde { k } } + \frac { \log ( C _ { e } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } \right] ^ { \frac { d - 1 } { 2 } } } , a n d \mathbf { B } _ { k , \tilde { k } } = \frac { \sigma _ { k } \sigma _ { \tilde { k } } \| \mu _ { k } - \mu _ { \tilde { k } } \| _ { 2 } ^ { 2 } } { ( \sigma _ { k } - \sigma _ { \tilde { k } } ) ^ { 2 } } + \frac { B _ { k } - B _ { \tilde { k } } } { \sigma _ { k } - \sigma _ { \tilde { k } } } , } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where for the input-label pair in $\mathcal { D } _ { k , \tilde { k } }$ , there is $\mathcal { L } _ { g - S C E } \sim p _ { k , \tilde { k } } ( c )$ .
|
| 130 |
+
|
| 131 |
+
Limitations of the $\mathbf { g }$ -SCE loss. Based on Theorem 1 and the approximation in Eq. (6), let $C ^ { * } =$ $\mathrm { l o g } ( 1 + \exp ( \mathbf { B } _ { k , \tilde { k } } ( \sigma _ { \tilde { k } } - \sigma _ { k } ) ) )$ and $C _ { e } ^ { * } = \exp ( C ^ { * } )$ , such that $\begin{array} { r } { \bar { \mathbf { B } } _ { k , \tilde { k } } + \frac { \log ( C _ { e } ^ { * } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } \bar { = } \bar { 0 } } \end{array}$ = 0. According to Appendix A.1, if $\sigma _ { k } > \sigma _ { \tilde { k } }$ , then $C ^ { * }$ will act as a tight lower bound for $C$ , i.e., the solution set of $C < C ^ { * }$ is empty. This will make the training procedure tend to avoid this case since the loss $C$ cannot be further minimized to zero, which will introduce unnecessary biases on the returned predictions. On the other hand, if $\sigma _ { k } < \sigma _ { \tilde { k } }$ , $C$ could be minimized to zero. However, when $C 0$ , the sample density will also tend to zero since there is $\begin{array} { r } { \mathbf { B } _ { k , \tilde { k } } + \frac { \log ( C _ { e } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } \infty } \end{array}$ , which means the feature point will be encouraged to go further and further from the hypersphere center $\mathbf { M } _ { k , \tilde { k } }$ only to make the loss value $C$ be lower, as intuitively illustrated in Fig. 2(a).
|
| 132 |
+
|
| 133 |
+
This counter-intuitive behavior mainly roots from applying the softmax function in training. Namely, the softmax normalization makes the loss value only depend on the relative relation among logits. This causes indirect and unexpected supervisory signals on the learned features, such that the points with low loss values tend to spread over the space sparsely. Fortunately, in practice, the feature point will not really move to infinity, since the existence of batch normalization layers (Ioffe & Szegedy, 2015), and the squared radius from the center $\mathbf { M } _ { k , \tilde { k } }$ increases as $\mathcal { O } ( | \log C | )$ when minimizing the loss $C$ These theoretical conclusions are consistent with the empirical observations on the two-dimensional features in previous work (cf. Fig. 1 in Wan et al. (2018)).
|
| 134 |
+
|
| 135 |
+
Another limitation of the $\mathbf { g }$ -SCE loss is that the sample density is proportional to $N _ { k , \tilde { k } }$ , which is on average $N / L ^ { 2 }$ . For example, there are around 1.3 million training data in ImageNet (Deng et al., 2009), but with a large number of classes $L = 1 , 0 0 0$ , there are averagely less than two samples in each $\mathcal { D } _ { k , \tilde { k } }$ . These limitations inspire us to design the new training loss as in Sec 3.3.
|
| 136 |
+
|
| 137 |
+
Remark 1. If $\sigma _ { k } = \sigma _ { \tilde { k } }$ (e.g., as in the SCE loss), the features with loss values in $[ C , C + \Delta C ]$ will be encouraged to locate between two hyperplane contours without further supervision, and consequently there will not be explicit supervision on the sample density as shown in the left panel of Fig. 1.
|
| 138 |
+
|
| 139 |
+
Remark 2. Except for the $\mathbf { g }$ -SCE loss, Wen et al. (2016) propose the center loss in order to improve the intra-class compactness of learned features, formulated as $\begin{array} { r } { \mathcal { L } _ { \mathrm { C e n t e r } } ( Z ( x ) , y ) = \frac { 1 } { 2 } \| z - \mu _ { y } \| _ { 2 } ^ { 2 } } \end{array}$ . Here the center $\mu _ { y }$ is updated based on a mini-batch of learned features with label $y$ in each training iteration. The center loss has to be jointly used with the SCE loss as $\mathcal { L } _ { \mathrm { S C E } } + \lambda \mathcal { L } _ { \mathrm { C e n t e r } } ,$ , since simply supervise the DNNs with the center loss term will cause the learned features and centers to degrade to zeros (Wen et al., 2016). This makes it difficult to derive a closed-form formula for the induced sample density. Besides, the center loss method cannot concentrate on improving intra-class compactness, since it has to seek for a trade-off between inter-class dispersion and intra-class compactness.
|
| 140 |
+
|
| 141 |
+
# 3.3 MAX-MAHALANOBIS CENTER LOSS
|
| 142 |
+
|
| 143 |
+
Inspired by the above analyses, we propose the Max-Mahalanobis center (MMC) loss to explicitly learn more structured representations and induce high-density regions in the feature space. The MMC loss is defined in a regression form without the softmax function as
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\mathcal { L } _ { \mathrm { M M C } } ( Z ( x ) , y ) = \frac { 1 } { 2 } \| z - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 } .
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
Here $\mu ^ { * } = \{ \mu _ { l } ^ { * } \} _ { l \in [ L ] }$ are the centers of the Max-Mahalanobis distribution (MMD) (Pang et al., 2018). The MMD is a mixture of Gaussian distribution with identity covariance matrix and preset centers $\mu ^ { * }$ , where $\| \mu _ { l } ^ { * } \| _ { 2 } = C _ { \mathrm { M M } }$ for any $l \in [ L ]$ , and $C _ { \mathrm { M M } }$ is a hyperparameter. These MMD centers are invariable during training, which are crafted according to the criterion: $\begin{array} { r } { \mu ^ { * } = \arg \operatorname* { m i n } _ { \mu } \operatorname* { m a x } _ { i \neq j } \langle \mu _ { i } , \mu _ { j } \rangle } \end{array}$ . Intuitively, this criterion is to maximize the minimal angle between any two centers, which can provide optimal inter-class dispersion as shown in Pang et al. (2018). In Appendix B.1, we provide the generation algorithm for $\mu ^ { * }$ in MMC. We derive the sample density induced by the MMC loss in the feature space, as stated in Theorem 2. Similar to the previously introduced notations, here we define the subset $\mathcal { D } _ { k } = \{ ( x , y ) \in \mathcal { D } | y = k \}$ and $N _ { k } = | \mathcal { D } _ { k } |$ .
|
| 150 |
+
|
| 151 |
+
Theorem 2. (Proof in Appendix A.2) Given $( x , y ) \in \mathcal { D } _ { k }$ , $z = Z ( x )$ and $\mathcal { L } _ { M M C } ( z , y ) = C$ , the sample density nearby the feature point $z$ is
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathbb { S D } ( z ) \propto \frac { N _ { k } \cdot p _ { k } ( C ) } { C ^ { \frac { d - 1 } { 2 } } } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where for the input-label pair in $\mathcal { D } _ { k }$ , there is $\mathcal { L } _ { M M C } \sim p _ { k } ( c )$
|
| 158 |
+
|
| 159 |
+
According to Theorem 2, there are several attractive merits of the MMC loss, as described below.
|
| 160 |
+
|
| 161 |
+
Inducing higher sample density. Compared to Theorem 1, the sample density induced by MMC is proportional to $N _ { k }$ rather than $N _ { k , \tilde { k } }$ , where $N _ { k }$ is on average $N / L$ . It facilitates producing higher sample density. Furthermore, when the loss value $C$ is minimized to zero, the sample density will exponentially increase according to Eq. (9), as illustrated in Fig. 2(b). The right panel of Fig. 1 also provides an intuitive insight on this property of the MMC loss: since the loss value $C$ is proportional to the squared distance from the preset center $\mu _ { y } ^ { * }$ , the feature points with lower loss values are certain to locate in a smaller volume around the center. Consequently, the feature points of the same class are encouraged to gather around the corresponding center, such that for each sample, there will be locally enough data in its neighborhood for robust learning (Schmidt et al., 2018). The MMC loss value also becomes a reliable metric of the uncertainty on returned predictions.
|
| 162 |
+
|
| 163 |
+
Better exploiting model capacity. Behind the simple formula, the MMC loss can explicitly monitor inter-class dispersion by the hyperparameter $C _ { \mathrm { M M } }$ , while enabling the network to concentrate on minimizing intra-class compactness in training. Instead of repeatedly searching for an internal tradeoff in training as the center loss, the monotonicity of the supervisory signals induced by MMC can better exploit model capacity and also lead to faster convergence, as empirically shown in Fig. 3(a).
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 3: (a) Test error rates on clean images w.r.t training time on CIFAR-10. Here AT refers to 10-steps targeted PGD adversarial training, i.e., $\mathsf { A T } _ { 1 0 } ^ { \mathsf { t a r } }$ . (b) Two-dimensional visualization of the attacks on trained MMC networks in the feature space of MNIST. For each attack there is $\epsilon = 0 . 3$ with step size of 0.01. The total number of iteration steps is 50, where Iter- indicates the perturbed features at -th iteration step.
|
| 167 |
+
|
| 168 |
+
Avoiding the degradation problem. The MMC loss can naturally avoid the degradation problem encountered in Wen et al. (2016) when the center loss is not jointly used with the SCE loss, since the preset centers $\mu ^ { * }$ for MMC are untrainable. In the test phase, the network trained by MMC can still return a normalized prediction with the softmax function. More details about the empirical superiorities of the MMC loss over other previous losses are demonstrated in Sec. 4.
|
| 169 |
+
|
| 170 |
+
Remark 3. In Appendix B.2, we discuss on why the squared-error form in Eq. (8) is preferred compared to, e.g., the absolute form or the Huber form in the adversarial setting. We further introduce flexible variants of the MMC loss in Appendix B.3, which can better adapt to various tasks.
|
| 171 |
+
|
| 172 |
+
Remark 4. Pang et al. (2018) propose a Max-Mahalanobis linear discriminant analysis (MMLDA) method, which assumes the features to distribute as an MMD. Due to the Gaussian mixture assumption, the training loss for the MMLDA method is obtained by the Bayes’ theorem as
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
{ \mathcal { L } } _ { \mathrm { M M L D A } } ( Z ( x ) , y ) = - \log \left[ \frac { \exp ( - \frac { \| z - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 } } { 2 } ) } { \sum _ { l \in [ L ] } \exp ( - \frac { \| z - \mu _ { l } ^ { * } \| _ { 2 } ^ { 2 } } { 2 } ) } \right] = - \log \left[ \frac { \exp ( z ^ { \top } \mu _ { y } ^ { * } ) } { \sum _ { l \in [ L ] } \exp ( z ^ { \top } \mu _ { l } ^ { * } ) } \right] .
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
Note that there is $\Sigma _ { i } = { \textstyle { \frac { 1 } { 2 } } } I$ in Eq. (4) for the MMLDA loss, similar with the SCE loss. Thus the MMLDA method cannot explicitly supervise on the sample density and induce high-density regions in the feature space, as analyzed in Sec. 3.2. Compared to the MMLDA method, the MMC loss introduces extra supervision on intra-class compactness, which facilitates better robustness.
|
| 179 |
+
|
| 180 |
+
# 4 EXPERIMENTS
|
| 181 |
+
|
| 182 |
+
In this section, we empirically demonstrate several attractive merits of applying the MMC loss. We experiment on the widely used MNIST, CIFAR-10, and CIFAR-100 datasets (Krizhevsky & Hinton, 2009; LeCun et al., 1998). The main baselines for the MMC loss are SCE (He et al., 2016), Center loss (Wen et al., 2016), MMLDA (Pang et al., 2018), and L-GM (Wan et al., 2018). The codes are provided in https://github.com/P2333/Max-Mahalanobis-Training.
|
| 183 |
+
|
| 184 |
+
# 4.1 PERFORMANCE ON THE CLEAN INPUTS
|
| 185 |
+
|
| 186 |
+
The network architecture applied is ResNet-32 with five core layer blocks (He et al., 2016). Here we use MMC-10 to indicate the MMC loss with $C _ { \mathrm { M M } } = 1 0$ , where $C _ { \mathrm { M M } }$ is assigned based on the cross-validation results in Pang et al. (2018). The hyperparameters for the center loss, L-GM loss and the MMLDA method all follow the settings in the original papers (Pang et al., 2018; Wan et al., 2018; Wen et al., 2016). The pixel values are scaled to the interval $[ 0 , 1 ]$ . For each training loss with or without the AT mechanism, we apply the momentum SGD (Qian, 1999) optimizer with the initial learning rate of 0.01, and train for 40 epochs on MNIST, 200 epochs on CIFAR-10 and CIFAR-100. The learning rate decays with a factor of 0.1 at 100 and 150 epochs, respectively.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: Classification accuracy under the black-box transfer-based attacks on the test set of CIFAR-10. The substitute model one used to craft adversarial examples, and the target model is the one that an adversary actually intends to fool. Here AT refers to $\mathbf { A T _ { 1 0 } ^ { t a r } }$ to the.
|
| 190 |
+
|
| 191 |
+
When applying the AT mechanism (Madry et al., 2018), the adversarial examples for training are crafted by 10-steps targeted or untargeted PGD with $\epsilon = 8 / 2 5 5$ . In Fig. 3(a), we provide the curves of the test error rate w.r.t. the training time. Note that the MMC loss induces faster convergence rate and requires little extra computation compared to the SCE loss and its variants, while keeping comparable performance on the clean images. In comparison, implementing the AT mechanism is computationally expensive in training and will sacrifice the accuracy on the clean images.
|
| 192 |
+
|
| 193 |
+
# 4.2 ADAPTIVE ATTACKS FOR THE MMC LOSS
|
| 194 |
+
|
| 195 |
+
As stated in Athalye et al. (2018), only applying the existing attacks with default hyperparameters is not sufficient to claim reliable robustness. Thus, we apply the adaptive versions of existing attacks when evading the networks trained by the MMC loss (detailed in Appendix B.4). For instance, the non-adaptive objectives for PGD are variants of the SCE loss (Madry et al., 2018), while the adaptive objectives are $- \mathcal { L } _ { \mathrm { M M C } } ( z , y )$ and $\mathcal { L } _ { \mathrm { M M C } } ( z , y _ { t } )$ in the untargeted and targeted modes for PGD, respectively. Here $y _ { t }$ is the target label. To verify that the adaptive attacks are more effective than the non-adaptive ones, we modify the network architecture with a two-dimensional feature layer and visualize the PGD attacking procedure in Fig. 3(b). The two panels separately correspond to two randomly selected clean inputs indicated by black stars. The ten colored clusters in each panel consist of the features of all the 10,000 test samples in MNIST, where each color corresponds to one class. We can see that the adaptive attacks are indeed much more efficient than the non-adaptive one.
|
| 196 |
+
|
| 197 |
+
# 4.3 PERFORMANCE UNDER THE WHITE-BOX ATTACKS
|
| 198 |
+
|
| 199 |
+
We first investigate the white-box $l _ { \infty }$ distortion setting using the PGD attack, and report the results in Table 1. According to Carlini et al. (2019), we evaluate under different combinations of the attacking parameters: the perturbation $\epsilon$ , iteration steps, and the attack mode, i.e., targeted or untargeted.
|
| 200 |
+
|
| 201 |
+
Table 2: Experiments on CIFAR-10. Part I: Averaged $l _ { 2 }$ distortion of the white-box adversarial examples crafted by C&W with 1,000 iteration steps. Part II: Classification accuracy $( \% )$ under the block-box SPSA attack. Part III: Classification accuracy $( \% )$ under general transformations. The standard deviation $\sigma$ for the Gaussian noise is 0.05, the degree range is $\pm 3 0 ^ { \circ }$ for random rotation.
|
| 202 |
+
|
| 203 |
+
<table><tr><td rowspan=1 colspan=3>Methods</td><td rowspan=1 colspan=2>Part IC& Wtar C& Wun</td><td rowspan=1 colspan=2>Part II (ε=8/255)SPSA10 SPSA10</td><td rowspan=1 colspan=2>Part II (e=16/255)SPSA10 SPSA10</td><td rowspan=1 colspan=2>Part IIINoise Rotation</td></tr><tr><td rowspan=7 colspan=3>SCECenter lossMMLDAL-GMMMC-10</td><td rowspan=1 colspan=1>0.12</td><td rowspan=1 colspan=1>0.07</td><td rowspan=1 colspan=1>12.3</td><td rowspan=1 colspan=1>1.2</td><td rowspan=1 colspan=1>5.1</td><td rowspan=1 colspan=1>≤1</td><td rowspan=1 colspan=1>52.0</td><td rowspan=1 colspan=1>83.5</td></tr><tr><td rowspan=3 colspan=2>S</td><td rowspan=3 colspan=1>0.13</td><td rowspan=3 colspan=1>0.07</td><td rowspan=3 colspan=1>21.2</td><td rowspan=3 colspan=1>6.0</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=2 colspan=1></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan=1 colspan=1>10.6</td><td rowspan=1 colspan=1>2.0</td><td rowspan=1 colspan=1>55.4</td><td rowspan=1 colspan=1>84.9</td></tr><tr><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>0.10</td><td rowspan=1 colspan=1>25.6</td><td rowspan=1 colspan=1>13.2</td><td rowspan=1 colspan=1>11.3</td><td rowspan=1 colspan=1>5.7</td><td rowspan=1 colspan=1>57.9</td><td rowspan=1 colspan=1>84.8</td></tr><tr><td rowspan=1 colspan=1>0.23</td><td rowspan=1 colspan=1>0.12</td><td rowspan=1 colspan=1>61.9</td><td rowspan=1 colspan=1>45.9</td><td rowspan=1 colspan=1>46.1</td><td rowspan=1 colspan=1>28.2</td><td rowspan=1 colspan=1>59.2</td><td rowspan=1 colspan=1>82.4</td></tr><tr><td rowspan=1 colspan=1>0.34</td><td rowspan=1 colspan=1>0.17</td><td rowspan=1 colspan=1>69.5</td><td rowspan=1 colspan=1>56.9</td><td rowspan=1 colspan=1>57.2</td><td rowspan=1 colspan=1>41.5</td><td rowspan=1 colspan=1>69.3</td><td rowspan=1 colspan=1>87.2</td></tr><tr><td rowspan=2 colspan=3>AT10 (SCE)AT10 (MMC-10)</td><td rowspan=2 colspan=1>1.191.91</td><td rowspan=1 colspan=1>0.63</td><td rowspan=1 colspan=1>81.1</td><td rowspan=1 colspan=1>67.8</td><td rowspan=1 colspan=1>77.9</td><td rowspan=1 colspan=1>59.4</td><td rowspan=2 colspan=1>82.283.5</td><td rowspan=1 colspan=1>76.0</td></tr><tr><td rowspan=1 colspan=1>0.85</td><td rowspan=1 colspan=1>79.1</td><td rowspan=1 colspan=1>69.2</td><td rowspan=1 colspan=1>74.5</td><td rowspan=1 colspan=1>62.7</td><td rowspan=1 colspan=1>75.2</td></tr><tr><td rowspan=2 colspan=3>AT10 (SCE)AT10(MMC-10)</td><td rowspan=1 colspan=1>1.26</td><td rowspan=1 colspan=1>0.68</td><td rowspan=1 colspan=1>78.8</td><td rowspan=1 colspan=1>67.0</td><td rowspan=1 colspan=1>73.7</td><td rowspan=1 colspan=1>60.3</td><td rowspan=1 colspan=1>78.9</td><td rowspan=1 colspan=1>73.7</td></tr><tr><td rowspan=1 colspan=1>1.55</td><td rowspan=1 colspan=1>0.73</td><td rowspan=1 colspan=1>80.4</td><td rowspan=1 colspan=1>69.6</td><td rowspan=1 colspan=1>74.6</td><td rowspan=1 colspan=1>62.4</td><td rowspan=1 colspan=1>80.3</td><td rowspan=1 colspan=1>75.8</td></tr></table>
|
| 204 |
+
|
| 205 |
+
Following the setting in Madry et al. (2018), we choose the perturbation $\epsilon = 8 / 2 5 5$ and 16/255, with the step size be $2 / 2 5 5$ . We have also run PGD-100 and PGD-200 attacks, and find that the accuracy converges compared to PGD-50. In each PGD experiment, we ran several times with different random restarts to guarantee the reliability of the reported results.
|
| 206 |
+
|
| 207 |
+
Ablation study. To investigate the effect on robustness induced by high sample density in MMC, we substitute uniformly sampled center set (Liu et al., 2018; Duan et al., 2019), i.e., $\mu ^ { r } = \{ \mu _ { l } ^ { r } \} _ { l \in [ L ] }$ for the MM center set $\mu ^ { * }$ , and name the resulted method as "MMC-10 (rand)" as shown in Table 1. There is also $\| \mu _ { l } ^ { r } \| _ { 2 } = C _ { \mathrm { M M } }$ , but $\mu ^ { r }$ is no longer the solution of the min-max problem in Sec. 3.3.
|
| 208 |
+
|
| 209 |
+
From the results in Table 1, we can see that higher sample density alone in "MMC-10 (rand)" can already lead to much better robustness than other baseline methods even under the adaptive attacks, while using the optimal center set $\mu ^ { * }$ as in "MMC-10" can further improve performance. When combining with the AT mechanism, the trained models have better performance under the attacks different from the one used to craft adversarial examples for training, e.g, $\mathrm { P G D } _ { 5 0 } ^ { \mathbf { u n } }$ with $\epsilon = 1 6 / 2 5 5$ .
|
| 210 |
+
|
| 211 |
+
Then we investigate the white-box $l _ { 2 }$ distortion setting. We apply the C&W attack, where it has a binary search mechanism to find the minimal distortion to successfully mislead the classifier under the untargeted mode, or lead the classifier to predict the target label in the targeted mode. Following the suggestion in Carlini & Wagner (2017a), we set the binary search steps to be 9 with the initial constant $c = 0 . 0 1$ . The iteration steps for each value of $c$ are set to be 1,000 with the learning rate of 0.005. In the Part I of Table 2, we report the minimal distortions found by the C&W attack. As expected, it requires much larger distortions to successfully evade the networks trained by MMC.
|
| 212 |
+
|
| 213 |
+
# 4.4 PERFORMANCE UNDER THE BLACK-BOX ATTACKS
|
| 214 |
+
|
| 215 |
+
Table 3: Accuracy $( \% )$ of MMC-10 under SPSA with different batch sizes.
|
| 216 |
+
|
| 217 |
+
<table><tr><td rowspan=2 colspan=3>CIFAR-10Batch SPSA10 SPSA</td></tr><tr><td rowspan=1 colspan=1>Batch</td><td rowspan=1 colspan=1>SPSA10</td></tr><tr><td rowspan=1 colspan=1>128</td><td rowspan=1 colspan=1>57.0</td><td rowspan=1 colspan=1>69.0</td></tr><tr><td rowspan=1 colspan=1>4096</td><td rowspan=1 colspan=1>41.0</td><td rowspan=1 colspan=1>52.0</td></tr><tr><td rowspan=1 colspan=1>8192</td><td rowspan=1 colspan=1>37.0</td><td rowspan=1 colspan=1>49.0</td></tr></table>
|
| 218 |
+
|
| 219 |
+
As suggested in Carlini et al. (2019), providing evidence of being robust against the black-box attacks is critical to claim reliable robustness. We first perform the transfer-based attacks using PGD and MIM. Since the targeted attacks usually have poor transferability (Kurakin et al., 2018), we only focus on the untargeted mode in this case, and the results are shown in Fig. 4. We further perform the gradient-free attacks using the SPSA method and report the results in the Part II of Table 2. To perform numerical approximations on gradients in SPSA, we set the batch size to be 128, the learning rate is 0.01, and the step size of the finite difference is $\delta = 0 . 0 1$ , as suggested by Uesato et al. (2018). We also evaluate under stronger
|
| 220 |
+
|
| 221 |
+
SPSA attacks with batch size to be 4096 and 8192 in Table 3, where the $\epsilon = 8 / 2 5 5$ . With larger batch sizes, we can find that the accuracy under the black-box SPSA attacks converges to it under the white-box PGD attacks. These results indicate that training with the MMC loss also leads to robustness under the black-box attacks, which verifies that our method can induce reliable robustness, rather than the false one caused by, e.g., gradient mask (Athalye et al., 2018).
|
| 222 |
+
|
| 223 |
+
Table 4: Experiments on CIFAR-100. Part I: Classification accuracy $( \% )$ on the clean test samples. Part II: Classification accuracy $( \% )$ under the white-box PGD attacks and the block-box SPSA attack. The attacks are adaptive for MMC. Here the batch size for SPSA is 128. Part III: Averaged $l _ { 2 }$ distortion of the white-box adversarial examples crafted by C&W with 1,000 iteration steps and 9 binary search epochs.
|
| 224 |
+
|
| 225 |
+
<table><tr><td rowspan="2">Methods</td><td rowspan="2">Part I Clean</td><td colspan="4">Part II(ε = 8/255)</td><td colspan="2">Part I</td></tr><tr><td>PGD</td><td>PGD10</td><td>SPSA</td><td>SPSA10</td><td>C&Wtar</td><td>C&Wun</td></tr><tr><td>SCE</td><td>72.9</td><td>≤1</td><td>8.0</td><td>14.0</td><td>1.9</td><td>0.16</td><td>0.047</td></tr><tr><td>Center</td><td>72.8</td><td>≤1</td><td>10.2</td><td>14.7</td><td>2.3</td><td>0.18</td><td>0.048</td></tr><tr><td>MMLDA</td><td>72.2</td><td>≤1</td><td>13.9</td><td>18.5</td><td>5.6</td><td>0.21</td><td>0.050</td></tr><tr><td>L-GM</td><td>71.3</td><td>15.8</td><td>15.3</td><td>22.8</td><td>7.6</td><td>0.31</td><td>0.063</td></tr><tr><td>MMC-10</td><td>71.9</td><td>23.9</td><td>23.4</td><td>33.4</td><td>15.8</td><td>0.37</td><td>0.085</td></tr></table>
|
| 226 |
+
|
| 227 |
+
# 4.5 PERFORMANCE UNDER THE GENERAL-PURPOSE ATTACKS
|
| 228 |
+
|
| 229 |
+
To show that our method is generally robust, we further test under the general-purpose attacks (Carlini et al., 2019). We apply the Gaussian noise (Fawzi et al., 2016; Gilmer et al., 2019) and rotation transformation (Engstrom et al., 2019), which are not included in the data augmentation for training. The results are given in the Part III of Table 2. Note that the AT methods are less robust to simple transformations like rotation, as also observed in previous work (Engstrom et al., 2019). In comparison, the models trained by the MMC loss are still robust to these easy-to-apply attacks.
|
| 230 |
+
|
| 231 |
+
# 4.6 EXPERIMENTS ON CIFAR-100
|
| 232 |
+
|
| 233 |
+
In Table 4 and Table 5, we provide the results on CIFAR-100 under the white-box PGD and C&W attacks, and the black-box gradient-free SPSA attack. The hyperparameter setting for each attack is the same as it on CIFAR-10. Compared to previous defense strategies which also evaluate on CIFAR-100 (Pang et al., 2019; Mustafa et al., 2019), MMC can improve robustness more significantly, while keeping better performance on the clean inputs. Compared to the results on CIFAR-10, the averaged distortion of C&W on CIFAR-100 is larger for a successful targeted attack and is much smaller for a successful untargeted attack. This is because when only the number of classes increases, e.g., from 10 to 100, it is easier to achieve a coarse untargeted attack, but harder to make a subtle targeted attack. Note that in Table 5, we also train on the ResNet-110 model with eighteen core block layers except for the ResNet-32 model. The results show that MMC can further benefit from deep network architectures and better exploit model capacity to improve robustness. Similar properties are also observed in previous work when applying the AT methods (Madry et al., 2018). In contrast, as shown in Table 5, the models trained by SCE are comparably sensitive to adversarial perturbations for different architectures, which demonstrates that SCE cannot take full advantage of the model capacity to improve robustness. This verifies that MMC provides effective robustness promoting mechanism like the AT methods, with much less computational cost.
|
| 234 |
+
|
| 235 |
+
# 5 CONCLUSION
|
| 236 |
+
|
| 237 |
+
In this paper, we formally demonstrate that applying the softmax function in training could potentially lead to unexpected supervisory signals. To solve this problem, we propose the MMC loss to learn more structured representations and induce high-density regions in the feature space. In our experiments, we empirically demonstrate several favorable merits of our method: (i) Lead to reliable robustness even under strong adaptive attacks in different threat models; (ii) Keep high performance on clean inputs comparable to SCE; (iii) Introduce little extra computation compared to the SCE loss; (iv) Compatible with the existing defense mechanisms, e.g., the AT methods. Our analyses in this paper also provide useful insights for future work on designing new objectives beyond the SCE framework.
|
| 238 |
+
|
| 239 |
+
# ACKNOWLEDGEMENTS
|
| 240 |
+
|
| 241 |
+
This work was supported by the National Key Research and Development Program of China (No. 2017YFA0700904), NSFC Projects (Nos. 61620106010, U19B2034, U1811461), Beijing NSF Project (No. L172037), Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Huawei Joint Research Program, a grant from Tsinghua Institute for Guo Qiang, Tiangong Institute for Intelligent Computing, the JP Morgan Faculty Research Program and the NVIDIA NVAIL Program with GPU/DGX Acceleration.
|
| 242 |
+
|
| 243 |
+
# REFERENCES
|
| 244 |
+
|
| 245 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning (ICML), 2018.
|
| 246 |
+
|
| 247 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndic, Pavel Laskov, Giorgio ´ Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pp. 387–402. Springer, 2013.
|
| 248 |
+
|
| 249 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy (S&P), 2017a.
|
| 250 |
+
|
| 251 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In ACM Workshop on Artificial Intelligence and Security (AISec), 2017b.
|
| 252 |
+
|
| 253 |
+
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, Aleksander Madry, and Alexey Kurakin. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 254 |
+
|
| 255 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 256 |
+
|
| 257 |
+
Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security (AISec), pp. 15–26. ACM, 2017.
|
| 258 |
+
|
| 259 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 248–255. IEEE, 2009.
|
| 260 |
+
|
| 261 |
+
Jiankang Deng, Jia Guo, Niannan Xue, and Stefanos Zafeiriou. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4690–4699, 2019.
|
| 262 |
+
|
| 263 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 264 |
+
|
| 265 |
+
Yueqi Duan, Jiwen Lu, and Jie Zhou. Uniformface: Learning deep equidistributed representation for face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3415–3424, 2019.
|
| 266 |
+
|
| 267 |
+
Krishnamurthy Dvijotham, Sven Gowal, Robert Stanforth, Relja Arandjelovic, Brendan O’Donoghue, Jonathan Uesato, and Pushmeet Kohli. Training verified learners with learned verifiers. arXiv preprint arXiv:1805.10265, 2018a.
|
| 268 |
+
|
| 269 |
+
Krishnamurthy Dvijotham, Robert Stanforth, Sven Gowal, Timothy Mann, and Pushmeet Kohli. A dual approach to scalable verification of deep networks. In Annual Conference on Uncertainty in Artificial Intelligence (UAI), 2018b.
|
| 270 |
+
|
| 271 |
+
Logan Engstrom, Brandon Tran, Dimitris Tsipras, Ludwig Schmidt, and Aleksander Madry. A rotation and a translation suffice: Fooling cnns with simple transformations. In International Conference on Machine Learning (ICML), 2019.
|
| 272 |
+
|
| 273 |
+
Alhussein Fawzi, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Robustness of classifiers: from adversarial to random noise. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1632–1640, 2016.
|
| 274 |
+
|
| 275 |
+
Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 276 |
+
|
| 277 |
+
Jerome Friedman, Trevor Hastie, and Robert Tibshirani. The elements of statistical learning, volume 1. Springer series in statistics New York, 2001.
|
| 278 |
+
|
| 279 |
+
Justin Gilmer, Nicolas Ford, Nicolas Carlini, and Ekin Cubuk. Adversarial examples are a natural consequence of test error in noise. In International Conference on Machine Learning (ICML), 2019.
|
| 280 |
+
|
| 281 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http: //www.deeplearningbook.org.
|
| 282 |
+
|
| 283 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015.
|
| 284 |
+
|
| 285 |
+
Yandong Guo and Lei Zhang. One-shot face recognition by promoting underrepresented classes. arXiv preprint arXiv:1707.05574, 2017.
|
| 286 |
+
|
| 287 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), pp. 630–645. Springer, 2016.
|
| 288 |
+
|
| 289 |
+
Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems (NeurIPS), pp. 2266–2276, 2017.
|
| 290 |
+
|
| 291 |
+
Cormac Herley and Paul C Van Oorschot. Sok: Science, security and the elusive goal of security as a scientific pursuit. In 2017 IEEE Symposium on Security and Privacy (S&P), pp. 99–120. IEEE, 2017.
|
| 292 |
+
|
| 293 |
+
Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In International Conference on Machine Learning (ICML), 2018.
|
| 294 |
+
|
| 295 |
+
Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Anish Athalye, Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 296 |
+
|
| 297 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning (ICML), pp. 448–456, 2015.
|
| 298 |
+
|
| 299 |
+
John David Jackson. Classical electrodynamics. American Journal of Physics, 1999.
|
| 300 |
+
|
| 301 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial logit pairing. arXiv preprint arXiv:1803.06373, 2018.
|
| 302 |
+
|
| 303 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 304 |
+
|
| 305 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In The International Conference on Learning Representations (ICLR) Workshops, 2017.
|
| 306 |
+
|
| 307 |
+
Alexey Kurakin, Ian Goodfellow, Samy Bengio, Yinpeng Dong, Fangzhou Liao, Ming Liang, Tianyu Pang, Jun Zhu, Xiaolin Hu, Cihang Xie, et al. Adversarial attacks and defences competition. arXiv preprint arXiv:1804.00097, 2018.
|
| 308 |
+
|
| 309 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 310 |
+
|
| 311 |
+
Xuezhi Liang, Xiaobo Wang, Zhen Lei, Shengcai Liao, and Stan Z Li. Soft-margin softmax for deep classification. In International Conference on Neural Information Processing (ICNIP), pp. 413–421. Springer, 2017.
|
| 312 |
+
|
| 313 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In International Conference on Machine Learning (ICML), 2016.
|
| 314 |
+
|
| 315 |
+
Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, Bhiksha Raj, and Le Song. Sphereface: Deep hypersphere embedding for face recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pp. 212–220, 2017.
|
| 316 |
+
|
| 317 |
+
Weiyang Liu, Rongmei Lin, Zhen Liu, Lixin Liu, Zhiding Yu, Bo Dai, and Le Song. Learning towards minimum hyperspherical energy. In Advances in Neural Information Processing Systems (NeurIPS), pp. 6222–6233, 2018.
|
| 318 |
+
|
| 319 |
+
Pavel Loskot and Norman C. Beaulieu. On monotonicity of the hypersphere volume and area. Journal of Geometry, 2007.
|
| 320 |
+
|
| 321 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations (ICLR), 2018.
|
| 322 |
+
|
| 323 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2574–2582, 2016.
|
| 324 |
+
|
| 325 |
+
Aamir Mustafa, Salman Khan, Munawar Hayat, Roland Goecke, Jianging Shen, and Ling Shao. Adversarial defense by restricting the hidden space of deep neural networks. In International Conference on Computer Vision (ICCV), 2019.
|
| 326 |
+
|
| 327 |
+
Yu Nesterov. Smooth minimization of non-smooth functions. Mathematical programming, 103(1): 127–152, 2005.
|
| 328 |
+
|
| 329 |
+
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 427–436, 2015.
|
| 330 |
+
|
| 331 |
+
Frank Nielsen and Ke Sun. Guaranteed bounds on the kullback–leibler divergence of univariate mixtures. IEEE Signal Processing Letters, 23(11):1543–1546, 2016.
|
| 332 |
+
|
| 333 |
+
Tianyu Pang, Chao Du, and Jun Zhu. Max-mahalanobis linear discriminant analysis networks. In International Conference on Machine Learning (ICML), 2018.
|
| 334 |
+
|
| 335 |
+
Tianyu Pang, Kun Xu, Chao Du, Ning Chen, and Jun Zhu. Improving adversarial robustness via promoting ensemble diversity. In International Conference on Machine Learning (ICML), 2019.
|
| 336 |
+
|
| 337 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In IEEE European Symposium on Security and Privacy (EuroS&P), pp. 372–387. IEEE, 2016.
|
| 338 |
+
|
| 339 |
+
Nicolas Papernot, Patrick McDaniel, Arunesh Sinha, and Michael Wellman. Towards the science of security and privacy in machine learning. In European Symposium on Security and Privacy (EuroS&P), 2018.
|
| 340 |
+
|
| 341 |
+
Xianbiao Qi and Lei Zhang. Face recognition via centralized coordinate learning. arXiv preprint arXiv:1801.05678, 2018.
|
| 342 |
+
|
| 343 |
+
Ning Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12(1): 145–151, 1999.
|
| 344 |
+
|
| 345 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In Advances in Neural Information Processing Systems (NeurIPS), pp. 5019–5031, 2018.
|
| 346 |
+
|
| 347 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 815–823, 2015.
|
| 348 |
+
|
| 349 |
+
Ali Shafahi, Mahyar Najibi, Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 350 |
+
|
| 351 |
+
Robert Stanforth, Alhussein Fawzi, Pushmeet Kohli, et al. Are labels required for improving adversarial robustness? In Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 352 |
+
|
| 353 |
+
Yi Sun, Yuheng Chen, Xiaogang Wang, and Xiaoou Tang. Deep learning face representation by joint identification-verification. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1988–1996, 2014.
|
| 354 |
+
|
| 355 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations (ICLR), 2014.
|
| 356 |
+
|
| 357 |
+
Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. In International Conference on Machine Learning (ICML), 2018.
|
| 358 |
+
|
| 359 |
+
Weitao Wan, Yuanyi Zhong, Tianpeng Li, and Jiansheng Chen. Rethinking feature distribution for loss functions in image classification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 9117–9126, 2018.
|
| 360 |
+
|
| 361 |
+
Feng Wang, Xiang Xiang, Jian Cheng, and Alan Loddon Yuille. Normface: l 2 hypersphere embedding for face verification. In Proceedings of the 25th ACM international conference on Multimedia (ACM MM), pp. 1041–1049. ACM, 2017.
|
| 362 |
+
|
| 363 |
+
Hao Wang, Yitong Wang, Zheng Zhou, Xing Ji, Dihong Gong, Jingchao Zhou, Zhifeng Li, and Wei Liu. Cosface: Large margin cosine loss for deep face recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5265–5274, 2018.
|
| 364 |
+
|
| 365 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In European Conference on Computer Vision (ECCV), pp. 499–515. Springer, 2016.
|
| 366 |
+
|
| 367 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning (ICML), pp. 5283–5292, 2018.
|
| 368 |
+
|
| 369 |
+
Eric Wong, Frank Schmidt, Jan Hendrik Metzen, and J Zico Kolter. Scaling provable adversarial defenses. In Advances in Neural Information Processing Systems (NeurIPS), pp. 8400–8409, 2018.
|
| 370 |
+
|
| 371 |
+
Kai Y Xiao, Vincent Tjeng, Nur Muhammad Shafiullah, and Aleksander Madry. Training for faster adversarial robustness verification via inducing relu stability. In International Conference on Learning Representations (ICLR), 2019.
|
| 372 |
+
|
| 373 |
+
Cihang Xie, Yuxin Wu, Laurens van der Maaten, Alan Yuille, and Kaiming He. Feature denoising for improving adversarial robustness. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 374 |
+
|
| 375 |
+
Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Accelerating adversarial training via maximal principle. In Advances in Neural Information Processing Systems (NeurIPS), 2019a.
|
| 376 |
+
|
| 377 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning (ICML), 2019b.
|
| 378 |
+
|
| 379 |
+
# A PROOF
|
| 380 |
+
|
| 381 |
+
In this section, we provide the proof of the theorems proposed in the paper.
|
| 382 |
+
|
| 383 |
+
A.1 PROOF OF THEOREM 1
|
| 384 |
+
|
| 385 |
+
According to the definition of sample density
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\mathbb { S D } ( z ) = \frac { \Delta N } { \mathrm { V o l } ( \Delta B ) } ,
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
we separately calculate $\Delta N$ and $\mathrm { V o l } ( \Delta B )$ . Since $\mathcal { L } _ { \mathrm { g - S C E } } \sim p _ { k , \tilde { k } } ( c )$ for the data points in $\mathcal { D } _ { k , \tilde { k } }$ , recall that $\Delta B = \{ z \in \mathbb { R } ^ { d } | { \mathcal { L } } _ { \mathrm { g - S C E } } \in [ C , C + \Delta C ] \}$ , then there is
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r l } & { \Delta N = | Z ( \mathcal { D } _ { k , \tilde { k } } ) \cap \Delta B | } \\ & { \qquad = N _ { k , \tilde { k } } \cdot p _ { k , \tilde { k } } ( C ) \cdot \Delta C . } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Now we calculate $\mathrm { V o l } ( \Delta B )$ by approximating it with $\mathrm { V o l } ( \Delta B _ { y , \tilde { y } } )$ . We first derive the solution of $\begin{array} { r l } { \mathcal { L } _ { y , } } & { { } = ~ C } \end{array}$ . For simplicity, we assume scaled identity covariance matrix, i.e., $\Sigma _ { i } = \sigma _ { i } I $ , where $\sigma _ { i } > 0$ are scalars. Then $\forall i , j \in [ L ]$ , $c$ is any constant, if $\sigma _ { i } \neq \sigma _ { j }$ , the solution of $h _ { i } - h _ { j } = c$ is a $( d \mathrm { - } 1 )$ -dimensional hypersphere embedded in the $d$ -dimensional space of the feature $z$ :
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\| z - \mathbf { M } _ { i , j } \| _ { 2 } ^ { 2 } = \mathbf { B } _ { i , j } - { \frac { c } { \sigma _ { i } - \sigma _ { j } } } , { \mathrm { w h e r e } } \mathbf { M } _ { i , j } = { \frac { \sigma _ { i } \mu _ { i } - \sigma _ { j } \mu _ { j } } { \sigma _ { i } - \sigma _ { j } } } , \ \mathbf { B } _ { i , j } = { \frac { \sigma _ { i } \sigma _ { j } \| \mu _ { i } - \mu _ { j } \| _ { 2 } ^ { 2 } } { ( \sigma _ { i } - \sigma _ { j } ) ^ { 2 } } } + { \frac { B _ { i } - B _ { j } } { \sigma _ { i } - \sigma _ { j } } } .
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Note that each value of $c$ corresponds to a specific contour, where $\mathbf { M } _ { i , j }$ and $\mathbf { B } _ { i , j }$ can be regraded as constant w.r.t. $c$ . When $\mathbf { B } _ { i , j } < ( \sigma _ { i } - \sigma _ { j } ) ^ { - 1 } c$ , the solution set becomes empty. Specially, if $\sigma _ { i } = \sigma _ { j } = \sigma$ , the hypersphere-shape contour will degenerate to a hyperplane: $z ^ { \top } ( \mu _ { i } - \mu _ { j } ) =$ $\begin{array} { r } { \frac { 1 } { 2 } \left[ \| \mu _ { i } \| _ { 2 } ^ { 2 } - \| \mu _ { j } \| _ { 2 } ^ { 2 } + \sigma ^ { - 1 } ( B _ { j } - B _ { i } + c ) \right] } \end{array}$ . For example, for the SCE loss, the solution of the contour is $z ^ { \top } ( W _ { i } - W _ { j } ) = b _ { j } - b _ { i } + c$ . For more general $\Sigma _ { i }$ , the conclusions are similar, e.g., the solution in Eq. (12) will become a hyperellipse. Now it easy to show that the solution of $\begin{array} { r l } { \mathcal { L } _ { y , } } & { { } = C } \end{array}$ when $y = k , \tilde { y } = \tilde { k }$ is the hypersphere:
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\| z - \mathbf { M } _ { k , \tilde { k } } \| _ { 2 } ^ { 2 } = \mathbf { B } _ { k , \tilde { k } } + \frac { \log ( C _ { e } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } .
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
According to the formula of the hypersphere surface area (Loskot & Beaulieu, 2007), the volume of $\Delta B _ { y , }$ is
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\mathrm { V o l } ( \Delta B _ { y , \tilde { y } } ) = \frac { 2 \pi ^ { \frac { d } { 2 } } } { \Gamma ( \frac { d } { 2 } ) } \left( \mathbf { B } _ { k , \tilde { k } } + \frac { \log ( C _ { e } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } \right) ^ { \frac { d - 1 } { 2 } } \cdot \Delta C ,
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
where $\Gamma ( \cdot )$ is the gamma function. Finally we can approximate the sample density as
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { l } { \displaystyle \mathbb { S } \mathbb { D } ( z ) \approx \frac { \Delta N } { \Delta B _ { y , } } } \\ { \displaystyle \propto \frac { N _ { k , \tilde { k } } \cdot p _ { k , \tilde { k } } ( C ) } { \left[ \mathbf { B } _ { k , \tilde { k } } + \frac { \log ( C _ { e } - 1 ) } { \sigma _ { k } - \sigma _ { \tilde { k } } } \right] ^ { \frac { d - 1 } { 2 } } } . } \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
# A.2 PROOF OF THEOREM 2
|
| 422 |
+
|
| 423 |
+
Similar to the proof of Theorem 1, there is
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\begin{array} { r l } { \Delta N = | Z ( \mathcal { D } _ { k } ) \cap \Delta B | } & { } \\ { = N _ { k } \cdot p _ { k } ( C ) \cdot \Delta C . } \end{array}
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
Unlike for the $\mathbf { g }$ -SCE, we can exactly calculate $\mathrm { V o l } ( \Delta B )$ for the MMC loss. Note that the solution of $\mathcal { L } _ { \mathrm { M M C } } = C$ is the hypersphere:
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\| z - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 } = 2 C .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
Figure 5: Intuitive illustration of the Max-Mahalanobis centers in the cases of $L = 2 , 3 , 4$ .
|
| 437 |
+
|
| 438 |
+
According to the formula of the hypersphere surface area (Loskot & Beaulieu, 2007), we have
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\operatorname { V o l } ( \Delta B ) = { \frac { 2 ^ { \frac { d + 1 } { 2 } } \pi ^ { \frac { d } { 2 } } C ^ { \frac { d - 1 } { 2 } } } { \Gamma ( { \frac { d } { 2 } } ) } } \cdot \Delta C ,
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
where $\Gamma ( \cdot )$ is the gamma function. Finally we can obtain the sample density as
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\begin{array} { l } { \displaystyle \mathbb { S D } ( z ) = \frac { \Delta N } { \Delta B } } \\ { \displaystyle \propto \frac { N _ { k } \cdot p _ { k } ( C ) } { C ^ { \frac { d - 1 } { 2 } } } . } \end{array}
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
# B TECHNICAL DETAILS
|
| 451 |
+
|
| 452 |
+
In this section, we provide more technical details we applied in our paper. Most of our experiments are conducted on the NVIDIA DGX-1 server with eight Tesla P100 GPUs.
|
| 453 |
+
|
| 454 |
+
# B.1 GENERATION ALGORITHM FOR THE MAX-MAHALANOBIS CENTERS
|
| 455 |
+
|
| 456 |
+
We give the generation algorithm for crafting the Max-Mahalanobis Centers in Algorithm 1, proposed by Pang et al. (2018). Note that there are two minor differences from the originally proposed algorithm. First is that in Pang et al. (2018) they use $C = \| \mu _ { i } \| _ { 2 } ^ { 2 }$ , while we use $C _ { \bf M M } = \| \mu _ { i } \| _ { 2 }$ . Second is that we denote the feature $z \in \mathbb { R } ^ { d }$ , while they denote $z \in \mathbb { R } ^ { p }$ . The Max-Mahalanobis centers generated in the low-dimensional cases are quite intuitive and comprehensible as shown in Fig. 5. For examples, when $L = 2$ , the Max-Mahalanobis centers are the two vertexes of a line segment; when $L = 3$ , they are the three vertexes of an equilateral triangle; when $L = 4$ , they are the four vertexes of a regular tetrahedron.
|
| 457 |
+
|
| 458 |
+
# Algorithm 1 GenerateMMcenters
|
| 459 |
+
|
| 460 |
+
<table><tr><td></td><td>Input: The constant CMm,the dimension of vectors d and the number of classes L.(L ≤d +1) Initialization: Let the L mean vectors be μ* = e1 and μ* = Od,i ÷ 1. Here e1 and Od separately</td><td></td><td></td><td></td></tr><tr><td>denote the first unit basis vector and the zero vector in Rd. fori=2 toL do</td><td></td><td></td><td></td><td></td></tr><tr><td>for j=1 toi-1 do</td><td>μ*(j)=-[1+(μ*,μ>·(L-1)]/[μ(j)·(L-1)]</td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td><td></td></tr><tr><td>H(i=√1-1*12</td><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>for k = 1 to L do</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>H=CMM·μ</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Return: The optimal mean vectors μ*,i ∈ [L].</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 461 |
+
|
| 462 |
+
# B.2 WHY THE SQUARED-ERROR FORM IS PREFERRED
|
| 463 |
+
|
| 464 |
+
In the feature space, penalizing the distance between the features and the prefixed centers can be regarded as a regression problem. In the MMC loss, we apply the squared-error form as $\| \boldsymbol { z } - \boldsymbol { \mu } _ { y } ^ { * } \| _ { 2 } ^ { 2 }$ Other substitutes could be the absolute form $\lVert \boldsymbol { z } - \boldsymbol { \mu } _ { y } ^ { * } \rVert _ { 2 }$ or the Huber form. As stated in Friedman et al. (2001), the absolute form and the Huber form are more resistant to the noisy data (outliers) or the misspecification of the class labels, especially in the data mining applications. However, in the classification tasks that we focus on in this paper, the training data is clean and reliable. Thus the squared-error form can lead to high accuracy with faster convergence rate compared to other forms. Furthermore, in the adversarial setting, the adversarial examples have similar properties as the outliers. When we apply the AT mechanism in the training procedure, we expect the classifiers to pay more attention to the adversarial examples, i.e., the outliers. Note that this goal is the opposite of it in the data mining applications, where outliers are intended to be ignored. Therefore, due to the sensitivity to the outliers, the squared-error form can better collaborate with the AT mechanism to improve robustness.
|
| 465 |
+
|
| 466 |
+
Besides, the MMC loss can naturally perform stronger AT mechanism without additional regularizer term. Specifically, let $x$ be the clean input, $x ^ { * }$ be the adversarial example crafted based on $x$ , then in the adversarial logit pairing (ALP) method (Kannan et al., 2018), there is an extra regularizer except for SCE as:
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\| z ( x ) - z ( x ^ { * } ) \| _ { 2 } ^ { 2 } .
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
When adding $x ^ { * }$ as an extra training point for MMC, then the MMC loss will minimize $\| z ( x ) - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 } +$ $\| z ( x ^ { * } ) - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 }$ , which is an upper bound for $\begin{array} { r } { \frac { 1 } { 2 } \| z ( x ) - z ( x ^ { * } ) \| _ { 2 } ^ { 2 } } \end{array}$ . Thus performing naive adversarial training (Goodfellow et al., 2015; Madry et al., 2018) with MMC is equivalent to performing stronger adversarial training variants like ALP. As analyzed above, the squared-error form in the MMC loss can accelerate the convergence of the AT mechanism, since the objective is sensitive to the crafted adversarial examples.
|
| 473 |
+
|
| 474 |
+
# B.3 VARIANTS OF THE MMC LOSS
|
| 475 |
+
|
| 476 |
+
In the MMC loss, we encourage the features to gather around the preset Max-Mahalanobis (MM) centers $\mu ^ { * } = \{ \mu _ { l } ^ { * } \} _ { l \in [ L ] }$ , which leads to many attractive properties. However, this ’hard’ supervision, which induces quite an orderly feature distribution may beyond the reach of the model capability, especially when the classification tasks themselves are already challenging to learn, e.g., ImageNet (Deng et al., 2009). Therefore, we propose potential variants of the MMC loss that could probably solve the problem and make our method more adaptable. We leave the experimental investigations as future work.
|
| 477 |
+
|
| 478 |
+
Note that the MMC loss can be regarded as minimizing the negative log likelihood (NLL) of $- \log ( P ( z | y ) )$ , where the conditional feature distribution is modeled as $\mathsf { \bar { z } } | y \sim \mathcal N ( \mu _ { y } ^ { * } , I )$ . As described above, this distribution model may not be easy to learn by the DNNs in some cases. Thus, we construct a softer model: $z | y , \mu _ { y } \sim \mathcal { N } ( \mu _ { y } , I )$ and $\mu _ { y } \sim \mathcal { N } ( \mu _ { y } ^ { * } , \alpha I )$ , where $\alpha > 0$ is a scalar. Here we give the feature center $\mu _ { y }$ a prior distribution, while the prior is centered at $\mu _ { y } ^ { * }$ . Intuitively, we relax the constraint that the features have to gather around $\mu _ { y } ^ { * }$ . Instead, we encourage the features to gather around a substitute $\mu _ { y }$ , while $\mu _ { y }$ should be in the vicinity of $\mu _ { y } ^ { * }$ . In the training, we minimize the joint NLL of $- \log ( P ( z , \mu _ { y } | y ) ) = - \log ( P ( z | y , \mu _ { y } ) ) - \log ( \tilde { P ( \mu _ { y } ) } )$ , which is equivalent to minimize the what we call elastic Max-Mahalanobis center (EMC) loss as:
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\mathcal { L } _ { \mathrm { E M C } } ( Z ( x ) , y ) = \frac { 1 } { 2 } \| z - \mu _ { y } \| ^ { 2 } + \frac { 1 } { 2 \alpha } \| \mu _ { y } - \mu _ { y } ^ { * } \| ^ { 2 } .
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
Here $\mu = \{ \mu _ { l } \} _ { l \in [ L ] }$ are simply extra trainable parameters, the prior variance $\alpha$ is a hyperparameter. When $\alpha 0$ , the EMC loss degenerates to the MMC loss. Note that although $\mu _ { l } ^ { * }$ are all on the hypersphere $\{ \mathbf { z } \in \mathbb { R } ^ { d } | \| \mathbf { z } \| = C _ { \mathrm { M M } } \}$ , the support sets of $\mu _ { l }$ are the entire feature space $\mathbb { R } ^ { d }$ .
|
| 485 |
+
|
| 486 |
+
Further improvement can be made w.r.t. the MM centers $\mu ^ { * }$ . An implicit assumption behind the generation process of $\mu ^ { * }$ is that any two classes are mutually independent. This assumption could be approximately true for MNIST and CIFAR-10, but for more complex datasets, e.g., CIFAR-100 or ImageNet, this assumption may not be appropriate since there are structures in the relation among classes. These structures can usually be visualized by a tree. To solve this problem, we introduce the hierarchical Max-Mahalanobis (HM) centers $\mu ^ { \mathrm { H } } = \{ \mu _ { l } ^ { \mathrm { H } } \} _ { l \in [ L ] }$ , which adaptively craft the centers according to the tree structure. Specifically, we first assign a virtual center (i.e., the origin) to the root node. For any child node $n _ { c }$ in the tree, we denote its parent node as $n _ { p }$ , and the number of its brother nodes as $L _ { c }$ . We locally generate a set of MM centers as $\mu ^ { ( s , L _ { c } ) } =$ GenerateMMcenters $\left( C ^ { s } , d , L _ { c } \right)$ , where $s$ is the depth of the child node $n _ { c }$ , $C ^ { s }$ is a constant with smaller values for larger $s$ . Then we assign the virtual center to each child node of $n _ { p }$ from $\mu _ { n _ { p } } + \mu ^ { ( s , L _ { c } ) }$ , i.e., a shifted set of crafted MM centers, where $\mu _ { n _ { p } }$ is the virtual center assigned to $n _ { p }$ . If the child node $n _ { c }$ is a leaf node, i.e., it correspond to a class label $l$ , then there is $\mu _ { l } ^ { \mathrm { H } } = \mu _ { n _ { c } }$ . For example, in the CIFAR-100 dataset, there are 20 superclasses, with 5 classes in each superclass. We first craft $2 0 ~ \mathrm { M M }$ centers as $\mu ^ { ( 1 , 2 0 ) } =$ GenerateMMcenters $( C ^ { 1 } , d , 2 0 )$ and 5 MM centers as $\mu ^ { ( 2 , 5 ) } =$ GenerateMMcenters $( C ^ { 2 } , d , 5 )$ , where $C ^ { 2 } \ll C ^ { 1 }$ . Note that $\mu ^ { ( 2 , 5 ) }$ could be different for each superclass, e.g., by a rotation transformation. Then if the label $l$ is the $j$ -th class in the $i$ -th superclass, there is $\mu _ { l } ^ { \mathrm { H } } = \mu _ { i } ^ { ( 1 , 2 0 ) } + \mu _ { j } ^ { ( 2 , 5 ) }$
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
Figure 6: Intuitive demonstration of the attacking mechanisms under different adaptive objectives. Here $_ y$ is the original label, $\begin{array} { r l } { \tilde { y } } & { { } = } \end{array}$ arg $\operatorname* { m a x } _ { l \neq y } h _ { l }$ is the label of the nearest other decision region w.r.t. the feature $_ z$ , and $y _ { t }$ is the target label of targeted attacks.
|
| 490 |
+
|
| 491 |
+
# B.4 ADAPTIVE OBJECTIVES AND THE INDUCED ATTACKING MECHANISMS
|
| 492 |
+
|
| 493 |
+
We apply the adaptive versions of existing attacks when evading the networks trained by the MMC loss. Wmode: $\mathcal { L } _ { \mathrm { A d a } } ^ { \bf u \bar { n } , 1 } = - \dot { \mathcal { L } } _ { \mathrm { M M C } } ( z , y )$ a; $\mathcal { L } _ { \mathrm { A d a } } ^ { \bar { \bf u n } , 2 } = \mathcal { L } _ { \mathrm { M M C } } ( z , \tilde { y } ) - \mathcal { L } _ { \mathrm { M M C } } ( z , y )$ $\mathcal { L } _ { \mathrm { { A d a } } }$ o minimize under the untargeted, and under the targeted mode: $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathrm { t a r } , 1 } { = } \mathcal { L } _ { \mathrm { M M C } } ( z , y _ { t } )$ ; $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathrm { t a r } , 2 } = \mathcal { L } _ { \mathrm { M M C } } ( z , y _ { t } ) { - \mathcal { L } _ { \mathrm { M M C } } ( z , y ) }$ , where $y _ { t }$ is the targeted label, $\tilde { y }$ is generally the highest predicted label except for by Carlini & Wagner (2017a;b). Spe $y$ as defined in Sec. 3.2. These ofically, the adaptive objectives ves rand previous workare used in the $\bar { \mathcal { L } } _ { \mathrm { A d a } } ^ { \mathrm { t a r } , 1 }$ $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathbf { u n } , 1 }$ PGD, MIM and SPSA attacks, while the objectives Ltar,2Ada and $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathbf { u n } , 2 }$ Ada Ada are used in the C&W attacks.
|
| 494 |
+
|
| 495 |
+
In Fig. 6, we demonstrate the attacking mechanisms induced by different adaptive adversarial objectives. Note that we only focus on the gradients and ignore the specific method which implements the attack. Different adaptive objectives are preferred under different adversarial goals. For examples, when decreasing the confidence of the true label is the goal, $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathbf { u n } , 1 }$ is the optimal choice; in order to mislead the classifier to predict an untrue label or the target label, $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathbf { u n } , 2 }$ and $ { \mathcal { L } } _ { \mathrm { A d a } } ^ { \mathrm { t a r } , 2 }$ are the optimal choices, respectively. Sometimes there are additional detectors, then the adversarial examples generated by $\mathcal { L } _ { \mathrm { A d a } } ^ { \mathrm { t a r } , 1 }$ could be assigned to the target label with high confidence by the classifiers.
|
| 496 |
+
|
| 497 |
+
# B.5 RELATED WORK IN THE FACE RECOGNITION AREA
|
| 498 |
+
|
| 499 |
+
There are many previous work in the face recognition area that focus on angular margin-based softmax (AMS) losses (Liu et al., 2016; 2017; Liang et al., 2017; Wang et al., 2018; Deng et al., 2019). They mainly exploit three basic operations: weight normalization (WN), feature normalization (FN), and angular margin (AN). It has been empirically shown that WN can benefit the cases with unbalanced data (Guo & Zhang, 2017); FN can encourage the models to focus more on hard examples (Wang et al., 2017); AN can induce larger inter-class margins and lead to better generalization in different facial tasks (Wang et al., 2018; Deng et al., 2019). However, there are two critical differences between our MMC loss and these AMS losses:
|
| 500 |
+
|
| 501 |
+
Table 5: Classification accuracy $( \% )$ on the white-box adversarial examples crafted on the test set of CIFAR-10 and CIFAR-100. The results w.r.t the MMC loss are reported under the adaptive versions of different attacks. MMC can better exploit deep architectures, while SCE cannot.
|
| 502 |
+
|
| 503 |
+
<table><tr><td rowspan="2">Methods</td><td rowspan="2">Cle.</td><td colspan="4">Perturbation ε = 8/255</td><td colspan="4">Perturbation ε = 16/255</td></tr><tr><td>PGD</td><td>PGD1</td><td>PGD5</td><td>PGD50</td><td>PGD</td><td>PGD</td><td>PGD5</td><td>PGD3</td></tr><tr><td colspan="9">CIFAR-10</td></tr><tr><td>SCE (Res.32)</td><td>93.6</td><td><1</td><td>3.7</td><td><1</td><td>3.6</td><td><1</td><td>2.7</td><td><1</td><td>2.9</td></tr><tr><td>MMC (Res.32)</td><td>92.7</td><td>48.7</td><td>36.0</td><td>26.6</td><td>24.8</td><td>36.1</td><td>25.2</td><td>13.4</td><td>17.5</td></tr><tr><td>SCE (Res.110) MMC (Res.110)</td><td>94.7 93.6</td><td>≤1 54.7</td><td>3.0 46.0</td><td>≤1 34.4</td><td>2.9 31.4</td><td><1 41.0</td><td>2.1 30.7</td><td>≤1 16.2</td><td>2.0 21.6</td></tr><tr><td colspan="10">CIFAR-100</td></tr><tr><td>SCE (Res.32)</td><td>72.3</td><td><1</td><td>7.8</td><td><1</td><td>7.4</td><td><1</td><td>4.8</td><td><1</td><td>4.7</td></tr><tr><td>MMC (Res.32)</td><td>71.9</td><td>23.9</td><td>23.4</td><td>15.1</td><td>21.9</td><td>16.4</td><td>16.7</td><td>8.0</td><td>15.7</td></tr><tr><td>SCE (Res.110)</td><td>74.8</td><td>≤1</td><td>7.5</td><td>≤1</td><td>7.3</td><td>≤1</td><td>4.7</td><td>≤1</td><td>4.5</td></tr><tr><td>MMC (Res.110)</td><td>73.2</td><td>34.6</td><td>22.4</td><td>23.7</td><td>16.5</td><td>24.1</td><td>14.9</td><td>13.9</td><td>10.5</td></tr></table>
|
| 504 |
+
|
| 505 |
+
# Difference one: The inter-class margin
|
| 506 |
+
|
| 507 |
+
• The AMS losses induce the inter-class margins mainly by encouraging the intra-class compactness, while the weights are not explicitly forced to have large margins (Qi & Zhang, 2018).
|
| 508 |
+
|
| 509 |
+
• The MMC loss simultaneously fixes the class centers to be optimally dispersed and encourages the intra-class distribution to be compact. Note that both of the two mechanisms can induce inter-class margins, which can finally lead to larger inter-class margins compared to the AMS losses.
|
| 510 |
+
|
| 511 |
+
# Difference two: The normalization
|
| 512 |
+
|
| 513 |
+
• The AMS losses use both WN and FN to exploit the angular metric, which makes the normalized features distribute on hyperspheres. The good properties of the AMS losses are at the cost of abandoning the radial degree of freedom, which may reduce the capability of models.
|
| 514 |
+
|
| 515 |
+
• In the MMC loss, there is only WN on the class centers, i.e., $\| \mu _ { y } ^ { * } \| = C _ { \mathrm { M M } }$ , and we leave the degree of freedom in the radial direction for the features to keep model capacity. However, note that the MMC loss $\| z - \mu _ { y } ^ { * } \| _ { 2 } ^ { 2 } \geq ( \| z \| _ { 2 } - C _ { \mathrm { M M } } ) ^ { 2 }$ is a natural penalty term on the feature norm, which encourage $\left. z \right. _ { 2 }$ to not be far from $C _ { \mathrm { M M } }$ . This prevents models from increasing feature norms for easy examples and ignoring hard examples, just similar to the effect caused by FN but more flexible.
|
md/train/BygFVAEKDH/BygFVAEKDH.md
ADDED
|
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING KNOWLEDGE DISTILLATION IN NON-AUTOREGRESSIVE MACHINE TRANSLATION
|
| 2 |
+
|
| 3 |
+
Chunting Zhou1∗, Jiatao $\mathbf { G u ^ { 2 * } }$ , Graham Neubig1
|
| 4 |
+
|
| 5 |
+
Language Technologies Institute, Carnegie Mellon University Facebook AI Research2 {chuntinz, gneubig}@cs.cmu.edu, jgu@fb.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Non-autoregressive machine translation (NAT) systems predict a sequence of output tokens in parallel, achieving substantial improvements in generation speed compared to autoregressive models. Existing NAT models usually rely on the technique of knowledge distillation, which creates the training data from a pretrained autoregressive model for better performance. Knowledge distillation is empirically useful, leading to large gains in accuracy for NAT models, but the reason for this success has, as of yet, been unclear. In this paper, we first design systematic experiments to investigate why knowledge distillation is crucial in NAT training. We find that knowledge distillation can reduce the complexity of data sets and help NAT to model the variations in the output data. Furthermore, a strong correlation is observed between the capacity of an NAT model and the complexity of the distilled data that provides the best translation quality. Based on these findings, we further propose several approaches that can alter the complexity of data sets to improve the performance of NAT models. We achieve state-of-theart performance for NAT-based models, and close the gap with the autoregressive baseline on the WMT14 En-De benchmark.1
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Traditional neural machine translation (NMT) systems (Bahdanau et al., 2015; Gehring et al., 2017; Vaswani et al., 2017) generate sequences in an autoregressive fashion; each target token is predicted step-by-step by conditioning on the previous generated tokens in a monotonic (e.g. left-to-right) order. While such autoregressive translation (AT) models have proven successful, the sequential dependence of decisions precludes taking full advantage of parallelism afforded by modern hardware (e.g. GPUs) at inference time. In contrast, non-autoregressive translation (NAT) models (Gu et al., 2018; Lee et al., 2018) predict the whole sequence or multi-token chunks of the sequence simultaneously, alleviating this problem by trading the model’s capacity for decoding efficiency. Such a non-autoregressive factorization assumes that the output tokens are independent from each other. However, this assumption obviously does not hold in reality and as a result NAT models generally perform worse than standard AT models.
|
| 14 |
+
|
| 15 |
+
One key ingredient in the training recipe for NAT models that is used in almost all existing works (Gu et al. (2018); Lee et al. (2018); Stern et al. (2019), inter alia) is creation of training data through knowledge distillation (Hinton et al., 2015). More precisely, sequence-level knowledge distillation (Kim & Rush, 2016) – a special variant of the original approach – is applied during NAT model training by replacing the target side of training samples with the outputs from a pre-trained AT model trained on the same corpus with a roughly equal number of parameters. It is usually assumed (Gu et al., 2018) that knowledge distillation’s reduction of the “modes” (alternative translations for an input) in the training data is the key reason why distillation benefits NAT training. However, this intuition has not been rigorously tested, leading to three important open questions:
|
| 16 |
+
|
| 17 |
+
• Exactly how does distillation reduce the “modes”, and how we could we measure this reduction quantitatively? Why does this reduction consistently improve NAT models? • What is the relationship between the NAT model (student) and the AT model (teacher)? Are different varieties of distilled data better for different NAT models? • Due to distillation, the performance of NAT models is largely bounded by the choice of AT teacher. Is there a way to further close the performance gap with standard AT models?
|
| 18 |
+
|
| 19 |
+
In this paper, we aim to answer the three questions above, improving understanding of knowledge distillation through empirical analysis over a variety of AT and NAT models. Specifically, our contributions are as follows:
|
| 20 |
+
|
| 21 |
+
• We first visualize explicitly on a synthetic dataset how modes are reduced by distillation (§3.1). Inspired by the synthetic experiments, we further propose metrics for measuring complexity and faithfulness for a given training set. Specifically, our metrics are the conditional entropy and KL-divergence of word translation based on an external alignment tool, and we show that these metrics are correlated with NAT model performance (§3.2). We conduct a systematic analysis (§4) over four AT teacher models and six NAT student models with various architectures on the standard WMT14 English-German translation benchmark. These experiments find a strong correlation between the capacity of an NAT model and the optimal dataset complexity that results in the best translation quality.
|
| 22 |
+
• Inspired by these observations, we propose approaches to further adjust the complexity of the distilled data in order to match the model’s capacity (§5). We also show that we can achieve the state-of-the-art performance for NAT models and largely match the performance of the AT model.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
# 2.1 NON-AUTOREGRESSIVE NEURAL MACHINE TRANSLATION
|
| 27 |
+
|
| 28 |
+
In order to model the joint probability of the output sequence $\textbf { { y } }$ , NMT models usually generate each output token conditioned on the previously generated ones $\begin{array} { r } { p ( \pmb { y } | \pmb { x } ) = \prod _ { t = 1 } ^ { T } p ( y _ { t } | \pmb { y } _ { < t } , \pmb { x } ) } \end{array}$ . This is known as the autoregressive factorization. To generate a translation from this model, one could predict one token at a time from left to right and greedily take arg max over each output probability distribution, or use beam search to consider a fixed number of hypotheses. In this work, we study non-autoregressive translation (NAT), a special subset of NMT models with an additional restriction (the zeroth-order Markov assumption) upon the output predictions or a subset thereof. The simplest formulation of an NAT model independently factors the conditional distribution: $\begin{array} { r } { p ( \pmb { y } | \pmb { x } ) = \overline { { \prod _ { t = 1 } ^ { T } p ( y _ { t } | \pmb { x } ) } } } \end{array}$ .
|
| 29 |
+
|
| 30 |
+
Standard NAT models (Gu et al., 2018) adopt an architecture similar to the Transformer (Vaswani et al., 2017) and make non-autoregressive predictions for the entire sequence with one forward pass of the decoder. However, because multiple translations are possible for a single input sentence (the so-called multi-modality problem; Gu et al. (2018)), vanilla NAT models can fail to capture the dependencies between output tokens. As a result, they tend to make egregious mistakes such as outputting tokens repeatedly. To improve the model’s ability to handle multi-modality, recent works have incorporated approaches including (1) relaxing the fully non-autoregressive restriction and adopting $K$ decoding passes (instead of just one) to iteratively refine the generated outputs (Lee et al., 2018; Ghazvininejad et al., 2019; Wang et al., 2018; Stern et al., 2018; 2019; Gu et al., 2019); (2) using latent variables (Kaiser et al., 2018; Ma et al., 2019; Shu et al., 2019) or structured information such as syntax trees (Akoury et al., 2019) to capture translation variation; (3) training NAT models with objectives other than maximum likelihood (Wang et al., 2019; Wei et al., 2019; Shao et al., 2019) which ameliorates the effects of multi-modality. However, to achieve competitive performance with the autoregressive model, almost all existing NAT models rely on training using data distilled from a pre-trained AT model instead of the real parallel training set, as described below.
|
| 31 |
+
|
| 32 |
+
# 2.2 SEQUENCE-LEVEL KNOWLEDGE DISTILLATION
|
| 33 |
+
|
| 34 |
+
Knowledge distillation (Liang et al., 2008; Hinton et al., 2015) was originally proposed for training a weaker student classifier on the targets predicted from a stronger teacher model. A typical approach is using the label probabilities produced by the teacher as “soft targets” $q _ { i } =$ $\mathrm { e x p } ( z _ { i } \bar { / \tau } ) / { \sum _ { j } \mathrm { e x p } ( z _ { j } \bar { / \tau } ) }$ for training the student model, where $q _ { i }$ and $z _ { i }$ are the probability and the logit of class $i$ respectively and $\tau$ is the temperature. Prior work has shown the effectiveness of adopting knowledge distillation in adversarial defense (Papernot et al., 2016), neural network compression (Howard et al., 2017), and fast inference for speech synthesis (Oord et al., 2018).
|
| 35 |
+
|
| 36 |
+
In the context of sequence generation, Kim & Rush (2016) extend knowledge distillation to the sentence level using “hard targets” from a pretrained large teacher model to train a small sequence generation model. More precisely, the teacher distribution $q ( t | x )$ is approximated by its mode: $\begin{array} { r } { \bar { q } ( { \pmb t } | { \pmb x } ) \approx \mathbb { 1 } \{ { \pmb t } = \arg \operatorname* { m a x } _ { { \pmb t } \in { \mathcal T } } q ( { \pmb t } | { \pmb x } ) \} } \end{array}$ with the following objectives:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathcal { L } _ { \mathrm { s e q } , \mathrm { K D } } = - \mathbb { E } _ { \mathbf { x } \sim \mathrm { d a t a } } \sum _ { t \in \mathcal { T } } q ( t | x ) \log p ( t | x ) \approx - \mathbb { E } _ { \mathbf { x } \sim \mathrm { d a t a } , \hat { y } = \mathbf { a r g } \operatorname* { m a x } _ { t \in \mathcal { T } } \mathbf { \Phi } } q ( t | x ) \left[ \log p ( t = \hat { y } | x ) \right] ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $t \in \tau$ is the space of possible target sequences. This can also be seen as a special case of standard distillation over the sentence space when the temperature $\tau$ approaches 0, which is equivalent to taking the arg max over all feasible translations. While the “hard target” $\hat { y }$ is the most likely translation predicted by the teacher, in practice we use beam search as an approximation. As mentioned earlier, almost all the existing literature trains NAT models using sequence-level knowledge distillation from a pre-trained AT model to achieve competitive performance. Particularly, it is common to train the teacher model as a standard autoregressive Transformer (Vaswani et al., 2017) with a roughly equal number of trainable parameters as the desired NAT model on the real data. Next, we will first study how this knowledge distillation process affects the behavior of NAT models.
|
| 43 |
+
|
| 44 |
+
# 3 HOW DOES DISTILLATION IMPROVE NAT?
|
| 45 |
+
|
| 46 |
+
In this section, we start from an introductory example to illustrate how NAT models fail to capture the multi-modality of data. Then we propose a metric to assess the multi-modality of a data set and use it to test our hypothesis about how knowledge distillation affects NAT models.
|
| 47 |
+
|
| 48 |
+
# 3.1 SYNTHETIC EXPERIMENT FOR MULTI-MODALITY
|
| 49 |
+
|
| 50 |
+
Dataset. We start by investigating NAT’s difficulties in modeling multi-modality in output data using a synthetic setup where we explicitly include multiple modes in the training data. More specifically, we utilize three language pairs – English-German (En-De), English-French (En-Fr), and English-Spanish (En-Es) – from the Europarl parallel corpus.2 We extract sentences that have aligned sentences for all languages, and create a multi-target En-De/Es/Fr corpus. In this case every English input sentence always corresponds to target sentences in three different languages, which forms three explicit output modes. Notably, this is similar to the one-to-many translation setting in Johnson et al. (2017) but in our case we do not have an explicit signal (e.g. target language tag) to tell the NMT model which target language to translate to.
|
| 51 |
+
|
| 52 |
+
Models. We train both the AT and NAT models on this concatenated data set, then compare the distributions of translations with each other. We use the standard Transformer(base) model (Vaswani et al., 2017) as the AT model, and a simplified version of Gu et al. (2018) as the NAT model where the decoder’s inputs are monotonically copied from the encoder embeddings and a length predictor is learned to predict the target sentence length. Both models are trained for 300, 000 steps using maximum likelihood. After training, we use both models to translate the English sentences in the validation and test sets.
|
| 53 |
+
|
| 54 |
+
Visualization of AT Outputs. The synthetic setup enables us to better understand and visualize the modes in the outputs more easily. First, we visualize the outputs from the AT model. For every translated sentence, we visualize the estimated probability distribution of language classes as a point in Fig. 1 (a). This probability is calculated as the average of the posterior probability of each token, and it is estimated based on the Bayes’ law:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
p ( l _ { i } | \pmb { y } ) \approx \frac { 1 } { T } \sum _ { t = 1 } ^ { T } p ( l _ { i } | y _ { t } ) = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \frac { p ( y _ { t } | l _ { i } ) p ( l _ { i } ) } { \sum _ { k } p ( y _ { t } | l _ { k } ) p ( l _ { k } ) }
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 1: Posterior distribution of language IDs for the outputs from different models. Each translation is represented as a point inside the simplex $\Delta ^ { 2 } = \{ ( p _ { \mathrm { d e } } , p _ { \mathrm { e s } } , p _ { \mathrm { f r } } ) | p _ { k } \in ( 0 , 1 ) , p _ { \mathrm { d e } } + p _ { \mathrm { e s } } + p _ { \mathrm { f r } } = 1 \}$ where $p _ { k }$ is the estimated probability of being translated into language $k \in ( \mathrm { d e } , \mathrm { e s } , \mathrm { f r } )$ . We distinguish the language that has the largest probability with different colors.
|
| 62 |
+
|
| 63 |
+
where $l _ { i }$ denotes the language class $i$ , and $p ( y _ { t } | l _ { i } )$ is the token frequency of $y _ { t }$ in language $l _ { i }$ . We assume $p ( l _ { i } )$ follows a uniform distribution. As shown in Fig. 1 (a), points of the AT outputs are clustered closely to each vertex of the simplex, indicating that the AT model prefers to generate the whole sequence in one language. This phenomenon verifies our assumption that decoding with the AT model (distillation) is essentially selecting “modes” over the real data.
|
| 64 |
+
|
| 65 |
+
Visualization of NAT Outputs. We visualize outputs for the NAT model trained on the same data in Fig. 1 (b). In contrast to the AT results, the NAT points are scattered broadly inside the simplex, indicating that the NAT model fails to capture the mode of language types. Instead, it predicts tokens mixed with multiple languages, which corroborates our hypothesis that the NAT model has trouble consistently selecting a single mode when multiple modes exist.
|
| 66 |
+
|
| 67 |
+
Next, we create two datasets that have fewer modes than the original dataset. First, we randomly select a single target sentence from one of the three languages for each source sentence. Second, we perform distillation, decoding from the AT model trained on the combined training set. As noted in the AT results, distillation will also roughly be selecting a language mode, but we conjecture that this selection may be more systematic, selecting a particular language for a particular type of training sentence. As shown in Fig. 1(c) (d), NAT models trained on both of these datasets are more likely to choose one mode (language) when generating translations, showing that training with reduced modes is essential for NAT model. Furthermore, points in Fig. 1 (d) are clearly clustered better than (c) indicating that modes selected by AT models are indeed likely more systematic and easy to capture than those generated by randomly assigning a language for each sentence.
|
| 68 |
+
|
| 69 |
+
# 3.2 QUANTITATIVE MEASURES FOR PARALLEL DATA
|
| 70 |
+
|
| 71 |
+
To better study why distillation is crucial for NAT models, in this section, we propose quantitative measures for analyzing the complexity and faithfulness of parallel data, two properties that we hypothesize are important for NAT training.
|
| 72 |
+
|
| 73 |
+
Measure of Complexity. Inspired by the observations in the synthetic experiments, we propose to use a measure of translation uncertainty, specifically operationalized as conditional entropy, as the measurement of complexity $C ( d )$ for any given dataset $d = \{ ( \pmb { x } _ { 1 } , \pmb { y } _ { 1 } ) , . . . , ( \pmb { x } _ { N } , \pmb { y } _ { N } ) \}$ , where $( { \pmb x } , { \pmb y } )$ is sentence pair instantiation of $( \mathbf { \bar { X } } , \mathbf { Y } )$ and $\mathbf { X } \in { \mathcal { X } } , \mathbf { Y } \in { \mathcal { Y } }$ :
|
| 74 |
+
|
| 75 |
+
asm.1: conditional independence
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } { \mathcal { H } ( { \mathbf { Y } } | { \mathbf { X } } = x ) = \displaystyle \sum _ { y \in \mathcal { Y } } p ( y | x ) \log p ( y | x ) } \\ & { ~ \mathrm { ~ } } \\ { \approx \displaystyle \sum _ { y \in \mathcal { Y } } ( \displaystyle \prod _ { \substack { l = 1 } } ^ { T _ { y } } p ( y | x ) ) ( \displaystyle \sum _ { t = 1 } ^ { T _ { y } } \log p ( y _ { t } | x ) ) } \\ & { ~ \approx \displaystyle \sum _ { t = 1 } ^ { T _ { y } } \displaystyle \sum _ { y _ { t } < A ( x ) } p ( y _ { t } | \mathrm { A l i g n } ( y _ { t } ) ) \log p ( y _ { t } | \mathrm { A l i g n } ( y _ { t } ) ) } \\ & { ~ = \displaystyle \sum _ { t = 1 } ^ { T _ { x } } \mathcal { H } ( y | x = x _ { t } ) } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
<table><tr><td>d</td><td>En-De</td><td>En-Es</td><td></td><td>En-Fr丨Full Real Data</td><td>Random Selection</td><td>Distillation</td></tr><tr><td>C(d)</td><td>3.12</td><td>2.81</td><td>2.89</td><td>3.67</td><td>3.30</td><td>2.64</td></tr></table>
|
| 82 |
+
|
| 83 |
+
Table 1: Complexity $C ( d )$ $\uparrow$ more complex) of the Europarl data set of different settings in $\ S 3 . 1$ .
|
| 84 |
+
|
| 85 |
+
where we use $x$ and $y$ to denote a word in the source and target vocabulary respectively. $T _ { x }$ and $T _ { y }$ denote the length of the source and target sentences. To make the computation tractable, we make two additional assumptions on the conditional distribution $p ( \pmb { y } | \pmb { x } )$ :
|
| 86 |
+
|
| 87 |
+
• Assumption 1: We assume the target tokens are independent given the source sentence. Then the conditional entropy of a sentence can be converted into the sum of entropy of target words conditioned on the source sentence $_ { \textbf { \em x } }$ .
|
| 88 |
+
• Assumption 2: We assume the distribution of $p ( y _ { t } | \pmb { x } )$ follows an alignment model (Dyer et al., $2 0 1 3 ) ^ { \bar { 3 } }$ where $y _ { t }$ is is generated from the word alignment distribution $p ( y _ { t } | \mathrm { A l i g n ( y _ { t } ) } )$ . This makes it possible to simplify the conditional entropy to the sum of entropy of target words conditioned on the aligned source words denoted $\mathcal { H } ( y \vert x = x _ { t } )$ ).
|
| 89 |
+
|
| 90 |
+
The corpus level complexity $C ( d )$ is then calculated by adding up the conditional entropy $\mathcal { H } ( \mathbf { Y } | \mathbf { X } =$ ${ \pmb x } )$ of all sentences. To prevent $C ( d )$ from being dominated by frequent words, we calculate $\ddot { C } ( d )$ by averaging the entropy of target words conditioned on a source word, denoted $C ( d ) \ =$ $\begin{array} { r } { \frac { 1 } { | \mathcal { V } _ { x } | } \overset { \cdot } { \sum _ { x \in \mathcal { V } _ { x } } } \mathcal { H } ( y | x ) } \end{array}$ .
|
| 91 |
+
|
| 92 |
+
To illustrate that the proposed metric is a reasonable measure of complexity of a parallel corpus, in Tab. 1 we compute $C ( d )$ for parallel data from different language pairs, the concatenated data set, and the data distilled from the AT model described in $\ S 3 . 1$ . We observe that the conditional entropy of the distilled data is much smaller than that of the concatenated or randomly selected data mentioned above. Additionally, we find that the conditional entropy of En-Es and En-Fr are similar but that of En-De is relatively larger, which can also explain why the student NAT model prefers to predict the modes of Es or Fr more often than De as shown in Fig. 1(d).
|
| 93 |
+
|
| 94 |
+
Measure of Faithfulness. $C ( d )$ reflects the level of multi-modality of a parallel corpus, and we have shown that a simpler data set is favorable to an NAT model. However, it is not fair to assess the data set only by its complexity; we can trivially construct a simple data set with no variations in the output, which obviously won’t be useful for training. The other important measurement of the data set is its faithfulness to the real data distribution. To measure the faithfulness of a parallel corpus $d$ , we use KL-divergence of the alignment distribution between the real parallel data set $r$ and an altered parallel data set $d$ , denoted $F ( d )$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
F ( d ) = \frac { 1 } { | \mathcal { V } _ { x } | } \sum _ { x \in \mathcal { V } _ { x } } \sum _ { y \in \mathcal { V } _ { y } } p _ { r } ( y | x ) \log \frac { p _ { r } ( y | x ) } { p _ { d } ( y | x ) }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 4 EMPIRICAL STUDY
|
| 101 |
+
|
| 102 |
+
In this section, we perform an extensive study over a variety of non-autoregressive (NAT) models trained from different autoregressive (AT) teacher models to assess how knowledge distillation affects the performance of NAT models.
|
| 103 |
+
|
| 104 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 105 |
+
|
| 106 |
+
Data. We use the data set commonly used by prior work as our evaluation benchmark: WMT14 English-German $( \mathrm { E n - D e } ) ^ { 4 }$ . We use newstest2013 as the validation set for selecting the best model, and newstest2014 as the test set. We learn a byte-pair encoding (BPE, Sennrich et al., 2016) vocabulary of 37,000 on the tokenized data.
|
| 107 |
+
|
| 108 |
+
AT Models. We set up four Transformer models with different parameter sizes: Transformertiny/small/base/big denoted as tiny, small, base, big respectively. We build base and big models following settings described in Vaswani et al. (2017), and reduce the model sizes for tiny, small to create weaker teacher models. Details of the model architectures can be found in Appendix A.
|
| 109 |
+
|
| 110 |
+
All the models are trained using the Adam optimizer (Kingma & Ba, 2014) with the maximum number of steps set to 300, 000. After training, we use the resulting AT models to decode the whole training set with beam size 5 and replace the real target sentences to create a new parallel corpus.
|
| 111 |
+
|
| 112 |
+
NAT Models. We consider the following NAT models, from vanilla to state-of-the-art. All the models are using the Transformer as the basic backbone and are (re-)implemented based on Fairseq5 except for FlowSeq. We briefly outline the methods and parameters here, and describe detailed settings in the Appendix A.
|
| 113 |
+
|
| 114 |
+
• Vanilla NAT (Gu et al., 2018): Similarly to $\ S 3 . 1$ , we use a simplified version where the decoder’s inputs are directly copied from the encoder without considering latent variables.
|
| 115 |
+
• FlowSeq (Ma et al., 2019): FlowSeq adopts normalizing flows (Kingma & Dhariwal, 2018) as the latent variables to model the mappings from source sentences to a latent space.
|
| 116 |
+
• NAT with Iterative Refinement (iNAT, Lee et al., 2018): iNAT extends the vanilla NAT by iteratively reading and refining the translation. The number of iterations is set to 10 for decoding.
|
| 117 |
+
• Insertion Transformer (InsT, Stern et al., 2019): InsT adopts a similar architecture as iNAT while generating the sequence by parallel insertion operations. Here, we only consider InsT trained with uniform loss as described in the original paper.
|
| 118 |
+
• MaskPredict (MaskT, Ghazvininejad et al., 2019): MaskT adopts a masked language model (Devlin et al., 2018) to progressively generate the sequence from an entirely masked input. The number of iterations is set to be 10.
|
| 119 |
+
• Levenshtein Transformer (LevT, Gu et al., 2019): LevT uses similar architectures as in InsT and MaskT while generating based on both insertion and deletion operations. We experiment with a base and big LevT model (LevT and LevT-big in Tab. 2).
|
| 120 |
+
|
| 121 |
+
We also summarize the parameter size, performance and relative decoding speed of the NAT models introduced in Tab. 2. We use the decoding time of vanilla NAT to represent one unit of time, and $\mathtt { I t e r s } \times \mathtt { P a s s }$ represents the relative time units used for each model.
|
| 122 |
+
|
| 123 |
+
As mentioned earlier, we analyze each model by training from both the real and 4 distilled targets. We train the NAT models for the same number of steps as the AT models. For a fair comparison of the actual ability of each NAT-based model, we test all the models based on greedy decoding without any advanced search algorithms (e.g. length beam (Ghazvininejad et al., 2019), noisy parallel decoding (Ma et al., 2019), or re-ranking from the teacher model (Gu et al., 2018)). Notably, the vanilla NAT and FlowSeq output translations with single forward pass, while the remaining models are based on the iterative refinement.
|
| 124 |
+
|
| 125 |
+
# 4.2 ANALYSIS OF THE DISTILLED DATA
|
| 126 |
+
|
| 127 |
+
Table 2: AT and NAT models. Number of parameters and test BLEU when trained on the real data demonstrate model capacity. Iters is number of passes used in decoding for output length $n$ and hyperparameter $k$ . Pass is relative time used for one pass of decoding.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Models</td><td>Params</td><td>BLEU</td><td>Pass</td><td>Iters</td></tr><tr><td>AT models</td><td></td><td></td><td></td><td></td></tr><tr><td>AT-tiny</td><td>16M</td><td>23.3</td><td></td><td>n</td></tr><tr><td>AT-small</td><td>37M</td><td>25.6</td><td></td><td>n</td></tr><tr><td>AT-base</td><td>65M</td><td>27.1</td><td></td><td>n</td></tr><tr><td>AT-big</td><td>218M</td><td>28.2</td><td></td><td>n</td></tr><tr><td>NAT models</td><td></td><td></td><td></td><td></td></tr><tr><td>vanilla</td><td>71M</td><td>11.4</td><td>1</td><td>1</td></tr><tr><td>FlowSeq</td><td>73M</td><td>18.6</td><td>13</td><td>1</td></tr><tr><td>iNAT</td><td>66M</td><td>19.3</td><td>1</td><td>k<n</td></tr><tr><td>InsT</td><td>66M</td><td>20.9</td><td>1</td><td>~ log2 n</td></tr><tr><td>MaskT</td><td>66M</td><td>23.5</td><td>1</td><td>10</td></tr><tr><td>LevT</td><td>66M</td><td>25.2</td><td>1</td><td>3k<n</td></tr><tr><td>LevT-big</td><td>220M</td><td>26.5</td><td>~3</td><td>3k<n</td></tr></table>
|
| 130 |
+
|
| 131 |
+
We compare different dimensions of the data generated by the four AT models and the real data set in Fig. 3. First, Fig. 3 (a) shows that as the capacity of the AT model increases, the
|
| 132 |
+
|
| 133 |
+
complexity $\dot { C } ( d )$ of the distilled data increases, which indicates that the multi-modality increases as well. At the same time, we observe that $F ( d )$ defined in $\ S 3 . 2$ also decreases, showing that the distilled data more faithfully represents the word-level translation distribution of the original data.
|
| 134 |
+
|
| 135 |
+
Source For more than 30 years , Josef Winkler has been writing from the heart , telling of the hardships of his childhood and youth . Distilled Target Seit mehr als 30 Jahren schreibt Josef Winkler aus dem Herzen und erzählt von der Not seiner Kindheit und Jugend . Real Target Josef Winkler schreibt sich seit mehr als 30 Jahren die Nöte seiner Kindheit und Jugend von der Seele .
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 2: A sampled pair together with its real target from the distilled data of the base-AT model. Chunks annotated in the same colors are approximately aligned with each other.
|
| 139 |
+
Figure 3: Complexity $C ( d )$ (↑ more complex), faithfulness $F ( d )$ ( $\downarrow$ more faithful), training BLEU, and reordering score $\uparrow$ more monotonic alignment) of different distilled sets of WMT14-ENDE.
|
| 140 |
+
|
| 141 |
+
Second, we plot the BLEU score of the distilled data w.r.t to the real data set in (b) and we observe that the BLEU score of the distilled data from a higher-capacity teacher model is higher, which is both intuitive and in agreement with the results on KL divergence.
|
| 142 |
+
|
| 143 |
+
We also investigate how the relative ordering of words in the source and target sentences is changed during distillation. We use the fuzzy reordering score proposed in Talbot et al. (2011). A larger fuzzy reordering score indicates the more monotonic alignments. As shown in Fig 3 (c), the distilled data has significantly less reordering compared to the real parallel sentences, and the distilled data from a weaker AT teacher is more monotonic than a stronger AT teacher. We also show a randomly sampled example in Fig. 2 where compared to the real translation, the AT distilled target is much more monotonically aligned to the source sentence. This has potential benefits in that these simpler reordering patterns may be easier to learn for NAT models, but also disadvantages in that it may prevent NAT models from learning complex reordering patterns.
|
| 144 |
+
|
| 145 |
+
# 4.3 ANALYSIS OF DISTILLATION STRATEGIES
|
| 146 |
+
|
| 147 |
+
In $\ S 4 . 2$ , we have shown that decoding with an AT model reduces the conditional entropy of the parallel data set, which mitigates multi-modality in the output data. But does the decoding method of the AT model affect this change in the data set? We also investigate different decoding strategies when creating distilled data, using the base Transformer model as the teacher and the vanilla NAT model as the student. In Tab. 3, four decoding methods are presented: sampling, sampling within the top-10 candidates, beam search, and greedy decoding. With the same AT model, the performance of the NAT model differs widely depending on the decoding approach, where distillation with beam search results in the best performance.
|
| 148 |
+
|
| 149 |
+
We can see that beam search or greedy decoding can reduce the complexity of the real data the most while maintaining high faithfulness. In contrast, sampling based decoding methods less aggressively reduce the modes in the output sequence. This finding is in concert with Ott et al. (2018), who demonstrate that because beam search approximately selects the most probable translation, it effectively reduces diversity in the output translations compared to sampling or the true distribution.
|
| 150 |
+
|
| 151 |
+
Table 3: Comparisons of decoding methods on WMT14-ENDE newstest 2014 test set.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Decoding Method</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td> sampling</td><td>3.623</td><td>3.354</td><td>6.6</td></tr><tr><td>sampling (Top 10)</td><td>2.411</td><td>2.932</td><td>14.6</td></tr><tr><td>greedy</td><td>1.960</td><td>2.959</td><td>18.9</td></tr><tr><td>beam search</td><td>1.902</td><td>2.948</td><td>19.5</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# 4.4 DISTILLED DATA V.S. NAT MODELS
|
| 156 |
+
|
| 157 |
+
We next examine the relationship between the NAT students and distilled training data from different AT models. In Fig. 4, we demonstrate results for the NAT models listed in $\ S 4 . 1$ . We use the test set performance on real data as a simple metric to measure the capacity of the NAT model and arrange the subfigures in an increasing order of the performance (left-to-right, top-to-bottom). The results in the figure demonstrate that, interestingly, weaker NAT students prefer distilled data with smaller complexity as measured above in $\ S 4 . 2$ . The best performance of NAT models – from lower capacity ones to higher capacity ones – is achieved with distilled data of lower complexity to higher complexity, i.e. the vanilla NAT model performs best when using the distilled data from a small Transformer whereas LevT achieves the best performance when training with the distilled data from a big Transformer. Third, and notably, by simply changing the distilled data set upon which the models are trained, we are able to significantly improve the state-of-the-art results for models in a particular class. For example, FlowSeq increased to 22, by simply changing from the distilled data of Transformer(base) to Transformer(small). Finally, we find that by distilling from a big AT model, LevT is able to close the gap with the Transformer (base) with a similar number of parameters. Both LevT and LevT-big achieve the state-of-the-art performance for NAT-based models.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: The performance of NAT models of varying capacity trained on both the real and the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets.
|
| 161 |
+
|
| 162 |
+
# 5 IMPROVEMENTS TO KNOWLEDGE DISTILLATION
|
| 163 |
+
|
| 164 |
+
The previous section shows that the optimal complexity of the dataset is highly correlated with the capacity of the NAT model. In this section, we introduce three techniques that can be used to alter the distilled data to match the capacity of NAT model. Specifically, these techniques can be used to simplify the data further (BANs, MoE) for a lower-capacity student model or increase faithfulness of the data set (Interpolation) for a higher-capacity student model.
|
| 165 |
+
|
| 166 |
+
Born-Again Networks. We apply Born-Again neworks (BANs) to create a simplified dataset for NAT models. BANs were originally proposed as a self-distillation technique (Furlanello et al., 2018) that uses the output distribution of a trained model to train the original model. Starting from the real data, we repeatedly train new AT models with decoded sentences from the AT model at the previous iteration. This process is repeated for $k$ times and yields $k$ distilled data sets, upon which we perform NAT training and examine how the $k$ born-again teachers affect the performance of NAT students.
|
| 167 |
+
|
| 168 |
+
We conduct experiments using the vanilla NAT model (Gu et al., 2018) (which achieved the best performance with distilled data from a small Transformer in $\ S 4 . 4 )$ and the base Transformer as the AT model. As shown in Fig. 5, we can make the following observations: (i) The performance of the base AT model almost remains unchanged during the reborn iterations. (ii) The performance of the vanilla NAT model can be improved by 2 BLEU when using the distilled data from reborn iteration 6. (iii) As the reborn iterations continue, the complexity of the distilled data decreases and becomes constant eventually. Meanwhile, the quality of the distilled data compared to the real data decreases.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 5: Reborn experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets. R-i denotes the $i$ -th reborn iteration.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 6: MoE experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets w.r.t the number of experts.
|
| 175 |
+
|
| 176 |
+
Mixture-of-Experts. The mixture-of-expert model (MoE; Shen et al. (2019)) learns different experts for diverse machine translation, and different mixture components were shown to capture consistent translation styles across examples. Inspired by this, we use one expert from the mixture model to translate the training data, which is supposed to generate a single style of translation and reduce the diversity in the original data set. Then we use the best single-expert translations as the distilled data to train the vanilla NAT model. Specifically, we follow Shen et al. (2019)’s setup, using the base Transformer model and uniform hard mixture model, varying the number of experts.
|
| 177 |
+
|
| 178 |
+
In Fig. 6, we observe that the performance of the best expert of MoE tends to decrease as the number of experts increases. However, the complexity $( C ( d ) )$ and faithfulness $( F ( D ) )$ of distilled data from different MoE models has a relatively large variance. Compared to using the distilled data from a plain base AT model, the performance of NAT model is improved by 1.21 BLEU when using the distilled data from the MoE model with the number of experts of 3 which produces the distilled data with the least complexity.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>d</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td>base</td><td>1.902</td><td>2.948</td><td>26.94</td></tr><tr><td>base-inter</td><td>1.908</td><td>2.916</td><td>27.32</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Sequence-Level Interpolation. $\ S 4 . 4$ shows stronger NAT models (e.g. MaskT, LevT) have the ability to learn from the dataset that is closer to the real data, and achieve better performance. We adopt the sequence-level interpolation proposed in Kim & Rush (2016) as a natural way to create a better dataset. Different from distillation, interpolation picks the sentence with the highest sentence-level BLEU score w.r.t. the ground truth from $K$ −best beam search hy
|
| 183 |
+
|
| 184 |
+
Table 4: Results w/ and w/o sequencelevel interpolation with LevT.
|
| 185 |
+
|
| 186 |
+
potheses. In our experiments, we first run beam search using the base Transformer model with a beam size of 5 then select the sentences with the highest BLEU score from the top-3 candidates.
|
| 187 |
+
|
| 188 |
+
Tab. 4 compares the performance of LevT trained with distilled data from the AT model with the standard distillation or interpolation. We observe that selection with BLEU score from the base AT model (base-inter) improves the performance of LevT $\sim 0 . 4$ BLEU while the dataset complexity $C ( d )$ does not increase much.
|
| 189 |
+
|
| 190 |
+
# 6 CONCLUSION
|
| 191 |
+
|
| 192 |
+
In this paper, we first systematically examine why knowledge distillation improves the performance of NAT models. We conducted extensive experiments with autoregressive teacher models of different capacity and a wide range of NAT models. Furthermore, we defined metrics that can quantitatively measure the complexity of a parallel data set. Empirically, we find that a higher-capacity
|
| 193 |
+
|
| 194 |
+
NAT model requires a more complex distilled data to achieve better performance. Accordingly, we propose several techniques that can adjust the complexity of a data set to match the capacity of an NAT model for better performance.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Nader Akoury, Kalpesh Krishna, and Mohit Iyyer. Syntactically supervised transformers for faster neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1269–1281, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1122. URL https://www.aclweb.org/ anthology/P19-1122.
|
| 199 |
+
|
| 200 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 201 |
+
|
| 202 |
+
Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pp. 65–72, 2005.
|
| 203 |
+
|
| 204 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
|
| 205 |
+
|
| 206 |
+
Chris Dyer, Victor Chahuneau, and Noah Smith. A simple, fast, and effective reparameterization of IBM Model 2. In NAACL, 2013.
|
| 207 |
+
|
| 208 |
+
Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born-again neural networks. In International Conference on Machine Learning, pp. 1602–1611, 2018.
|
| 209 |
+
|
| 210 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1243–1252. JMLR. org, 2017.
|
| 211 |
+
|
| 212 |
+
Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Constant-time machine translation with conditional masked language models. arXiv preprint arXiv:1904.09324, 2019.
|
| 213 |
+
|
| 214 |
+
Jiatao Gu, James Bradbury, Caiming Xiong, Victor O.K. Li, and Richard Socher. Non-autoregressive neural machine translation. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, Canada, April 30-May 3, 2018, Conference Track Proceedings, 2018.
|
| 215 |
+
|
| 216 |
+
Jiatao Gu, Changhan Wang, and Jake Zhao. Levenshtein transformer. In Advances in Neural Information Processing Systems 33. 2019.
|
| 217 |
+
|
| 218 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 219 |
+
|
| 220 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 221 |
+
|
| 222 |
+
Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh, and Hajime Tsukada. Automatic evaluation of translation quality for distant language pairs. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pp. 944–952. Association for Computational Linguistics, 2010.
|
| 223 |
+
|
| 224 |
+
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. ´ Google’s multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339–351, 2017.
|
| 225 |
+
|
| 226 |
+
Lukasz Kaiser, Samy Bengio, Aurko Roy, Ashish Vaswani, Niki Parmar, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. In International Conference on Machine Learning, pp. 2395–2404, 2018.
|
| 227 |
+
|
| 228 |
+
Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1317–1327, 2016.
|
| 229 |
+
|
| 230 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 231 |
+
|
| 232 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
|
| 233 |
+
|
| 234 |
+
Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1173–1182, 2018.
|
| 235 |
+
|
| 236 |
+
Percy Liang, Hal Daume III, and Dan Klein. Structure compilation: trading structure for features. ´ In ICML, pp. 592–599, 2008.
|
| 237 |
+
|
| 238 |
+
Xuezhe Ma, Pengcheng Yin, Jingzhou Liu, Graham Neubig, and Eduard Hovy. Softmax qdistribution estimation for structured prediction: A theoretical interpretation for raml. arXiv preprint arXiv:1705.07136, 2017.
|
| 239 |
+
|
| 240 |
+
Xuezhe Ma, Chunting Zhou, Xian Li, Graham Neubig, and Eduard Hovy. Flowseq: Nonautoregressive conditional sequence generation with generative flow. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, Hong Kong, November 2019.
|
| 241 |
+
|
| 242 |
+
Aaron Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, et al. Parallel wavenet: Fast high-fidelity speech synthesis. In International Conference on Machine Learning, pp. 3915–3923, 2018.
|
| 243 |
+
|
| 244 |
+
Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Analyzing uncertainty in neural machine translation. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 3953–3962, 2018. URL http://proceedings.mlr.press/v80/ott18a.html.
|
| 245 |
+
|
| 246 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan $\mathrm { N g }$ , David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
|
| 247 |
+
|
| 248 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pp. 582–597. IEEE, 2016.
|
| 249 |
+
|
| 250 |
+
Maja Popovic. chrf: character n-gram f-score for automatic mt evaluation. In ´ Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 392–395, 2015.
|
| 251 |
+
|
| 252 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://www.aclweb. org/anthology/P16-1162.
|
| 253 |
+
|
| 254 |
+
Chenze Shao, Yang Feng, Jinchao Zhang, Fandong Meng, Xilin Chen, and Jie Zhou. Retrieving sequential information for non-autoregressive neural machine translation. arXiv preprint arXiv:1906.09444, 2019.
|
| 255 |
+
|
| 256 |
+
Tianxiao Shen, Myle Ott, Michael Auli, et al. Mixture models for diverse machine translation: Tricks of the trade. In International Conference on Machine Learning, pp. 5719–5728, 2019.
|
| 257 |
+
|
| 258 |
+
Raphael Shu, Jason Lee, Hideki Nakayama, and Kyunghyun Cho. Latent-variable nonautoregressive neural machine translation with deterministic inference using a delta posterior. arXiv preprint arXiv:1908.07181, 2019.
|
| 259 |
+
|
| 260 |
+
Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. A study of translation edit rate with targeted human annotation. In In Proceedings of Association for Machine Translation in the Americas, pp. 223–231, 2006.
|
| 261 |
+
|
| 262 |
+
Milos Stanojevic and Khalil Simaan. Beer: Better evaluation as ranking. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pp. 414–419, 2014.
|
| 263 |
+
|
| 264 |
+
Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. In Advances in Neural Information Processing Systems, pp. 10107–10116, 2018.
|
| 265 |
+
|
| 266 |
+
Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion transformer: Flexible sequence generation via insertion operations. arXiv preprint arXiv:1902.03249, 2019.
|
| 267 |
+
|
| 268 |
+
David Talbot, Hideto Kazawa, Hiroshi Ichikawa, Jason Katz-Brown, Masakazu Seno, and Franz J Och. A lightweight evaluation framework for machine translation reordering. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pp. 12–21. Association for Computational Linguistics, 2011.
|
| 269 |
+
|
| 270 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 271 |
+
|
| 272 |
+
Chunqi Wang, Ji Zhang, and Haiqing Chen. Semi-autoregressive neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 479–488, 2018.
|
| 273 |
+
|
| 274 |
+
Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. arXiv preprint arXiv:1902.10245, 2019.
|
| 275 |
+
|
| 276 |
+
Bingzhen Wei, Mingxuan Wang, Hao Zhou, Junyang Lin, and Xu Sun. Imitation learning for nonautoregressive neural machine translation. arXiv preprint arXiv:1906.02041, 2019.
|
| 277 |
+
|
| 278 |
+
# A EXPERIMENTAL DETAILS
|
| 279 |
+
|
| 280 |
+
# A.1 AT MODELS
|
| 281 |
+
|
| 282 |
+
Model All the AT models are implemented based on the Transformer model using fairseq (Ott et al., 2019), and we basically follow the fairseq examples to train the transformers6. Following the notation from Vaswani et al. (2017), we list the basic parameters of all the AT model we used:
|
| 283 |
+
|
| 284 |
+
Table 5: Basic hyper-parameters of architecture for AT models.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Models</td><td>tiny</td><td>small</td><td>base</td><td>big</td></tr><tr><td>dmodel</td><td>256</td><td>512</td><td>512</td><td>1024</td></tr><tr><td>dhidden</td><td>1024</td><td>1024</td><td>2048</td><td>4096</td></tr><tr><td>nlayers</td><td>3</td><td>3</td><td>6</td><td>6</td></tr><tr><td>nheads</td><td>4</td><td>8</td><td>8</td><td>16</td></tr><tr><td>Pdropout</td><td>0.1</td><td>0.1</td><td>0.3</td><td>0.3</td></tr></table>
|
| 287 |
+
|
| 288 |
+
Training For all experiments, we adopt the Adam optimizer (Kingma & Ba, 2014) using $\beta _ { 1 } =$ $0 . 9 , \beta _ { 2 } = 0 . 9 8$ , $\epsilon = 1 e - 8$ . The learning rate is scheduled using inverse sqrt with a maximum learning rate 0.0005 and 4000 warmup steps. We set the label smoothing as 0.1. All the models are run on 8 GPUs for 300, 000 updates with an effective batch size of 32, 000 tokens. The best model is selected based on the validation loss except for FlowSeq which uses valid BLEU score.
|
| 289 |
+
|
| 290 |
+
Decoding After training, we use beam-search with a fixed beam size 5 for all AT models to create the distilled dataset. We use length normalization without length penalty.
|
| 291 |
+
|
| 292 |
+
# A.2 NAT MODELS
|
| 293 |
+
|
| 294 |
+
Model Tab. 2 also lists all the NAT models we test in this work. In general, all the NAT models except FlowSeq and LevT-big adopts a similar architecture and hyper-parameters as the Transformerbase (see Tab. 5). LevT-big is a naive extension of the original LevT model with a comparable parameter setting as Transformer-big (Tab. 5). For FlowSeq, we use the base model (FlowSeq-base) described in (Ma et al., 2019). We re-implemented the vanilla NAT as a simplified version of Gu et al. (2018) where instead of modeling fertility as described in the original paper, we monotonically copy the encoder embeddings to the input of the decoder. All the models except InsT require the additional module to predict the length of the output sequence, or the number of placeholders to be inserted, which is implemented as a standard softmax classifier over the lengths of [0, 256). For LevT, we also have a binary classifier to predict the deletion of the incorrect tokens.
|
| 295 |
+
|
| 296 |
+
Training Similar to the AT models, all the NAT models are trained using the Adam optimizer with the same learning rate scheduler, in which the warmup steps are set to 10, 000. We train the FlowSeq model on 32 GPUs with a batch size as 2048 sentences, while all the other models are trained on 8 GPUs with an effective batch size of 64, 000 tokens. Note that, the batch sizes for training NAT is typically larger than the AT model, which improves final results. There are also specialized training settings for each models:
|
| 297 |
+
|
| 298 |
+
• iNAT (Lee et al., 2018): following the original paper, we train the iNAT model jointly with 4 iterations of refinement during training. For each iteration, the model has the $5 0 \%$ probability to learn as a denoising autoencoder, and the rest of the probability to learn from the model’s own prediction.
|
| 299 |
+
• InsT (Stern et al., 2019): in this work, we only consider training the Insertion Transformer (InsT) using the slot-loss based on the uniform loss function (Stern et al., 2019). That is, we assign equal probabilities to all the insertable tokens inside each slot.
|
| 300 |
+
• MaskT (Ghazvininejad et al., 2019): following the original paper, we train the model as a typical masked language model where the ratio of masked tokens is sampled from $0 \sim 1 0 0 \%$ .
|
| 301 |
+
|
| 302 |
+
• LevT (Gu et al., 2019): in this work, we only consider sequence generation tasks, which means the training of LevT is very similar to InsT. We use sentences with randomly deleted tokens to learn insertion, and learn deletion based on the model’s own prediction.
|
| 303 |
+
|
| 304 |
+
Decoding For a fair comparison over all the NAT models, we use greedy decoding for all the models without considering any advanced decoding methods such as searching or re-ranking from a teacher model. For the vanilla NAT and FlowSeq, decoding is quite straight-forward and simply picks the arg max at every position. For iNAT and MaskT, we fix the decoding steps to 10. Both InsT and LevT decode in an adaptive number of iterations, and we set the maximum iterations for both models to be 10. A special EOS penalty that penalizes generating too short sequences is tuned based on the validation set for both InsT and LevT.
|
| 305 |
+
|
| 306 |
+
For all models, final results are calculated using tokenized BLEU score.
|
| 307 |
+
|
| 308 |
+
# B REAL DATA STATISTICS
|
| 309 |
+
|
| 310 |
+
The detailed dataset split for WMT14 En-De is shown in Tab. 6. In Fig. 7, we also plot the histogram of the conditional entropy of each pair of sentences $\scriptstyle { \mathcal { H } } ( y | x )$ in the real parallel data and different distilled data sets from the big-AT, base-AT, small-AT and tiny-AT respectively. It shows that the distribution of the sentence-level conditional entropy differs widely. The mode of $\scriptstyle { \mathcal { H } } ( y | x )$ in the real data is the highest and follows by distilled data from the big-AT, base-AT, small-AT and tiny-AT. This observation aligns with the complexity value $C ( d )$ proposed in $\ S 3 . 2$ .
|
| 311 |
+
|
| 312 |
+
Table 6: Dataset statistics for WMT14 En-De.
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Dataset</td><td>Train</td><td>Valid</td><td>Test</td><td>Vocabulary</td></tr><tr><td>WMT'14 En-De</td><td>4,500,966</td><td>3000</td><td>3003</td><td>37,009</td></tr></table>
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 7: Density of conditional entropy $C ( d )$ of each sentence pairs in different distilled data sets and the real data.
|
| 318 |
+
|
| 319 |
+
# C ADDITIONAL METRICS
|
| 320 |
+
|
| 321 |
+
In Figure 8, we also showed results with different metrics together with BLEU scores considering that BLEU scores sometimes cannot fully capture the changes in the system. We considered 5 additional metrics in our experiments: METEOR (Banerjee & Lavie, 2005), RIBES (Isozaki et al., 2010), ChrF (Popovic, 2015) TER (Snover et al., 2006), and BEER (Stanojevic & Simaan, 2014). ´ Not surprisingly, we find that all the metrics are correlated with the original BLEU scores quite well showing a similar trend as discussed earlier.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 8: The performance of variant measure (BLEU $\uparrow$ , METEOR $\uparrow$ , RIBES $\uparrow$ , ChrF $\uparrow$ , TER $\downarrow$ BEER $\uparrow$ ) for the vanilla NAT model trained on the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets.
|
| 325 |
+
|
| 326 |
+
# D SYNTHETIC DATA WITH ACCESS TO THE TRUE DISTRIBUTION
|
| 327 |
+
|
| 328 |
+
D.1 BACKGROUND: BAYESIAN DECISION THEORY
|
| 329 |
+
|
| 330 |
+
Bayesian decision theory is a fundamental statistical approach to the problem of pattern classification, which provides a principled rule of finding the optimal classification decision using probability and losses that accompany such decisions.
|
| 331 |
+
|
| 332 |
+
In the problem of structured prediction (Ma et al., 2017), let $_ { \textbf { \em x } }$ denote the input sequence and $\textbf { { y } }$ denote the output label sequence. Let $\mathcal { H }$ denote all the possible hypothesis functions from the input to the output space: $\mathcal { H } = \{ h : \mathcal { X } \mathcal { Y } \}$ . Let $r ( \pmb { y } | \pmb { x } )$ denote the conditional risk on the input $_ { \textbf { \em x } }$ , which is the expected loss of predicting $\textbf { { y } }$ based on the posterior probabilities:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
r ( { \pmb y } | { \pmb x } ) = \mathbb { E } _ { P ( { \pmb y } ^ { \prime } | { \pmb x } ) } [ L ( { \pmb y } , { \pmb y } ^ { \prime } ) ] ,
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
, where $L ( \boldsymbol { y } , \boldsymbol { y } ^ { \prime } )$ is the loss function that penalizes predicting the true target $\boldsymbol { y } ^ { \prime }$ as $\textbf { { y } }$ . The classification task aims to find a hypothesis function $h$ that minimizes the overall risk $R$ given by
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
R ( h ) = \mathbb { E } _ { P ( \pmb { x } ) } [ r ( h ( \pmb { x } ) | \pmb { x } ) ]
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
This is known as the Bayes risk. To minimize the overall risk, obviously we need to minimize the conditional risk for each input $_ { \textbf { \em x } }$ . The Bayesian decision rule states that the global minimum of $R ( h )$ is achieved when the classifier make predictions that minimize each conditional risk given $_ { \textbf { \em x } }$ and this gives the Bayes optimal classifier:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
h ^ { * } ( { \pmb x } ) = \arg \operatorname* { m i n } _ { { \pmb y } \in { \pmb y } } r ( { \pmb y } | { \pmb x } )
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Let us consider two loss functions defined in Eq. 5. First is the sequence-level loss $L _ { s e q } ( { \pmb y } , { \pmb y } ^ { \prime } ) =$ $1 - \mathbb { I } ( { \pmb y } = { \pmb y } ^ { \prime } )$ , then in this case the Bayes classifier is:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
h _ { s e q } ^ { * } ( { \pmb x } ) = \arg \operatorname* { m a x } _ { { \pmb y } \in \mathcal { V } } P ( { \pmb y } | { \pmb x } )
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
, which is the most probable output label sequence given the input sequence $_ { \textbf { \em x } }$
|
| 357 |
+
|
| 358 |
+
Second let us consider the token-level loss $\begin{array} { r } { L _ { t o k } ( \pmb { y } , \pmb { y } ^ { \prime } ) = \sum _ { t = 1 } ^ { T } 1 - \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) } \end{array}$ , i.e the sum of zero-one loss at each time step. We have:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r l } { h _ { t o k } ^ { * } ( \pmb { x } ) } & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m i n ~ } } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ L _ { 2 } ( \pmb { y } , \pmb { y ^ { \prime } } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x ~ } } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ \sum _ { t = 1 } ^ { T } \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \sum _ { t = 1 } ^ { T } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \sum _ { t = 1 } ^ { T } \mathbb { E } _ { P ( y _ { t } ^ { \prime } | \pmb { x } ) } [ \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \underset { t = 1 } { \overset { T } { \prod } } P ( y _ { t } | \pmb { x } ) } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
This suggests that the Bayes classifier finds the most probable label at each time step given the input sequence.
|
| 365 |
+
|
| 366 |
+
# D.2 EXPERIMENTAL SETUPS AND ANALYSIS
|
| 367 |
+
|
| 368 |
+
To study how training data affects the performance of a weaker classifier, we construct a Hidden Markov Model (HMM) by sampling the parameters of the transition and emission probabilities uniformly within $( 0 , a ]$ and $( 0 , b ]$ respectively. A higher value of $a$ and $b$ indicates an HMM model with higher uncertainty. We refer this HMM as the “true HMM” as our real data generator. Next we consider a weaker classifier that uses a low-dimension bidirectional-LSTM (Bi-LSTM) to encode the input sequence and individual softmax functions at each time step to predict labels independently, which is referred as the “Bi-LSTM” classifier. Obviously, the Bi-LSTM classifier is not able to model the dependencies between output labels embedded in the HMM, and it is equivalent to a simplified non-autoregressive generation model.
|
| 369 |
+
|
| 370 |
+
We generate the real training data $D _ { r e a l } = \{ ( { \pmb x } _ { 1 } , { \pmb y } _ { 1 } ) , \cdot \cdot \cdot , ( { \pmb x } _ { N } , { \pmb y } _ { N } ) \}$ of size $N$ by sampling from the joint probability of the true HMM. Similarly we sample $N _ { t e s t }$ data points as the test data and $N _ { v a l i d }$ data points as the validation data. We evaluate the classifier’s token-level accuracy tacc and sequand n the test data respectively, where . These two metrics correspond $\begin{array} { r } { t a c c = \frac { \sum _ { i = 1 } ^ { N _ { t e s t } } \sum _ { t = 1 } ^ { T } \mathbb { I } ( h ( \pmb { x } _ { i } ) ^ { t } = \pmb { y } _ { i } ^ { t } ) } { T \times N _ { t e s t } } } \end{array}$ $\begin{array} { r } { s a c c \ = \ \frac { \sum _ { i = 1 } ^ { N _ { t e s t } } { \mathbb { I } \left( { h ( { \bf { x } } _ { i } ) = y _ { i } } \right) } } { N _ { t e s t } } } \end{array}$ $L _ { t o k }$ sequence-level loss $L _ { s e q }$ on each data point of the test data.
|
| 371 |
+
|
| 372 |
+
First, we use $h _ { s e q } ^ { * } ( { \pmb x } )$ to generate the distillation labels $\boldsymbol { y } ^ { \prime }$ from the true HMM, which corresponds to applying the Viterbi decoding to each $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ in $D _ { r e a l }$ . The training data set $D _ { s e q }$ is created with $( { \pmb x } _ { i }$ , $\pmb { y } _ { i } ^ { \prime } )$ . Next, we use $h _ { t o k } ^ { * } ( x )$ to generate the distillation labels $\hat { y }$ and create the training data $D _ { t o k }$ of $( \dot { \pmb x } _ { i } , \hat { \pmb y } _ { i } )$ . To generate $\hat { y }$ , we apply the forward-backward algorithm to each $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ in $D _ { r e a l }$ and obtain $P ( y _ { i } ^ { t } | \mathbf { x } _ { i } )$ . We take arg max over the label space $\mathcal { L }$ : $\hat { y } _ { i } ^ { t } = \underset { y _ { i } ^ { t } \in \mathcal { L } } { \operatorname { a r g m a x } } P ( y _ { i } ^ { t } | \mathbf { x } _ { i } )$ .
|
| 373 |
+
|
| 374 |
+
We use these three training data $( D _ { r e a l } , D _ { t o k } , D _ { s e q } )$ to train the Bi-LSTM classifier respectively. We repeat the experiment for 50 times by constructing 50 HMM models with different random seeds as the data generator. We find that when evaluating with the token-level accuracy tacc, models trained with $D _ { t o k }$ yields the best performance (Bi-LSTM trained with $D _ { t o k }$ win $9 7 . 6 \%$ runs); when evaluating with the sequence-level accuracy sacc, models trained with $D _ { s e q }$ yields the best performance (Bi-LSTM trained with $D _ { s e q }$ win $9 8 . 5 \%$ runs). This is because the Bi-LSTM classifier has difficulty modeling the true data distribution defined by an HMM. On the other hand, it is easier for the Bi-LSTM classifier to model the distributions of $D _ { s e q }$ and $D _ { t o k }$ . Data sets $D _ { s e q }$ and $D _ { t o k }$ define deterministic conditional distributions over the input data, which are much simpler than the real data distribution. By definition, $D _ { t o k }$ is created by the optimal Bayes classifier $\bar { h } _ { t o k } ^ { * } ( { \pmb x } )$ , this means that the Bi-LSTM classifier trained with $D _ { t o k }$ can better capture the distribution of $P ( y _ { t } | \mathbf { x } ) = \operatorname* { m a x } _ { u _ { t } } P ( u _ { t } | \mathbf { x } )$ , which can generalize better to the test data when evaluated with the token-level accuracy. Similarly, Bi-LSTM trained with $D _ { s e q }$ performs better on the test data with the sequence-level metric.
|
| 375 |
+
|
| 376 |
+
This corroborates our observation in machine translation task that NAT has difficulty in modeling the real conditional distribution of true sentence pairs. However, when using the distilled data translated from a pretrained autoregressive model with beam-search decoding, it performs better on the test set when evaluated with the BLEU score metric.
|
md/train/BygZK2VYvB/BygZK2VYvB.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Utilizing Edge Features in Graph Neural Networks via Variational Information Maximization
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Graph Neural Networks (GNNs) broadly follow the scheme that the representation vector of each node is updated recursively using the message from neighbor nodes, where the message of a neighbor is usually pre-processed with a parameterized transform matrix. To make better use of edge features, we propose the Edge Information maximized Graph Neural Network (EIGNN) that maximizes the Mutual Information (MI) between edge features and message passing channels. The MI is reformulated as a differentiable objective via a variational approach. We theoretically show that the newly introduced objective enables the model to preserve edge information, and empirically corroborate the enhanced performance of MI-maximized models across a broad range of learning tasks including regression on molecular graphs and relation prediction in knowledge graphs.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Many real-world datasets naturally come in the form of graphs, such as citation networks (Kipf & Welling, 2017), social networks Hamilton et al. (2017), knowledge graphs (Schlichtkrull et al., 2018), molecular graphs (Scarselli et al., 2009; Duvenaud et al., 2015) etc., all of which consist of a number of nodes and edges equipped with their inherent features. Recently, impressive performance has been achieved in graph learning tasks with various forms of Graph Neural Networks (GNNs) (Zhou et al., 2018). Compared to prior works, such as node2vec (Grover & Leskovec, 2016), GNNs learn the state of a node by recursively aggregating messages from its neighbors: combining the graph structure with node features. Intuitively, edge features should play an important role in graph learning tasks. For example, chemical bonds in a molecule have a high impact on chemical properties of molecules, and edge features in knowledge graphs encode important relations between concepts, data, and entities. Our proposed method focuses on improving the usage of edge features in GNNs.
|
| 12 |
+
|
| 13 |
+
The expressive power of GNNs largely depends on how the message is passed between nodes. A widely adopted scheme is multiplying neighbor node states with a parameterized transform matrix before aggregation (Gilmer et al., 2017; Xu et al., 2019). Despite tremendous success of GNNs, existing models do not exhaustively exploit the full potentials of edge features on graphs. For example, many GNNs such as GCN (Kipf & Welling, 2017), ChebyNet (Defferrard et al., 2016) and GAT (Veličković et al., 2018) do not even consider categorized edge types. To utilize edge features in multi-relational graphs, RGCN (Schlichtkrull et al., 2018) proposes to learn a different transform matrix for each edge type, respectively. However, it does not generalize to edge features in continuous space. MPNN (Gilmer et al., 2017) introduces an edge network that takes edge feature vectors as input and outputs transform matrices, which are used to transform states of neighbor nodes. In principle, the MPNN framework can handle complex edge features. Yet, the lack of maximization of MI between edge and message channels implies that the MPNN may give an edge-independent transform matrix.
|
| 14 |
+
|
| 15 |
+
In this work, we aim to more efficiently exploit the full potentials of edge features from the perspective of training. We propose the Edge Information maximized Graph Neural Network (EIGNN) that maximizes the Mutual Information (MI) between edge features and the message passing channel which is parameterized as the transform matrix in the widely-accepted message passing framework (transformation and aggregation) (Gilmer et al., 2017; Xu et al., 2019). Considering the challenge of computing the MI, we adopt a variational approach to reformulate it as an differentiable objective, which can be easily applied as a regularization term. We theoretically show that EIGNN can reduce information loss of edge features. Apart from demonstrating the impressive performance of EIGNN on extensive benchmarks of molecular graphs and knowledge graphs, we also analyze and attribute the enhanced effectiveness of EIGNN to the exploitation of edge features instead of the regularization effects. Notably, attribution analysis on molecular graphs show that EIGNN can capture domain knowledge without human interference.
|
| 16 |
+
|
| 17 |
+
Preliminaries Let $G = ( \nu , \mathcal { E } )$ be a graph with node feature vectors $x _ { v } \in \mathbb { R } ^ { d }$ for node $v \in \nu$ and edge feature vectors $e _ { v w } \in \mathcal { E }$ for the edge connecting node $v$ and $w$ . In GNNs, the state of each node is updated recursively using neighbor nodes. Let $\mathcal { N } _ { v }$ be the set of neighbor nodes of $v$ and $h _ { v } ^ { ( l ) } \in \mathbb { R } ^ { d _ { l } }$ be the hidden state of $v$ at $\it l$ -th layer, where $d _ { l }$ is the dimension of the hidden layer. For simplicity of notation, we use a single $d$ to denote the dimension such that $h _ { v } ^ { ( l ) } \in \mathbb { R } ^ { d }$ . We also have $h _ { v } ^ { ( 0 ) } = x _ { v }$ at the input layer.
|
| 18 |
+
|
| 19 |
+
# 2 Related works
|
| 20 |
+
|
| 21 |
+
# 2.1 Relational Modeling in Graph Neural Networks
|
| 22 |
+
|
| 23 |
+
Single-relational modeling. Many variants such as GCN (Kipf & Welling, 2017), GAT (Veličković et al., 2018), ChebyNet (Defferrard et al., 2016), GraphSAGE (Hamilton et al., 2017) focus on learning node states. These models can assign weight to neighbors, but they can not handle various edge features. A typical neighborhood aggregation scheme is
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
h _ { v } ^ { ( l + 1 ) } = \sigma \left( \sum _ { w \in \mathcal { N } _ { v } } \alpha _ { v w } W _ { 1 } ^ { ( l ) } h _ { w } ^ { ( l ) } + W _ { 0 } ^ { ( l ) } h _ { v } ^ { ( l ) } \right) ,
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where $\sigma$ denotes an activation function, $\alpha _ { v w }$ can be a normalization constant or a learned attention coefficient (Veličković et al., 2018). States of all neighbors are multiplied by the same trainable transform matrix $W _ { 1 } ^ { ( l ) }$ . Sometimes the self-connection is also treated in the same way, s.t., W (l)0 = W (l)1 .
|
| 30 |
+
|
| 31 |
+
Multi-relational modeling. A simple strategy to handle multi-relational graphs is assigning each edge type with a separate transform matrix as presented in RGCN (Schlichtkrull et al., 2018) and adopted by GGNN (Li et al., 2016) and LNet (Liao et al., 2019). RGCN updates node states according to the following scheme
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\begin{array} { r } { h _ { v } ^ { ( l + 1 ) } = \sigma \left( \sum _ { r \in \mathcal { R } } \sum _ { w \in \mathcal { N } _ { v } ^ { r } } \alpha _ { v w , r } W _ { r } ^ { ( l ) } h _ { w } ^ { ( l ) } + W _ { 0 } ^ { ( l ) } h _ { v } ^ { ( l ) } \right) , } \end{array}
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\mathcal { N } _ { v } ^ { r }$ is the collection of neighboring nodes of $\boldsymbol { v }$ with relation $r \in \mathcal { R }$ and $\alpha _ { v w , r }$ is a normalization constant similar as $\alpha _ { v w }$ in Eq. (1). Such a scheme faces challenge in handling edge features of continuous space. GGNN and LNet do not focus on the improvement of edge expressibility. GGNN introduces Gated Recurrent Unit (GRU) (Cho et al., 2014) and LNet focus on handling multi-scale connections.
|
| 38 |
+
|
| 39 |
+
Complex-relational modeling. The relation in a graph can be quite complex, expressed as a general feature vector $e$ . MPNN (Gilmer et al., 2017) introduces an edge network which takes edge feature vectors as input and outputs transform matrices. A single edge network is shared in a MPNN model. The forward propagation is formalized as
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
m _ { v } ^ { ( l + 1 ) } = \sigma \left( \sum _ { w \in \mathcal { N } _ { v } } f ( e _ { v w } ) h _ { w } ^ { ( l ) } + W _ { 0 } ^ { ( l ) } h _ { v } ^ { ( l ) } \right) , \quad h _ { v } ^ { ( l + 1 ) } = \mathrm { G R U } ( h _ { v } ^ { ( l ) } , m _ { v } ^ { ( l + 1 ) } ) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $f : e W$ denotes the edge network. Recently, some research works treat a multirelational problem as the complex-relational one by introducing a continuous edge embedding vector for each edge type, so as to handle increasing number of relations (Nathani et al., 2019). Although the MPNN architecture allows the usage of arbitrary edge features, this advantage is not utilized in practice. MPNN can actually learn an edge-independent transform matrix. A GNN model that efficiently utilizes edge features is yet to emerge.
|
| 46 |
+
|
| 47 |
+
# 2.2 Readout functions
|
| 48 |
+
|
| 49 |
+
After several forward propagations, GNNs yield final states of all nodes, which are suitable for node/edge classification or regression. For graph classification or regression tasks, we can apply a readout function (Ying et al., 2018; Vinyals et al., 2015) such that
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
y = R ( \{ h _ { v } ^ { L } | v \in G \} ) ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $h _ { v } ^ { L }$ is the state of $v$ at the last layer, $R$ is the readout function that outputs a graph-level representation $y$ , e.g., summing up the final node states, applying hierarchical pooling (Ying et al., 2018) or using the set2set model (Vinyals et al., 2015).
|
| 56 |
+
|
| 57 |
+
# 3 Our method
|
| 58 |
+
|
| 59 |
+
# 3.1 The Usage of Mutual Information
|
| 60 |
+
|
| 61 |
+
In probability theory and information theory, MI is a measure of mutual dependence between two random variables. Our method proposes to preserve edge information in GNNs, which is important in many real-world graph structures such as molecules - apart from node (atom) features, attributes of edges (bonds) are equally important for predicting properties of molecules. To this end, we maximize $I ( e ; W )$ - the MI between the edge feature vector $e$ and the message passing channel, i.e., the transform matrix $W$ which is used to transform neighbor node states in the forward propagation. Our method can be easily generalized to directly maximize the MI between edge features and the message itself in methods that do not explicitly have the transform matrix, e.g., the message from node $w$ to node $v$ can be expressed as $f ( h _ { v } , e _ { v w } , h _ { w } )$ rather than $f ( e _ { v w } ) h _ { w }$ , which is shown in Section 4.3.
|
| 62 |
+
|
| 63 |
+
An general principle of maximum MI is described for unsupervised learning task by (Linsker, 1988) and MI inspired objective functions have long been adopted in unsupervised learning (Bridle et al., 1992; Barber & Agakov, 2006; Veličković et al., 2019; Hjelm et al., 2019), semi-supervised learning (Krause et al., 2010) and generative adversarial networks (Chen et al., 2016). Specifically, DGI (Veličković et al., 2019) also applies MI to GNNs. DGI proposes to learn node-wise representations in an unsupervised manner by maximizing the MI between node representations and corresponding high-level summaries of graphs, using adversarial learning and negative sampling. The node representations may then be retrieved and used for downstream tasks, such as node classification. DGI can be used to pre-train GNNs, as demonstrated in Hu et al. (2019). Our EIGNN also proposes information maximization but targets a completely different objective and adopts a quite different approach.
|
| 64 |
+
|
| 65 |
+
# 3.2 A Variational Approach to Maximize Mutual Information
|
| 66 |
+
|
| 67 |
+
Computing $I ( e ; W )$ itself is intractable in practice, needless to say that training a model requires the derivative. Thus, we adopt a variational approach (Agakov, 2004) to reformulate $I ( e ; W )$ as a differentiable objective. We show that our objective is an approximated lower bound of $I ( e ; W )$ and notably, optimizing our objective does lead to maximizing $I ( e ; W )$ . Following MPNN (Gilmer et al., 2017), we use an edge network to parameterize the transform matrix $W$ and relate it to edge features. Therefore, the prior $p ( W | e )$ is
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
p ( W | e ) = \delta ( W - f ( e ) ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\delta ( \cdot )$ is the Dirac delta function. The posterior $p ( e | W )$ is intractable, so we define a variational distribution $q ( e | W )$ , which can be obtained by defining a neural network $g : W \to e$ Specifically, $q ( e | W )$ substitutes to some distribution (such as Gaussian distribution) with parameter $g ( W )$ . In this way, $f$ and $g$ are similar to the probabilistic encoder and decoder in the Variational Auto-Encoder (VAE) (Kingma $\&$ Welling, 2013). Then we can approximate $I ( e ; W )$ with a differentiable objective $L _ { I } ( f , g ; e )$ as follows.
|
| 74 |
+
|
| 75 |
+
Theorem 1. Let e be the edge feature vector, $W$ be the transform matrix with conditional distribution $p ( W | e )$ specified by the probabilistic encoder $f$ as shown in Eq. (5) and $q ( e | W )$ be the variational distribution specified by the probabilistic decoder $g$ , then we have
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
I ( e ; W ) \geq H ( e ) + \mathbb { E } _ { e \sim p ( e ) } [ \mathcal { L } _ { I } ( f , g ; e ) ] ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { L } _ { I } ( f , g ; e ) = \log q ( e | f ( e ) )$ and $H ( \cdot )$ denotes the entropy.
|
| 82 |
+
|
| 83 |
+
Proof. Let $D _ { K L } ( \cdot \parallel \cdot )$ denote the KL-divergence, which should be nonnegative, then we have
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r l } { I ( e ; W ) = H ( e ) - H ( e | W ) } & { } \\ { \ } & { = H ( e ) + \mathbb { E } _ { W \sim p ( W ) } [ \mathbb { E } _ { e \sim p ( e | W ) } [ \log p ( e | W ) ] ] } \\ { \ } & { = H ( e ) + \mathbb { E } _ { W \sim p ( W ) } [ \mathbb { E } _ { e \sim p ( e | W ) } [ \log p ( e | W ) - \log q ( e | W ) + \log q ( e | W ) ] ] } \\ { \ } & { = H ( e ) + \mathbb { E } _ { W \sim p ( W ) } [ D _ { K L } ( p ( e | W ) \| q ( e | W ) ) + \mathbb { E } _ { e \sim p ( e | W ) } [ \log q ( e | W ) ] ] } \\ { \ } & { \geq H ( e ) + \mathbb { E } _ { W \sim p ( W ) } [ \mathbb { E } _ { e \sim p ( e | W ) } [ \log q ( e | W ) ] ] } \\ { \ } & { = H ( e ) + \mathbb { E } _ { e \sim p ( e ) , W \sim p ( W | e ) } [ \log q ( e | W ) ] } \\ { \ } & { \stackrel { ( a ) } { = } H ( e ) + \mathbb { E } _ { e \sim p ( e ) } [ \log q ( e | f ( e ) ) ] } \end{array}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where the equality ( $a$ ) follows from Eq. (5).
|
| 90 |
+
|
| 91 |
+
According to Theorem 1, we can maximize the variational lower bound for $I ( e ; W )$ . The bound becomes tight when the variational distribution $q ( e | W )$ approaches the true posterior $p ( e | W )$ . Moreover, $H ( e )$ is a constant because the distribution of edge feature vector $e$ is fixed for given graphs, hence we can equivalently maximize $\mathcal { L } _ { I } ( f , g ; e )$ . We choose the widely accepted Gaussian distribution as the prior distribution for the probabilistic decoder $g$ ,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
q ( e | W ) = \mathcal { N } ( e ; g ( W ) , \sigma ^ { 2 } I ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Then we have
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { I } ( f , g ; e ) = \log q ( e | f ( e ) ) = \log \mathcal { N } ( e ; g ( f ( e ) ) , \sigma ^ { 2 } I ) = - \lambda \| e - g ( f ( e ) ) \| _ { 2 } ^ { 2 }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\lambda > 0$ is a constant determined by $\sigma$ and the dimension of $e$ , taken as a tunable parameter. The following Theorem 2 shows that maximizing the objective in Eq. (8) does lead to the maximization of $I ( e ; W )$ , hence enables the model to preserve edge information.
|
| 104 |
+
|
| 105 |
+
Theorem 2. Assume the optimal solution of maximizing $\mathcal { L } _ { I } ( f , g ; e )$ is $f ^ { \star }$ and $g ^ { \star }$ , then $f ^ { \star }$ also maximizes $I ( e ; W )$ .
|
| 106 |
+
|
| 107 |
+
Proof. Note that $H ( e )$ is a constant when the graphs are given. In information theory, we have
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
H ( g ( f ( e ) ) ) \leq H ( f ( e ) ) \leq H ( e ) .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
$I ( e ; W )$ is upper bounded by $H ( e )$ ,
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
I ( e ; W ) = I ( e ; f ( e ) ) = H ( f ( e ) ) - H ( f ( e ) | e ) = H ( f ( e ) ) \leq H ( e ) .
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Since $f ^ { \star }$ and $g ^ { \star }$ is the optimal solution of maximizing $\mathcal { L } _ { I } ( f , g ; e )$ presented in Eq. (8), it is not difficult to see that $e = g ^ { \star } ( f ^ { \star } ( e ) ) , \forall e \in \mathcal { E }$ . In this case, the inequalities in Eq. 9 become equalities, i.e.,
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
H ( g ^ { \star } ( f ^ { \star } ( e ) ) ) = H ( f ^ { \star } ( e ) ) = H ( e ) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Therefore, we have $I ( e ; W ) = H ( e )$ , i.e., the maximum is attained in this case.
|
| 126 |
+
|
| 127 |
+
3.3 Edge Information Maximized Graph Neural Networks
|
| 128 |
+
|
| 129 |
+
Our EIGNN is derived by implementing our MI objective in GNNs. As a concrete example, the forward propagation of our model follows the formulation in Eq. (3), where the dege network $f : e W$ is expressed as a multi-layer perceptron (MLP). According to theoretical analysis presented in Sec. 3.2 , we introduce another MLP $g : W \to e$ as the decoder.
|
| 130 |
+
|
| 131 |
+
For graph regression or classification tasks, the model outputs a prediction $y$ for each graph $G$ , which has label $\hat { y }$ . Without MI maximization, we denote the vanilla loss as $\mathcal { L } _ { 0 } ( \hat { y } , y ; G )$ . Common choice of $\mathcal { L } _ { 0 }$ includes Mean Square Error (MSE), Mean Absolute Error (MAE) and Cross Entropy (CE). For a graph $G = ( \nu , \mathcal { E } )$ , EIGNN maximizes $\mathcal { L } _ { I } ( f , g ; e )$ and minimizes $\mathcal { L } _ { 0 } ( \hat { y } , y ; G )$ using the following loss function
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathcal { L } _ { E I G N N } ( G ) = \mathcal { L } _ { 0 } ( \hat { y } , y ; G ) - \lambda \mathbb { E } _ { e \in \mathcal { E } } [ \mathcal { L } _ { I } ( f , g ; e ) ] ,
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where $\mathbb { E } _ { e \in \mathcal { E } } [ \cdot ]$ denotes taking the mean over all edges in $G = ( \nu , \mathcal { E } )$ and $\lambda$ is the regularization parameter. When EIGNN is trained using mini-batches, $\mathcal { L } _ { 0 } ( \hat { y } , y ; G )$ is averaged over all graphs in the batch while $\mathcal { L } _ { I } ( f , g ; e )$ is averaged over all edges of all graphs in the batch.
|
| 138 |
+
|
| 139 |
+
Similarly, for relational prediction tasks in knowledge graphs, EIGNN directly yields nodelevel representations $h _ { v }$ for each node $v \in \mathcal V$ and edge-level representations $e$ for each relationship. The objective function of EIGNN can be derived from the translational scoring function Bordes et al. (2013), which learns embedding such that for a given valid triple $t _ { v w } = ( h _ { v } , e _ { v w } , h _ { w } )$ from the valid set $S$ , the condition $d _ { t _ { v w } } = h _ { v } + e _ { v w } - h _ { w } \approx 0$ holds. Let $\mathcal { L } _ { 0 } = \mathbb { E } _ { t _ { v w } \in S } \mathbb { E } _ { t _ { v w } ^ { \prime } \in S ^ { \prime } } \operatorname* { m a x } \{ d _ { t _ { v w } ^ { \prime } } - d _ { t _ { v w } } + \gamma , 0 \}$ , where $S ^ { \prime }$ denotes a set of invalid triples and $\gamma$ is a margin hyper-parameter, EIGNN can be trained by minimizing the following loss,
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\mathcal { L } _ { E I G N N } ( G ) = \mathcal { L } _ { 0 } - \lambda \mathbb { E } _ { e \in \mathcal { E } } [ \mathcal { L } _ { I } ( f , g ; e ) ] .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
# 4 Experiments
|
| 146 |
+
|
| 147 |
+
In this section, we first conduct experiments on a large quantum chemistry benchmark QM9, which is challenging for most baselines. Then we evaluate EIGNN on several useful molecule benchmarks and use attribution analysis to show that EIGNN increases the impact of edges and captures domain knowledge without human interference. Finally, we adopt our method to large-scale knowledge graphs and evaluate the performance on challenging relation prediction tasks using a wide variety of real-world datasets. All experimental results demonstrate a clear and substantial improvement of EIGNN over the state-of-the-art methods.
|
| 148 |
+
|
| 149 |
+
# 4.1 Quantum Chemistry
|
| 150 |
+
|
| 151 |
+
QM9 (Ramakrishnan et al., 2014) is a large benchmark containing 134k molecules with 12 quantum chemistry regression properties, which have been show to be quite challenging for many GNNs (Gilmer et al., 2017). Feature engineering of nodes and edges exactly follows (Gilmer et al., 2017) such that molecules are preprocessed as graphs according to atom features and bond features. We compare our EIGNN with nine state-of-the-art baselines which can be categorized into three groups according to the ability of handling edge features: i) GCN, ChebyNet, GAT and GIN (Xu et al., 2019) which simply use binary edge features to indicate the existence of a bond without any other edge features; ii) RGCN, GGNN, LNet and simplified MPNN (sMPNN) which consider bond types (no bond, single, double, triple, or aromatic); iii) MPNN and our EIGNN which use edge feature vectors to indicate both edge types and pairwise distance between atoms.
|
| 152 |
+
|
| 153 |
+
For a fair comparison, we repeat all experiments 3 times with different random seeds while during each run, all methods share the same random seed. We randomly choose 10k molecules for validation, 10k molecules for testing, and keep the rest for training. Each target property is normalized to zero mean and unit variance for training. Each model is trained to predict the 12 target properties simultaneously. $\lambda$ is naively set to 1 for EIGNN. We use mean square error (MSE) loss to train the models for at most 300 epochs till convergence, and the performance is measured by mean absolute error (MAE). For LNet and GGNN, implementation of the readout function follows the original paper. While for all other models, we use the same set2set (Vinyals et al., 2015) readout, which has been demonstrated to work well in (Gilmer et al., 2017).
|
| 154 |
+
|
| 155 |
+
Table 1: Quantum property regressions for 12 targets and overall performance (top two raws) on QM9. We repeat all experiments 3 times with different random seeds and report the average performance. Full results with standard deviation are presented in Appendix A, e.g., for MPNN and EIGNN, we have Avg. nMAE $0 . 0 3 9 8 \pm 0 . 0 0 0 2$ and 0.0357 ± 0.0005.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Method</td><td>GCN</td><td>ChebyNet</td><td>GAT</td><td>GIN</td><td>RGCN</td><td>GGNN</td><td>LNet</td><td>sMPNN</td><td>MPNN</td><td>EIGNN</td></tr><tr><td>Avg.nMAE</td><td>0.135</td><td>0.121</td><td>0.137</td><td>0.100</td><td>0.102</td><td>0.099</td><td>0.099</td><td>0.089</td><td>0.040</td><td>0.036</td></tr><tr><td>Avg.MAE</td><td>5.306</td><td>4.303</td><td>5.470</td><td>3.480</td><td>3.817</td><td>3.661</td><td>3.653</td><td>3.161</td><td>0.693</td><td>0.633</td></tr><tr><td>mu</td><td>0.568</td><td>0.518</td><td>0.567</td><td>0.478</td><td>0.506</td><td>0.518</td><td>0.472</td><td>0.472</td><td>0.110</td><td>0.097</td></tr><tr><td>alpha</td><td>0.881</td><td>0.793</td><td>0.891</td><td>0.621</td><td>0.632</td><td>0.608</td><td>0.623</td><td>0.528</td><td>0.332</td><td>0.294</td></tr><tr><td>HOMO(10-3)</td><td>5.451</td><td>4.775</td><td>5.429</td><td>4.183</td><td>4.453</td><td>4.483</td><td>3.889</td><td>3.854</td><td>2.481</td><td>2.230</td></tr><tr><td>LUMO(10-3)</td><td>6.400</td><td>5.674</td><td>6.331</td><td>4.796</td><td>5.138</td><td>5.153</td><td>4.194</td><td>4.549</td><td>2.862</td><td>2.593</td></tr><tr><td>gap(10-3)</td><td>8.201</td><td>7.097</td><td>8.193</td><td>6.096</td><td>6.500</td><td>6.602</td><td>5.813</td><td>5.634</td><td>3.620</td><td>3.275</td></tr><tr><td>R2</td><td>53.56</td><td>41.95</td><td>54.52</td><td>34.65</td><td>40.10</td><td>39.68</td><td>35.27</td><td>33.49</td><td>6.064</td><td>5.646</td></tr><tr><td>ZPVE(10-3)</td><td>2.533</td><td>2.527</td><td>2.271</td><td>1.744</td><td>1.477</td><td>1.292</td><td>1.438</td><td>1.345</td><td>0.679</td><td>0.612</td></tr><tr><td>UO</td><td>2.042</td><td>1.984</td><td>2.290</td><td>1.422</td><td>1.059</td><td>0.697</td><td>1.806</td><td>0.791</td><td>0.416</td><td>0.357</td></tr><tr><td>U</td><td>2.042</td><td>1.984</td><td>2.290</td><td>1.422</td><td>1.059</td><td>0.697</td><td>1.755</td><td>0.791</td><td>0.416</td><td>0.357</td></tr><tr><td>H</td><td>2.042</td><td>1.984</td><td>2.290</td><td>1.422</td><td>1.059</td><td>0.697</td><td>1.796</td><td>0.791</td><td>0.416</td><td>0.357</td></tr><tr><td>G</td><td>2.042</td><td>1.984</td><td>2.290</td><td>1.422</td><td>1.059</td><td>0.696</td><td>1.778</td><td>0.791</td><td>0.416</td><td>0.357</td></tr><tr><td>Cv</td><td>0.473</td><td>0.420</td><td>0.479</td><td>0.309</td><td>0.317</td><td>0.315</td><td>0.312</td><td>0.262</td><td>0.134</td><td>0.121</td></tr></table>
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 1: Ablation study. Training and validation error on QM9. The shadow area indicates $m e a n \pm s t d$ over 3 runs.
|
| 161 |
+
|
| 162 |
+
In Table 1, we list regression results for all methods. We report individual MAE for each target in their original scale, averaged MAE (Avg. MAE) over 12 properties, and averaged normalized MAE (Avg. nMAE; averaged over normalized target properties since different targets have different units and ranges). Our EIGNN achieves the best performance for each metric and each target. Now we are ready to answer the following research questions. i) Are edge features important? Yes. The error has a trend of decreasing with increasing edge features. The comparison between sMPNN (using edge types) and MPNN (using edge types and distance) directly verifies the importance of edge features. It is also consistent with the expert knowledge that distances between pairwise atoms are closely related to quantum properties. For example, the smaller the distance between the two atoms, the stronger the bond is, and consequently a higher bond energy is associated with this atom pair. ii) Does the EIGNN work? Yes. EIGNN achieves the best performance on each target, outperforming the strong baseline MPNN. Moreover, the advantage of EIGNN over MPNN is consistent over 3 runs and the standard deviation on this task is quite small. Detailed results are shown in Table 4 of Appendix A. iii) How does the EIGNN work? Our MI objective is easily implemented on top of vanilla loss function. We have shown that our objective enables preserving of edge information. Fig. 1 demonstrates that regularization such as $L _ { 2 }$ weight decay can increase training error while our objective does not. Moreover, the validation performance verifies that regularization itself does not reduce the validation error. Thus, the effectiveness of EIGNN is due to exploiting edge features rather than the regularization effect. We further run an ablation study where we concatenate edge features to node representations (i.e., MPNN+concat in Fig. 1) in message passing. Concatenation is unable to identify correlations between edges and nodes (Gilmer et al., 2017) and our results show that it slightly reduces the mean validation error but increases the variance.
|
| 163 |
+
|
| 164 |
+
# 4.2 More Molecule Benchmarks with Potential Applications
|
| 165 |
+
|
| 166 |
+
We further evaluate EIGNN on three molecule benchmarks: Lipophilicity (Wu et al., 2018), ESOL (Delaney, 2004) and FreeSolv (Mobley & Guthrie, 2014). These datasets contain fewer molecules, and have potential usages in applications such as chemistry, drug discovery, and materials science. For example, the property lipophilicity is an important feature of drug molecules that affects both membrane permeability and solubility. The dataset Lipophilicity contains 4200 compounds. ESOL provides water solubility data for 1128 compounds. FreeSolv contains hydration free energy of 642 small molecules in water. We conduct graph regression experiments on these benchmarks. All datasets are split into training, validation and test according to a proportion of 0.8/0.1/0.1. MPNN and our EIGNN share the same architecture with 3 layers of message passing and 3 steps of set2set. We repeat each experiment 3 times with different random seeds. Results of testing root mean square error (RMSE) in Table 2 verify the effectiveness of our method. Our EIGNN outperforms MPNN on each dataset and each run. Detailed results for each run are presented in Appendix B.
|
| 167 |
+
|
| 168 |
+
Table 2: Testing RMSE on Lipophilicity, ESOL and FreeSolv.
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Dataset</td><td colspan="2">Lipophilicity</td><td colspan="2">ESOL</td><td colspan="2">FreeSolv</td></tr><tr><td>Method</td><td>MPNN</td><td>EIGNN</td><td>MPNN</td><td>EIGNN</td><td>MPNN</td><td>EIGNN</td></tr><tr><td>mean±std</td><td>0.678±0.042</td><td>0.653±0.025</td><td>0.805±0.064</td><td>0.776±0.071</td><td>1.398±0.081</td><td>1.273±0.137</td></tr></table>
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 2: Attribution analysis. The color indicates the impact of an edge/atom on the output, i.e., the regression result. EIGNN i) increases the edge attribution, ii) reduces the prediction error and iii) can learn domain knowledge without human interference.
|
| 174 |
+
|
| 175 |
+
Attribution analysis. To understand how our EIGNN reduces the regression error, we conduct attribution analysis, i.e., attributing the prediction of a deep network to its input features, which usually builds up on the standard gradient operator (Sundararajan et al., features 2017). For an output $e$ as $\begin{array} { r } { S _ { e } = | \frac { \partial y } { \partial e } | } \end{array}$ $y$ , i.e., the prediction of a GNN, we define its sensitivity to an edge with , where $\left. \cdot \right.$ denotes the $L _ { 1 }$ norm. Similarly, the sensitivity to an atom with features $x$ is $\begin{array} { r } { S _ { x } = | \frac { \partial y } { \partial x } | } \end{array}$ . Then $S _ { e }$ and $S _ { x }$ are used as the metrics of attribution in our experiments. As an example, we show in Fig. 2 the attribution for two molecules in Lipophilicity: (a) $N c I n o n c I C ( = N O ) N c \mathcal { Q } c c c ( F ) c ( C l ) c \mathcal { Q }$ and (b) Oc1c2ncc3ccccc3c2nn1c4ccccc4 . Molecule in (a) has the potential to be used to treat, prevent and/or diagnose cancer Prinz et al. (2019). Compared with MPNN, we can observe an increasing of overall edge attribution under our EIGNN and a decreasing of prediction error in both cases. Interestingly, the attribution under EIGNN is similar to the expert knowledge of chemists: halogen atoms such as {Cl, Br, I} and their bond with the carbon atom greatly effect the lipophilicity of a molecule Wilcken et al. (2013), while atoms {O, N} also have high impact on the lipophilicity but usually in a negative way (Augustijns & Brewster, 2007). In Fig. 2 (a), the attribution of the halogen bond C-Cl and the pair {O, N} under our EIGNN is much higher than the one under MPNN, which is consistent with the expert knowledge. In Fig. 2 (b), similarly, the attribution of atoms {O, N} and the bond C-O under EIGNN is much higher. More examples are presented in Appendix C.
|
| 176 |
+
|
| 177 |
+
# 4.3 Predicting Relations in Knowledge Graphs
|
| 178 |
+
|
| 179 |
+
In this subsection, we adopt EIGNN to tackle the problem of relation prediction in knowledge graphs (KGs), which entails predicting whether a given triple is valid or not. For example, a triple (London, capital of, United Kingdom) should be classified as valid or London should be predicted as the capital of United Kingdom. KGs represent human knowledge as a directed graph, and have been widely used in practical applications, such as semantic search, dialogue generation, question answering etc. Recovering missing relations in KGs have been a major task for practical usages of KGs. We evaluate our methods on three benchmark datasets, WN18RR (Dettmers et al., 2018), FB15k-237 (Toutanova et al., 2015) and NELL-995 (Xiong et al., 2017). Without the reversible relation problem (Dettmers et al., 2018), WN18RR includes 11 relations scraped from WordNet for 40, 943 synsets. FB15k-237 is a subset of Freebase, and contains 14, 541 entities associated with 237 types of edge. NELL-995 is constructed from the $9 9 5 ^ { t h }$ iteration of NELL system, containing 75, 492 entities and 200 types of edge.
|
| 180 |
+
|
| 181 |
+
Table 3: Experimental results on WN18RR, FB15K-237 and NELL-995 test sets. Hits@N values are in percentage. The best score is in bold and second best score is underlined.
|
| 182 |
+
|
| 183 |
+
<table><tr><td rowspan="3">Dataset</td><td colspan="4">WN18RR</td><td colspan="4">FB15K-237</td><td colspan="4">NELL-995</td></tr><tr><td colspan="4"></td><td rowspan="2">MRR</td><td colspan="3">Hit@N%</td><td rowspan="2">MRR</td><td colspan="3">Hit@N %</td></tr><tr><td>MRR</td><td>@1</td><td>@3</td><td>@10</td><td>@1</td><td>@3</td><td>@10</td><td>@1</td><td>@3</td><td>@10</td></tr><tr><td>DistMult</td><td>0.444</td><td>41.2</td><td>47</td><td>50.4</td><td>0.281</td><td>19.9</td><td>30.1</td><td>44.6</td><td>0.485</td><td>40.1</td><td>52.4</td><td>61</td></tr><tr><td>ComplEx</td><td>0.449</td><td>40.9</td><td>46.9</td><td>53</td><td>0.278</td><td>19.4</td><td>29.7</td><td>45</td><td>0.482</td><td>39.9</td><td>52.8</td><td>60.6</td></tr><tr><td>ConvE</td><td>0.456</td><td>41.9</td><td>47</td><td>53.1</td><td>0.312</td><td>22.5</td><td>34.1</td><td>49.7</td><td>0.491</td><td>40.3</td><td>53.1</td><td>61.3</td></tr><tr><td>TransE</td><td>0.243</td><td>42.7</td><td>44.1</td><td>53.2</td><td>0.279</td><td>19.8</td><td>37.6</td><td>44.1</td><td>0.401</td><td>34.4</td><td>47.2</td><td>50.1</td></tr><tr><td>ConvKB</td><td>0.265</td><td>58.2</td><td>44.5</td><td>55.8</td><td>0.289</td><td>19.8</td><td>32.4</td><td>47.1</td><td>0.43</td><td>37.0</td><td>47</td><td>54.5</td></tr><tr><td>R-GCN</td><td>0.123</td><td>8</td><td>13.7</td><td>20.7</td><td>0.164</td><td>10</td><td>18.1</td><td>30</td><td>0.12</td><td>8.2</td><td>12.6</td><td>18.8</td></tr><tr><td>KBGAT</td><td>0.436</td><td>35.8</td><td>48.1</td><td>57.8</td><td>0.431</td><td>36.1</td><td>45.8</td><td>56.9</td><td>0.514</td><td>42.9</td><td>55.3</td><td>67.8</td></tr><tr><td>EIGNN</td><td>0.438</td><td>35.7</td><td>48.8</td><td>58.1</td><td>0.451</td><td>37.4</td><td>48.2</td><td>60.5</td><td>0.523</td><td>43.8</td><td>56.1</td><td>68.3</td></tr></table>
|
| 184 |
+
|
| 185 |
+
A critical issue of applying Eq. (3) to KGs is that high-dimensional embedding vectors are required to distinguish massive amount of entities and relations, leading to a rapid growth in number of parameters in EIGNN. To address this issue, we adopt the architecture of (Nathani et al., 2019) and learn graph attention based embeddings that target relation prediction on KGs as follows,
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\begin{array} { r } { m _ { v w } = f \big ( h _ { v } ^ { ( l ) } , e _ { v w } ^ { l } , h _ { w } ^ { ( l ) } \big ) , \alpha _ { v w } ^ { l } = \mathrm { s o f t m a x } \big ( a ^ { l } m _ { v w } ^ { l } \big ) , h _ { v } ^ { ( l + 1 ) } = \sigma \left( \sum _ { w \in \mathcal { N } _ { v } } \alpha _ { v w } ^ { l } m _ { v w } ^ { l } \right) . } \end{array}
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
Compared with Eq. (3), where $m _ { v w } = f ( e _ { v w } ) h _ { w }$ , the above equation absorbs the transform matrix $f ( e _ { v w } )$ into $f ( h _ { v } ^ { ( l ) } , e _ { v w } , h _ { w } ^ { ( l ) } )$ and reduces the model parameters. In the following experiments, we implement $f$ using a MLP as in previous experiments, and maximizes the MI between $e _ { v w }$ and $m _ { v w }$ by introducing another MLP with $\lambda = 0 . 0 1$ . Multi-head attention is further introduced to stabilize the learning process and encapsulate more information about neighbors according to (Veličković et al., 2018). After training EIGNN, ConvKB (Nguyen et al., 2018) is adopted as a regression function for a given triple by analyzing the global embedding properties across each dimension.
|
| 192 |
+
|
| 193 |
+
In the relation prediction task, the aim is to predict a triple $( v , e _ { v w } , w )$ with $\boldsymbol { v }$ or $w$ missing. We can generate a set of candidate triples for each missing entity $v$ by randomly replacing it with an arbitrary one. Scores can be calculated by ConvKB for all triples, and we find the rank of a correct triple by sorting all scores in ascending order. Thus, the performance of relation prediction task can be evaluated by mean reciprocal rank (MRR) and the proportion of correct entities in the top $N$ ranks (Hits@N) for $N = 1 , 3$ , and 10 (Bordes et al., 2013). We compare our EIGNN with seven state-of-the-art baselines focusing on this task: DistMult (Yang et al., 2014), ComplEx (Trouillon et al., 2016), ConvE (Dettmers et al., 2018), TransE (Bordes et al., 2013), ConvKB (Nguyen et al., 2018), RGCN (Schlichtkrull et al., 2018) and KBGAT (Nathani et al., 2019). As shown in Table 3, our EIGNN achieves the best performance for each metric on FB15K-237 and NELL-995, and achieves the best performance on WN18RR with Hit $^ \mathrm { ( a 3 }$ and 10 metrics. The results of KBGAT are reproduced following the official implementation1, and the results of other methods can be found in the previous peer-reviewed publications, i.e. (Nathani et al., 2019).
|
| 194 |
+
|
| 195 |
+
# 5 Conclusions
|
| 196 |
+
|
| 197 |
+
In this work, to make better use of edge features in GNNs, we proposed the edge information maximized graph neural network (EIGNN) that maximizes the mutual information between edge feature vectors and message passing channels. We reformulated the mutual information as a differentiable objective by adopting a variational approach. We have theoretically proved that our proposed objective enables EIGNN to preserve edge information and empirically evaluated EIGNN’s performance on a variety of benchmarks incorporating an array of challenging molecular datasets and knowledge graphs. These results clearly manifested a substantial improvement of EIGNN over the prior state-of-the-art methods. Apart from demonstrating the impressive performance of EIGNN, we also showed that its effectiveness is due to exploitation of edge features instead of the regularization effect. Notably, attribution analysis on molecular graphs show that EIGNN can capture domain knowledge in an end-to-end fashion.
|
| 198 |
+
|
| 199 |
+
# References
|
| 200 |
+
|
| 201 |
+
David Barber Felix Agakov. The im algorithm: a variational approach to information maximization. NeurIPS, 2004.
|
| 202 |
+
|
| 203 |
+
Patrick Augustijns and Marcus E Brewster. Solvent systems and their selection in pharmaceutics and biopharmaceutics, volume 190. Springer, 2007.
|
| 204 |
+
|
| 205 |
+
David Barber and Felix V Agakov. Kernelized infomax clustering. In NeurIPS, 2006.
|
| 206 |
+
|
| 207 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NeurIPS, pp. 2787–2795, 2013.
|
| 208 |
+
|
| 209 |
+
John S Bridle, Anthony JR Heading, and David JC MacKay. Unsupervised classifiers, mutual information and’phantom targets. In NeurIPS, 1992.
|
| 210 |
+
|
| 211 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: interpretable representation learning by information maximizing generative adversarial nets. In NeurIPS, 2016.
|
| 212 |
+
|
| 213 |
+
Kyunghyun Cho, Bart Van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
|
| 214 |
+
|
| 215 |
+
Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, 2016.
|
| 216 |
+
|
| 217 |
+
John S Delaney. Esol: estimating aqueous solubility directly from molecular structure. Journal of chemical information and computer sciences, 44(3):1000–1005, 2004.
|
| 218 |
+
|
| 219 |
+
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2d knowledge graph embeddings. In AAAI, 2018.
|
| 220 |
+
|
| 221 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In NeurIPS, 2015.
|
| 222 |
+
|
| 223 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In ICML, 2017.
|
| 224 |
+
|
| 225 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 855–864. ACM, 2016.
|
| 226 |
+
|
| 227 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pp. 1024–1034, 2017.
|
| 228 |
+
|
| 229 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. 2019.
|
| 230 |
+
|
| 231 |
+
Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Pre-training graph neural networks. arXiv preprint arXiv:1905.12265, 2019.
|
| 232 |
+
|
| 233 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 234 |
+
|
| 235 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 236 |
+
|
| 237 |
+
Andreas Krause, Pietro Perona, and Ryan G Gomes. Discriminative clustering by regularized information maximization. In NeurIPS, 2010.
|
| 238 |
+
|
| 239 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In ICLR, 2016.
|
| 240 |
+
|
| 241 |
+
Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. Lanczosnet: Multi-scale deep graph convolutional networks. In ICLR, 2019.
|
| 242 |
+
|
| 243 |
+
Ralph Linsker. Self-organization in a perceptual network. Computer, 21(3):105–117, 1988.
|
| 244 |
+
|
| 245 |
+
David L Mobley and J Peter Guthrie. Freesolv: a database of experimental and calculated hydration free energies, with input files. Journal of computer-aided molecular design, 28 (7):711–720, 2014.
|
| 246 |
+
|
| 247 |
+
Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI, volume 33, pp. 4602–4609, 2019.
|
| 248 |
+
|
| 249 |
+
Deepak Nathani, Jatin Chauhan, Charu Sharma, and Manohar Kaul. Learning attentionbased embeddings for relation prediction in knowledge graphs. The 57th Annual Meeting of the Association for Computational Linguistics (ACL), 2019.
|
| 250 |
+
|
| 251 |
+
Dai Quoc Nguyen, Tu Dinh Nguyen, Dat Quoc Nguyen, and Dinh Phung. A novel embedding model for knowledge base completion based on convolutional neural network. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 327–333, 2018.
|
| 252 |
+
|
| 253 |
+
Bianka Prinz, Jerry M Thomas, Ansgar Brock, Viviana Cremasco, Catherine Anne SabatosPeyton, Glenn Dranoff, Scott Chapel, Andrew Lake, Alison Paterson, Rachel W O’connor, et al. Antibody molecules to cd73 and uses thereof, January 31 2019. US Patent App. 16/014,744.
|
| 254 |
+
|
| 255 |
+
Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1: 140022, 2014.
|
| 256 |
+
|
| 257 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1): 61–80, 2009.
|
| 258 |
+
|
| 259 |
+
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne Van Den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. In European Semantic Web Conference, pp. 593–607. Springer, 2018.
|
| 260 |
+
|
| 261 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In ICML, pp. 3319–3328. JMLR. org, 2017.
|
| 262 |
+
|
| 263 |
+
Kristina Toutanova, Danqi Chen, Patrick Pantel, Hoifung Poon, Pallavi Choudhury, and Michael Gamon. Representing text for joint embedding of text and knowledge bases. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pp. 1499–1509, 2015.
|
| 264 |
+
|
| 265 |
+
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In ICML, pp. 2071–2080, 2016.
|
| 266 |
+
|
| 267 |
+
Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. In ICLR, 2018.
|
| 268 |
+
|
| 269 |
+
Petar Veličković, William Fedus, William L Hamilton, Pietro Liò, Yoshua Bengio, and R Devon Hjelm. Deep graph infomax. In ICLR, 2019.
|
| 270 |
+
|
| 271 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
|
| 272 |
+
|
| 273 |
+
Rainer Wilcken, Markus O Zimmermann, Andreas Lange, Andreas C Joerger, and Frank M Boeckler. Principles and applications of halogen bonding in medicinal chemistry and chemical biology. Journal of medicinal chemistry, 56(4):1363–1388, 2013.
|
| 274 |
+
|
| 275 |
+
Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. Moleculenet: a benchmark for molecular machine learning. Chemical science, 9(2):513–530, 2018.
|
| 276 |
+
Wenhan Xiong, Thien Hoang, and William Yang Wang. Deeppath: A reinforcement learning method for knowledge graph reasoning. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 564–573, 2017.
|
| 277 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 278 |
+
Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. ICLR, 2014.
|
| 279 |
+
Zhitao Ying, Jiaxuan You, Christopher Morris, Xiang Ren, Will Hamilton, and Jure Leskovec. Hierarchical graph representation learning with differentiable pooling. In NeurIPS, pp. 4800–4810, 2018.
|
| 280 |
+
Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, and Maosong Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
|
| 281 |
+
|
| 282 |
+
# A Full Results on QM9
|
| 283 |
+
|
| 284 |
+
Table 4: Full results of quantum property regressions for 12 targets and overall performance (nMAE and MAE in top two raws) on QM9. We repeat all experiments 3 times with different random seeds and report the average performance and standard deviation. This is a supplement for Table 1. in the main text.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Method</td><td>GCN</td><td>ChebyNet</td><td>GAT</td><td>GIN</td></tr><tr><td>Avg.nMAE</td><td>0.1350±0.0046</td><td>0.1206±0.0084</td><td>0.1367±0.0050</td><td>0.1001±0.0007</td></tr><tr><td>Avg.MAE</td><td>5.3063±0.1964</td><td>4.3032±0.4814</td><td>5.4698±0.2040</td><td>3.4799±0.0402</td></tr><tr><td>mu</td><td>0.5679±0.0078</td><td>0.5180±0.0131</td><td>0.5670±0.0102</td><td>0.4783±0.0041</td></tr><tr><td>alpha</td><td>0.8811±0.0308</td><td>0.7932±0.0778</td><td>0.8913±0.0314</td><td>0.6209±0.0028</td></tr><tr><td>HOMO(10-3)</td><td>5.4510±0.0790</td><td>4.7750±0.2040</td><td>5.4290±0.1660</td><td>4.1830±0.0370</td></tr><tr><td>LUMO(10-3)</td><td>6.4000±0.1230</td><td>5.6740±0.2670</td><td>6.3310±0.2390</td><td>4.7960±0.0520</td></tr><tr><td>gap(10-3)</td><td>8.2010±0.2150</td><td>7.0970±0.3620</td><td>8.1930±0.2910</td><td>6.0960±0.0420</td></tr><tr><td>R2</td><td>53.563±1.0319</td><td>41.950±4.8289</td><td>54.519±1.5992</td><td>34.647±0.2167</td></tr><tr><td>ZPVE(10-3)</td><td>2.5330±0.1070</td><td>2.5270±0.3560</td><td>2.2710±0.1450</td><td>1.7440±0.0100</td></tr><tr><td>UO</td><td>2.0422±0.3281</td><td>1.9842±0.2035</td><td>2.2899±0.2000</td><td>1.4215±0.0857</td></tr><tr><td>U</td><td>2.0422±0.3281</td><td>1.9842±0.2035</td><td>2.2899±0.2000</td><td>1.4215±0.0857</td></tr><tr><td>H</td><td>2.0422±0.3281</td><td>1.9842±0.2035</td><td>2.2899±0.2000</td><td>1.4215±0.0857</td></tr><tr><td>G</td><td>2.0423±0.3281</td><td>1.9842±0.2036</td><td>2.2899±0.2000</td><td>1.4215±0.0857</td></tr><tr><td>Cv</td><td>0.4730±0.0209</td><td>0.4199±0.0499</td><td>0.4787±0.0164</td><td>0.3093±0.0035</td></tr><tr><td>Method</td><td>RGCN</td><td>GGNN</td><td>LNet</td><td>sMPNN</td></tr><tr><td>Avg.nMAE</td><td>0.1021±0.0016</td><td>0.0992±0.0013</td><td>0.0992±0.0061</td><td>0.0888±0.0014</td></tr><tr><td>Avg.MAE</td><td>3.8175±0.0605</td><td>3.6608±0.0723</td><td>3.6527±0.3417</td><td>3.1610±0.0697</td></tr><tr><td>mu</td><td>0.5056±0.0048</td><td>0.5179±0.0076</td><td>0.4717±0.0063</td><td>0.4718±0.0096</td></tr><tr><td>alpha</td><td>0.6321±0.0145</td><td>0.6077±0.0092</td><td>0.6225±0.0508</td><td>0.5278±0.0106</td></tr><tr><td>HOMO(10-3)</td><td>4.4530±0.1290</td><td>4.4830±0.0650</td><td>3.8889±0.1617</td><td>3.8540±0.0410</td></tr><tr><td>LUMO(10-3)</td><td>5.1380±0.1210</td><td>5.1530±0.0890</td><td>4.1935±0.2205</td><td>4.5490±0.0810</td></tr><tr><td>gap(10-3)</td><td>6.5000±0.1390</td><td>6.6020±0.1400</td><td>5.8132±0.6456</td><td>5.6340±0.0570</td></tr><tr><td>R2</td><td>40.102±0.7428</td><td>39.685±0.8212</td><td>35.275±3.0531</td><td>33.489±0.6562</td></tr><tr><td>ZPVE(10-3)</td><td>1.4770±0.0090</td><td>1.2920±0.0340</td><td>1.4376±0.0769</td><td>1.3450±0.0260</td></tr><tr><td>UO</td><td>1.0589±0.0231</td><td>0.6969±0.0413</td><td>1.8058±0.2533</td><td>0.7914±0.0446</td></tr><tr><td>U</td><td>1.0589±0.0231</td><td>0.6966±0.0418</td><td>1.7555±0.2196</td><td>0.7914±0.0446</td></tr><tr><td>H</td><td>1.0589±0.0231</td><td>0.6974±0.0408</td><td>1.7964±0.2428</td><td>0.7914±0.0446</td></tr><tr><td>G</td><td>1.0589±0.0231</td><td>0.6961±0.0421</td><td>1.7780±0.2458</td><td>0.7914±0.0446</td></tr><tr><td>Cv</td><td>0.3170±0.0152</td><td>0.3146±0.0125</td><td>0.3124±0.0303</td><td>0.2625±0.0040</td></tr><tr><td>Method</td><td>MPNN</td><td>EIGNN</td><td></td><td></td></tr><tr><td>Avg.nMAE</td><td>0.0398±0.0002</td><td>0.0357±0.0005</td><td></td><td></td></tr><tr><td>Avg.MAE</td><td>0.6929±0.0212</td><td>0.6331±0.0298</td><td></td><td></td></tr><tr><td>mu</td><td>0.1095±0.0014</td><td>0.0974±0.0026</td><td></td><td></td></tr><tr><td>alpha</td><td>0.3318±0.0026</td><td>0.2939±0.0054</td><td></td><td></td></tr><tr><td>HOMO(10-3)</td><td>2.4810±0.0200</td><td>2.2300±0.0310</td><td></td><td></td></tr><tr><td>LUMO(10-3)</td><td>2.8620±0.0370</td><td>2.5930±0.0440</td><td></td><td></td></tr><tr><td>gap(10-3)</td><td>3.6200±0.0180</td><td>3.2750±0.0520</td><td></td><td></td></tr><tr><td>R2</td><td>6.0637±0.2511</td><td>5.6464±0.3098</td><td></td><td></td></tr><tr><td>ZPVE(10-3)</td><td>0.6790±0.0140</td><td>0.6120±0.0170</td><td></td><td></td></tr><tr><td>UO</td><td>0.4164±0.0225</td><td>0.3574±0.0100</td><td></td><td></td></tr><tr><td>U</td><td>0.4164±0.0225</td><td>0.3575±0.0100</td><td></td><td></td></tr><tr><td>H</td><td>0.4164±0.0225</td><td>0.3574±0.0100</td><td></td><td></td></tr><tr><td>G</td><td>0.4164±0.0225</td><td>0.3575±0.0101</td><td></td><td></td></tr><tr><td>Cv</td><td>0.1339±0.0013</td><td>0.1208±0.0027</td><td></td><td></td></tr></table>
|
| 287 |
+
|
| 288 |
+
We present full results of quantum property regressions on QM9 with average performance and standard deviation in Table 4. The $( 1 0 ^ { - 3 }$ ) in the parentheses indicates that the values in the corresponding raw of the table should multiply by $1 0 ^ { - 3 }$ . This is simply for clear presentation of the values. We also present a detailed descriptions on the target properties in Table 5 for your reference.
|
| 289 |
+
|
| 290 |
+
In our results, we directly report MAE instead of Error Ratio [(MAE)/(Chemical Accuracy) (Gilmer et al., 2017)], because it is common to report MAE in terms of chemical unit. This practice has been widely adopted not only in computational chemistry but also in the machine learning community working on molecular graphs (Wu et al., 2018; Morris et al., 2019). Still, we add Table 6 which contains the Error Ratio for MPNN and our EIGNN. In this comparison, we follow (Gilmer et al., 2017) and train models separately to predict each target. Our EIGNN consistently outperforms MPNN.
|
| 291 |
+
|
| 292 |
+
Table 5: Regression targets on QM9.
|
| 293 |
+
|
| 294 |
+
<table><tr><td>Target property</td><td>Description</td><td>Unit</td></tr><tr><td>mu</td><td>Dipole moment</td><td>D</td></tr><tr><td>alpha</td><td>Isotropic polarizability</td><td>a</td></tr><tr><td>HOMO</td><td>Highest occupied molecular orbital energy</td><td>Eh</td></tr><tr><td>LUMO</td><td>Lowest unoccupied molecular orbital energy</td><td>Eh</td></tr><tr><td>gap</td><td>Gap between HOMO and LUMO</td><td>Eh</td></tr><tr><td>R2</td><td>Electronic spatial extent</td><td>品</td></tr><tr><td>ZPVE</td><td>Zero point vibrational energy</td><td>Eh</td></tr><tr><td>UO</td><td>Internal energy at OK</td><td>Eh</td></tr><tr><td>U</td><td>Internal energy at 298.15K</td><td>Eh</td></tr><tr><td>H</td><td>Enthalpy at 298.15K</td><td>Eh</td></tr><tr><td>G</td><td>Free energy at 298.15K</td><td>Eh</td></tr><tr><td>Cv</td><td>Heat capavity at 298.15K</td><td>cal molK</td></tr></table>
|
| 295 |
+
|
| 296 |
+
Table 6: Error Ratio [(MAE)/(Chemical Accuracy) (Gilmer et al., 2017)] on QM9. Note that the energy values of $\{ \mathrm { U 0 , ~ U , ~ H , ~ G } \}$ are per molecule rather than per atom. Following (Gilmer et al., 2017), models are separately trained on each target.
|
| 297 |
+
|
| 298 |
+
<table><tr><td>Target</td><td>MPNN</td><td>EIGNN</td><td>Improvement (%)</td></tr><tr><td>mu</td><td>0.87</td><td>0.80</td><td>8.24</td></tr><tr><td>alpha</td><td>2.64</td><td>2.44</td><td>7.57</td></tr><tr><td>HOMO</td><td>1.54</td><td>1.39</td><td>10.2</td></tr><tr><td>LUMO</td><td>1.31</td><td>1.28</td><td>2.13</td></tr><tr><td>gap</td><td>2.20</td><td>1.97</td><td>10.4</td></tr><tr><td>R2</td><td>1.00</td><td>0.72</td><td>28.4</td></tr><tr><td>ZPVE</td><td>5.31</td><td>4.43</td><td>16.5</td></tr><tr><td>UO</td><td>64.3</td><td>35.8</td><td>44.4</td></tr><tr><td>U</td><td>56.6</td><td>23.6</td><td>58.3</td></tr><tr><td>H</td><td>77.4</td><td>35.2</td><td>54.5</td></tr><tr><td>G</td><td>46.6</td><td>34.4</td><td>26.1</td></tr><tr><td>Cv</td><td>1.69</td><td>1.79</td><td>-6.22</td></tr></table>
|
| 299 |
+
|
| 300 |
+
B Full Results on Lipophilicity, ESOL and FreeSolv
|
| 301 |
+
|
| 302 |
+
In this section, we present experimental results on Lipophilicity, ESOL and FreeSolv with detailed results for each run. The results in Table 7 verify that our EIGNN consistently outperforms MPNN.
|
| 303 |
+
|
| 304 |
+
# C More Examples of Attribution
|
| 305 |
+
|
| 306 |
+
In this section, we present more examples of attribution analysis on Lipophilicity. As a supplement for Fig. 2 in the main text, the observation here is similar. Compared with MPNN, we can observe an increasing of overall edge attribution under our EIGNN and a decreasing of prediction error in both cases. Notably, our EIGNN is able to capture the expert knowledge. (a) The molecule is $C N [ C @ \mathbb { Q } H ] ( C ) C ( = O ) N [ C @ \mathbb { Q } H ] ( C 1 C C C C T 1 ) C ( =$ $O ) N [ C @ H ] 2 C C C N ( C C c ( F ) c c 3 ) C 2$ . The attribution of $\{ \mathrm { O } , \mathrm { N } \}$ and the halogen atom $\mathrm { F }$ is higher under EIGNN. (b) The molecule is $C C ( C ) N 1 C C N [ C @ H ] ( C 1 ) C ( =$ $O ) N 2 C C N ( C C 2 ) C ( = O ) N c 3 c c c ( C l ) c ( C l ) c 3$ . Our EIGNN successfully captures the importance of two critical halogen atoms Cl and several atoms N. (c) The molecule is $C O c 1 c c ( c c 1 ) C ( = \ O ) N 2 C C C C 2 \ = \ O$ . The attribution of two atoms $\mathrm { \ o }$ at the top is
|
| 307 |
+
|
| 308 |
+
Table 7: Testing RMSE on Lipophilicity, ESOL and FreeSolv. This is a supplement for Table 2 in the main text.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Dataset</td><td colspan="2">Lipophilicity</td><td colspan="2">ESOL</td><td colspan="2">FreeSolv</td></tr><tr><td>Seed</td><td>MPNN</td><td>EIGNN</td><td>MPNN</td><td>EIGNN</td><td>MPNN</td><td>EIGNN</td></tr><tr><td>0</td><td>0.718</td><td>0.676</td><td>0.770</td><td>0.718</td><td>1.396</td><td>1.109</td></tr><tr><td>1</td><td>0.696</td><td>0.664</td><td>0.750</td><td>0.733</td><td>1.299</td><td>1.265</td></tr><tr><td>2</td><td>0.620</td><td>0.619</td><td>0.894</td><td>0.876</td><td>1.499</td><td>1.443</td></tr><tr><td>mean±std</td><td>0.678±0.042</td><td>0.653±0.025</td><td>0.805±0.064</td><td>0.776±0.071</td><td>1.398±0.081</td><td>1.273±0.137</td></tr></table>
|
| 311 |
+
|
| 312 |
+
much higher under EIGNN. (d) The molecule is $C c 1 c c 2 N C ( = O ) C ( = C C ( = O ) c 2 c c 1 C ) O$ .
|
| 313 |
+
The attribution of atoms O is much higher under EIGNN.
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 3: More examples of attribution analysis. The color indicates the impact of an edge/atom on the output, i.e., the regression result. EIGNN i) increases the edge attribution, ii) reduces the prediction error and iii) can learn domain knowledge without human interference.
|
md/train/ByxkijC5FQ/ByxkijC5FQ.md
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURAL PERSISTENCE: A COMPLEXITY MEASURE FOR DEEP NEURAL NETWORKS USING ALGEBRAIC TOPOLOGY
|
| 2 |
+
|
| 3 |
+
Bastian Rieck1,2,†, Matteo Togninalli1,2,†, Christian $\mathbf { B o c k } ^ { 1 , 2 , \dagger }$ , Michael Moor1,2, Max Horn1,2, Thomas Gumbsch1,2, Karsten Borwardt1,2
|
| 4 |
+
|
| 5 |
+
1DEPARTMENT OF BIOSYSTEMS SCIENCE AND ENGINEERING, ETH ZURICH, SWITZERLAND
|
| 6 |
+
2SIB SWISS INSTITUTE OF BIOINFORMATICS, SWITZERLAND
|
| 7 |
+
†These authors contributed equally
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
While many approaches to make neural networks more fathomable have been proposed, they are restricted to interrogating the network with input data. Measures for characterizing and monitoring structural properties, however, have not been developed. In this work, we propose neural persistence, a complexity measure for neural network architectures based on topological data analysis on weighted stratified graphs. To demonstrate the usefulness of our approach, we show that neural persistence reflects best practices developed in the deep learning community such as dropout and batch normalization. Moreover, we derive a neural persistencebased stopping criterion that shortens the training process while achieving comparable accuracies as early stopping based on validation loss.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The practical successes of deep learning in various fields such as image processing (Simonyan & Zisserman, 2015; He et al., 2016; Hu et al., 2018), biomedicine (Ching et al., 2018; Rajpurkar et al., 2017; Rajkomar et al., 2018), and language translation (Bahdanau et al., 2015; Sutskever et al., 2014; Wu et al., 2016) still outpace our theoretical understanding. While hyperparameter adjustment strategies exist (Bengio, 2012), formal measures for assessing the generalization capabilities of deep neural networks have yet to be identified (Zhang et al., 2017). Previous approaches for improving theoretical and practical comprehension focus on interrogating networks with input data. These methods include i) feature visualization of deep convolutional neural networks (Zeiler & Fergus, 2014; Springenberg et al., 2015), ii) sensitivity and relevance analysis of features (Montavon et al., 2017), iii) a descriptive analysis of the training process based on information theory (Tishby & Zaslavsky, 2015; Shwartz-Ziv & Tishby, 2017; Saxe et al., 2018; Achille & Soatto, 2018), and iv) a statistical analysis of interactions of the learned weights (Tsang et al., 2018). Additionally, Raghu et al. (2017) develop a measure of expressivity of a neural network and use it to explore the empirical success of batch normalization, as well as for the definition of a new regularization method. They note that one key challenge remains, namely to provide meaningful insights while maintaining theoretical generality. This paper presents a method for elucidating neural networks in light of both aspects.
|
| 16 |
+
|
| 17 |
+
We develop neural persistence, a novel measure for characterizing neural network structural complexity. In doing so, we adopt a new perspective that integrates both network weights and connectivity while not relying on interrogating networks through input data. Neural persistence builds on computational techniques from algebraic topology, specifically topological data analysis (TDA), which was already shown to be beneficial for feature extraction in deep learning (Hofer et al., 2017) and describing the complexity of GAN sample spaces (Khrulkov & Oseledets, 2018). More precisely, we rephrase deep networks with fully-connected layers into the language of algebraic topology and develop a measure for assessing the structural complexity of i) individual layers, and ii) the entire network. In this work, we present the following contributions:
|
| 18 |
+
|
| 19 |
+
- We introduce neural persistence, a novel measure for characterizing the structural complexity of neural networks that can be efficiently computed.
|
| 20 |
+
- We prove its theoretical properties, such as upper and lower bounds, thereby arriving at a normalization for comparing neural networks of varying sizes.
|
| 21 |
+
- We demonstrate the practical utility of neural persistence in two scenarios: i) it correctly captures the benefits of dropout and batch normalization during the training process, and ii) it can be easily used as a competitive early stopping criterion that does not require validation data.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND: TOPOLOGICAL DATA ANALYSIS
|
| 24 |
+
|
| 25 |
+
Topological data analysis (TDA) recently emerged as a field that provides computational tools for analysing complex data within a rigorous mathematical framework that is based on algebraic topology. This paper uses persistent homology, a theory that was developed to understand highdimensional manifolds (Edelsbrunner et al., 2002; Edelsbrunner & Harer, 2010), and has since been successfully employed in characterizing graphs (Sizemore et al., 2017; Rieck et al., 2018), finding relevant features in unstructured data (Lum et al., 2013), and analysing image manifolds (Carlsson et al., 2008). This section gives a brief summary of the key concepts; please refer to Edelsbrunner & Harer (2010) for an extensive introduction.
|
| 26 |
+
|
| 27 |
+
Simplicial homology The central object in algebraic topology is a simplicial complex K, i.e. a high-dimensional generalization of a graph, which is typically used to describe complex objects such as manifolds. Various notions to describe the connectivity of K exist, one of them being simplicial homology. Briefly put, simplicial homology uses matrix reduction algorithms (Munkres, 1996) to derive a set of groups, the homology groups, for a given simplicial complex K. Homology groups describe topological features—colloquially also referred to as holes—of a certain dimension $d$ , such as connected components $( d = 0$ ), tunnels $( d = 1 )$ , and voids $\ Q \ = \ 2$ ). The information from the dth homology group is summarized in a simple complexity measure, the dth Betti number $\beta _ { d }$ , which merely counts the number of $d$ -dimensional features: a circle, for example, has Betti numbers $( 1 , 1 )$ , i.e. one connected component and one tunnel, while a filled circle has Betti numbers $( 1 , 0 )$ , i.e. one connected component but no tunnel. In the context of analysing simple feedforward neural networks for two classes, Bianchini & Scarselli (2014) calculated bounds of Betti numbers of the decision region belonging to the positive class, and were thus able to show the implications of different activation functions. These ideas were extended by Guss & Salakhutdinov (2018) to obtain a measure of the topological complexity of decision boundaries.
|
| 28 |
+
|
| 29 |
+
Persistent homology For the analysis of real-world data sets, however, Betti numbers turn out to be of limited use because their representation is too coarse and unstable. This prompted the development of persistent homology. Given a simplicial complex $\mathrm { K }$ with an additional set of weights $a _ { 0 } ~ \leq ~ a _ { 1 } ~ \leq ~ \cdot ~ \cdot ~ \leq ~ a _ { m - 1 } ~ \leq ~ a _ { m }$ , which are commonly thought to represent the idea of a scale, it is possible to put K in a filtration, i.e. a nested sequence of simplicial complexes $\emptyset = \mathrm { K } _ { 0 } \subseteq \mathrm { K } _ { 1 } \subseteq \cdots \subseteq \mathrm { K } _ { m - 1 } \subseteq \mathrm { K } _ { m } = \mathrm { K }$ . This filtration is thought to represent the ‘growth’ of K as the scale is being changed. During this growth process, topological features can be created (new vertices may be added, for example, which creates a new connected component) or destroyed (two connected components may merge into one). Persistent homology tracks these changes and represents the creation and destruction of a feature as a point $( a _ { i } , a _ { j } ) \in \mathbb { R } ^ { 2 }$ for indices $i \leq j$ with respect to the filtration. The collection of all points corresponding to $d$ -dimensional topological features is called the dth persistence diagram $\mathcal { D } _ { d }$ . It can be seen as a collection of Betti numbers at multiple scales. Given a point $( x , y ) \in \mathcal { D } _ { d }$ , the quantity $\mathrm { p e r s } ( x , y ) : = | y - x |$ is referred to as its persistence. Typically, high persistence is considered to correspond to features, while low persistence is considered to indicate noise (Edelsbrunner et al., 2002).
|
| 30 |
+
|
| 31 |
+
# 3 A NOVEL MEASURE FOR NEURAL NETWORK COMPLEXITY
|
| 32 |
+
|
| 33 |
+
This section details neural persistence, our novel measure for assessing the structural complexity of neural networks. By exploiting both network structure and weight information through persistent homology, our measure captures network expressiveness and goes beyond mere connectivity properties. Subsequently, we describe its calculation, provide theorems for theoretical and empirical bounds, and show the existence of neural networks complexity regimes. To summarize this section, Figure 1 illustrates how our method treats a neural network.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Illustrating the neural persistence calculation of a network with two layers $( l _ { 0 }$ and $l _ { 1 } .$ ). Colours indicate connected components per layer. The filtration process is depicted by colouring connected components that are created or merged when the respective weights are greater than or equal to the threshold $w _ { i } ^ { \prime }$ . As $w _ { i } ^ { \prime }$ decreases, network connectivity increases. Creation and destruction thresholds are collected in one persistence diagram per layer (right), and summarized according to Equation 1 for calculating neural persistence.
|
| 37 |
+
|
| 38 |
+
# 3.1 NEURAL PERSISTENCE
|
| 39 |
+
|
| 40 |
+
Given a feedforward neural network with an arrangement of neurons and their connections $E$ , let $\mathcal { W }$ refer to the set of weights. Since $\mathcal { W }$ is typically changing during training, we require a function $\varphi \colon E \mathcal { W }$ that maps a specific edge to a weight. Fixing an activation function, the connections form a stratified graph.
|
| 41 |
+
|
| 42 |
+
Definition 1 (Stratified graph and layers). $A$ stratified graph is a multipartite graph $G = ( V , E )$ satisfying $V = V _ { 0 } \sqcup V _ { 1 } \sqcup \ldots ,$ , such that if $u \in V _ { i }$ , $v \in V _ { j }$ , and $( u , v ) \in E$ , we have $j = i + 1$ Hence, edges are only permitted between adjacent vertex sets. Given $k \in \mathbb N$ , the kth layer of $a$ stratified graph is the unique subgraph $G _ { k } : = ( V _ { k } \sqcup V _ { k + 1 } , E _ { k } : = E \cap \{ V _ { k } \times V _ { k + 1 } \} )$ .
|
| 43 |
+
|
| 44 |
+
This enables calculating the persistent homology of $G$ and each $G _ { k }$ , using the filtration induced by sorting all weights, which is common practice in topology-based network analysis (Carstens & Horadam, 2013; Horak et al., 2009) where weights often represent closeness or node similarity. However, our context requires a novel filtration because the weights arise from an incremental fitting procedure, namely the training, which could theoretically lead to unbounded values. When analysing geometrical data with persistent homology, one typically selects a filtration based on the (Euclidean) distance between data points (Bubenik, 2015). The filtration then connects points that are increasingly distant from each other, starting from points that are direct neighbours. Our network filtration aims to mimic this behaviour in the context of fully-connected neural networks. Our framework does not explicitly take activation functions into account; however, activation functions influence the evolution of weights during training.
|
| 45 |
+
|
| 46 |
+
Filtration Given the set of weights $\mathcal { W }$ for one training step, let $w _ { \mathrm { m a x } } : = \operatorname* { m a x } _ { w \in \mathcal { W } } | w |$ . Furthermore, let $\mathcal { W } ^ { \prime } : = \{ | w | / w _ { \operatorname* { m a x } } | w \bar { \in } \mathcal { W } \}$ be the set of transformed weights, indexed in non-ascending order, such that $G _ { k }$ $G _ { k } ^ { ( 0 ) } \subseteq G _ { k } ^ { ( 1 ) } \subseteq \cdot \cdot .$ $1 = w _ { 0 } ^ { \prime } \geq w _ { 1 } ^ { \prime } \geq \cdot \cdot \cdot \geq 0$ , where e trans $G _ { k } ^ { ( i ) } : = ( V _ { k } \sqcup V _ { k + 1 } , \{ ( u , v ) \mid ( u , v ) \in E _ { k } \land \varphi ^ { \prime } ( u , v ) \geq w _ { i } ^ { \prime } \} )$ . This permits us to define a filtration for the $k$ th layer ands the $\varphi ^ { \prime } ( u , v ) \ { \stackrel { } { \in } } \ \mathcal { W } ^ { \prime }$
|
| 47 |
+
analysis of neural networks, for which large (absolute) weights indicate that certain neurons exert a larger influence over the final activation of a layer. The strength of a connection is thus preserved by the filtration, and weaker weights with $| w | \approx \dot { 0 }$ remain close to 0. Moreover, since $w ^ { \prime } \in [ 0 , 1 ]$ holds for the transformed weights, this filtration makes the network invariant to scaling, which simplifies the comparison of different networks.
|
| 48 |
+
|
| 49 |
+
Persistence diagrams Having set up the filtration, we can calculate persistent homology for every layer $G _ { k }$ . As the filtration contains at most 1-simplices (edges), we capture zero-dimensional topological information, i.e. how connected components are created and merged during the filtration. These information are structurally equivalent to calculating a maximum spanning tree using the weights, or performing hierarchical clustering with a specific setup (Carlsson & Mémoli, 2010). While it would theoretically be possible to include higher-dimensional information about each layer $G _ { k }$ , for example in the form of cliques (Rieck et al., 2018), we focus on zero-dimensional information in this paper, because of the following advantages: i) the resulting values are easily interpretable as they essentially describe the clustering of the network at multiple weight thresholds, ii) previous research (Rieck & Leitte, 2016; Hofer et al., 2017) indicates that zero-dimensional topological information is already capturing a large amount of information, and iii) persistent homology calculations are highly efficient in this regime (see below). We thus calculate zero-dimensional persistent homology with this filtration. The resulting persistence diagrams have a special structure: since our filtration solely sorts edges, all vertices are present at the beginning of the filtration, i.e. they are already part of $G _ { k } ^ { ( 0 ) }$ for each $k$ . As a consequence, they are assigned a weight of 1, resulting in connected components. Hence, entries in the corresponding persistence diagram are of the form $( 1 , x )$ , with $x \in \mathcal { W } ^ { \prime }$ , and will be situated below the diagonal, similar to superlevel set filtrations (Bubenik, 2015; Cohen-Steiner et al., 2009). Using the $p$ -norm of a persistence diagram, as introduced by Cohen-Steiner et al. (2010), we obtain the following definition for neural persistence.
|
| 50 |
+
|
| 51 |
+
<table><tr><td colspan="2">Algorithm1Neural persistence calculation</td></tr><tr><td>Require: Neural network with l layers and weights W</td><td>Determine largest absolute weight</td></tr><tr><td>1: Wmax ← maxw∈w lwl 2: W' ← {lwl/wmax |w ∈W}</td><td>>Transform weights for filtration</td></tr><tr><td>3: for k ∈{0,...,l-1} do G 4: F↑ n n</td><td>>Establish filtration of kth layer</td></tr><tr><td>5: Dk ←PERSISTENTHOMOLOGY(Fε)</td><td> Calculate persistence diagram</td></tr><tr><td>end for 7: return{Dollp,...,|/Dt-1llp}</td><td>> Calculate neural persistence for each layer</td></tr></table>
|
| 52 |
+
|
| 53 |
+
Definition 2 (Neural persistence). The neural persistence of the kth layer $G _ { k }$ , denoted by $\mathrm { N P } ( G _ { k } )$ is the $p$ -norm of the persistence diagram $\mathcal { D } _ { k }$ resulting from our previously-introduced filtration, i.e.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathrm { N P } ( G _ { k } ) : = \| \mathcal { D } _ { k } \| _ { p } : = \Big ( \sum _ { ( c , d ) \in \mathcal { D } _ { k } } \mathrm { p e r s } ( c , d ) ^ { p } \Big ) ^ { \frac { 1 } { p } } ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which (for $p = 2$ ) captures the Euclidean distance of points in $\mathcal { D } _ { k }$ to the diagonal.
|
| 60 |
+
|
| 61 |
+
The $p$ -norm is known to be a stable summary (Cohen-Steiner et al., 2010) of topological features in a persistence diagram. For neural persistence to be a meaningful measure of structural complexity, it should increase as a neural network is learning. We evaluate this and other properties in Section 4.
|
| 62 |
+
|
| 63 |
+
Algorithm 1 provides pseudocode for the calculation process. It is highly efficient: the filtration (line 4) amounts to sorting all $n$ weights of a network, which has a computational complexity of ${ \mathcal { O } } ( n \log n )$ . Calculating persistent homology of this filtration (line 5) can be realized using an algorithm based on union–find data structures Edelsbrunner et al. (2002). This has a computational complexity of $O \left( n \cdot \alpha \left( n \right) \right)$ , where $\alpha ( \cdot )$ refers to the extremely slow-growing inverse of the Ackermann function (Cormen et al., 2009, Chapter 22). We make our implementation and experiments available under https://github.com/BorgwardtLab/Neural-Persistence.
|
| 64 |
+
|
| 65 |
+
# 3.2 PROPERTIES OF NEURAL PERSISTENCE
|
| 66 |
+
|
| 67 |
+
We elucidate properties about neural persistence to permit the comparison of networks with different architectures. As a first step, we derive bounds for the neural persistence of a single layer $G _ { k }$ .
|
| 68 |
+
|
| 69 |
+
Theorem 1. Let $G _ { k }$ be a layer of a neural network according to Definition 1. Furthermore, let $\varphi _ { k } \colon E _ { k } \to \mathcal { W } ^ { \prime }$ denote the function that assigns each edge of $G _ { k }$ a transformed weight. Using the filtration from Section 3.1 to calculate persistent homology, the neural persistence $\mathrm { N P } ( G _ { k } )$ of the kth layer satisfies
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
0 \leq \mathrm { N P } ( G _ { k } ) \leq \left( \operatorname* { m a x } _ { e \in E _ { k } } \varphi _ { k } ( e ) - \operatorname* { m i n } _ { e \in E _ { k } } \varphi _ { k } ( e ) \right) ( | V _ { k } \times V _ { k + 1 } | - 1 ) ^ { \frac { 1 } { p } } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $| V _ { k } \times V _ { k + 1 } |$ denotes the cardinality of the vertex set, i.e. the number of neurons in the layer.
|
| 76 |
+
|
| 77 |
+
Proof. We prove this constructively and show that the bounds can be realized. For the lower bound, let $G _ { k } ^ { - }$ be a fully-connected layer with $| V _ { k } |$ vertices and, given $\theta \in [ 0 , 1 ]$ , let $\varphi _ { k } ( e ) : = \theta$ for every edge $e$ . Since a vertex $v$ is created before its incident edges, the filtration degenerates to a lexicographical ordering of vertices and edges, and all points in $\mathcal { D } _ { k }$ will be of the form $( \theta , \theta )$ . Thus, $\mathrm { N P } ( G _ { k } ^ { - } ) = 0$ . For the upper bound, let $G _ { k } ^ { + }$ again be a fully-connected layer with $| V _ { k } | \geq 3$ vertices and let $\dot { a } , b \in [ 0 , 1 ]$ with $a \ < \ b$ . Select one edge $e ^ { \prime }$ at random and define a weight function as $\varphi ( e ^ { \prime } ) : = b$ and $\varphi ( e ) : = a$ otherwise. In the filtration, the addition of the first edge will create a pair of the form $( b , b )$ , while all other pairs will be of the form $( b , a )$ . Consequently, we have
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } & { \mathrm { N P } ( G _ { k } ^ { + } ) = \Big ( \mathrm { p e r s } ( b , b ) ^ { p } + ( n - 1 ) \cdot \mathrm { p e r s } ( b , a ) ^ { p } \Big ) ^ { \frac { 1 } { p } } = ( b - a ) \cdot ( n - 1 ) ^ { \frac { 1 } { p } } } \\ & { \quad \quad \quad = \bigg ( \underset { e \in E _ { k } } { \operatorname* { m a x } } \varphi ( e ) - \underset { e \in E _ { k } } { \operatorname* { m i n } } \varphi ( e ) \bigg ) ( | V _ { k } | - 1 ) ^ { \frac { 1 } { p } } , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
so our upper bound can be realized. To show that this term cannot be exceeded by $\mathrm { N P } ( G )$ for any $G$ , suppose we perturb the weight function $\widetilde { \varphi } ( e ) : = \varphi ( e ) + \epsilon \in [ 0 , 1 ]$ . This cannot increase NP, however, because each difference $b - a$ in Equation 3 is maximized by max $\varphi ( e ) - \operatorname* { m i n } \varphi ( e )$ .
|
| 84 |
+
|
| 85 |
+
We can use the upper bound of Theorem 1 to normalize the neural persistence of a layer, making it possible to compare layers (and neural networks) that feature different architectures, i.e. a different number of neurons.
|
| 86 |
+
|
| 87 |
+
Definition 3 (Normalized neural persistence). For a layer $G _ { k }$ following Definition $^ { l }$ , using the upper bound of Theorem 1, the normalized neural persistence $\widetilde { \mathrm { N P } } ( G _ { k } )$ is defined as the neural persistence of $G _ { k }$ divided by its upper bound, i.e. $\widetilde { \mathrm { N P } } ( G _ { k } ) : = \mathrm { N P } ( G _ { k } ) \cdot \mathrm { N P } ( G _ { k } ^ { + } ) ^ { - 1 }$ .
|
| 88 |
+
|
| 89 |
+
The normalized neural persistence of a layer permits us to extend the definition to an entire network. While this is more complex than using a single filtration for a neural network, this permits us to side-step the problem of different layers having different scales.
|
| 90 |
+
|
| 91 |
+
Definition 4 (Mean normalized neural persistence). Considering a network as a stratified graph $G$ according to Definition $^ { l }$ , we sum the neural persistence values per layer to obtain the mean normalized neural persistence, i.e. $\begin{array} { r } { \overline { { \mathrm { N P } } } ( G ) : = 1 / l \cdot \sum _ { k = 0 } ^ { l - 1 } \widetilde { \mathrm { N P } } ( G _ { k } ) } \end{array}$ .
|
| 92 |
+
|
| 93 |
+
While Theorem 1 gives a lower and upper bound in a general setting, it is possible to obtain empirical bounds when we consider the tuples that result from the computation of a persistence diagram. Recall that our filtration ensures that the persistence diagram of a layer contains tuples of the form $( 1 , w _ { i } )$ , with $w _ { i } \in [ 0 , 1 ]$ being a transformed weight. Exploiting this structure permits us to obtain bounds that could be used prior to calculating the actual neural persistence value in order to make the implementation more efficient.
|
| 94 |
+
|
| 95 |
+
Theorem 2. Let $G _ { k }$ be a layer of a neural network as in Theorem $^ { l }$ with n vertices and m edges whose edge weights are sorted in non-descending order, i.e. $w _ { 0 } \ \leq \ w _ { 2 } \ \leq \ \cdot \cdot \ \leq \ w _ { m - 1 }$ . Then $\mathrm { N P } ( G _ { k } )$ can be empirically bounded by
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p } \leq \mathrm { N P } ( G _ { k } ) \leq \left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\mathbf { w } _ { \mathrm { m a x } } = ( w _ { m - 1 } , w _ { m - 2 } , \ldots , w _ { m - n } ) ^ { T }$ and $\mathbf { w } _ { \mathrm { m i n } } = ( w _ { 0 } , w _ { 2 } , \ldots , w _ { n - 1 } ) ^ { T }$ are the vectors containing the n largest and $n$ smallest weights, respectively.
|
| 102 |
+
|
| 103 |
+
Proof. See Section A.2 in the appendix.
|
| 104 |
+
|
| 105 |
+
Complexity regimes in neural persistence As an application of the two theorems, we briefly take a look at how neural persistence changes for different classes of simple neural networks. To this end, we train a perceptron on the ‘MNIST’ data set. Since our measure uses the weight matrix of a perceptron, we can compare its neural persistence with the neural persistence of random weight matrices, drawn from different distributions. Moreover, we can compare trained networks with respect to their initial parameters. Figure 2 depicts the neural persistence values as well as the lower bounds according to Theorem 2 for different settings. We can see that a network in which the optimizer diverges (due to improperly selected parameters) is similar to a random Gaussian matrix.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 2: Neural persistence values of trained perceptrons (green), diverging ones (yellow), random Gaussian matrices (red), and random uniform matrices (black). We performed 100 runs per category; dots indicate neural persistence while crosses indicate the predicted lower bound according to Theorem 2. The bounds according to Theorem 1 are shown as dashed lines.
|
| 109 |
+
|
| 110 |
+
Trained networks, on the other hand, are clearly distinguished from all other networks. Uniform matrices have a significantly lower neural persistence than Gaussian ones. This is in line with the intuition that the latter type of networks induces functional sparsity because few neurons have large absolute weights. For clarity, we refrain from showing the empirical upper bounds because most weight distributions are highly right-tailed; the bound will not be as tight as the lower bound. These results are in line with a previous analysis (Sizemore et al., 2017) of small weighted networks, in which persistent homology is seen to outperform traditional graph-theoretical complexity measures such as the clustering coefficient (see also Section A.1 in the appendix). For deeper networks, additional experiments discuss the relation between validation accuracy and neural persistence (Section A.5), the impact of different data distributions, as well as the variability of neural persistence for architectures of varying depth (Section A.6).
|
| 111 |
+
|
| 112 |
+
# 4 EXPERIMENTS
|
| 113 |
+
|
| 114 |
+
This section demonstrates the utility and relevance of neural persistence for fully connected deep neural networks. We examine how commonly used regularization techniques (batch normalization and dropout) affect neural persistence of trained networks. Furthermore, we develop an early stopping criterion based on neural persistence and we compare it to the traditional criterion based on validation loss. We used different architectures with $R e L U$ activation functions across experiments. The brackets denote the number of units per hidden layer. In addition, the Adam optimizer with hyperparameters tuned via cross-validation was used unless noted otherwise. Please refer to Table A.1 in the appendix for further details about the experiments.
|
| 115 |
+
|
| 116 |
+
# 4.1 DEEP LEARNING BEST PRACTICES IN LIGHT OF NEURAL PERSISTENCE
|
| 117 |
+
|
| 118 |
+
We compare the mean normalized neural persistence (see Definition 4) of a two-layer (with an architecture of [650, 650]) neural network to two models where batch normalization (Ioffe & Szegedy, 2015) or dropout (Srivastava et al., 2014) are applied. Figure 3 shows that the networks designed according to best practices yield higher normalized neural persistence values on the ‘MNIST’ data set in comparison to an unmodified network. The effect of dropout on the mean normalized neural persistence is more pronounced and this trend is directly analogous to the observed accuracy on the test set. These results are consistent with expectations if we consider dropout to be similar to ensemble learning (Hara et al., 2016). As individual parts of the network are trained independently, a higher degree of per-layer redundancy is expected, resulting in a different structural complexity. Overall, these results indicate that for a fixed architecture approaches targeted at increasing the neural persistence during the training process may be of particular interest.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Comparison of mean normalized neural persistence for trained networks without modifications (green), with batch normalization (yellow), and with $50 \%$ of the neurons dropped out during training (red) for the ‘MNIST’ data set (50 runs per setting).
|
| 122 |
+
|
| 123 |
+
# 4.2 EARLY STOPPING BASED ON NEURAL PERSISTENCE
|
| 124 |
+
|
| 125 |
+
Neural persistence can be used as an early stopping criterion that does not require a validation data set to prevent overfitting: if the mean normalized neural persistence does not increase by more than $\Delta _ { \mathrm { m i n } }$ during a certain number of epochs $g$ , the training process is stopped. This procedure is called ‘patience’ and Algorithm 2 describes it in detail. A similar variant of this algorithm, using validation loss instead of persistence, is the state-of-the-art for early stopping in training (Bengio, 2012; Chollet et al., 2015). To evaluate the efficacy of our measure, we compare it against validation loss in an extensive set of scenarios. More precisely, for a training process with at most $G$ epochs, we define a $G \times G$ parameter grid consisting of the ‘patience’ parameter $g$ and a burn-in rate $b$ (both measured in epochs). $b$ defines the number of epochs after which an early stopping criterion starts monitoring, thereby preventing underfitting. Subsequently, we set $\Delta _ { \operatorname* { m i n } } = 0$ for all measures to remain comparable and scale-invariant, as non-zero values could implicitly favour one of them due to scaling. For each data set, we perform 100 training runs of the same architecture, monitoring validation loss and mean normalized neural persistence every quarter epoch. The early stopping behaviour of both measures is simulated for each combination of $b$ and $g$ and their performance over all runs is summarized in terms of median test accuracy and median stopping epoch; if a criterion is not triggered for one run, we report the test accuracy at the end of the training and the number of training epochs. This results in a scatterplot, where each point (corresponding to a single parameter combination) shows the difference in epochs and the absolute difference in test accuracy (measured in percent). The quadrants permit an intuitive explanation: $Q _ { 2 }$ , for example, contains all configurations for which our measure stops earlier, while achieving a higher accuracy. Since $b$ and $g$ are typically chosen to be small in an early stopping scenario, we use grey points to indicate uncommon configurations for which $b$ or $g$ is larger than half of the total number of epochs. Furthermore, to summarize the performance of our measure, we calculate the barycentre of all configurations (green square).
|
| 126 |
+
|
| 127 |
+
Figure 4a depicts the comparison with validation loss for the ‘Fashion-MNIST’ (Xiao et al., 2017) data set; please refer to Section A.3 in the appendix for more data sets. Here, we observe that most common configurations are in $Q _ { 2 }$ or in $Q _ { 3 }$ , i.e our criterion stops earlier. The barycentre is at $( - 0 . 5 3 , - 0 . 0 8 )$ , showing that out of 625 configurations, on average we stop half an epoch earlier than validation loss, while losing virtually no accuracy $\left( 0 . 0 8 \% \right)$ . Figure 4c depicts detailed differences in accuracy and epoch for our measure when compared to validation loss; each cell in a heatmap corresponds to a single parameter configuration of $b$ and $g$ . In the heatmap of accuracy differences, blue, white, and red represent parameter combinations for which we obtain higher, equal, or lower accuracy, respectively, than with validation loss for the same parameters. Similarly, in the
|
| 128 |
+
|
| 129 |
+
Require: Weighted neural network $\mathcal { N }$ , patience $g$ , $\Delta _ { \mathrm { m i n } }$
|
| 130 |
+
1: $P 0$ , $G \gets 0$ $\triangleright$ Initialize highest observed value and patience counter
|
| 131 |
+
2: procedure EARLYSTOPPING $( \mathcal { N } , g , \Delta _ { \mathrm { m i n } } )$ $\triangleright$ Callback that monitors training at every epoch
|
| 132 |
+
3: $P ^ { \prime } \overline { { \mathrm { N P } } } ( \mathcal { N } )$
|
| 133 |
+
4: if $P ^ { \prime } > P + \Delta _ { \mathrm { m i n } }$ then ▷ Update mean normalized neural persistence and reset counter
|
| 134 |
+
5: $P P ^ { \prime }$ , $G 0$
|
| 135 |
+
6: else ▷ Update patience counter
|
| 136 |
+
7: $G G + 1$
|
| 137 |
+
8: end if
|
| 138 |
+
9: if $G \geq g$ then $\triangleright$ Patience criterion has been triggered
|
| 139 |
+
10: return $P$ $\triangleright$ Stop training and return highest observed value
|
| 140 |
+
11: end if
|
| 141 |
+
12: end procedure
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 4: The visualizations depict the differences in accuracy and epoch for all comparison scenarios of mean normalized neural persistence versus validation loss, while the table summarizes the results on other data sets. Final test accuracies are shown irrespectively of early stopping to put the accuracy differences into context.
|
| 145 |
+
|
| 146 |
+
heatmap of epoch differences, green represents parameter combinations for which we stop earlier than validation loss. For $b \leq 8$ , we stop earlier (0.62 epochs on average), while losing only $0 . 0 6 \%$ accuracy. Finally, Figure 4d shows how often each measure is triggered. Ideally, each measure should consist of a dark green triangle, as this would indicate that each configuration stops all the time. For this data set, we observe that our method stops for more parameter combinations than validation loss, but not as frequently for all of them. To ensure comparability across scenarios, we did not use the validation data as additional training data when stopping with neural persistence; we refer to Section A.7 for additional experiments in data scarcity scenarios. We observe that our method stops earlier when overfitting can occur, and it stops later when longer training is beneficial.
|
| 147 |
+
|
| 148 |
+
# 5 DISCUSSION
|
| 149 |
+
|
| 150 |
+
In this work, we presented neural persistence, a novel topological measure of the structural complexity of deep neural networks. We showed that this measure captures topological information that pertains to deep learning performance. Being rooted in a rich body of research, our measure is theoretically well-defined and, in contrast to previous work, generally applicable as well as computationally efficient. We showed that our measure correctly identifies networks that employ best practices such as dropout and batch normalization. Moreover, we developed an early stopping criterion that exhibits competitive performance while not relying on a separate validation data set. Thus, by saving valuable data for training, we managed to boost accuracy, which can be crucial for enabling deep learning in regimes of smaller sample sizes. Following Theorem 2, we also experimented with using the $p$ -norm of all weights of the neural network as a proxy for neural persistence. However, this did not yield an early stopping measure because it was never triggered, thereby suggesting that neural persistence captures salient information that would otherwise be hidden among all the weights of a network. We extended our framework to convolutional neural networks (see Section A.4) by deriving a closed-form approximation, and observed that an early stopping criterion based on neural persistence for convolutional layers will require additional work. Furthermore, we conjecture that assessing dissimilarities of networks by means of persistence diagrams (making use of higher-dimensional topological features), for example, will lead to further insights regarding their generalization and learning abilities. Another interesting avenue for future research would concern the analysis of the ‘function space’ learned by a neural network. On a more general level, neural persistence demonstrates the great potential of topological data analysis in machine learning.
|
| 151 |
+
|
| 152 |
+
# REFERENCES
|
| 153 |
+
|
| 154 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems: Simple, end-to-end, LeNet-5-like convolutional MNIST model example, 2015. URL https://github.com/tensorflow/models/blob/master/ tutorials/image/mnist/convolutional.py.
|
| 155 |
+
|
| 156 |
+
Alessandro Achille and Stefano Soatto. Emergence of invariance and disentanglement in deep representations. Journal of Machine Learning Research, 18:1–34, 2018.
|
| 157 |
+
|
| 158 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 159 |
+
|
| 160 |
+
Yoshua Bengio. Practical recommendations for gradient-based training of deep architectures. In Grégoire Montavon, Geneviève B. Orr, and Klaus-Robert Müller (eds.), Neural Networks: Tricks of the Trade, volume 7700 of Lecture Notes in Computer Science, pp. 437–478. Springer, Heidelberg, Germany, 2012.
|
| 161 |
+
|
| 162 |
+
Monica Bianchini and Franco Scarselli. On the complexity of neural network classifiers: A comparison between shallow and deep architectures. IEEE Transactions on Neural Networks and Learning Systems, 25(8):1553–1565, 2014.
|
| 163 |
+
|
| 164 |
+
Peter Bubenik. Statistical topological data analysis using persistence landscapes. Journal of Machine Learning Research, 16:77–102, 2015.
|
| 165 |
+
|
| 166 |
+
Gunnar Carlsson and Facundo Mémoli. Characterization, stability and convergence of hierarchical clustering methods. Journal of Machine Learning Research, 11:1425–1470, 2010.
|
| 167 |
+
|
| 168 |
+
Gunnar Carlsson, Tigran Ishkhanov, Vin de Silva, and Afra Zomorodian. On the local behavior of spaces of natural images. International Journal of Computer Vision, 76(1):1–12, 2008.
|
| 169 |
+
|
| 170 |
+
Corrie J. Carstens and Kathy J. Horadam. Persistent homology of collaboration networks. Mathematical Problems in Engineering, 2013:815035, 2013.
|
| 171 |
+
|
| 172 |
+
Travers Ching, Daniel S. Himmelstein, Brett K. Beaulieu-Jones, Alexandr A. Kalinin, Brian T. Do, Gregory P. Way, Enrico Ferrero, Paul-Michael Agapow, Michael Zietz, Michael M. Hoffman, Weil Xie, Gail L. Rosen, Benjamin J. Lengerich, Johnny Israeli, Jack Lanchantin, Stephen Woloszynek, Anne E. Carpenter, Avanti Shrikumar, Jinbo Xu, Evan M. Cofer, Christopher A. Lavender, Srinivas C. Turaga, Amr M. Alexandri, Zhiyong Lu, David J. Harris, Dave DeCaprio, Yanjun Qi, Anshul Kundaje, Yifan Peng, Laura K. Wiley, Marwin H.S. Segler, Simina M. Boca, S. Joshua Swamidass, Austin Huang, Anthony Gitter, and Casey S. Greene. Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15 (141):20170387, 2018.
|
| 173 |
+
|
| 174 |
+
François Chollet et al. Keras. https://keras.io, 2015.
|
| 175 |
+
|
| 176 |
+
David Cohen-Steiner, Herbert Edelsbrunner, and John Harer. Extending persistence using Poincaré and Lefschetz duality. Foundations of Computational Mathematics, 9(1):79–103, 2009.
|
| 177 |
+
|
| 178 |
+
David Cohen-Steiner, Herbert Edelsbrunner, John Harer, and Yuriy Mileyko. Lipschitz functions have $\mathrm { L } _ { p }$ -stable persistence. Foundations of Computational Mathematics, 10(2):127–139, 2010.
|
| 179 |
+
|
| 180 |
+
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to algorithms. MIT Press, Cambridge, MA, USA, 3rd edition, 2009.
|
| 181 |
+
|
| 182 |
+
Herbert Edelsbrunner and John Harer. Computational topology: An introduction. American Mathematical Society, Providence, RI, USA, 2010.
|
| 183 |
+
|
| 184 |
+
Herbert Edelsbrunner, David Letscher, and Afra J. Zomorodian. Topological persistence and simplification. Discrete & Computational Geometry, 28(4):511–533, 2002.
|
| 185 |
+
|
| 186 |
+
William H Guss and Ruslan Salakhutdinov. On characterizing the capacity of neural networks using algebraic topology. arXiv preprint arXiv:1802.04443, 2018.
|
| 187 |
+
|
| 188 |
+
Kazuyuki Hara, Daisuke Saitoh, and Hayaru Shouno. Analysis of dropout learning regarded as ensemble learning. In Alessandro E.P. Villa, Paolo Masulli, and Antonio Javier Pons Rivero (eds.), Artificial Neural Networks and Machine Learning (ICANN), number 9887 in Lecture Notes in Computer Science, pp. 72–79, Cham, Switzerland, 2016. Springer.
|
| 189 |
+
|
| 190 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 191 |
+
|
| 192 |
+
Christoph Hofer, Roland Kwitt, Marc Niethammer, and Andreas Uhl. Deep learning with topological signatures. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1633– 1643, 2017.
|
| 193 |
+
|
| 194 |
+
Danijela Horak, Slobodan Maletic, and Milan Rajkovi ´ c. Persistent homology of complex networks.´ Journal of Statistical Mechanics: Theory and Experiment, 2009(03):P03034, 2009.
|
| 195 |
+
|
| 196 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7132–7141, 2018.
|
| 197 |
+
|
| 198 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 448–456. PMLR, 2015.
|
| 199 |
+
|
| 200 |
+
Valentin Khrulkov and Ivan Oseledets. Geometry score: A method for comparing generative adversarial networks. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2621–2629. PMLR, 2018.
|
| 201 |
+
|
| 202 |
+
Pek Y. Lum, Gurjeet Singh, Alan Lehman, Tigran Ishkanov, Mikael Vejdemo-Johansson, Muthu Alagappan, John Carlsson, and Gunnar Carlsson. Extracting insights from the shape of complex data using topology. Scientific Reports, 3:1–8, 2013.
|
| 203 |
+
|
| 204 |
+
Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 73:1–15, 2017.
|
| 205 |
+
|
| 206 |
+
James R. Munkres. Elements of algebraic topology. CRC Press, Boca Raton, FL, USA, 1996.
|
| 207 |
+
|
| 208 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2847–2854. PMLR, 2017.
|
| 209 |
+
|
| 210 |
+
Alvin Rajkomar, Eyal Oren, Kai Chen, Andrew M. Dai, Nissan Hajaj, Michaela Hardt, Peter J Liu, Xiaobing Liu, Jake Marcus, Mimi Sun, et al. Scalable and accurate deep learning with electronic health records. npj Digital Medicine, 1(1):18, 2018.
|
| 211 |
+
|
| 212 |
+
Pranav Rajpurkar, Jeremy Irvin, Kaylie Zhu, Brandon Yang, Hershel Mehta, Tony Duan, Daisy Ding, Aarti Bagul, Curtis Langlotz, Katie Shpanskaya, Matthew Lungren, and Andrew Y. Ng. CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning. arXiv preprint arXiv:1711.05225, 2017.
|
| 213 |
+
|
| 214 |
+
Bastian Rieck and Heike Leitte. Exploring and comparing clusterings of multivariate data sets using persistent homology. Computer Graphics Forum, 35(3):81–90, 2016.
|
| 215 |
+
|
| 216 |
+
Bastian Rieck, Ulderico Fugacci, Jonas Lukasczyk, and Heike Leitte. Clique community persistence: A topological visual analysis approach for complex networks. IEEE Transactions on Visualization and Computer Graphics, 24(1):822–831, 2018.
|
| 217 |
+
|
| 218 |
+
Andrew Michael Saxe, Yamini Bansal, Joel Dapello, Madhu Advani, Artemy Kolchinsky, Brendan Daniel Tracey, and David Daniel Cox. On the information bottleneck theory of deep learning. In International Conference on Learning Representations (ICLR), 2018.
|
| 219 |
+
|
| 220 |
+
Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
|
| 221 |
+
|
| 222 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 223 |
+
|
| 224 |
+
Ann Sizemore, Chad Giusti, and Danielle S. Bassett. Classification of weighted networks through mesoscale homological features. Journal of Complex Networks, 5(2):245–273, 2017.
|
| 225 |
+
|
| 226 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. In Workshop Track of the International Conference on Learning Representations (ICLR), 2015.
|
| 227 |
+
|
| 228 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 229 |
+
|
| 230 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3104–3112, 2014.
|
| 231 |
+
|
| 232 |
+
Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In IEEE Information Theory Workshop (ITW), pp. 1–5, 2015.
|
| 233 |
+
|
| 234 |
+
Michael Tsang, Dehua Cheng, and Yan Liu. Detecting statistical interactions from neural network weights. In International Conference on Learning Representations (ICLR), 2018.
|
| 235 |
+
|
| 236 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 237 |
+
|
| 238 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 239 |
+
|
| 240 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In David Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), European Conference on Computer Vision (ECCV), volume 8689 of Lecture Notes in Computer Science, pp. 818–833, Cham, Switzerland, 2014. Springer.
|
| 241 |
+
|
| 242 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations (ICLR), 2017.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure A.1: Traditional graph measures (top), such as the clustering coefficient, fail to detect differences in the complexity of neural networks. Our novel neural persistence measure (bottom), by contrast, shows that trained networks with $\eta = 0 . 5$ (green), which have an accuracy of $\approx 0 . 9 1$ , obey a different distribution than networks trained with $\bar { \eta = 1 \times 1 0 ^ { - 0 . 5 } }$ (yellow), which have accuracies ranging from 0.38–0.65.
|
| 246 |
+
|
| 247 |
+
# A APPENDIX
|
| 248 |
+
|
| 249 |
+
# A.1 COMPARISON WITH GRAPH-THEORETICAL MEASURES
|
| 250 |
+
|
| 251 |
+
Traditional complexity/structural measures from graph theory, such as the clustering coefficient, the average shortest path length, and global/local efficiency are already known to be insufficiently accurate to characterize different models of complex random networks Sizemore et al. (2017). Our experiments indicate that this holds true for (deep) neural networks, too. As a brief example, we trained a perceptron on the MNIST data set with batch stochastic gradient descent $\left( \eta = 0 . 5 \right)$ , achieving a test accuracy of $\approx 0 . 9 1$ . Moreover, we intentionally ‘sabotaged’ the training by setting $\eta = 1 \check { \times } 1 0 ^ { - 5 }$ such that SGD is unable to converge properly. This leads to networks with accuracies ranging from 0.38–0.65. A complexity measure should be capable of distinguishing both classes of networks. However, as Figure A.1 (top) shows, this is not the case for the clustering coefficient. Neural persistence (bottom), on the other hand, results in two regimes that can clearly be distinguished, with the trained networks having a significantly smaller variance.
|
| 252 |
+
|
| 253 |
+
# A.2 PROOF OF THEOREM 2
|
| 254 |
+
|
| 255 |
+
Proof. We may consider the filtration from Section 3.1 to be a subset selection problem with constraints, where we select $n$ out of $m$ weights. The neural persistence $\mathrm { N P } ( G _ { k } )$ of a layer thus only depends on the selected weights that appear as tuples of the form $( 1 , w _ { i } )$ in $\mathcal { D } _ { k }$ . Letting $\widetilde { \mathbf { w } }$ denote the vector of selected weights arising from the persistence diagram calculation, we can rewrite neural persistence as $\mathrm { N P } ( G _ { k } ) = \| \mathbf { 1 } - \mathbf { \bar { w } } \| _ { p }$ . Furthermore, $\widetilde { \mathbf { w } }$ satisfies $\left\| \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } \leq \left\| \widetilde { \mathbf { w } } \right\| _ { p } \leq \left\| \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p }$ . Since all transformed weights are non-negative in our filtration, it follows that (note the reversal of the two terms)
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p } \leq \mathrm { N P } ( G _ { k } ) \leq \left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } ,
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
and the claim follows.
|
| 262 |
+
|
| 263 |
+
# A.3 ADDITIONAL VISUALIZATIONS AND ANALYSES FOR EARLY STOPPING
|
| 264 |
+
|
| 265 |
+
Due to space constraints and the large number of configurations that we investigated for our early stopping experiments, this section contains additional plots that follow the same schematic: the top row shows the differences in accuracy and epoch for our measure when compared to the commonlyused validation loss. Each cell in the heatmap corresponds to a single configuration of $b$ and $g$ . In the heatmap of accuracy differences, blue represents parameter combinations for which we obtain a higher accuracy than validation loss for the same parameters; white indicates combinations for which we obtain the same accuracy, while red highlights combinations in which our accuracy decreases. Similarly, in the heatmap of epoch differences, green represents parameter combinations for which we stop earlier than validation loss for the same parameter. The scatterplots in
|
| 266 |
+
|
| 267 |
+
Section 4.2 show an ‘unrolled’ version of this heat map, making it possible to count how many parameter combinations result in early stops while also increasing accuracy, for example. The heatmaps, by contrast, make it possible to compare the behaviour of the two measures with respect to each parameter combination. Finally, the bottom row of every plot shows how many times each measure was triggered for every parameter combination. We consider a measure to be triggered if its stopping condition is satisfied prior to the last training epoch. Due to the way the parameter grid is set up, no configuration above the diagonal can stop, because $b + g$ would be larger than the total number of training epochs. This permits us to compare the ‘slopes’ of cells for each measure. Ideally, each measure should consist of a dark green triangle, as this would indicate that parameter configuration stops all the time.
|
| 268 |
+
|
| 269 |
+
MNIST Please refer to Figures A.2 and A.3. The colours in the difference matrix of the top row are slightly skewed because in a certain configuration, our measure loses $0 . 8 \%$ of accuracy when stopping. However, there are many other configurations in which virtually no accuracy is lost and in which we are able to stop more than four epochs earlier. The heatmaps in the bottom row again indicate that neural persistence is capable of stopping for more parameter combinations in general. We do not trigger as often for some of them, though.
|
| 270 |
+
|
| 271 |
+
CIFAR-10 Please refer to Figure A.4. In general, we observe that this data set is more sensitive with respect to the parameters for early stopping. While there are several configurations in which neural persistence stops with an increase of almost $1 0 \%$ in accuracy, there are also scenarios in which we cannot stop training earlier, or have to train longer (up to 15 epochs out of 80 epochs in total). The second row of plots shows our measure triggers reliably for more configurations than validation loss. Overall, the scatterplot of all scenarios (Figure A.5) shows that most practical configurations are again located in $Q _ { 2 }$ and $Q _ { 3 }$ . While we may thus find certain configurations in which we reliably outperform validation loss as an early stopping criterion, we also want to point out that our measures behaves correctly for many practical configurations. Points in $Q _ { 1 }$ , where we train longer and achieve a higher accuracy, are characterized by a high patience $g$ of approximately 40 epochs and a low burn-in rate $b$ , or vice versa. This is caused by the training for CIFAR-10, which does not reliably converge for FCNs. Figure A.6 demonstrates this by showing loss curves and the mean normalized neural persistence curves of five runs over training (loss curves have been averaged over all runs; standard deviations are shown in grey; we show the first half of the training to highlight the behaviour for practical early stopping conditions). For ‘Fashion-MNIST’, we observe that NP exhibits clear change points during the training process, which can be exploited for early stopping. For ‘CIFAR- $1 0 ^ { \circ }$ , we observe a rather incremental growth for some runs (with no clearlydefined maximum), making it harder to derive a generic early stopping criterion that does not depend on fine-tuned parameters. Hence, we hypothesize that neural persistence cannot be used reliably in scenarios where the architecture is incapable of learning the data set. In the future, we plan to experiment with deliberately selected ‘bad’ and ‘good’ architectures in order to evaluate to what extent our topological measure is capable of assessing their suitability for training, but this is beyond the scope of this paper.
|
| 272 |
+
|
| 273 |
+
IMDB Please refer to Figure A.7. For this data set, we observe that most parameter configurations result in earlier stopping (up to two epochs earlier than validation loss), with accuracy increases of up to $0 . 1 0 \%$ . This is also shown in the scatterplot A.8. Only a single configuration, viz. $g = 1$ and $b = 0$ , results in a severe loss of accuracy; we removed it from the scatterplot for reasons of clarity, as its accuracy difference of $- 2 1 \%$ would skew the display of the remaining configurations too much (this is also why the legends do not include this outlier).
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure A.2: Additional visualizations for the ‘MNIST’ data set.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure A.3: Scatterplot of epoch and accuracy differences for ‘MNIST’.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure A.4: Additional visualizations for the ‘CIFAR-10’ data set.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure A.5: Scatterplot of epoch and accuracy differences for ‘CIFAR-10’.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure A.6: A comparison of mean normalized neural persistence curves that we obtain during the training of ‘CIFAR- $1 0 ^ { \circ }$ and ‘Fashion-MNIST’.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure A.7: Additional visualizations for the ‘IMDB’ data set.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure A.8: Scatterplot of epoch and accuracy differences for ‘IMDB’.
|
| 295 |
+
|
| 296 |
+
# A.4 NEURAL PERSISTENCE FOR CONVOLUTIONAL LAYERS
|
| 297 |
+
|
| 298 |
+
In principle, the proposed filtration process could be applied to any bipartite graph. Hence, we can directly apply our framework to convolutional layers, provided we represent them properly. Specifically, for layer $l$ we represent the convolution of its ith input feature map $a _ { i } ^ { ( l - 1 ) } \in \overline { { \mathbb { R } ^ { h _ { \mathrm { i n } } \times w _ { \mathrm { i n } } } } }$ with the $j$ th filter $H _ { j } \in \mathbb { R } ^ { p \times q }$ as one bipartite graph $G _ { i , j }$ parametrized by a sparse weight matrix $W _ { i , j } ^ { ( l ) } \ \in \ \mathbb { R } ^ { ( h _ { \mathrm { o u t } } \cdot w _ { \mathrm { o u t } } ) \times ( h _ { \mathrm { i n } } \cdot w _ { \mathrm { i n } } ) }$ , which in each row contains the $p \cdot q$ unrolled values of $H _ { j }$ on the diagonal, with $h _ { \mathrm { i n } } \ : - \ : p$ zeros padded in between after each $p$ values of $\mathrm { v e c } ( H _ { j } )$ . This way, the flattened pre-activation can be described as $\begin{array} { r } { \mathrm { v e c } ( z _ { i , j } ^ { ( l ) } ) = W _ { i , j } ^ { ( l ) } \cdot \mathrm { v e c } ( a _ { i } ^ { ( l - 1 ) } ) + b _ { i , j } ^ { l } \cdot \mathbb { 1 } _ { ( h _ { \mathrm { o u t } } \cdot w _ { \mathrm { o u t } } ) \times 1 } . } \end{array}$
|
| 299 |
+
|
| 300 |
+
Since flattening does not change the topology of our bipartite graph, we compute the normalized neural persistence on this sparse weight matrix W (l)i,j as the unrolled analogue of the fully-connected network’s weight matrix. Averaging over all filters then gives a per-layer measure, similar to the way we derived mean normalized neural persistence in the main paper.
|
| 301 |
+
|
| 302 |
+
When studying the unrolled adjacency matrix can be approximated in a closed form. Spe $W _ { i , j } ^ { ( l ) }$ , it becolly, for es cleand that the edge filtration processinput and output neurons we $m$ $n$
|
| 303 |
+
initialize $\tau = m + n$ connected components. When using zero padding, the additional dummy input
|
| 304 |
+
neurons have to included in $m$ . For all $\tau$ tuples in the persistence diagram the creation event $c = 1$ .
|
| 305 |
+
Notably, each output neuron shares the same set of edge weights.
|
| 306 |
+
|
| 307 |
+
Due to this, the destruction events—except for a few special cases—simplify to a list of length $\tau$ containing the largest filter values (each value is contained $n$ times) in descending order until the list is filled. This simplification of neural persistence of a convolution with one filter is shown as a closed expression in Equations 7–11, and our implementation is sketched in Algorithm 3. We thus obtain
|
| 308 |
+
|
| 309 |
+
where we use
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\begin{array} { r l } & { \mathrm { N P } ( G _ { i , j } ) = \| \mathbb { 1 } - \widetilde { \mathbf { w } } \| _ { p } , } \\ & { } \\ & { \| \widetilde { \mathbf { w } } \| _ { p } \leq \left\| \left( 0 , \mathbf { w } _ { c } ^ { T } , \mathbf { w } _ { \bar { c } , \phi } ^ { T } , \mathrm { v e c } ( A _ { \phi } ) ^ { T } , \mathrm { v e c } ( B _ { \phi } ) ^ { T } \right) ^ { T } \right\| _ { p } , } \end{array}
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
with
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r l } & { \quad \phi = \tau - \dim ( \mathbf { w } _ { c } ) - 1 , } \\ & { \quad A _ { x } = \mathbf { w } _ { 1 : \left\lfloor \frac { x } { n } \right\rfloor } \otimes \mathbb { 1 } _ { n - 1 } , } \\ & { \quad B _ { y } = \mathbf { w } _ { \left\lfloor \frac { y } { n } \right\rfloor + 1 } \otimes \mathbb { 1 } _ { y \mathrm { ~ m o d ~ } n } , } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $\mathbf { 1 } _ { 0 } : = 0$ . Following this notation, Equation 7 expresses neural persistence of the bipartite graph $G _ { i , j }$ , with $\widetilde { \mathbf { w } }$ denoting the vector of selected weights (i.e. the destruction events) when calculating the persistence diagram. We use w to denote the flattened and sorted weight values (in descending order) of the convolutional filter $H _ { j }$ , while ${ \bf w } _ { c }$ represents the vector of all weights that are located in a corner of $H _ { j }$ , whereas $\mathbf { w } _ { \bar { c } , \phi }$ is the vector of all weights which do not originate from the corner of the filter while still belonging to the first (and thus largest) $\textstyle { \left\lfloor { \frac { \phi } { n } } \right\rfloor }$ weights in w, which we denote by w1:⌊ ϕ ⌋.
|
| 322 |
+
|
| 323 |
+
For the subsequent experiments (see below), we use a simple CNN that employs $3 2 + 2 0 4 8$ filters. Hence, by using the shortcut described above, we do not have to unroll 2080 weight matrices explicitly, thereby gaining both in memory efficiency and run time, as compared to the naive approach: on average, a naive exact computation based on unrolling required 8.77 s per convolutional filter and evaluation step, whereas the approximation only took about 0.000 38 s while showing very similar behaviour up to a constant offset.
|
| 324 |
+
|
| 325 |
+
For our experiments, we used an off-the-shelf ‘LeNet-like’ CNN model architecture (two convolutional layers each with max pooling and ReLU, 1 fully-connected and softmax) as described in Abadi et al. (2015). We trained the model on ‘Fashion-MNIST’ and included this setup in the early stopping experiments (100 runs of 20 epochs). In Figure A.9, we observe that stopping based on the neural persistence of a convolutional layer typically only incurs a considerable loss of accuracy: given a final test accuracy of $9 1 . 7 3 { \pm } 0 . 1 3 $ , stopping with this naive extension of our measure reduces accuracy by up to $4 \%$ . Furthermore, in contrast to early stopping on a fully-connected architecture, we do not observe any parameter combinations that stop early and increase accuracy. In fact, there is no configuration that results in an increased accuracy. This empirically confirms our theoretical scepticism towards naively applying our edge-focused filtration scheme to CNNs.
|
| 326 |
+
|
| 327 |
+
<table><tr><td></td><td>Algorithm 3 Approximating Neural Persistence of Convolutions per filter</td></tr><tr><td>Require: filter H ∈ RpXq; number of input and output neurons as m, n 1:T←0</td><td>>Initialize set of tuples for persistence diagram</td></tr><tr><td>2:T↑m+n,t←0,i←0 3:hmax ←maXh∈H |hl</td><td>Initialize number of tuples, tuple counter, weight index Determine largest absolute weight</td></tr><tr><td>4:H'← {|h|/hmax|h∈H}</td><td>>Transform weights for filtration</td></tr><tr><td>5:s ← sort(vec(H'))</td><td> Sort weights in descending order</td></tr><tr><td></td><td>6: H' ← {h,o,h',q-1,hp-1,o,hp-1,q-1}DDetermine the set of all corner weights of flter H'</td></tr><tr><td>7:T←(1,0),t←t+1</td><td>Add tuple for surviving component</td></tr><tr><td>8:1 forh'∈H'do T←(1,h),t←t+1</td><td>>Each corner of H'merges components</td></tr><tr><td>9: 10: end for</td><td></td></tr><tr><td></td><td></td></tr><tr><td>11: while 1 do</td><td> Create the remaining tuples (Approximation step)</td></tr><tr><td>12: n' = n-Ind(s[i] ∈H')</td><td>>if current weight is a corner weight, write one less tuple</td></tr><tr><td>13: ift+n'≤τthen</td><td>√if there are at least n' more tuples, set their merge value to s[i]</td></tr><tr><td>14:</td><td>repeat n' times</td></tr><tr><td>15:</td><td></td></tr><tr><td></td><td>T ←(1,s[i])>approximative as s[i] does not always add n' merges due to loops</td></tr><tr><td>16:</td><td>t←t+n',i←𝑖+1</td></tr><tr><td>17: else</td><td>>otherwise,process the remaining tuples similarly</td></tr><tr><td>18:</td><td></td></tr><tr><td></td><td>repeat (T - t) times</td></tr><tr><td>19:</td><td></td></tr><tr><td></td><td>T←(1,s[])</td></tr><tr><td>20:</td><td>break</td></tr><tr><td>21:</td><td></td></tr><tr><td></td><td>end if</td></tr><tr><td>22: end while</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>23:1</td><td></td></tr><tr><td> return |/Tllp</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 328 |
+
|
| 329 |
+
# A.5 RELATIONSHIP BETWEEN NEURAL PERSISTENCE AND VALIDATION ACCURACY
|
| 330 |
+
|
| 331 |
+
Motivated by Figure 2, which shows the different ‘regimes’ of neural persistence for a perceptron network, we investigate a possible correlation of (high) neural persistence with (high) predictive accuracy. For deeper networks, we find that neural persistence measures structural properties that arise from different parameters (such as training procedures or initializations), and no correlation can be observed.
|
| 332 |
+
|
| 333 |
+
For our experiments, we constructed neural networks with a high neural persistence prior to training. More precisely, following the theorems in this paper, we initialized most weights of each layer with very low values and reserved high values for very few weights. This was achieved by sampling the weights from a beta distribution with $\alpha = 0 . 0 0 5$ and $\beta = 0 . 5$ . Using this procedure, we are able to initialize [20,20,20] networks with $\overline { { \mathrm { N P } } } \approx 0 . 9 0 \pm 0 . 0 0 3$ compared to the same networks that have $\overline { { \mathrm { N P } } } \approx 0 . 3 \bar { 8 } \pm 0 . 0 0 \bar { 4 }$ when initialized by Xavier initialization. The mean validation accuracy of these untrained networks on the ‘Fashion-MNIST’ data set is $0 . 1 0 \pm 0 . 0 1$ and $0 . 0 9 \pm 0 . 0 3$ , respectively.
|
| 334 |
+
|
| 335 |
+
Figure A.10 depicts how both types of networks converge to similar regimes of validation accuracy, while the mean normalized neural persistence achieved at the end of the training varies. For networks initialized with high $\overline { { \mathrm { N P } } }$ (Figure A.10, left) the validation accuracy of networks with final $0 . 9 \ \leq$ $\overline { { \mathrm { N P } } } \leq 0 . 9 5$ ranges from 0.098 (not shown) to 0.863. For Xavier initialization (Figure A.10, right), the lack of correlation can also be observed. Furthermore, comparing the two plots, there are no clear advantages in initializing networks with high $\overline { { \mathrm { N P } } }$ . This observation further motivates the proposed early stopping criterion, which checks for changes in the $\overline { { \mathrm { N P } } }$ value, and considers stagnating values to be indicative of a trained network.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure A.9: Additional visualizations for the ‘Fashion-MNIST’ data set, following the preliminary examination of convolutional layers. Here, the approximated neural persistence calculation for the first convolutional layer was used. However, we also ran few runs of the same experiment using the exact method which showed the same results. Employing the second convolutional layer or both did not improve this result.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure A.10: Each cluster of points represent the last two training epochs (sampled every quarter epoch) of a [20,20,20] network trained on the ‘Fashion-MNIST’ data set. We observe no correlation between validation accuracy and normalized total persistence
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure A.11: (left) Histogram of the final normalized neural persistence of a [50, 50, 20] network for 100 runs and 25 epochs of training. (right) Normalized neural persistence after 15 epochs of training on MNIST for different architectures with increasing depth. Deeper architectures are denoted as $[ n \times 2 0 ]$ where $n$ is the number of hidden layers.
|
| 345 |
+
|
| 346 |
+
# A.6 NEURAL PERSISTENCE FOR DIFFERENT DATA DISTRIBUTIONS AND DEEPER FCN ARCHITECTURES
|
| 347 |
+
|
| 348 |
+
Neural persistence captures information about different data distributions during training. The weights tuned via backpropagation are directly influenced by the input data (as well as their labels) and neural persistence tracks those changes. To demonstrate this, we trained the same architecture , i.e. [50, 50, 20], on two data sets with the same dimensions but different properties: MNIST and ‘Fashion-MNIST’. Each data set has the same image size $2 8 \times 2 8$ pixels, one channel) but lay on different manifolds. Figure A.11 (left) shows a histogram of the mean normalized neural persistence $( \overline { { \mathrm { N P } } } )$ after 25 epochs of training over 100 different runs. The distributions have a similar shape but are shifted, indicating that the two datasets lead the network to different topological regimes.
|
| 349 |
+
|
| 350 |
+
We also investigated the effect of depth on neural persistence. We selected a fixed layer size (20 hidden units) and increased the number of hidden layers. Figure A.11 (right) depicts the boxplots of mean $\overline { { \mathrm { N P } } }$ for multiple architectures after 15 epochs of training on MNIST. Adding layers initially increases the variability of $\overline { { \mathrm { N P } } }$ by enabling the network to converge to different regimes (essentially, there are many more valid configurations in which a trained neural network might end up in). However, this effect is reduced after a certain depth: networks with deeper architectures exhibit less variability in $\overline { { \mathrm { N P } } }$ .
|
| 351 |
+
|
| 352 |
+
# A.7 EARLY STOPPING IN DATA SCARCITY SCENARIOS
|
| 353 |
+
|
| 354 |
+
Labelled data is expensive in most domains of interest, which results in small data sets or low quality of the labels. We investigate the following experimental set-ups: (1) Reducing the training data set size and (2) Permuting a fraction of the training labels. We train a fully connected network ([500, 500, 200] architecture) on ‘MNIST’ and ‘Fashion-MNIST’. In the experiments, we compare the following measures for stopping the training: i) Stopping at the optimal test accuracy. ii) Fixed stopping after the burn in period. iii) Neural persistence patience criterion. iv) Training loss patience criterion. v) Validation loss patience criterion. For a description of the patience criterion, see Algorithm 2. All measures, except validation loss, include the validation datasets $( 2 0 \% )$ in the training process to simulate a larger data set when no cross-validation is required. We report the accuracy on the non-reduced, non-permuted test sets. The batch size is 32 training instances. The stopping measures are evaluated every quarter epoch.
|
| 355 |
+
|
| 356 |
+
Figure A.12 shows the results averaged over 10 runs (the error is the standard deviation). The difference between the top and the bottom panel is the data set and the patience parameters. The $x$ -axis depicts the fraction of the data set, which is warped for better accessibility. In each panel, the left-hand side subplots depict the results of the reduced data set experiment where the right-hand side subplots depict the result of the permutation experiments. The $y$ -axis of the top subplot shows the accuracy on the non-reduced, non-permuted test set. The $y$ -axis of the bottom subplot shows when the stopping criterion was triggered.
|
| 357 |
+
|
| 358 |
+
We note the following observations, which hold for both panels: More, non-permuted data yields higher test accuracy. Also, as expected, the optimal stopping gives the highest test accuracy. The fixed early stopping results in inferior test accuracy when only a fraction of the data is available. The neural persistence based stopping is triggered late when only a fraction of the data is available which results in a slightly better test accuracy compared to training and validation loss. The training loss stopping achieves similar test accuracies compared to the persistence based stopping (for all regimes except the very small data set) with shorter training, on average. We note that, it is generally not advisable to use training loss as a measure for stopping because the stability of this criterion also depends on the batch size. When only a fraction of the data is available, the validation loss based stopping stops on average after the same number of training epochs as the training loss, which results in inferior test accuracy because the network has seen in total fewer training samples. Most strikingly, validation loss based stopping is is triggered later (sometimes never) when most training and validation labels are randomly permuted which results in overfitting and poor test accuracy.
|
| 359 |
+
|
| 360 |
+
To conclude, the neural persistence based stopping achieves good performance without being affected by the batch size and noisy labels. The authors also note that the result is consistent for multiple architectures and most patience parameters.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure A.12: On MNIST and Fashion-MNIST $\overline { { \mathrm { N P } } }$ (in blue) stops later than validation and training loss when fewer training samples are available (left-hand side) which results in a higher test accuracy. For increasing noise in the training labels (right-hand side), the stopping of $\overline { { \mathrm { N P } } }$ remains stable, in contrast to the validation loss stopping, which leads to lower test accuracy after longer training at a high fraction of permuted labels. The patience and burn in parameters are reported in quarter epochs.
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan="10">saaarrreirerg Thit rtrer iTrile sarelieg Jrrinti Aeeeetrect</td><td> 8-01 ×[=ə'666:0= °‘60= £0000 =น</td><td>8</td><td rowspan="11">-O1 x[=96660= °g60= g g-01×[=น 28 28 IMRR</td></tr><tr><td>90=u</td><td>8-01 ×[=ə666:0= °g 6'0= 1£0000=4</td></tr><tr><td>3</td><td>W4pa 44pa</td></tr><tr><td>[001000] 40</td><td>[008'000'008] [9149871] 25</td></tr><tr><td>1</td><td>8</td></tr><tr><td></td><td></td></tr><tr><td></td><td>5</td></tr><tr><td>[TILTINI(-UTIT0)</td><td>1 CIATIIIT</td></tr><tr><td></td><td></td></tr><tr><td rowspan="9">srprsg#sanr# Jateter</td><td>W4pa [0700005] [01000000]</td></tr><tr><td>rrndeeied</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr></table>
|
| 366 |
+
|
| 367 |
+
|
| 368 |
+
= 0.0003
|
| 369 |
+
10 = 0.0003
|
| 370 |
+
10
|
| 371 |
+
= 0.0003
|
| 372 |
+
10 3 40
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure A.13: Comparison of test set accuracy for trained networks without modifications (green), with batch normalization (yellow), and with $50 \%$ of the neurons dropped out during training (red) for the MNIST data set.
|
| 376 |
+
|
| 377 |
+
# A.8 TESTING ACCURACY OF DIFFERENTLY REGULARIZED MODELS
|
| 378 |
+
|
| 379 |
+
We showed in the main text that neural persistence is capable of distinguishing between networks trained with/without batch normalization and/or dropout. Figure A.13 additionally shows test set accuracies.
|
md/train/E4PK0rg2eP/E4PK0rg2eP.md
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PARAMETER-EFFICIENT TRANSFER LEARNING WITH DIFF PRUNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While task-specific finetuning of deep networks pretrained with self-supervision has led to significant empirical advances in NLP, their large size makes the standard finetuning approach difficult to apply to multi-task, memory-constrained settings, as storing the full model parameters for each task become prohibitively expensive. We propose diff pruning as a simple approach to enable parameterefficient transfer learning within the pretrain-finetune framework. This approach views finetuning as learning a task-specific “diff” vector that is applied on top of the pretrained parameter vector, which remains fixed and is shared across different tasks. The diff vector is adaptively pruned during training with a differentiable approximation to the $L _ { 0 }$ -norm penalty to encourage sparsity. Diff pruning becomes parameter-efficient as the number of tasks increases, as it requires storing only the nonzero positions and weights of the diff vector for each task, while the cost of storing the shared pretrained model remains constant. We find that models finetuned with diff pruning can match the performance of fully finetuned baselines on the GLUE benchmark while only modifying $0 . 5 \%$ of the pretrained model’s parameters per task.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Task-specific finetuning of pretrained deep networks has become the dominant paradigm in contemporary NLP, achieving state-of-the-art results across a suite of natural language understanding tasks (Devlin et al., 2019; Liu et al., 2019c; Yang et al., 2019; Lan et al., 2020). While straightforward and empirically effective, this approach is difficult to scale to multi-task, memory-constrained settings (e.g. for on-device applications), as it requires shipping and storing a full set of model parameters for each task. Inasmuch as these models are learning generalizable, task-agnostic language representations through self-supervised pretraining, finetuning the entire model for each task is an especially inefficient use of model parameters.
|
| 12 |
+
|
| 13 |
+
A popular approach to parameter-efficiency is to learn sparse models for each task where a subset of the final model parameters are exactly zero (Gordon et al., 2020; Sajjad et al., 2020; Zhao et al., 2020; Sanh et al., 2020). Such approaches often face a steep sparsity/performance tradeoff, and a substantial portion of nonzero parameters (e.g. $10 \% { - } 3 0 \% )$ ) are still typically required to match the performance of the dense counterparts. An alternative is to use multi-task learning or feature-based transfer for more parameter-efficient transfer learning with pretrained models (Liu et al., 2019b; Clark et al., 2019; Stickland & Murray, 2019; Reimers & Gurevych, 2019; Feng et al., 2020). These methods learn only a small number of additional parameters (e.g. a linear layer) on top of a shared model. However, multi-task learning generally requires access to all tasks during training to prevent catastrophic forgetting (French, 1999), while feature-based transfer learning (e.g. based on taskagnostic sentence representations) is typically outperformed by full finetuning (Howard & Ruder, 2018).
|
| 14 |
+
|
| 15 |
+
Adapters (Rebuffi et al., 2018) have recently emerged as a promising approach to parameterefficient transfer learning within the pretrain-finetune paradigm (Houlsby et al., 2019; Pfeiffer et al., 2020a;b;c). Adapter layers are smaller, task-specific modules that are inserted between layers of a pretrained model, which remains fixed and is shared across tasks. These approaches do not require access to all tasks during training making them attractive in settings where one hopes to obtain and share performant models as new tasks arrive in stream. Houlsby et al. (2019) find that adapter layers trained on BERT can match the performance of fully finetuned BERT on the GLUE benchmark (Wang et al., 2019a) while only requiring $3 . 6 \%$ additional parameters (on average) per task.
|
| 16 |
+
|
| 17 |
+
In this work, we consider a similar setting as adapters but propose a new diff pruning approach with the goal of even more parameter-efficient transfer learning. Diff pruning views finetuning as learning a task-specific difference vector that is applied on top of the pretrained parameter vector, which remains fixed and is shared across different tasks. In order to learn this vector, we reparameterize the task-specific model parameters as $\theta _ { \mathrm { t a s k } } = \theta _ { \mathrm { p r e t r a i n e d } } + \delta _ { \mathrm { t a s k } }$ , where the pretrained parameter vector $\theta _ { \mathrm { p r e t r a i n e d } }$ is fixed and the task-specific diff vector $\delta _ { \mathrm { t a s k } }$ is finetuned. The diff vector is regularized with a differentiable approximation to the $L _ { 0 }$ -norm penalty (Louizos et al., 2018) to encourage sparsity. This approach can become parameter-efficient as the number of tasks increases as it only requires storing the nonzero positions and weights of the diff vector for each task. The cost of storing the shared pretrained model remains constant and is amortized across multiple tasks. On the GLUE benchmark (Wang et al., 2019a), diff pruning can match the performance of the fully finetuned BERT baselines while finetuning only $0 . 5 \%$ of the pretrained parameters per task, making it a potential alternative to adapters for parameter-efficient transfer learning.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND: TRANSFER LEARNING FOR NLP
|
| 20 |
+
|
| 21 |
+
The field of NLP has recently seen remarkable progress through transfer learning with a pretrainand-finetune paradigm, which initializes a subset of the model parameters for all tasks from a pretrained model and then finetunes on a task specific objective. Pretraining objectives include context prediction (Mikolov et al., 2013), autoencoding (Dai & Le, 2015), machine translation (McCann et al., 2017), and more recently, variants of language modeling (Peters et al., 2018; Radford et al., 2018; Devlin et al., 2019) objectives.
|
| 22 |
+
|
| 23 |
+
Here we consider applying transfer learning to multiple tasks. We consider a setting with a potentially unknown set of tasks, where each $\tau \in \mathcal { T }$ has an associated training set $\{ x _ { \tau } ^ { ( n ) } , y _ { \tau } ^ { ( n ) } \} _ { n = 1 } ^ { N }$ 1 For . all tasks, the goal is to produce (possibly tied) model parameters to minimize the empirical risk,
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\operatorname* { m i n } _ { \pmb { \theta } _ { \tau } } \ \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( f ( x _ { \tau } ^ { ( n ) } ; \pmb { \theta } _ { \tau } ) , y _ { \tau } ^ { ( n ) } \right) + \lambda R ( \pmb { \theta } _ { \tau } )
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where $f ( \cdot ; \pmb \theta )$ is a parameterized function over the input (e.g. a neural network), $\mathcal L ( \cdot , \cdot )$ is a loss function (e.g. cross-entropy), and $R ( \cdot )$ is an optional regularizer with hyperparameter $\lambda$ .
|
| 30 |
+
|
| 31 |
+
This multi-task setting can use the pretrain-then-finetune approach by simply learning independent parameters for each task; however the large size of pretrained models makes this approach exceedingly parameter inefficient. For example, widely-adopted models such as BERTBASE and BERTLARGE have 110M and 340M parameters respectively, while their contemporaries such as T5 (Raffel et al., 2020), Megatron-LM (Shoeybi et al., 2019), and Turing-NLG (Rajbhandari et al., 2019) have parameter counts in the billions. Storing the fully finetuned models becomes difficult even for a moderate number of tasks.2 A classic approach to tackling this parameterinefficiency (Caruana, 1997) is to train a single shared model (along with a task-specific output layer) against multiple tasks through joint training. However, the usual formulation of multi-task learning requires the set of tasks $\tau$ to be known in advance in order to prevent catastrophic forgetting (French, 1999),3 making it unsuitable for applications in which the set of tasks is unknown (e.g. when tasks arrive in stream).
|
| 32 |
+
|
| 33 |
+
# 3 DIFF PRUNING
|
| 34 |
+
|
| 35 |
+
Diff pruning formulates task-specific finetuning as learning a diff vector $\delta _ { \tau }$ that is added to the pretrained model parameters $\theta _ { \mathrm { p r e t r a i n e d } }$ . We first reparameterize the task-specific model parameters,
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\begin{array} { r } { \pmb { \theta } _ { \tau } = \pmb { \theta } _ { \mathrm { p r e t r a i n e d } } + \delta _ { \tau } , } \end{array}
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
which results in the following empirical risk minimization problem,
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\operatorname* { m i n } _ { \delta _ { \tau } } \ \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( f ( x _ { \tau } ^ { ( n ) } ; \theta _ { \mathrm { p r e t r a i n e d } } + \delta _ { \tau } ) , y _ { \tau } ^ { ( n ) } \right) + \lambda R ( \theta _ { \mathrm { p r e t r a i n e d } } + \delta _ { \tau } ) .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
This trivial reparameterization is equivalent to the original formulation. Its benefit comes in the multi-task setting where the cost of storing the pretrained parameters $\theta _ { \mathrm { p r e t r a i n e d } }$ is amortized across tasks, and the only marginal cost for new tasks is the diff vector. If we can regularize $\delta _ { \tau }$ to be sparse such that $\lVert \delta _ { \tau } \rVert _ { 0 } \ll \lVert \bar { \pmb { \theta } } _ { \mathrm { p r e t r a i n e d } } \rVert _ { 0 }$ , then this approach can become more parameter-efficient as the number of tasks increases. We can specify this goal with an $L _ { 0 }$ -norm penalty on the diff vector,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
R ( \theta _ { \mathrm { p r e t r a i n e d } } + \delta _ { \tau } ) = \| \pmb { \delta } _ { \tau } \| _ { 0 } = \sum _ { i = 1 } ^ { d } \mathbb { 1 } \{ \pmb { \delta } _ { \tau , i } \neq 0 \} .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
# 3.1 DIFFERENTIABLE APPROXIMATION TO THE $L _ { 0 }$ -NORM
|
| 54 |
+
|
| 55 |
+
This regularizer is difficult to directly optimize as it is non-differentiable. In order to approximate this $L _ { 0 }$ objective, we follow the standard approach for gradient-based learning with $L _ { 0 }$ sparsity using a relaxed mask vector (Louizos et al., 2018). This approach involves relaxing a binary vector into continuous space, and then multiplying it with a dense weight vector to determine how much of the weight vector is applied during training. After training, the mask is deterministic and a large portion of the diff vector is true zero.
|
| 56 |
+
|
| 57 |
+
To apply this method we first decompose $\delta _ { \tau }$ into a binary mask vector multiplied with a dense vector,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r } { \delta _ { \tau } = \mathbf { z } _ { \tau } \odot \mathbf { w } _ { \tau } , \qquad \mathbf { z } _ { \tau } \in \{ 0 , 1 \} ^ { d } , \mathbf { w } _ { \tau } \in \mathbb { R } ^ { d } } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We can now instead optimize an expectation with respect to ${ \bf z } _ { \tau }$ , whose distribution $p ( \mathbf { z } _ { \tau } ; \pmb { \alpha } _ { \tau } )$ is initially Bernoulli with parameters $\pmb { \alpha } _ { \tau }$ ,
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\operatorname* { m i n } _ { \alpha _ { \tau } , \mathbf { w } _ { \tau } } \mathbb { E } _ { \mathbf { z } _ { \tau } \sim p ( \mathbf { z } _ { \tau } ; \alpha _ { \tau } ) } \left[ \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( f ( x _ { \tau } ^ { ( n ) } ; \boldsymbol { \theta } _ { \mathrm { p r e t r a i n e d } } + \mathbf { z } _ { \tau } \odot \mathbf { w } _ { \tau } , ) , y _ { \tau } ^ { ( n ) } \right) + \lambda \lVert \delta _ { \tau } \rVert _ { 0 } \right] .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
This objective is still difficult in practice due to ${ \bf z } _ { \tau }$ ’s being discrete (which requires the score function gradient estimator), but the expectation provides some guidance for empirically effective relaxations. We follow prior work (Louizos et al., 2018; Wang et al., 2019b) and relax ${ \bf z } _ { \tau }$ into continuous space $[ 0 , 1 ] ^ { d }$ with a stretched Hard-Concrete distribution (Jang et al., 2017; Maddison et al., 2017), which allows for the use of pathwise gradient estimators. Specifically, ${ \bf z } _ { \tau }$ is now defined to be a deterministic and (sub)differentiable function of a sample $\mathbf { u }$ from a uniform distribution,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r } { \mathbf { u } \sim U ( \mathbf { 0 } , \mathbf { 1 } ) , \qquad \mathbf { s } _ { \tau } = \sigma \left( \log \mathbf { u } - \log ( 1 - \mathbf { u } ) + \alpha _ { \tau } \right) , } \\ { \bar { \mathbf { s } } _ { \tau } = \mathbf { s } _ { \tau } \times ( r - l ) + l , \qquad \mathbf { z } _ { \tau } = \operatorname* { m i n } ( \mathbf { 1 } , \operatorname* { m a x } ( \mathbf { 0 } , \bar { \mathbf { s } } _ { \tau } ) ) . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here $l < 0$ and $r > 1$ are two constants used to stretch ${ \bf s } _ { \tau }$ into the interval $( l , r ) ^ { d }$ before it is clamped to $[ 0 , 1 ] ^ { d }$ with the $\operatorname* { m i n } ( \mathbf { 1 } , \operatorname* { m a x } ( \mathbf { 0 } , \cdot ) )$ operation. In this case we have a differentiable closed-form expression for the expected $L _ { 0 }$ -norm,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathbb { E } \left[ \left. \pmb { \delta } _ { \tau } \right. _ { 0 } \right] = \sum _ { i = 1 } ^ { d } \mathbb { E } \left[ \mathbb { 1 } \left\{ \mathbf { z } _ { \tau , i } > 0 \right\} \right] = \sum _ { i = 1 } ^ { d } \sigma \left( \alpha _ { \tau , i } - \log \frac { - l } { r } \right) .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Thus the final optimization problem is given by,
|
| 82 |
+
|
| 83 |
+
$\operatorname* { m i n } _ { \tau _ { \tau } , \mathbf { w } _ { \tau } } \mathbb { E } _ { \mathbf { u } \sim U [ \mathbf { 0 } , 1 ] } \left[ \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \mathcal { L } \left( f ( x _ { \tau } ^ { ( n ) } ; \boldsymbol { \theta } _ { \mathrm { p r e r a i n e d } } + \mathbf { z } _ { \tau } \odot \mathbf { w } _ { \tau } , ) , y _ { \tau } ^ { ( n ) } \right) \right] + \lambda \sum _ { i = 1 } ^ { d } \sigma \left( \alpha _ { \tau , i } - \log \frac { - l } { r } \right) ,$ and we can now utilize pathwise gradient estimators to optimize the first term with respect to $\pmb { \alpha } _ { \tau }$ since the expectation no longer depends on it.4 After training we obtain the final diff vector $\delta _ { \tau }$ by sampling $\mathbf { u }$ once to obtain ${ \bf z } _ { \tau }$ (which is not necessarily a binary vector but has a significant number of dimensions equal to exactly zero due to the clamping function), then setting $\pmb { \delta } _ { \tau } = \mathbf { z } _ { \tau } \odot \mathbf { w } _ { \tau }$ . 5
|
| 84 |
+
|
| 85 |
+
3.2 $L _ { 0 }$ -BALL PROJECTION WITH MAGNITUDE PRUNING FOR SPARSITY CONTROL
|
| 86 |
+
|
| 87 |
+
Differentiable $L _ { 0 }$ regularization provides a strong way to achieve high sparsity rate. However, it would be ideal to have more fine-grained control into the exact sparsity rate in the diff vector, especially considering applications which require specific parameter budgets. As $\lambda$ is just the Lagrangian multiplier for the constraint $\mathbb { E } \left[ \lVert \pmb { \delta } _ { \tau } \rVert _ { 0 } \right] < \eta$ for some $\eta$ , this could be achieved in principle by searching over different values of $\lambda$ . However we found it more efficient and empirically effective to achieve an exact sparsity rate by simply projecting onto the $L _ { 0 }$ -ball after training.
|
| 88 |
+
|
| 89 |
+
Specifically we use magnitude pruning on the diff vector $\delta _ { \tau }$ and target a sparsity rate $t \%$ by only keeping the top $t \% \times \bar { d }$ values in $\delta _ { \tau }$ .6 Note that unlike standard magnitude pruning, this is based on the magnitude of the diff vector values and not the model parameters. As is usual in magnitude pruning, we found it important to further finetune $\delta _ { \tau }$ with the nonzero masks fixed to maintain good performance (Han et al., 2016). Since this type of parameter-efficiency through projection onto the $L _ { 0 }$ -ball can be applied without adaptive diff pruning,7 such an approach will serve as one of our baselines in the empirical study.
|
| 90 |
+
|
| 91 |
+
# 3.3 STRUCTURED DIFF PRUNING
|
| 92 |
+
|
| 93 |
+
Diff pruning, as presented above, is architecture-agnostic and does not exploit the underlying model structure—each dimension of ${ \bf z } _ { \tau }$ is independent from one another. While this makes the approach potentially more flexible, we might expect to achieve better sparsity/performance tradeoff through a structured formulation which encourages active parameters to group together and other areas to be fully sparse. Motivated by this intuition, we first partition the parameter indices into $G$ groups $\{ g ( 1 ) , \ldots , g ( G ) \}$ where $g ( j )$ is a subset of parameter indices governed by group $g ( j )$ .8 We then introduce a scalar $\mathbf { z } _ { \tau } ^ { j }$ (with the associated parameter $\alpha _ { \tau } ^ { j }$ ) for each group $g ( j )$ , and decompose the task-specific parameter for index $i \in g ( j )$ as $\begin{array} { r } { \delta _ { \tau , i } ^ { j } = \mathbf { z } _ { \tau , i } \times \mathbf { z } _ { \tau } ^ { j } \times \mathbf { w } _ { \tau , i } . } \end{array}$ The expected $L _ { 0 }$ -norm is then given by,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\Sigma \left[ \left. \delta _ { \tau } \right. _ { 0 } \right] = \sum _ { j = 1 } ^ { G } \sum _ { i \in g ( j ) } \mathbb { E } \left[ \mathbb { I } \left\{ \mathbf { z } _ { \tau , i } \cdot \mathbf { z } _ { \tau } ^ { g } > 0 \right\} \right] = \sum _ { j = 1 } ^ { G } \sum _ { i \in g ( j ) } \sigma \left( \alpha _ { \tau , i } - \log { \frac { - l } { r } } \right) \times \sigma \left( \alpha _ { \tau } ^ { j } - \log { \frac { - l } { r } } \right) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
and we can train with gradient-based optimization as before.
|
| 100 |
+
|
| 101 |
+
# 4 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
# 4.1 MODEL AND DATASETS
|
| 104 |
+
|
| 105 |
+
For evaluation we use the GLUE benchmark (Wang et al., 2019b), a popular finetuning dataset. Following adapters (Houlsby et al., 2019), we test our approach on the following subset of the GLUE tasks: Multi-Genre Natural Language Inference (MNLI), where the goal is two predict whether the relationship between two sentences is entailment, contradiction, or neutral (we test on both $\mathrm { M N L L } \mathrm { I } _ { m }$ and $\mathrm { M N L I } _ { m m }$ which respectively tests on matched/mismatched domains); Quora Question Pairs (QQP), a classification task to predict whether two question are semantically equivalent; Question Natural Language Inference (QNLI), which must predict whether a sentence is a correct answer to the question; Stanford Sentiment Treebank (SST-2), a sentence classification task to predict the sentiment of movie reviews; Corpus of Linguistic Acceptability (CoLA), where the goal is predict whether a sentence is linguistically acceptable or not; Semantic Textual Similarity Benchmark (STS$\mathbf { B }$ ), which must predict a similarity rating between two sentences; Microsoft Research Paraphrase Corpus (MRPC), where the goal is to predict whether two sentences are semantically equivalent; Recognizing Textual Entailment (RTE), which must predict whether a second sentence is entailed by the first. For evaluation, the benchmark uses Matthew’s correlation for CoLA, Spearman for STS-B, $\mathrm { F _ { 1 } }$ score for MRPC/QQC, and accuracy for MNLI/QNLI/SST-2/RTE.
|
| 106 |
+
|
| 107 |
+
<table><tr><td></td><td>Total params</td><td>New params per task</td><td>QNLI*</td><td>SST-2 MNLIm</td><td></td><td>MNLImm</td><td>CoLA MRPC STS-B RTE</td><td></td><td></td><td></td><td>QQP</td><td>Avg</td></tr><tr><td>Full finetuning</td><td>9.00×</td><td>100%</td><td>91.1</td><td>94.9</td><td>86.7</td><td>85.9</td><td>60.5</td><td>89.3</td><td>87.6</td><td>70.1</td><td>72.1</td><td>80.9</td></tr><tr><td>Adapters (8-256)</td><td>1.32×</td><td>3.6%</td><td>90.7</td><td>94.0</td><td>84.9</td><td>85.1</td><td>59.5</td><td>89.5</td><td>86.9</td><td>71.5</td><td>71.8</td><td>80.4</td></tr><tr><td>Adapters (64)</td><td>1.19×</td><td>2.1%</td><td>91.4</td><td>94.2</td><td>85.3</td><td>84.6</td><td>56.9</td><td>89.6</td><td>87.3</td><td>68.6</td><td>71.8</td><td>79.8</td></tr><tr><td>Full finetuning</td><td>9.00×</td><td>100%</td><td>93.4</td><td>94.1</td><td>86.7</td><td>86.0</td><td>59.6</td><td>88.9</td><td>86.6</td><td>71.2</td><td>71.7</td><td>80.6</td></tr><tr><td>Last layer</td><td>1.34×</td><td>3.8%</td><td>79.8</td><td>91.6</td><td>71.4</td><td>72.9</td><td>40.2</td><td>80.1</td><td>67.3</td><td>58.6</td><td>63.3</td><td>68.2</td></tr><tr><td>Non-adap. diff pruning</td><td>1.05×</td><td>0.5%</td><td>89.7</td><td>93.6</td><td>84.9</td><td>84.8</td><td>51.2</td><td>81.5</td><td>78.2</td><td>61.5</td><td>68.6</td><td>75.5</td></tr><tr><td>Diff pruning</td><td>1.05×</td><td>0.5%</td><td>92.9</td><td>93.8</td><td>85.7</td><td>85.6</td><td>60.5</td><td>87.0</td><td>83.5</td><td>68.1</td><td>70.6</td><td>79.4</td></tr><tr><td>Diff pruning (struct.)</td><td>1.05×</td><td>0.5%</td><td>93.3</td><td>94.1</td><td>86.4</td><td>86.0</td><td>61.1</td><td>89.7</td><td>86.0</td><td>70.6</td><td>71.1</td><td>80.6</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 1: GLUE benchmark test server results with BERTLARGE models. (Top) Results with adapter bottleneck layers (brackets indicate the size of bottlenecks), taken from from Houlsby et al. (2019). (Bottom) Results from this work. ${ } ^ { * } \mathrm { Q N L I }$ results are not directly comparable across the two works as the GLUE benchmark has updated the test set since then. To make our results comparable the average column is calculated without QNLI.
|
| 110 |
+
|
| 111 |
+
For all experiments, we use the BERTLARGE model from Devlin et al. (2019), which has 24 layers, 1024 hidden size, 16 attention heads, and 340M parameters. We use the Huggingface Transformer library (Wolf et al., 2019) to conduct our experiments.
|
| 112 |
+
|
| 113 |
+
# 4.2 BASELINES
|
| 114 |
+
|
| 115 |
+
We compare both structured and non-structured variants of diff pruning against the following baselines: Full finetuning, which fully finetunes $\mathrm { B E R T _ { L } }$ ARGE as usual; Last layer finetuning, which only finetunes the penultimate layer (along with the final output layer)9; Adapters from Houlsby et al. (2019), which train task-specific bottleneck layers between between each layer of a pretrained model, where parameter-efficiency can be controlled by varying the size of the bottleneck layers; and Non-adaptive diff pruning, which performs diff pruning just based on magnitude pruning (i.e., we obtain $\pmb { \theta } _ { \tau }$ through usual finetuning, set $\delta _ { \tau } = \pmb { \theta } _ { \tau } - \pmb { \theta } _ { \mathrm { p r e t r a i n e d } }$ , and then apply magnitude pruning followed by additional finetuning on $\delta _ { \tau }$ ). For diff pruning we set our target sparsity rate to $0 . 5 \%$ and investigate the effect of different target sparsity rates in section 5.1.
|
| 116 |
+
|
| 117 |
+
# 4.3 IMPLEMENTATION DETAILS AND HYPERPARAMETERS
|
| 118 |
+
|
| 119 |
+
Diff pruning introduces additional hyperparameters $l , r$ (for stretching the Hard-Concrete distribution) and $\lambda$ (for weighting the approximate $L _ { 0 }$ -norm penalty). We found $l = - 1 . 5 , r = 1 . 5 , \lambda =$ $1 . 2 5 \times 1 0 ^ { - 7 }$ to work well across all tasks. We also initialize the weight vector ${ \bf w } _ { \tau }$ to 0, and $\pmb { \alpha } _ { \tau }$ to a positive vector (we use 5) to encourage ${ \bf z } _ { \tau }$ to be close to 1 at the start of training. While we mainly experiment with BERTLARGE to compare against prior work with adapters (Houlsby et al., 2019), in preliminary experiments we found these hyperparameters to work for finetuning RoBERTa (Liu et al., $2 0 1 9 \mathrm { c }$ ) and XLNet (Yang et al., 2019) models as well.
|
| 120 |
+
|
| 121 |
+
For all tasks we use a learning rate of $1 \times 1 0 ^ { - 5 }$ and perform a hyperparameter search over batch size $\in \{ 4 , 6 , 8 , 1 0 \}$ and the number of epochs $\in \{ 2 , 3 , 4 , 5 \}$ .10 However we found the default settings used for regular finetuning as suggested in the original BERT paper to work well for most tasks. Finetuning with the fixed mask after projecting onto the $L _ { 0 }$ -ball with magnitude pruning is done with a learning rate of $5 \times 1 0 ^ { - 5 }$ for 3 or 5 epochs (3 epochs for QNLI, SST-2, MNLI-m, MNLI-mm, CoLA, QQP, 5 epochs for MRPC, STS-B, RTE). Grouping for the structured version of diff pruning is based on the matrix/bias vectors (i.e. parameters that belong to the same matrix or bias vector are assumed to be in the same group), which results in 393 groups.1
|
| 122 |
+
|
| 123 |
+
# 5 RESULTS AND ANALYSIS
|
| 124 |
+
|
| 125 |
+
Our main results on the GLUE benchmark are shown in Table 1. Structured diff pruning can match the performance of a fully finetuned BERTLARGE model while only requiring $0 . 5 \%$ additional parameters per task. Diff pruning without structured sparsity also performs well, though slightly worse than the structured approach. Non-adaptive diff pruning, which magnitude prunes the diff vector without learning the binary mask $\mathbf { z } _ { \tau }$ , performs significantly worse, indicating the importance of learning the masking vector. Compared to adapters, diff pruning obtains similar performance while requiring fewer parameters per task, making it a potential alternative for parameter-efficient transfer learning.12 We now perform a series of analysis experiments on the validation set.
|
| 126 |
+
|
| 127 |
+
<table><tr><td rowspan="2">Non-structured</td><td colspan="2">Pruned Diff Groups</td><td colspan="2">Structured</td></tr><tr><td>#</td><td>%</td><td>#</td><td>%</td></tr><tr><td>MRPC</td><td>24</td><td>6.1</td><td>52</td><td>13.2</td></tr><tr><td>STS-B</td><td>25</td><td>6.4</td><td>48</td><td>12.2</td></tr><tr><td>RTE</td><td>28</td><td>7.1</td><td>50</td><td>12.7</td></tr><tr><td>Avg</td><td>25.7</td><td>6.5</td><td>50.0</td><td>12.7</td></tr></table>
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 1: (Left) Average performance on the GLUE validation set across different target sparsity rates for the different methods. (Right) Number of groups where all of the parameters in the group are fully zero for structured vs. non-structured diff pruning at $0 . 5 \%$ target sparsity. We group based on each matrix/bias vector, resulting in 393 groups in total.
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Diff vector target sparsity</td><td>QNLI</td><td>SST-2</td><td>MNLIm</td><td>MNLImm</td><td>CoLA</td><td>MRPC</td><td>STS-B</td><td>RTE</td><td>QQP</td><td>Avg</td></tr><tr><td>0.10%</td><td>92.7</td><td>93.3</td><td>85.6</td><td>85.9</td><td>58.0</td><td>87.4</td><td>86.3</td><td>68.6</td><td>85.2</td><td>82.5</td></tr><tr><td>0.25%</td><td>93.2</td><td>94.2</td><td>86.2</td><td>86.5</td><td>63.3</td><td>90.9</td><td>88.4</td><td>71.5</td><td>86.1</td><td>84.5</td></tr><tr><td>0.50%</td><td>93.4</td><td>94.2</td><td>86.4</td><td>86.9</td><td>63.5</td><td>91.3</td><td>89.5</td><td>71.5</td><td>86.6</td><td>84.8</td></tr><tr><td>1.00%</td><td>93.3</td><td>94.2</td><td>86.4</td><td>87.0</td><td>66.3</td><td>91.4</td><td>89.9</td><td>71.1</td><td>86.6</td><td>85.1</td></tr><tr><td>100%</td><td>93.5</td><td>94.1</td><td>86.5</td><td>87.1</td><td>62.8</td><td>91.9</td><td>89.8</td><td>71.8</td><td>87.6</td><td>85.0</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Table 2: Structured diff pruning results on the validation set with different target sparsity rates. Average performance includes all 9 tasks.
|
| 135 |
+
|
| 136 |
+
# 5.1 VARYING THE TARGET SPARSITY
|
| 137 |
+
|
| 138 |
+
In Figure 1 (left), we plot results on the GLUE validation set averaged across all tasks at target sparsity rates of $0 . 1 \%$ , $0 . 2 5 \%$ , $0 . 5 \%$ , $1 . 0 \%$ for the different baselines. Structured diff pruning consistently outperforms non-structured and and non-adaptive variants across different sparsity rates. The advantage of adaptive methods becomes more pronounced at extreme sparsity rates. In Table 2, we report the breakdown of accuracy of structured diff pruning across different tasks and sparsity rates, where we observe that different tasks have different sensitivity to target sparsity rates. This suggests that we can obtain even greater parameter-efficiency through targeting task-specific sparsity rates in the diff vector.
|
| 139 |
+
|
| 140 |
+
# 5.2 STRUCTURED VS. NON-STRUCTURED DIFF PRUNING
|
| 141 |
+
|
| 142 |
+
Structured diff pruning introduces an additional mask per group, which encourages pruning of entire groups. This is less restrictive than traditional group sparsity techniques that have been used with $L _ { 0 }$ -norm relaxations which force all parameters in a group to share the same mask (Louizos et al., 2018; Wang et al., 2019b). However we still expect entire groups to be pruned out more often in the structured case, which might bias the learning process towards either eliminating completely or clustering together nonzero diffs. In Figure 1 (right), we indeed find that structured diff pruning leads to finetuned models that are much more likely to leave entire groups unchanged from their pretrained values (zero diffs).
|
| 143 |
+
|
| 144 |
+
# 5.3 TASK-SPECIFIC SPARSITY
|
| 145 |
+
|
| 146 |
+
Different layers of pretrained models have argued to encode different information (Liu et al., 2019a; Tenney et al., 2019). Given that each task will likely recruit different kinds of language phenomena embedded in the hidden layers, we hypothesize that diff pruning will modify different parts of the pretrained model through task-specific finetuning. Figure 2 shows the percentage of nonzero diff parameters attributable to the different layers for each task. We find that different tasks indeed modify different parts of the network, although there are some qualitative similarities between some tasks, for example between QNLI & QQP (both must encode questions), and MRPC & STS-B (both must predict similarity between sentences). The embedding layer is very sparsely modified for all tasks. While some of the variations in the sparsity distributions is due to simple randomness, we do observe some level of consistency over multiple runs of the same task, as shown in Figure 3 of the appendix.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
|
| 150 |
+
Figure 2: Percentage of modified parameters attributable to each layer for different tasks at $0 . 5 \%$ target sparsity. The layers are ordered from earlier to later (i.e. the embedding layer is shown at the top). The $\mathbf { X }$ -axis for each plot goes from $0 \%$ to $20 \%$ .
|
| 151 |
+
|
| 152 |
+
<table><tr><td></td><td>QNLI</td><td>SST-2</td><td>MNLIm</td><td>MNLImm</td><td>CoLA</td><td>MRPC</td><td>STS-B</td><td>RTE</td><td>QQP</td><td>Avg</td></tr><tr><td>Sparsity</td><td>1.5%</td><td>0.6%</td><td>0.8%</td><td>0.8%</td><td>1.6%</td><td>2.4%</td><td>3.3%</td><td>0.7%</td><td>0.6%</td><td>1.4%</td></tr><tr><td>Performance</td><td>93.8</td><td>94.0</td><td>86.2</td><td>86.8</td><td>63.1</td><td>91.9</td><td>89.7</td><td>71.8</td><td>86.5</td><td>84.9</td></tr><tr><td>With 0.5% sparsity</td><td>93.4</td><td>94.2</td><td>86.4</td><td>86.9</td><td>63.5</td><td>91.3</td><td>89.5</td><td>71.5</td><td>86.6</td><td>84.8</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 3: (Top) Sparsity and performance before magnitude pruning on the validation set with structured diff pruning. (Bottom) Performance with $0 . 5 \%$ target sparsity.
|
| 155 |
+
|
| 156 |
+
The ability to modify different parts of the pretrained model for each task could explain the improved parameter-efficiency of our approach compared to Houlsby et al. (2019)’s adapter layers, which can only read/write to the pretrained model at certain points of the computational graph.13 This potentially suggests that adapter layers with more fine-grained access into model internals (e.g. adapters for key/value/query transformations) might result in even greater parameter-efficiency. While left as future work, we also note that diff pruning can be applied in conjunction with adapters, which might further improve results.
|
| 157 |
+
|
| 158 |
+
# 5.4 EFFECT OF $\mathrm { L } _ { 0 }$ -BALL PROJECTION VIA MAGNITUDE PRUNING
|
| 159 |
+
|
| 160 |
+
Applying magnitude pruning to project onto the $\mathrm { L } _ { 0 }$ -ball was crucial in achieving exact sparsity targets. As shown in Table 3, we observed little loss in performance through magnitude pruning. We re-iterate that it was crucial to finetune with the fixed mask in order to maintain good performance.14
|
| 161 |
+
|
| 162 |
+
# 5.5 SQUAD EXTRACTIVE QUESTION ANSWERING
|
| 163 |
+
|
| 164 |
+
To demonstrate the effectiveness of our approach beyond classification, we additionally experiment on the extractive question answering task SQuAD, which asks model to select the answer span to a question given a Wikipedia paragraph. To make direct comparisons with Houlsby et al. (2019), we run all experiments on SQuAD v1.1. For diff pruning, we use the same general hyper-parameters as our full finetuning baseline.15 Results are shown in Table 4. Diff pruning is able achieve comparable or better performance with only $1 \%$ additional parameters. Notably, we see that our method can improve the F1 score of full finetuning baseline by a significant margin (e.g. $9 0 . 8 \% \Rightarrow 9 3 . 2 \% )$ )
|
| 165 |
+
|
| 166 |
+
<table><tr><td></td><td>Sparsity</td><td>F1</td></tr><tr><td>Full finetuning Adapters</td><td>100% 2%</td><td>90.7% 90.4%</td></tr><tr><td>Full finetuning</td><td>100%</td><td>90.8%</td></tr><tr><td>Diff pruning</td><td>1%</td><td>92.1%</td></tr><tr><td>Diff pruning (struct.)</td><td>1%</td><td>93.2%</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 4: SQuAD validation results with BERTLARGE model.
|
| 169 |
+
|
| 170 |
+
while modifying many fewer parameters (e.g., $1 0 0 \% \Rightarrow 1 \%$ ), which potentially implies that diff pruning can have a useful regularization effect.
|
| 171 |
+
|
| 172 |
+
# 6 DISCUSSION
|
| 173 |
+
|
| 174 |
+
# 6.1 MEMORY REQUIREMENTS
|
| 175 |
+
|
| 176 |
+
For training, our approach requires more memory than usual finetuning due to additionally optimizing $\pmb { \alpha } _ { \tau }$ and ${ \bf w } _ { \tau }$ . This did not present a significant challenge for pretrained models that we experimented with in this study, since majority of GPU memory was utilized by the minibatch’s activation layers. However, this could present an issue as model sizes get larger and larger. While training efficiency was not a primary concern of this work, diff pruning takes approxiamtely $1 . 5 \times$ to $2 \times$ more time per batch, which results in slower training.
|
| 177 |
+
|
| 178 |
+
After training, storing the task-specific diff vector requires storing a compressed version with both the nonzero positions and weights, which incurs additional storage requirements.
|
| 179 |
+
|
| 180 |
+
# 6.2 INFORMATION-EFFICIENT TRANSFER LEARNING
|
| 181 |
+
|
| 182 |
+
Efficiently representing pretrained models adapted to new tasks is becoming an increasingly important problem in contemporary NLP. This paper focuses on a rather narrow definition of efficiency— parameter-efficiency. An interesting direction might be to target generalizations of parameterefficiency, for example, information-efficiency, which aims to minimize the number of bits required to represent the task-specific model when given the pretrained model for free. This view can suggest other avenues for achieving information-efficient transfer learning: for example, “what is the minimum number of (potentially synthetic) datapoints that we can finetune BERT on to obtain a good task-specific model?”,16 or “what is the shortest prefix string that we can condition GPT3 on for it to become a good task-specific model”?
|
| 183 |
+
|
| 184 |
+
# 7 RELATED WORK
|
| 185 |
+
|
| 186 |
+
Multi-task learning Multi-task learning (Caruana, 1997), broadly construed, aims to learn models and representations that can be utilized across a diverse range of tasks, and offers a natural approach to training parameter-efficient deep models. Several works have shown that a single BERT model can obtain good performance across multiple tasks when jointly trained (Liu et al., 2019b; Clark et al., 2019; Stickland & Murray, 2019). Adapter layers, which are task-specific layers that read and write to layers of a shared model (Rebuffi et al., 2018), offer an alternative approach to multi-task learning that does not require access to all tasks during training, and have also been applied to obtain parameter-efficient BERT models (Houlsby et al., 2019; Pfeiffer et al., 2020a;b;c). A related line of work targets extreme parameter-efficiency through task-agnostic sentence representations that can be used without finetuning for downstream tasks (Le & Mikolov, 2014; Kiros et al., 2015; Wieting et al., 2016; Hill et al., 2016; Arora et al., 2017; Conneau et al., 2017; Cer et al., 2018; Zhang et al., 2018; Subramanian et al., 2018; Zhang et al., 2020). Reimers & Gurevych (2019), building on the earlier work of Conneau et al. (2017), show that BERT finetuned on natural language inference obtains sentence representations that perform well across multiple sentence-level tasks. These feature-based transfer learning methods are however generally outperformed by fully finetuned models (Howard & Ruder, 2018).
|
| 187 |
+
|
| 188 |
+
Model compression There has been much recent work on compressing pretrained trained with self-supervision (see Ganesh et al. (2020) for a recent survey). A particularly promising line of work focuses on obtaining smaller pretrained models (for subsequent finetuning) through weight pruning (Gordon et al., 2020; Sajjad et al., 2020; Chen et al., 2020) and/or knowledge distillation (Sanh et al., 2019; Sun et al., 2019; Turc et al., 2019; Jiao et al., 2019; Sun et al., 2020). It would be interesting to see whether our approach can be applied on top of these smaller pretrained models to for even greater parameter-efficiency.
|
| 189 |
+
|
| 190 |
+
Learning to prune Our work is closely related to the line of work on learning to prune pretrained models with differentiable relaxations of binary masks (Wang et al., 2019b; Zhao et al., 2020; Sanh et al., 2020; Radiya-Dixit & Wang, 2020). While these works also enable parameter-efficient transfer learning, they generally apply the masks directly on the pretrained parameters instead of on the difference vector as in the present work.
|
| 191 |
+
|
| 192 |
+
Regularization towards pretrained models Finally, diff pruning is also related to works which regularize the learning process towards pretrained models for continual learning (Kirkpatrick et al., 2017; Schwarz et al., 2018), domain adaptation (Wiese et al., 2017; Miceli Barone et al., 2017), and stable finetuning (Lee et al., 2020). These works typically do not utilize sparse regularizers and target a different goal than parameter-efficiency.
|
| 193 |
+
|
| 194 |
+
# 8 CONCLUSION
|
| 195 |
+
|
| 196 |
+
We propose diff pruning as a simple approach for parameter-efficient transfer learning with pretrained models. Experiments on standard NLP benchmarks and models show that diff pruning can match the performance of fully finetuned baselines while requiring only a few additional parameters per task. We also propose a structured variant of diff pruning which provides further improvements. Future work will consider (i) applying this approach to other architectures (e.g. ConvNets for vision applications), (ii) injecting parameter-efficiency objectives directly into the pretraining process (to pretrain models that are better suited towards sparse transfer learning), and (iii) combining diff pruning with other techniques (e.g. adapters) to achieve even greater parameter-efficiency.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A Simple but Tough-to-Beat Baseline for Sentence Embeddings . In Proceedings of ICLR, 2017.
|
| 201 |
+
|
| 202 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language Models are Few-Shot Learners. 2020.
|
| 203 |
+
|
| 204 |
+
Rich Caruana. Multitask Learning. Machine Learning, 1997.
|
| 205 |
+
|
| 206 |
+
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St. John, Noah Constant, Mario Guajardo-Cespedes, Steve Yuan, Chris Tar, Brian Strope, and Ray Kurzweil. Universal sentence encoder for English. In Proceedings of EMNLP: System Demonstrations, 2018.
|
| 207 |
+
|
| 208 |
+
Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Zhangyang Wang, and Michael Carbin. The Lottery Ticket Hypothesis for Pre-trained BERT Networks. arXiv:2007.12223, 2020.
|
| 209 |
+
|
| 210 |
+
Kevin Clark, Minh-Thang Luong, Urvashi Khandelwal, Christopher D. Manning, and Quoc V. Le. BAM! Born-Again Multi-Task Networks for Natural Language Understanding. In Proceedings of ACL, 2019.
|
| 211 |
+
|
| 212 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. Supervised Learning of Universal Sentence Representations from Natural Language Inference Data. In Proceedings of EMNLP, 2017.
|
| 213 |
+
|
| 214 |
+
Andrew Dai and Quoc V. Le. Semi-Supervised Sequence Learning. In Proceedings of NIPS, 2015.
|
| 215 |
+
|
| 216 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of NAACL, 2019.
|
| 217 |
+
|
| 218 |
+
Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Naveen Arivazhagan, and Wei Wang. Languageagnostic BERT Sentence Embedding. arXiv:2007.01852, 2020.
|
| 219 |
+
|
| 220 |
+
Robert French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3, 1999.
|
| 221 |
+
|
| 222 |
+
Prakhar Ganesh, Yao Chen, Xin Lou, Mohammad Ali Khan, Yin Yang, Deming Chen, Marianne Winslett, Hassan Sajjad, and Preslav Nakov. Compressing Large-Scale Transformer-Based Models: A Case Study on BERT. arXiv:2002.11985, 2020.
|
| 223 |
+
|
| 224 |
+
Mitchell A. Gordon, Kevin Duh, and Nicholas Andrews. Compressing BERT: Studying the Effects of Weight Pruning on Transfer Learning. In Proceedings of Rep4NLP 2020 Workshop at ACL 2020, 2020.
|
| 225 |
+
|
| 226 |
+
Song Han, Huizi Mao, and William J. Dally. Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding. In Proceedings of ICLR, 2016.
|
| 227 |
+
|
| 228 |
+
Felix Hill, Kyunghyun Cho, and Anna Korhonen. Learning distributed representations of sentences from unlabelled data. In Proceedings of ACL, 2016.
|
| 229 |
+
|
| 230 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, and Mona Attariyanand Sylvain Gelly. Parameter-efficient transfer learning for nlp. In Proceedings of ICML, 2019.
|
| 231 |
+
|
| 232 |
+
Jeremy Howard and Sebastian Ruder. Universal Language Model Fine-tuning for Text Classification. In Proceedings of ACL, 2018.
|
| 233 |
+
|
| 234 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with Gumbel-Softmax. In Proceedings of ICLR, 2017.
|
| 235 |
+
|
| 236 |
+
Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. TinyBERT: Distilling BERT for Natural Language Understanding. arXiv:1909.10351, 2019.
|
| 237 |
+
|
| 238 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 14:3521–3526, 2017.
|
| 239 |
+
|
| 240 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urta sun, and Sanja Fidler. Skip-Thought Vectors. In Proceedings of NeurIPS, 2015.
|
| 241 |
+
|
| 242 |
+
Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. In Proceedings of ICLR, 2020.
|
| 243 |
+
|
| 244 |
+
Quoc V. Le and Tomas Mikolov. Distributed Representations of Sentences and Documents. In Proceedings of ICML, 2014.
|
| 245 |
+
|
| 246 |
+
Cheolhyoung Lee, Kyunghyun Cho, and Wanmo Kang. Mixout: Effective Regularization to Finetune Large-scale Pretrained Language Models. In Proceedings of ICLR, 2020.
|
| 247 |
+
|
| 248 |
+
Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in Neural Information Processing Systems. 2017.
|
| 249 |
+
|
| 250 |
+
Nelson F. Liu, Matt Gardner, Yonatan Belinkov, Matthew E. Peters, and Noah A. Smith. Linguistic Knowledge and Transferability of Contextual Representations. In Proceedings of ACL, 2019a.
|
| 251 |
+
|
| 252 |
+
Xiaodong Liu, Pengcheng He, Weizhu Chen, and Jianfeng Gao. Multi-Task Deep Neural Networks for Natural Language Understanding. In Proceedings of ACL, 2019b.
|
| 253 |
+
|
| 254 |
+
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv:1907.11692, 2019c.
|
| 255 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient Episodic Memory for Continual Learning. In Proceedings of NeurIPS, 2017.
|
| 256 |
+
Christos Louizos, Max Welling, Diederik P, and Kingma. Learning Sparse Neural Networks through $L _ { 0 }$ Regularization. In Proceedings of ICLR, 2018.
|
| 257 |
+
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. In Proceedings of ICLR, 2017.
|
| 258 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Proceedings of NeurIPS. 2017.
|
| 259 |
+
Antonio Valerio Miceli Barone, Barry Haddow, Ulrich Germann, and Rico Sennrich. Regularization techniques for fine-tuning in neural machine translation. In Proceedings of EMNLP, 2017.
|
| 260 |
+
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient Estimation of Word Representations in Vector Space. arXiv:1301.3781, 2013.
|
| 261 |
+
German I. Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual Lifelong Learning with Neural Networks: A Review. arXiv:1802.07569, 2018.
|
| 262 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep Contextualized Word Representations. In Proceedings of NAACL, 2018.
|
| 263 |
+
Jonas Pfeiffer, Aishwarya Kamath, Andreas Ruckle, and Kyunghyun Cho amd Iryna Gurevych. AdapterFusion: Non-Destructive Task Composition for Transfer Learning. arXiv:2005.00247, 2020a.
|
| 264 |
+
Jonas Pfeiffer, Andreas Ruckle, Clifton Poth, Aishwarya Kamath, Ivan Vulic, Sebastian Ruder, and Iryna Gurevych Kyunghyun Cho. AdapterHub: A Framework for Adapting Transformers. arXiv:2007.07779, 2020b.
|
| 265 |
+
Jonas Pfeiffer, Ivan Vulic, Iryna Gurevych, and Sebastian Ruder. MAD-X: An Adapter-based Framework for Multi-task Cross-lingual Transfer. arXiv:2005.00052, 2020c.
|
| 266 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018.
|
| 267 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language Models are Unsupervised Multitask Learners. 2019.
|
| 268 |
+
Evani Radiya-Dixit and Xin Wang. How fine can fine-tuning be? Learning efficient language models. In Proceedings of AISTATS, 2020.
|
| 269 |
+
Colin Raffel, Noam Shazeer, Katherine Lee Adam Roberts, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the Limits of Transfer Learning with a Unified Text-toText Transformer. Journal of Machine Learning Research, 21, 2020.
|
| 270 |
+
Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. ZeRO: Memory Optimizations Toward Training Trillion Parameter Models. arXiv:1910.02054, 2019.
|
| 271 |
+
S. Rebuffi, A. Vedaldi, and H. Bilen. Efficient Parametrization of Multi-domain Deep Neural Networks. In Proceedings of CVPR, 2018.
|
| 272 |
+
Nils Reimers and Iryna Gurevych. Sentence-BERT: Sentence Embeddings using Siamese BERTNetworks. In Proceedings of EMNLP, 2019.
|
| 273 |
+
Hassan Sajjad, Fahim Dalvi, Nadir Durrani, and Preslav Nakov. Poor Man’s BERT: Smaller and Faster Transformer Models. arXiv:2004.03844, 2020.
|
| 274 |
+
|
| 275 |
+
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. In Proceedings of 5th Workshop on Energy Efficient Machine Learning and Cognitive Computing, 2019.
|
| 276 |
+
|
| 277 |
+
Victor Sanh, Thomas Wolf, and Alexander M. Rush. Movement Pruning: Adaptive Sparsity by Fine-Tuning. arXiv:2005.07683, 2020.
|
| 278 |
+
|
| 279 |
+
Timo Schick and Hinrich Schutze. It’s Not Just Size That Matters: Small Language Models Are Also Few-Shot Learners. arXiv:2009.07118, 2020.
|
| 280 |
+
|
| 281 |
+
Jonathan Schwarz, Jelena Luketina, Wojciech M. Czarnecki, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & Compress: A scalable framework for continual learning. In Proceedings of ICML, 2018.
|
| 282 |
+
|
| 283 |
+
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual Learning with Deep Generative Replay. In Proceedings of NeurIPS. 2017.
|
| 284 |
+
|
| 285 |
+
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism. arXiv:1909.08053, 2019.
|
| 286 |
+
|
| 287 |
+
Asa Cooper Stickland and Iain Murray. BERT and PALs: Projected attention layers for efficient adaptation in multi-task learning. In Proceedings of ICML, 2019.
|
| 288 |
+
|
| 289 |
+
Sandeep Subramanian, Adam Trischler, Yoshua Bengio, and Christopher J. Pal. Learning General Purpose Distributed Sentence Representations via Large Scale Multi-task Learning. In Proceedings of ICLR, 2018.
|
| 290 |
+
|
| 291 |
+
Siqi Sun, Yu Cheng, Zhe Gan, and Jingjing Liu. Patient Knowledge Distillation for BERT Model Compression. In Proceedings of EMNLP, 2019.
|
| 292 |
+
|
| 293 |
+
Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou. MobileBERT: a compact task-agnostic BERT for resource-limited devices. In Proceedings of ACL, July 2020.
|
| 294 |
+
|
| 295 |
+
Ian Tenney, Dipanjan Das, and Ellie Pavlick. BERT Rediscovers the Classical NLP Pipeline. In Proceedings of ACL, 2019.
|
| 296 |
+
|
| 297 |
+
Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Well-Read Students Learn Better: On the Importance of Pre-training Compact Models. arXiv:1908.08962, 2019.
|
| 298 |
+
|
| 299 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of ICLR, 2019a.
|
| 300 |
+
|
| 301 |
+
Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A. Efros. Dataset Distillation. arXiv:1811.10959, 2018.
|
| 302 |
+
|
| 303 |
+
Ziheng Wang, Jeremy Wohlwend, and Tao Lei. Structured Pruning of Large Language Models. arXiv:1910.04732, 2019b.
|
| 304 |
+
|
| 305 |
+
Georg Wiese, Dirk Weissenborn, and Mariana Neves. Neural domain adaptation for biomedical question answering. In Proceedings of CoNLL, August 2017.
|
| 306 |
+
|
| 307 |
+
John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. Towards Universal Paraphrastic Sentence Embeddings. In Proceedings of ICLR, 2016.
|
| 308 |
+
|
| 309 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick ´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface’s transformers: Stateof-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
|
| 310 |
+
|
| 311 |
+
John M. Wu, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Similarity Analysis of Contextual Word Representation Models. In Proceedings of ACL, 2020.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
Figure 3: Percentage of modified parameters attributable to each layer for 5 different runs of SST-2 at $0 . 5 \%$ target sparsity. The layers are ordered from earlier to later (i.e. the embedding layer is shown at the top). The $\mathbf { X }$ -axis for each plot goes from $0 \%$ to $20 \%$ .
|
| 315 |
+
|
| 316 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. XLNet: Generalized Autoregressive Pretraining for Language Understanding. In Proceedings of NeurIPS, 2019.
|
| 317 |
+
|
| 318 |
+
Minghua Zhang, Yunfang Wu, Weikang Li, and Wei Li. Learning universal sentence representations with mean-max attention autoencoder. In Proceedings of EMNLP, 2018.
|
| 319 |
+
|
| 320 |
+
Yan Zhang, Ruidan He, Zuozhu Liu, Kwan Hui Lim, and Lidong Bing. An Unsupervised Sentence Embedding Method byMutual Information Maximization. In Proceedings of EMNLP, 2020.
|
| 321 |
+
|
| 322 |
+
Mengjie Zhao, Tao Lin, Martin Jaggi, and Hinrich Schutze. Masking as an Efficient Alternative to Finetuning for Pretrained Language Models. arXiv:2004.12406, 2020.
|
| 323 |
+
|
| 324 |
+
# A APPENDIX
|
| 325 |
+
|
| 326 |
+
# A.1 CONSISTENCY OF NONZERO PARAMETERS
|
| 327 |
+
|
| 328 |
+
Figure 3 shows the percentage of modified parameters attributable to each layer across 5 runs of SST2. We find that there is nonotrivial variation in sparsity across runs, but also a degree of consistency. For example, the first layer is modified considerably more than other layers across all runs.
|
md/train/EsA9Nr9JHvy/EsA9Nr9JHvy.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/GY6-6sTvGaf/GY6-6sTvGaf.md
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMAGE AUGMENTATION IS ALL YOU NEED: REGULARIZING DEEP REINFORCEMENT LEARNING FROM PIXELS
|
| 2 |
+
|
| 3 |
+
Denis Yarats∗ New York University & Facebook AI Research denisyarats@cs.nyu.edu
|
| 4 |
+
|
| 5 |
+
Ilya Kostrikov∗ New York University kostrikov@cs.nyu.edu
|
| 6 |
+
|
| 7 |
+
Rob Fergus New York University fergus@cs.nyu.edu
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Existing model-free reinforcement learning (RL) approaches are effective when trained on states but struggle to learn directly from image observations. We propose an augmentation technique that can be applied to standard model-free RL algorithms, enabling robust learning directly from pixels without the need for auxiliary losses or pre-training. The approach leverages input perturbations commonly used in computer vision tasks to transform input examples, as well as regularizing the value function and policy. Our approach reaches a new stateof-the-art performance on DeepMind control suite and Atari $1 0 0 \mathrm { k }$ benchmark, surpassing previous model-free (Haarnoja et al., 2018; van Hasselt et al., 2019a), model-based (Hafner et al., 2019; Lee et al., 2019; Hafner et al., 2018; Kaiser et al., 2019) and contrastive learning (Srinivas et al., 2020) approaches. It also closes the gap between state-based and image-based RL training. Our method, which we dub DrQ: Data-regularized Q, can be combined with any model-free RL algorithm. To the best of our knowledge, our approach is the first effective data augmentation method for RL on these benchmarks.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Sample-efficient deep reinforcement learning (RL) algorithms capable of directly training from image pixels would open up many real-world applications in control and robotics. However, simultaneously training a convolutional encoder alongside a policy network is challenging when given limited environment interaction, strong correlation between samples and a typically sparse reward signal. Limited supervision is a common problem across AI and two approaches are commonly taken: (i) training with an additional auxiliary losses, such as those based on self-supervised learning (SSL) and (ii) training with data augmentation.
|
| 16 |
+
|
| 17 |
+
A wide range of auxiliary loss functions have been proposed to augment supervised objectives, e.g. weight regularization, noise injection (Hinton et al., 2012), or various forms of auto-encoder (Kingma et al., 2014). In RL, reconstruction losses (Jaderberg et al., 2017; Yarats et al., 2019) or SSL objectives (Dwibedi et al., 2018; Srinivas et al., 2020) are used. However, these objectives are unrelated to the task at hand, thus have no guarantee of inducing an appropriate representation for the policy network. SSL losses are highly effective in the large data regime, e.g. in domains such as vision (Chen et al., 2020; He et al., 2019) and NLP (Collobert et al., 2011; Devlin et al., 2018) where large (unlabeled) datasets are readily available. However, in sample-efficient RL, training data is more limited due to restricted interaction between the agent and the environment, limiting their effectiveness.
|
| 18 |
+
|
| 19 |
+
Data augmentation methods are widely used in vision and speech domains, where output-invariant perturbations can easily be applied to the labeled input examples. Surprisingly, data augmentation has received little attention in the RL community. In this paper we propose augmentation approaches appropriate for sample-efficient RL and comprehensively evaluate them. The key idea of our approach is to use standard image transformations to perturb input observations, as well as regularizing the $Q$ -function learned by the critic so that different transformations of the same input image have similar $Q$ -function values. No further modifications to standard actor-critic algorithms are required. Our study is, to the best of our knowledge, the first careful examination of image augmentation in sample-efficient RL.
|
| 20 |
+
|
| 21 |
+
The main contributions of the paper are as follows: (i) the first to demonstrate that data augmentation greatly improves performance when training model-free RL algorithms from images; (ii) introducing a natural way to exploit MDP structure through two mechanisms for regularizing the value function, in a manner that is generally applicable to model-free RL and (iii) setting a new state-of-the-art performance on the standard DeepMind control suite (Tassa et al., 2018), closing the gap between learning from states, and Atari 100k (Kaiser et al., 2019) benchmarks.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Data Augmentation in Computer Vision Data augmentation via image transformations has been used to improve generalization since the inception of convolutional networks (Becker & Hinton, 1992; Simard et al., 2003; LeCun et al., 1989; Ciresan et al., 2011; Ciregan et al., 2012). Following AlexNet (Krizhevsky et al., 2012), they have become a standard part of training pipelines. For object classification tasks, the transformations are selected to avoid changing the semantic category, i.e. translations, scales, color shifts, etc. While a similar set of transformations are potentially applicable to control tasks, the RL context does require modifications to be made to the underlying algorithm.
|
| 26 |
+
|
| 27 |
+
Data augmentation methods have also been used in the context of self-supervised learning. Dosovitskiy et al. (2016) use per-exemplar perturbations in a unsupervised classification framework. More recently, several approaches (Chen et al., 2020; He et al., 2019; Misra & van der Maaten, 2019) have used invariance to imposed image transformations in contrastive learning schemes, producing state-of-the-art results on downstream recognition tasks. By contrast, our scheme addresses control tasks, utilizing different types of invariance.
|
| 28 |
+
|
| 29 |
+
Data Augmentation in RL In contrast to computer vision, data augmentation is rarely used in RL. Certain approaches implicitly adopt it, for example Levine et al. (2018); Kalashnikov et al. (2018) use image augmentation as part of the AlexNet training pipeline without analysing the benefits occurring from it, thus being overlooked in subsequent work. HER (Andrychowicz et al., 2017) exploits information about the observation space by goal and reward relabeling, which can be viewed as a way to perform data augmentation. Other work uses data augmentation to improve generalization in domain transfer (Cobbe et al., 2018). However, the classical image transformations used in vision have not previously been shown to definitively help on standard RL benchmarks. Concurrent with our work, RAD (Laskin et al., 2020) performs an exploration of different data augmentation approaches, but is limited to transformations of the image alone, without the additional augmentation of the Q-function used in our approach. Moreover, RAD can be regarded as a special case of our algorithm. Multiple follow ups to our initial preprint appeared on ArXiv (Raileanu et al., 2020; Okada & Taniguchi, 2020), using similar techniques on other tasks, thus supporting the effectiveness and generality of data augmentation in RL.
|
| 30 |
+
|
| 31 |
+
Continuous Control from Pixels There are a variety of methods addressing the sample-efficiency of RL algorithms that directly learn from pixels. The most prominent approaches for this can be classified into two groups, model-based and model-free methods. The model-based methods attempt to learn the system dynamics in order to acquire a compact latent representation of high-dimensional observations to later perform policy search (Hafner et al., 2018; Lee et al., 2019; Hafner et al., 2019). In contrast, the model-free methods either learn the latent representation indirectly by optimizing the RL objective (Barth-Maron et al., 2018; Abdolmaleki et al., 2018) or by employing auxiliary losses that provide additional supervision (Yarats et al., 2019; Srinivas et al., 2020; Sermanet et al., 2018; Dwibedi et al., 2018). Our approach is complementary to these methods and can be combined with them to improve performance.
|
| 32 |
+
|
| 33 |
+
# 3 BACKGROUND
|
| 34 |
+
|
| 35 |
+
Reinforcement Learning from Images We formulate image-based control as an infinite-horizon partially observable Markov decision process (POMDP) (Bellman, 1957; Kaelbling et al., 1998). An POMDP can be described as the tuple $( \mathcal { O } , \mathcal { A } , p , r , \gamma )$ , where $\mathcal { O }$ is the high-dimensional observation space (image pixels), $\mathcal { A }$ is the action space, the transition dynamics $p = P r ( o _ { t } ^ { \prime } | o _ { \leq t } , a _ { t } )$ capture the probability distribution over the next observation $o _ { t } ^ { \prime }$ given the history of previous observations $O { \le } t$ and current action $a _ { t }$ , $r : \mathcal { O } \times \mathcal { A } \to \mathbb { R }$ is the reward function that maps the current observation and action to a reward $r _ { t } = r ( o _ { \leq t } , a _ { t } )$ , and $\gamma \in [ 0 , 1 )$ is a discount factor. Per common practice (Mnih et al., 2013), throughout the paper the POMDP is converted into an MDP (Bellman, 1957) by stacking several consecutive image observations into a state $s _ { t } = \{ o _ { t } , o _ { t - 1 } , o _ { t - 2 } , . . . \}$ . For simplicity we redefine the transition dynamics $p = P r \big ( s _ { t } ^ { \prime } | s _ { t } , a _ { t } \big )$ and the reward function $r _ { t } \dot { = } r ( s _ { t } , a _ { t } )$ . We then aim to find a policy $\pi ( a _ { t } | s _ { t } )$ t that maximizes the cumulative discounted return $\begin{array} { r } { \mathbb { E } _ { \pi } [ \sum _ { t = 1 } ^ { \infty } \gamma ^ { t } r _ { t } | a _ { t } \sim } \end{array}$ $\pi ( \cdot | s _ { t } ) , s _ { t } ^ { \prime } \sim p ( \cdot | s _ { t } , a _ { t } ) , \dot { s } _ { 1 } \sim p ( \cdot ) ]$ .
|
| 36 |
+
|
| 37 |
+
Soft Actor-Critic The Soft Actor-Critic (SAC) (Haarnoja et al., 2018) learns a state-action value function $Q _ { \theta }$ , a stochastic policy $\pi _ { \theta }$ and a temperature $\alpha$ to find an optimal policy for an MDP $( S , \mathcal { A } , p , r , \gamma )$ by optimizing a $\gamma$ -discounted maximum-entropy objective (Ziebart et al., 2008). $\theta$ is used generically to denote the parameters updated through training in each part of the model.
|
| 38 |
+
|
| 39 |
+
Deep Q-learning DQN (Mnih et al., 2013) also learns a convolutional neural net to approximate Q-function over states and actions. The main difference is that DQN operates on discrete actions spaces, thus the policy can be directly inferred from Q-values. In practice, the standard version of DQN is frequently combined with a set of refinements that improve performance and training stability, commonly known as Rainbow (van Hasselt et al., 2015). For simplicity, the rest of the paper describes a generic actor-critic algorithm rather than DQN or SAC in particular. Further background on DQN and SAC can be found in Appendix A.
|
| 40 |
+
|
| 41 |
+
# 4 SAMPLE EFFICIENT REINFORCEMENT LEARNING FROM PIXELS
|
| 42 |
+
|
| 43 |
+
# 4.1 OPTIMALITY INVARIANT IMAGE TRANSFORMATIONS FOR Q FUNCTION
|
| 44 |
+
|
| 45 |
+
We first introduce a general framework for regularizing the value function through transformations of the input state. For a given task, we define an optimality invariant state transformation $f : S \times \mathcal { T } S$ as a mapping that preserves the $Q$ -values
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
Q ( s , a ) = Q ( f ( s , \nu ) , a ) { \mathrm { ~ f o r ~ a l l ~ } } s \in S , a \in { \mathcal { A } } { \mathrm { ~ a n d ~ } } \nu \in \mathcal { T } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $\nu$ are the parameters of $f ( \cdot )$ , drawn from the set of all possible parameters $\tau$ . One example of such transformations are the random image translations successfully applied in the previous section.
|
| 52 |
+
|
| 53 |
+
For every state, the transformations allow the generation of several surrogate states with the same $Q$ -values, thus providing a mechanism to reduce the variance of $Q$ -function estimation. In particular, for an arbitrary distribution of states $\mu ( \cdot )$ and policy $\pi$ , instead of using a single sample $s ^ { * } \sim \mu ( \cdot )$ , $a ^ { * } \sim \pi ( \cdot | s ^ { * } )$ estimation of the following expectation
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { { \mathbb E } _ { s \sim \mu ( \cdot ) } \left[ Q ( s , a ) \right] \approx Q ( s ^ { * } , a ^ { * } ) } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
we generate $K$ samples via random transformations and obtain an estimate with lower variance
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbb { E } _ { \mathbf { \Phi } _ { a \sim \pi ( \cdot | s ) } } \left[ Q ( s , a ) \right] \approx \frac { 1 } { K } \sum _ { k = 1 } ^ { K } Q ( f ( s ^ { * } , \nu _ { k } ) , a _ { k } ) \mathrm { ~ w h e r e ~ } \nu _ { k } \in \mathcal { T } \mathrm { ~ a n d ~ } a _ { k } \sim \pi ( \cdot | f ( s ^ { * } , \nu _ { k } ) ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
This suggests two distinct ways to regularize $Q$ -function. First, we use the data augmentation to compute the target values for every transition tuple $( s _ { i } , a _ { i } , r _ { i } , s _ { i } ^ { \prime } )$ as
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
y _ { i } = r _ { i } + \gamma \frac { 1 } { K } \sum _ { k = 1 } ^ { K } Q _ { \theta } \big ( f \big ( s _ { i } ^ { \prime } , \nu _ { i , k } ^ { \prime } \big ) , a _ { i , k } ^ { \prime } \big ) \mathrm { ~ w h e r e ~ } a _ { i , k } ^ { \prime } \sim \pi ( \cdot | f \big ( s _ { i } ^ { \prime } , \nu _ { i , k } ^ { \prime } \big ) )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\nu _ { i , k } ^ { \prime } \in \mathcal { T }$ corresponds to a transformation parameter of $s _ { i } ^ { \prime }$ . Then the Q-function is updated using these targets through an SGD update using learning rate $\lambda _ { \theta }$
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\theta \theta - \lambda _ { \theta } \nabla _ { \theta } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } ( Q _ { \theta } ( f ( s _ { i } , \nu _ { i } ) , a _ { i } ) - y _ { i } ) ^ { 2 } .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
In tandem, we note that the same target from Equation (1) can be used for different augmentations of $s _ { i }$ , resulting in the second regularization approach
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\theta \gets \theta - \lambda _ { \theta } \nabla _ { \theta } \frac { 1 } { N M } \sum _ { i = 1 , m = 1 } ^ { N , M } ( Q _ { \theta } ( f ( s _ { i } , \nu _ { i , m } ) , a _ { i } ) - y _ { i } ) ^ { 2 } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
When both regularization methods are used, $\nu _ { i , m }$ and $\nu _ { i , k } ^ { \prime }$ are drawn independently.
|
| 84 |
+
|
| 85 |
+
# 4.2 PRACTICAL INSTANTIATION OF OPTIMALITY INVARIANT IMAGE TRANSFORMATION
|
| 86 |
+
|
| 87 |
+
A range of successful image augmentation techniques have been developed in computer vision (Ciregan et al., 2012; Ciresan et al., 2011; Simard et al., 2003; Krizhevsky et al., 2012; Chen et al., 2020). These apply transformations to the input image for which the task labels are invariant, e.g. for object recognition tasks, image flips and rotations do not alter the semantic label. However, tasks in RL differ significantly from those in vision and in many cases the reward would not be preserved by these transformations. We examine image transformations from Chen et al. (2020) (random shifts, random cutouts, horizontal/vertical flips, rotations and intensity shifts) in Appendix E and conclude that random shifts strike a good balance between simplicity and performance, we therefore limit our choice of transformation function $f ( \cdot )$ to random shifts.
|
| 88 |
+
|
| 89 |
+
We apply shifts to the images sampled from the replay buffer. For example, images from the DeepMind control suite used in our experiments are $8 4 \times 8 4$ . We pad each side by 4 pixels (by repeating boundary pixels) and then select a random $8 4 \times 8 4$ crop, yielding the original image shifted by $\pm 4$ pixels. This procedure is repeated every time an image is sampled from the replay buffer.
|
| 90 |
+
|
| 91 |
+
# 4.3 OUR APPROACH: DATA-REGULARIZED Q (DRQ)
|
| 92 |
+
|
| 93 |
+
Our approach, $\mathbf { D r Q }$ , is the union of the three separate regularization mechanisms introduced above:
|
| 94 |
+
|
| 95 |
+
1. transformations of the input image (Section 4.2).
|
| 96 |
+
2. averaging the $Q$ target over K image transformations (Equation (1)).
|
| 97 |
+
3. averaging the $Q$ function itself over M image transformations (Equation (3)).
|
| 98 |
+
|
| 99 |
+
Algorithm 1 details how they are incorporated into a generic pixel-based off-policy actor-critic algorithm. Note that if $[ \mathsf { K } { = } 1 , \mathsf { M } { = } 1 ]$ then $\mathbf { D r Q }$ reverts to image transformations alone, this makes applying $\mathbf { D r Q }$ to any model-free RL algorithm straightforward.
|
| 100 |
+
|
| 101 |
+
For the experiments in this paper, we pair DrQ with SAC (Haarnoja et al., 2018) and DQN (Mnih et al., 2013), popular model-free algorithms for control in continuous and discrete action spaces respectively. We select image shifts as the class of image transformations $f$ , with $\nu \pm 4$ , as explained in Section 4.2.
|
| 102 |
+
|
| 103 |
+
# 5 EXPERIMENTS
|
| 104 |
+
|
| 105 |
+
# 5.1 ABLATION EXPERIMENT
|
| 106 |
+
|
| 107 |
+
Figure 1 shows the effect of image shift augmentation applied to three tasks from the DeepMind control suite (Tassa et al., 2018). Figure 1a shows unmodified SAC (Haarnoja et al., 2018) parameterized with different image encoders, taken from: NatureDQN (Mnih et al., 2013), Dreamer (Hafner et al., 2019), Impala (Espeholt et al., 2018), SAC-AE (Yarats et al., 2019), and D4PG (Barth-Maron et al., 2018). The encoders vary significantly in their architecture and capacity, with parameter
|
| 108 |
+
|
| 109 |
+
Algorithm 1 DrQ: Data-regularized Q applied to a generic off-policy actor critic algorithm.
|
| 110 |
+
Black: unmodified off-policy actor-critic. Orange: image transformation.
|
| 111 |
+
Green: target $Q$ augmentation.
|
| 112 |
+
Blue: $Q$ augmentation.
|
| 113 |
+
|
| 114 |
+
Hyperparameters: Total number of environment steps $T$ , mini-batch size $N$ , learning rate $\lambda _ { \theta }$ target network update rate $\tau$ , image transformation $f$ , number of target $Q$ augmentations $K$ number of $Q$ augmentations $M$ .
|
| 115 |
+
|
| 116 |
+
for each timestep $t = 1 . . T$ do
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathcal { D } \gets \mathcal { D } \cup ( s _ { t } , a _ { t } , r ( s _ { t } , a _ { t } ) , s _ { t } ^ { \prime } )
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
# end for
|
| 123 |
+
|
| 124 |
+
$\{ \nu _ { i , m } | \nu _ { i , m } \sim \mathcal { U } ( \mathcal { T } ) , i = 1 . . N , m = 1 . . M \}$ $\begin{array} { r } { J _ { Q } ( \theta ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } ( Q _ { \theta } ( s _ { i } , a _ { i } ) - y _ { i } ) ^ { 2 } } \end{array}$ or $\begin{array} { r } { J _ { Q } ( \theta ) = \frac { 1 } { N M } \sum _ { i , m = 1 } ^ { N , M } ( Q _ { \theta } ( f ( s _ { i } , \nu _ { i , m } ) , a _ { i } ) - y _ { i } ) ^ { 2 } } \end{array}$ . Uniformly sample Q augmentations θ ← θ − λθ∇θJQ(θ) $\triangleright$ Update the critic $\theta ^ { \prime } ( 1 - \tau ) \theta ^ { \prime } + \tau \theta$ $\triangleright$ Update the critic target
|
| 125 |
+
|
| 126 |
+
end procedure
|
| 127 |
+
|
| 128 |
+
counts ranging from $2 2 0 \mathrm { k }$ to 2.4M. None of these train satisfactorily, with performance decreasing for the larger capacity models. Figure 1b shows SAC with the application of our random shifts transformation of the input images (i.e. just Section 4.2, not Q augmentation also). The results for all encoder architectures improve dramatically, suggesting that our method is general and can assist many different encoder architectures. To the best of our knowledge, this is the first successful demonstration of applying image augmentation on the standard benchmarks for continuous control. Furthermore, Figure 2 shows the full $\mathbf { D r Q }$ , with both image shifts and Q augmentation (Section 4.1), as well as ablated versions. Q augmentation provides additional consistent gain over image shift augmentation alone (full results are in Appendix F).
|
| 129 |
+
|
| 130 |
+
# 5.2 DEEPMIND CONTROL SUITE EXPERIMENTS
|
| 131 |
+
|
| 132 |
+
In this section we evaluate our algorithm $\mathbf { ( D r Q ) }$ on the two commonly used benchmarks based on the DeepMind control suite (Tassa et al., 2018), namely the PlaNet (Hafner et al., 2018) and Dreamer (Hafner et al., 2019) setups. Throughout these experiments all hyper-parameters of the algorithm are kept fixed: the actor and critic neural networks are trained using the Adam optimizer (Kingma & Ba, 2014) with default parameters and a mini-batch size of 512 1. For SAC, the soft target update rate $\tau$ is 0.01, initial temperature is 0.1, and target network and the actor updates are made every 2 critic updates (as in Yarats et al. (2019)). We use the image encoder architecture from SAC-AE (Yarats et al., 2019) and follow their training procedure. The full set of parameters can be found in Appendix B. Following Henderson et al. (2018), the models are trained using 10 different seeds; for every seed the mean episode returns are computed every 10000 environment steps, averaging over 10 episodes. All figures plot the mean performance over the 10 seeds, together with $\pm$ 1 standard deviation shading. We compare our $\mathbf { D r Q }$ approach to leading model-free and model-based approaches: PlaNet (Hafner et al., 2018), SAC-AE (Yarats et al., 2019), SLAC (Lee et al., 2019), CURL (Srinivas et al., 2020) and Dreamer (Hafner et al., 2019). The comparisons use the results provided by the authors of the corresponding papers.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 1: The performance of SAC trained from pixels on the DeepMind control suite using image encoder networks of different capacity (network architectures taken from recent RL algorithms, with parameter count indicated). (a): unmodified SAC. Task performance can be seen to get worse as the capacity of the encoder increases. For Walker Walk (right), all architectures provide mediocre performance, demonstrating the inability of SAC to train directly from pixels on harder problems. (b): SAC combined with image augmentation in the form of random shifts. The task performance is now similar for all architectures, regardless of their capacity, which suggests the generality of our method. There is also a clear performance improvement relative to (a), particularly for the more challenging Walker Walk task.
|
| 138 |
+
Figure 2: Different combinations of our three regularization techniques on tasks from (Tassa et al., 2018) using SAC. Black: standard SAC. Blue: DrQ $[ \mathsf { K } { = } 1 , \mathsf { M } { = } 1 ]$ , SAC augmented with random shifts. Red: DrQ $[ \mathsf { K } { = } 2 , \mathsf { M } { = } 1 ]$ , random shifts $^ +$ Target Q augmentations. Purple: DrQ $[ \mathsf { K } { = } 2 , \mathsf { M } { = } 2 ]$ , random shifts $^ +$ Target $\mathbf { Q } + \mathbf { Q }$ augmentations. All three regularization methods correspond to Algorithm 1 with different K,M showing clear gains when both Target Q and Q augmentations are used.
|
| 139 |
+
|
| 140 |
+
PlaNet Benchmark (Hafner et al., 2018) consists of six challenging control tasks from (Tassa et al., 2018) with different traits. The benchmark specifies a different action-repeat hyper-parameter for each of the six tasks2. Following common practice (Hafner et al., 2018; Lee et al., 2019; Yarats et al.,
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 3: The PlaNet benchmark. Our algorithm $\mathbf { D r Q }$ $[ \mathsf { K } = 2 , \mathsf { M } = 2 ]$ ) outperforms the other methods and demonstrates the state-of-the-art performance. Furthermore, on several tasks $\mathbf { D r Q }$ is able to match the upper-bound performance of SAC trained directly on internal state, rather than images. Finally, our algorithm not only shows improved sample-efficiency relative to other approaches, but is also faster in terms of wall clock time.
|
| 144 |
+
|
| 145 |
+
2019; Mnih et al., 2013), we report the performance using true environment steps, thus are invariant to the action-repeat hyper-parameter. Aside from action-repeat, all other hyper-parameters of our algorithm are fixed across the six tasks, using the values previously detailed.
|
| 146 |
+
|
| 147 |
+
Figure 3 compares DrQ $\mathrm { K } { = } 2 , \mathrm { M } { = } 2$ ] to PlaNet (Hafner et al., 2018), SAC-AE (Yarats et al., 2019), CURL (Srinivas et al., 2020), SLAC (Lee et al., 2019), and an upper bound performance provided by SAC (Haarnoja et al., 2018) that directly learns from internal states. We use the version of SLAC that performs one gradient update per an environment step to ensure a fair comparison to other approaches. $\mathbf { D r Q }$ achieves state-of-the-art performance on this benchmark on all the tasks, despite being much simpler than other methods. Furthermore, since $\mathbf { D r Q }$ does not learn a model (Hafner et al., 2018; Lee et al., 2019) or any auxiliary tasks (Srinivas et al., 2020), the wall clock time also compares favorably to the other methods.
|
| 148 |
+
|
| 149 |
+
In Table 1 we also compare performance given at a fixed number of environment interactions (e.g. $1 0 0 \mathbf k$ and 500k). Furthermore, in Appendix G we demonstrate that $\mathbf { D r Q }$ is robust to significant changes in hyper-parameter settings.
|
| 150 |
+
|
| 151 |
+
Dreamer Benchmark is a more extensive testbed that was introduced in Dreamer (Hafner et al., 2019), featuring a diverse set of tasks from the DeepMind control suite. Tasks involving sparse reward were excluded (e.g. Acrobot and Quadruped) since they require modification of SAC to incorporate multi-step returns (Barth-Maron et al., 2018), which is beyond the scope of this work. We evaluate on the remaining 15 tasks, fixing the action-repeat hyper-parameter to 2 as in Hafner et al. (2019).
|
| 152 |
+
|
| 153 |
+
We compare DrQ $[ { \cal K } = 2 , { \cal M } = 2 ]$ ] to Dreamer (Hafner et al., 2019) and the upper-bound performance of SAC (Haarnoja et al., 2018) from states3. Again, we keep all the hyper-parameters of our algorithm fixed across all the tasks. In Figure 4, DrQ demonstrates the state-of-the-art results by collectively outperforming Dreamer (Hafner et al., 2019), although Dreamer is superior on 3 of the 15 tasks (Walker Run, Cartpole Swingup Sparse and Pendulum Swingup). On many tasks $\mathbf { D r Q }$ approaches the upper-bound performance of SAC (Haarnoja et al., 2018) trained directly on states.
|
| 154 |
+
|
| 155 |
+
Table 1: The PlaNet benchmark at $1 0 0 \mathrm { k }$ and $5 0 0 \mathrm { k }$ environment steps. Our method $\mathbf { ( D r Q }$ $[ \mathsf { K } { = } 2 , \mathsf { M } { = } 2 ]$ ) outperforms other approaches in both the data-efficient (100k) and asymptotic performance (500k) regimes. Random shifts only version (e.g. $\mathbf { D r Q }$ $[ \mathsf { K } = 1 , \mathsf { M } = 1 ]$ ) has a competitive performance but is consistently inferior to DrQ $[ { \cal K } = 2 , { \cal M } = 2 ]$ , particularly for $1 0 0 \mathrm { k }$ steps. We emphasize, that both versions of DrQ use exactly the same number of interactions with both the environment and replay buffer. Note that $\mathbf { D r Q }$ $[ \mathsf { K } { = } 1 , \mathsf { M } { = } 1 ]$ ] is almost identical to RAD (Laskin et al., 2020), modulo some hyper-parameter differences.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>500k step scores</td><td>DrQ[K=2,M=2]</td><td>DrQ[K=1,M=1]</td><td>CURL</td><td>PlaNet</td><td>SAC-AE</td><td>SLAC</td><td>SAC State</td></tr><tr><td>Finger Spin</td><td>938±103</td><td>913±151</td><td>874±151</td><td>718±40</td><td>914±107</td><td>771±203</td><td>927±43</td></tr><tr><td>Cartpole Swingup</td><td>868±10</td><td>845±39</td><td>861±30</td><td>787±46</td><td>730±152</td><td>-</td><td>870±7</td></tr><tr><td>Reacher Easy</td><td>942±71</td><td>857±120</td><td>904±94</td><td>588±471</td><td>601±135</td><td></td><td>975±5</td></tr><tr><td>Cheetah Run</td><td>660±96</td><td>460±59</td><td>500±91</td><td>568±21</td><td>544±50</td><td>629±74</td><td>772±60</td></tr><tr><td>Walker Walk</td><td>921±45</td><td>897±47</td><td>906±56</td><td>478±164</td><td>858±82</td><td>865±97</td><td>964±8</td></tr><tr><td>Ball In Cup Catch</td><td>963±9</td><td>961±12</td><td>958±13</td><td>939±43</td><td>810±121</td><td>959±4</td><td>979±6</td></tr><tr><td>100k step scores</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Finger Spin</td><td>901±104</td><td>744±144</td><td>779±108</td><td>560±77</td><td>747±130</td><td>680±130</td><td>672±76</td></tr><tr><td>Cartpole Swingup</td><td>759±92</td><td>537±119</td><td>592±170</td><td>563±73</td><td>276±38</td><td>-</td><td>812±45</td></tr><tr><td>Reacher Easy</td><td>601±213</td><td>451±210</td><td>517±113</td><td>82±174</td><td>225±164</td><td>=</td><td>919±123</td></tr><tr><td>Cheetah Run</td><td>344±67</td><td>250±58</td><td>307±48</td><td>252±173</td><td>240±38</td><td>391±47</td><td>228±95</td></tr><tr><td>Walker Walk</td><td>612±164</td><td>501±68</td><td>344±132</td><td>221±43</td><td>395±58</td><td>428±74</td><td>604±317</td></tr><tr><td>Ball In Cup Catch</td><td>913±53</td><td>667±146</td><td>772±241</td><td>710±217</td><td>338±196</td><td>607±173</td><td>957±26</td></tr></table>
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: The Dreamer benchmark. Our method (DrQ $[ { \bf K } { = } 2 , { \bf M } { = } 2 ]$ ) again demonstrates superior performance over Dreamer on 12 out 15 selected tasks. In many cases it also reaches the upper-bound performance of SAC that learns directly from states.
|
| 161 |
+
|
| 162 |
+
# 5.3 ATARI 100K EXPERIMENTS
|
| 163 |
+
|
| 164 |
+
We evaluate $\mathbf { D r Q }$ $[ \mathsf { K } { = } 1 , \mathsf { M } { = } 1 ]$ on the Atari 100k benchmark (Kaiser et al., 2019) – a sampleconstrained evaluation for discrete control algorithms. The underlying RL approach to which $\mathbf { D r Q }$ is applied is a DQN, combined with double Q-learning (van Hasselt et al., 2015), n-step returns (Mnih et al., 2016), and dueling critic architecture (Wang et al., 2015). As per common practice (Kaiser et al., 2019; van Hasselt et al., 2019a), we evaluate our agent for $1 2 5 \mathrm { k }$ environment steps at the end of training and average its performance over 5 random seeds. Figure 5 shows the median humannormalized episode returns performance (as in Mnih et al. (2013)) of the underlying model, which we refer to as Efficient DQN, in pink. When DrQ is added there is a significant increase in performance (cyan), surpassing OTRainbow (Kielak, 2020) and Data Efficient Rainbow (van Hasselt et al., 2019a). DrQ is also superior to CURL (Srinivas et al., 2020) that uses an auxiliary loss built on top of a hybrid between OTRainbow and Efficient rainbow. DrQ combined with Efficient DQN thus achieves state-of-the-art performance, despite being significantly simpler than the other approaches. The experimental setup and full results are detailed in Appendix C and Appendix D respectively.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 5: The Atari $1 0 0 \mathrm { k }$ benchmark. Compared to a set of leading baselines, our method $\mathbf { ( D r Q }$ $[ \mathsf { K } = 1 , \mathsf { M } = 1 ]$ , combined with Efficient DQN) achieves the state-of-the-art performance, despite being considerably simpler. Note the large improvement that results from adding DrQ to Efficient DQN (pink vs cyan). By contrast, the gains from CURL, that utilizes tricks from both Data Efficient Rainbow and OTRainbow, are more modest over the underlying RL methods.
|
| 168 |
+
|
| 169 |
+
# 6 CONCLUSION
|
| 170 |
+
|
| 171 |
+
We have introduced a regularization technique, based on image shifts and Q-function augmentation, that significantly improves the performance of model-free RL algorithms trained directly from images. In contrast to the concurrent work of Laskin et al. (2020), which is a special case of $\mathbf { D r Q }$ , our method exploits the MDP structure of the problem, demonstrating gains over image augmentations alone. Our method is easy to implement and adds a negligible computational burden. We compared our method to state-of-the-art approaches on the DeepMind control suite, outperforming them on the majority of tasks and closing the gap with state-based training. On the Atari $1 0 0 \mathrm { k }$ benchmark DrQ outperforms other SOTA methods in the median metric. To the best of our knowledge, this is the first convincing demonstration of the utility of data augmentation on these standard benchmarks. Furthermore, we demonstrate the method to be robust to the choice of hyper-parameters.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. arXiv preprint arXiv:1806.06920, 2018.
|
| 176 |
+
|
| 177 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, OpenAI Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in neural information processing systems, pp. 5048–5058, 2017.
|
| 178 |
+
|
| 179 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. arXiv e-prints, 2016.
|
| 180 |
+
|
| 181 |
+
Gabriel Barth-Maron, Matthew W. Hoffman, David Budden, Will Dabney, Dan Horgan, Dhruva TB, Alistair Muldal, Nicolas Heess, and Timothy Lillicrap. Distributional policy gradients. In International Conference on Learning Representations, 2018.
|
| 182 |
+
|
| 183 |
+
S. Becker and G. E. Hinton. Self-organizing neural network that discovers surfaces in random-dot stereograms. Nature, 1992.
|
| 184 |
+
|
| 185 |
+
Richard Bellman. A markovian decision process. Indiana Univ. Math. J., 1957.
|
| 186 |
+
|
| 187 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 188 |
+
|
| 189 |
+
Dan Ciregan, Ueli Meier, and Jurgen Schmidhuber. Multi-column deep neural networks for image classification. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3642–3649, 2012.
|
| 190 |
+
|
| 191 |
+
Dan C Ciresan, Ueli Meier, Jonathan Masci, Luca M Gambardella, and Jurgen Schmidhuber. Highperformance neural networks for visual object classification. arXiv preprint arXiv:1102.0183, 2011.
|
| 192 |
+
|
| 193 |
+
Karl Cobbe, Oleg Klimov, Chris Hesse, Taehoon Kim, and John Schulman. Quantifying generalization in reinforcement learning. arXiv preprint arXiv:1812.02341, 2018.
|
| 194 |
+
|
| 195 |
+
Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel Kuksa. Natural language processing (almost) from scratch. Journal of machine learning research, 2011.
|
| 196 |
+
|
| 197 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 198 |
+
|
| 199 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 200 |
+
|
| 201 |
+
Alexey Dosovitskiy, Philipp Fischer, Jost Tobias Springenberg, Martin Riedmiller, and Thomas Brox. Discriminative unsupervised feature learning with exemplar convolutional neural networks. TPAMI, 2016.
|
| 202 |
+
|
| 203 |
+
Debidatta Dwibedi, Jonathan Tompson, Corey Lynch, and Pierre Sermanet. Learning actionable representations from visual observations. CoRR, 2018.
|
| 204 |
+
|
| 205 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561, 2018.
|
| 206 |
+
|
| 207 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018, 2018.
|
| 208 |
+
|
| 209 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018.
|
| 210 |
+
|
| 211 |
+
Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. arXiv preprint arXiv:1811.04551, 2018.
|
| 212 |
+
|
| 213 |
+
Danijar Hafner, Timothy Lillicrap, Jimmy Ba, and Mohammad Norouzi. Dream to control: Learning behaviors by latent imagination. arXiv preprint arXiv:1912.01603, 2019.
|
| 214 |
+
|
| 215 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. arXiv preprint arXiv:1911.05722, 2019.
|
| 216 |
+
|
| 217 |
+
Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. Thirty-Second AAAI Conference On Artificial Intelligence (AAAI), 2018.
|
| 218 |
+
|
| 219 |
+
Geoffrey E Hinton, Nitish Srivastava, Alex Krizhevsky, Ilya Sutskever, and Ruslan R Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012.
|
| 220 |
+
|
| 221 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Czarnecki, Tom Schaul, Joel Z. Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. International Conference on Learning Representations, 2017.
|
| 222 |
+
|
| 223 |
+
Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial intelligence, 1998.
|
| 224 |
+
|
| 225 |
+
Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H. Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, Ryan Sepassi, George Tucker, and Henryk Michalewski. Model-based reinforcement learning for atari. arXiv preprint arXiv:1903.00374, 2019.
|
| 226 |
+
|
| 227 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
|
| 228 |
+
|
| 229 |
+
Kacper Piotr Kielak. Do recent advancements in model-based deep reinforcement learning really improve data efficiency? openreview, 2020. URL https://openreview.net/forum? id $=$ Bke9u1HFwB.
|
| 230 |
+
|
| 231 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 232 |
+
|
| 233 |
+
Durk P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in neural information processing systems, pp. 3581–3589, 2014.
|
| 234 |
+
|
| 235 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, 2012.
|
| 236 |
+
|
| 237 |
+
Michael Laskin, Kimin Lee, Adam Stooke, Lerrel Pinto, Pieter Abbeel, and Aravind Srinivas. Reinforcement learning with augmented data, 2020.
|
| 238 |
+
|
| 239 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1989.
|
| 240 |
+
|
| 241 |
+
A. X. Lee, A. Nagabandi, P. Abbeel, and S. Levine. Stochastic latent actor-critic: Deep reinforcement learning with a latent variable model. arXiv e-prints, 2019.
|
| 242 |
+
|
| 243 |
+
Sergey Levine, Peter Pastor, Alex Krizhevsky, Julian Ibarz, and Deirdre Quillen. Learning handeye coordination for robotic grasping with deep learning and large-scale data collection. The International Journal of Robotics Research, 37(4-5):421–436, 2018.
|
| 244 |
+
|
| 245 |
+
Timothy P. Lillicrap, Jonathan J. Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. CoRR, 2015.
|
| 246 |
+
|
| 247 |
+
Ishan Misra and Laurens van der Maaten. Self-supervised learning of pretext-invariant representations. arXiv:1912.01991, 2019.
|
| 248 |
+
|
| 249 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv e-prints, 2013.
|
| 250 |
+
|
| 251 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P. Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. CoRR, 2016.
|
| 252 |
+
|
| 253 |
+
Masashi Okada and Tadahiro Taniguchi. Dreaming: Model-based reinforcement learning by latent imagination without reconstruction. arXiv preprint arXiv:2007.14535, 2020.
|
| 254 |
+
|
| 255 |
+
Roberta Raileanu, Max Goldstein, Denis Yarats, Ilya Kostrikov, and Rob Fergus. Automatic data augmentation for generalization in deep reinforcement learning. 2020.
|
| 256 |
+
|
| 257 |
+
Edgar Riba, Dmytro Mishkin, Daniel Ponsa, Ethan Rublee, and Gary Bradski. Kornia: an open source differentiable computer vision library for pytorch. In The IEEE Winter Conference on Applications of Computer Vision, pp. 3674–3683, 2020.
|
| 258 |
+
|
| 259 |
+
Andrew M. Saxe, James L. McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv e-prints, 2013.
|
| 260 |
+
|
| 261 |
+
Pierre Sermanet, Corey Lynch, Yevgen Chebotar, Jasmine Hsu, Eric Jang, Stefan Schaal, Sergey Levine, and Google Brain. Time-contrastive networks: Self-supervised learning from video. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1134–1141. IEEE, 2018.
|
| 262 |
+
|
| 263 |
+
Patrice Y Simard, David Steinkraus, John C Platt, et al. Best practices for convolutional neural networks applied to visual document analysis. In Icdar, 2003.
|
| 264 |
+
|
| 265 |
+
Aravind Srinivas, Michael Laskin, and Pieter Abbeel. Curl: Contrastive unsupervised representations for reinforcement learning. arXiv preprint arXiv:2004.04136, 2020.
|
| 266 |
+
|
| 267 |
+
Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
|
| 268 |
+
|
| 269 |
+
Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. arXiv e-prints, 2015.
|
| 270 |
+
|
| 271 |
+
Hado van Hasselt, Matteo Hessel, and John Aslanides. When to use parametric models in reinforce ment learning? arXiv preprint arXiv:1906.05243, 2019a.
|
| 272 |
+
|
| 273 |
+
Hado P van Hasselt, Matteo Hessel, and John Aslanides. When to use parametric models in reinforcement learning? In Advances in Neural Information Processing Systems, 2019b.
|
| 274 |
+
|
| 275 |
+
Ziyu Wang, Tom Schaul, Matteo Hessel, Hado Van Hasselt, Marc Lanctot, and Nando De Freitas. Dueling network architectures for deep reinforcement learning. arXiv preprint arXiv:1511.06581, 2015.
|
| 276 |
+
|
| 277 |
+
Denis Yarats and Ilya Kostrikov. Soft actor-critic (sac) implementation in pytorch. https:// github.com/denisyarats/pytorch_sac, 2020.
|
| 278 |
+
|
| 279 |
+
Denis Yarats, Amy Zhang, Ilya Kostrikov, Brandon Amos, Joelle Pineau, and Rob Fergus. Improving sample efficiency in model-free reinforcement learning from images. arXiv preprint arXiv:1910.01741, 2019.
|
| 280 |
+
|
| 281 |
+
Brian D. Ziebart, Andrew Maas, J. Andrew Bagnell, and Anind K. Dey. Maximum entropy inverse reinforcement learning. In Proceedings of the 23rd National Conference on Artificial Intelligence - Volume 3, 2008.
|
| 282 |
+
|
| 283 |
+
# APPENDIX
|
| 284 |
+
|
| 285 |
+
# A EXTENDED BACKGROUND
|
| 286 |
+
|
| 287 |
+
Reinforcement Learning from Images We formulate image-based control as an infinite-horizon partially observable Markov decision process (POMDP) (Bellman, 1957; Kaelbling et al., 1998). An POMDP can be described as the tuple $( \mathcal { O } , \mathcal { A } , p , r , \gamma )$ , where $\mathcal { O }$ is the high-dimensional observation space (image pixels), $\mathcal { A }$ is the action space, the transition dynamics $p = P r ( o _ { t } ^ { \prime } | o _ { \leq t } , a _ { t } )$ capture the probability distribution over the next observation $o _ { t } ^ { \prime }$ given the history of previous observations $O { \le } t$ and current action $a _ { t }$ , $r : \mathcal { O } \times \mathcal { A } \to \mathbb { R }$ is the reward function that maps the current observation and action to a reward $r _ { t } = r ( o _ { \leq t } , a _ { t } )$ , and $\gamma \in [ 0 , 1 )$ is a discount factor. Per common practice (Mnih et al., 2013), throughout the paper the POMDP is converted into an MDP (Bellman, 1957) by stacking several consecutive image observations into a state $s _ { t } = \{ o _ { t } , o _ { t - 1 } , o _ { t - 2 } , . . . \}$ . For simplicity we redefine the transition dynamics $p = P r \big ( s _ { t } ^ { \prime } | s _ { t } , a _ { t } \big )$ and the reward function $r _ { t } \dot { = } r ( s _ { t } , a _ { t } )$ . We then aim to find a policy $\pi ( a _ { t } | s _ { t } )$ t that maximizes the cumulative discounted return $\begin{array} { r } { \mathbb { E } _ { \pi } [ \sum _ { t = 1 } ^ { \infty } \gamma ^ { t } r _ { t } | a _ { t } \sim } \end{array}$ $\pi ( \cdot | s _ { t } ) , s _ { t } ^ { \prime } \sim \bar { p } ( \cdot | s _ { t } , a _ { t } ) , \dot { s } _ { 1 } \sim p ( \cdot ) \mathrm { ~ . ~ }$ .
|
| 288 |
+
|
| 289 |
+
Soft Actor-Critic The Soft Actor-Critic (SAC) (Haarnoja et al., 2018) learns a state-action value function $Q _ { \theta }$ , a stochastic policy $\pi _ { \theta }$ and a temperature $\alpha$ to find an optimal policy for an MDP $( S , \mathcal { A } , p , r , \gamma )$ by optimizing a $\gamma$ -discounted maximum-entropy objective (Ziebart et al., 2008). $\theta$ is used generically to denote the parameters updated through training in each part of the model. The actor policy $\pi _ { \boldsymbol { \theta } } \big ( a _ { t } | \boldsymbol { s } _ { t } \big )$ is a parametric tanh-Gaussian that given $s _ { t }$ samples $a _ { t } = \operatorname { t a n h } ( \mu _ { \theta } ( s _ { t } ) + \sigma _ { \theta } ( s _ { t } ) \epsilon )$ , where $\epsilon \sim \mathcal { N } ( 0 , 1 )$ and $\mu _ { \theta }$ and $\sigma _ { \theta }$ are parametric mean and standard deviation.
|
| 290 |
+
|
| 291 |
+
The policy evaluation step learns the critic $Q _ { \theta } ( s _ { t } , a _ { t } )$ network by optimizing a single-step of the soft Bellman residual
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { r l } & { J _ { Q } ( \mathcal { D } ) = \mathbb { E } _ { ( s _ { t } , a _ { t } , s _ { t } ^ { \prime } ) \sim \mathcal { D } } [ ( Q _ { \theta } ( s _ { t } , a _ { t } ) - y _ { t } ) ^ { 2 } ] } \\ & { \qquad a _ { t } ^ { \prime } \sim \pi ( \cdot | s _ { t } ^ { \prime } ) } \\ & { y _ { t } = r ( s _ { t } , a _ { t } ) + \gamma [ Q _ { \theta ^ { \prime } } ( s _ { t } ^ { \prime } , a _ { t } ^ { \prime } ) - \alpha \log \pi _ { \theta } ( a _ { t } ^ { \prime } | s _ { t } ^ { \prime } ) ] , } \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
where $\mathcal { D }$ is a replay buffer of transitions, $\theta ^ { \prime }$ is an exponential moving average of the weights as done in (Lillicrap et al., 2015). SAC uses clipped double-Q learning (van Hasselt et al., 2015; Fujimoto et al., 2018), which we omit from our notation for simplicity but employ in practice.
|
| 298 |
+
|
| 299 |
+
The policy improvement step then fits the actor policy $\pi _ { \boldsymbol { \theta } } ( a _ { t } | \boldsymbol { s } _ { t } )$ network by optimizing the objective
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
J _ { \pi } ( \mathcal { D } ) = \mathbb { E } _ { s _ { t } \sim \mathcal { D } } [ D _ { \mathrm { K L } } ( \pi _ { \theta } ( \cdot | s _ { t } ) | | \exp \{ \frac { 1 } { \alpha } Q _ { \theta } ( s _ { t } , \cdot ) \} ) ] .
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
Finally, the temperature $\alpha$ is learned with the loss
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
J _ { \alpha } ( \mathcal { D } ) = \mathbb { E } _ { \underset { a _ { t } \sim \pi _ { \theta } ( \cdot | s _ { t } ) } { s _ { t } \sim \mathcal { D } } } [ - \alpha \log \pi _ { \theta } ( a _ { t } | s _ { t } ) - \alpha \bar { \mathcal { H } } ] ,
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
where $\bar { \mathcal { H } } \in \mathbb { R }$ is the target entropy hyper-parameter that the policy tries to match, which in practice is usually set to $\bar { \mathcal { H } } = - | \bar { \mathcal { A } } |$ .
|
| 312 |
+
|
| 313 |
+
Deep Q-learning DQN (Mnih et al., 2013) also learns a convolutional neural net to approximate Q-function over states and actions. The main difference is that DQN operates on discrete actions spaces, thus the policy can be directly inferred from Q-values. The parameters of DQN are updated by optimizing the squared residual error
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\begin{array} { r l } & { J _ { Q } ( \mathcal { D } ) = \mathbb { E } _ { ( s _ { t } , a _ { t } , s _ { t } ^ { \prime } ) \sim \mathcal { D } } [ ( Q _ { \theta } ( s _ { t } , a _ { t } ) - y _ { t } ) ^ { 2 } ] } \\ & { \qquad y _ { t } = r ( s _ { t } , a _ { t } ) + \gamma \underset { a ^ { \prime } } { \operatorname* { m a x } } Q _ { \theta ^ { \prime } } ( s _ { t } ^ { \prime } , a ^ { \prime } ) . } \end{array}
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
In practice, the standard version of DQN is frequently combined with a set of tricks that improve performance and training stability, wildly known as Rainbow (van Hasselt et al., 2015).
|
| 320 |
+
|
| 321 |
+
# B THE DEEPMIND CONTROL SUITE EXPERIMENTS SETUP
|
| 322 |
+
|
| 323 |
+
Our PyTorch SAC (Haarnoja et al., 2018) implementation is based off of Yarats & Kostrikov (2020).
|
| 324 |
+
|
| 325 |
+
# B.1 ACTOR AND CRITIC NETWORKS
|
| 326 |
+
|
| 327 |
+
We employ clipped double Q-learning (van Hasselt et al., 2015; Fujimoto et al., 2018) for the critic, where each $Q$ -function is parametrized as a 3-layer MLP with ReLU activations after each layer except of the last. The actor is also a 3-layer MLP with ReLUs that outputs mean and covariance for the diagonal Gaussian that represents the policy. The hidden dimension is set to 1024 for both the critic and actor.
|
| 328 |
+
|
| 329 |
+
# B.2 ENCODER NETWORK
|
| 330 |
+
|
| 331 |
+
We employ an encoder architecture from Yarats et al. (2019). This encoder consists of four convolutional layers with $3 \times 3$ kernels and 32 channels. The ReLU activation is applied after each conv layer. We use stride to 1 everywhere, except of the first conv layer, which has stride 2. The output of the convnet is feed into a single fully-connected layer normalized by LayerNorm (Ba et al., 2016). Finally, we apply tanh nonlinearity to the 50 dimensional output of the fully-connected layer. We initialize the weight matrix of fully-connected and convolutional layers with the orthogonal initialization (Saxe et al., 2013) and set the bias to be zero.
|
| 332 |
+
|
| 333 |
+
The actor and critic networks both have separate encoders, although we share the weights of the conv layers between them. Furthermore, only the critic optimizer is allowed to update these weights (e.g. we stop the gradients from the actor before they propagate to the shared conv layers).
|
| 334 |
+
|
| 335 |
+
# B.3 TRAINING AND EVALUATION SETUP
|
| 336 |
+
|
| 337 |
+
Our agent first collects 1000 seed observations using a random policy. The further training observations are collected by sampling actions from the current policy. We perform one training update every time we receive a new observation. In cases where we use action repeat, the number of training observations is only a fraction of the environment steps (e.g. a 1000 steps episode at action repeat 4 will only results into 250 training observations). We evaluate our agent every 10000 true environment steps by computing the average episode return over 10 evaluation episodes. During evaluation we take the mean policy action instead of sampling.
|
| 338 |
+
|
| 339 |
+
# B.4 PLANET AND DREAMER BENCHMARKS
|
| 340 |
+
|
| 341 |
+
We consider two evaluation setups that were introduced in PlaNet (Hafner et al., 2018) and Dreamer (Hafner et al., 2019), both using tasks from the DeepMind control suite (Tassa et al., 2018). The PlaNet benchmark consists of six tasks of various traits. Importantly, the benchmark proposed to use a different action repeat hyper-parameter for each task, which we summarize in Table 2.
|
| 342 |
+
|
| 343 |
+
The Dreamer benchmark considers an extended set of tasks, which makes it more difficult that the PlaNet setup. Additionally, this benchmark requires to use the same set hyper-parameters for each task, including action repeat (set to 2), which further increases the difficulty.
|
| 344 |
+
|
| 345 |
+
Table 2: The action repeat hyper-parameter used for each task in the PlaNet benchmark.
|
| 346 |
+
|
| 347 |
+
<table><tr><td>Task name</td><td>Action repeat</td></tr><tr><td>Cartpole Swingup</td><td>8</td></tr><tr><td>Reacher Easy</td><td>4</td></tr><tr><td>Cheetah Run</td><td>4</td></tr><tr><td>Finger Spin</td><td>2</td></tr><tr><td>Ball In Cup Catch</td><td>4</td></tr><tr><td>Walker Walk</td><td>2</td></tr></table>
|
| 348 |
+
|
| 349 |
+
# B.5 PIXELS PREPROCESSING
|
| 350 |
+
|
| 351 |
+
We construct an observational input as an 3-stack of consecutive frames (Mnih et al., 2013), where each frame is a RGB rendering of size $8 4 \times 8 4$ from the 0th camera. We then divide each pixel by 255 to scale it down to [0, 1] range.
|
| 352 |
+
|
| 353 |
+
# B.6 OTHER HYPER PARAMETERS
|
| 354 |
+
|
| 355 |
+
Due to computational constraints for all the continuous control ablation experiments in the main paper and appendix we use a minibatch size of 128, while for the main results we use minibatch of size 512. In Table 3 we provide a comprehensive overview of all the other hyper-parameters.
|
| 356 |
+
|
| 357 |
+
Table 3: An overview of used hyper-parameters in the DeepMind control suite experiments.
|
| 358 |
+
|
| 359 |
+
<table><tr><td>Parameter Replay buffer capacity</td><td>Setting 100000</td></tr><tr><td>Seed steps Ablations minibatch size Main results minibatch size Discount y Optimizer</td><td>1000 128 512 0.99</td></tr><tr><td>Learning rate Critic target update frequency Critic Q-function soft-update rate T Actor update frequency Actor log stddev bounds</td><td>Adam 10-3 2 0.01 2 [-10,2]</td></tr></table>
|
| 360 |
+
|
| 361 |
+
# C THE ATARI 100K EXPERIMENTS SETUP
|
| 362 |
+
|
| 363 |
+
For ease of reproducibility in Table 4 we report the hyper-parameter settings used in the Atari $1 0 0 \mathrm { k }$ experiments. We largely reuse the hyper-parameters from OTRainbow (Kielak, 2020), but adapt them for DQN (Mnih et al., 2013). Per common practise, we average performance of our agent over 5 random seeds. The evaluation is done for $1 2 5 \mathrm { k }$ environment steps at the end of training for 100k environment steps.
|
| 364 |
+
|
| 365 |
+
Table 4: A complete overview of hyper parameters used in the Atari $1 0 0 \mathrm { k }$ experiments.
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Parameter Data augmentation</td><td>Setting Random shifts and Intensity</td></tr><tr><td>Grey-scaling Observation down-sampling Frames stacked Action repetitions Reward clipping Terminal on loss of life Max frames per episode Update Dueling Target network: update period Discount factor Minibatch size Optimizer Optimizer: learning rate Optimizer: β1 Optimizer: β2 Optimizer: ∈ Max gradient norm Training steps Evaluation steps Min replay size for sampling Memory size Replay period every Multi-step return length Q network:channels Q network: filter size Q network: stride Q network: hidden units</td><td>True 84×84 4 4 [-1,1] True 108k Double Q True 1 0.99 32 Adam 0.0001 0.9 0.999 0.00015 10 100k 125k 1600 Unbounded 1 step 10 32,64,64 8×8,4×4,3×3 4,2,1</td></tr></table>
|
| 368 |
+
|
| 369 |
+
# D FULL ATARI 100K RESULTS
|
| 370 |
+
|
| 371 |
+
Besides reporting in Figure 5 median human-normalized episode returns over the 26 Atari games used in (Kaiser et al., 2019), we also provide the mean episode return for each individual game in Table 5.
|
| 372 |
+
|
| 373 |
+
Table 5: Mean episode returns on each of 26 Atari games from the setup in Kaiser et al. (2019). The results are recorded at the end of training and averaged across 5 random seeds (the CURL’s results are averaged over 3 seeds as reported in Srinivas et al. (2020)). On each game we mark as bold the highest score. Our method demonstrates better overall performance (as reported in Figure 5).
|
| 374 |
+
|
| 375 |
+
<table><tr><td>Game</td><td>Rainbow</td><td>SimPLe</td><td>OTRainbow</td><td>Eff. Rainbow</td><td>OT/Eff.Rainbow +CURL</td><td>Eff. DQN</td><td>Eff. DQN +DrQ (Ours)</td></tr><tr><td>Alien</td><td>318.7</td><td>616.9</td><td>824.7</td><td>739.9</td><td>1148.2</td><td>558.1</td><td>702.5</td></tr><tr><td>Amidar</td><td>32.5</td><td>88.0</td><td>82.8</td><td>188.6</td><td>232.3</td><td>63.7</td><td>100.2</td></tr><tr><td>Assault</td><td>231.0</td><td>527.2</td><td>351.9</td><td>431.2</td><td>543.7</td><td>589.5</td><td>490.3</td></tr><tr><td>Asterix</td><td>243.6</td><td>1128.3</td><td>628.5</td><td>470.8</td><td>524.3</td><td>341.9</td><td>577.9</td></tr><tr><td>BankHeist</td><td>15.6</td><td>34.2</td><td>182.1</td><td>51.0</td><td>193.7</td><td>74.0</td><td>205.3</td></tr><tr><td>BattleZone</td><td>2360.0</td><td>5184.4</td><td>4060.6</td><td>10124.6</td><td>11208.0</td><td>4760.8</td><td>6240.0</td></tr><tr><td>Boxing</td><td>-24.8</td><td>9.1</td><td>2.5</td><td>0.2</td><td>4.8</td><td>-1.8</td><td>5.1</td></tr><tr><td>Breakout</td><td>1.2</td><td>16.4</td><td>9.8</td><td>1.9</td><td>18.2</td><td>7.3</td><td>14.3</td></tr><tr><td>ChopperCommand</td><td>120.0</td><td>1246.9</td><td>1033.3</td><td>861.8</td><td>1198.0</td><td>624.4</td><td>870.1</td></tr><tr><td>CrazyClimber</td><td>2254.5</td><td>62583.6</td><td>21327.8</td><td>16185.3</td><td>27805.6</td><td>5430.6</td><td>20072.2</td></tr><tr><td>DemonAttack</td><td>163.6</td><td>208.1</td><td>711.8</td><td>508.0</td><td>834.0</td><td>403.5</td><td>1086.0</td></tr><tr><td>Freeway</td><td>0.0</td><td>20.3</td><td>25.0</td><td>27.9</td><td>27.9</td><td>3.7</td><td>20.0</td></tr><tr><td>Frostbite</td><td>60.2</td><td>254.7</td><td>231.6</td><td>866.8</td><td>924.0</td><td>202.9</td><td>889.9</td></tr><tr><td>Gopher</td><td>431.2</td><td>771.0</td><td>778.0</td><td>349.5</td><td>801.4</td><td>320.8</td><td>678.0</td></tr><tr><td>Hero</td><td>487.0</td><td>2656.6</td><td>6458.8</td><td>6857.0</td><td>6235.1</td><td>2200.1</td><td>4083.7</td></tr><tr><td>Jamesbond</td><td>47.4</td><td>125.3</td><td>112.3</td><td>301.6</td><td>400.1</td><td>133.2</td><td>330.3</td></tr><tr><td>Kangaroo</td><td>0.0</td><td>323.1</td><td>605.4</td><td>779.3</td><td>345.3</td><td>448.6</td><td>1282.6</td></tr><tr><td>Krull</td><td>1468.0</td><td>4539.9</td><td>3277.9</td><td>2851.5</td><td>3833.6</td><td>2999.0</td><td>4163.0</td></tr><tr><td>KungFuMaster</td><td>0.0</td><td>17257.2</td><td>5722.2</td><td>14346.1</td><td>14280.0</td><td>2020.9</td><td>7649.0</td></tr><tr><td>MsPacman</td><td>67.0</td><td>1480.0</td><td>941.9</td><td>1204.1</td><td>1492.8</td><td>872.0</td><td>1015.9</td></tr><tr><td>Pong</td><td>-20.6</td><td>12.8</td><td>1.3</td><td>-19.3</td><td>2.1</td><td>-19.4</td><td>-17.1</td></tr><tr><td>PrivateEye</td><td>0.0</td><td>58.3</td><td>100.0</td><td>97.8</td><td>105.2</td><td>351.3</td><td>-50.4</td></tr><tr><td>Qbert</td><td>123.5</td><td>1288.8</td><td>509.3</td><td>1152.9</td><td>1225.6</td><td>627.5</td><td>769.1</td></tr><tr><td>RoadRunner</td><td>1588.5</td><td>5640.6</td><td>2696.7</td><td>9600.0</td><td>6786.7</td><td>1491.9</td><td>8296.3</td></tr><tr><td>Seaquest</td><td>131.7</td><td>683.3</td><td>286.9</td><td>354.1</td><td>408.0</td><td>240.1</td><td>299.4</td></tr><tr><td>UpNDown</td><td>504.6</td><td>3350.3</td><td>2847.6</td><td>2877.4</td><td>2735.2</td><td>2901.7</td><td>3134.8</td></tr><tr><td>Median human-normalised episode returns</td><td>0.020</td><td>0.135</td><td>0.208</td><td>0.147</td><td>0.240</td><td>0.094</td><td>0.270</td></tr></table>
|
| 376 |
+
|
| 377 |
+
# E IMAGE AUGMENTATIONS ABLATION
|
| 378 |
+
|
| 379 |
+
Following (Chen et al., 2020), we evaluate popular image augmentation techniques, namely random shifts, cutouts, vertical and horizontal flips, random rotations and imagewise intensity jittering. Below, we provide a comprehensive overview of each augmentation. Furthermore, we examine effectiveness of these techniques in Figure 6.
|
| 380 |
+
|
| 381 |
+
Random Shift We bring our attention to random shifts that are commonly used to regularize neural networks trained on small images (Becker & Hinton, 1992; Simard et al., 2003; LeCun et al., 1989; Ciresan et al., 2011; Ciregan et al., 2012). In our implementation of this method images of size $8 4 \times 8 4$ are padded each side by 4 pixels (by repeating boundary pixels) and then randomly cropped back to the original $8 4 \times 8 4$ size.
|
| 382 |
+
|
| 383 |
+
Cutout Cutouts introduced in DeVries & Taylor (2017) represent a generalization of Dropout (Hinton et al., 2012). Instead of masking individual pixels cutouts mask square regions. Since image pixels can be highly correlated, this technique is proven to improve training of neural networks.
|
| 384 |
+
|
| 385 |
+
Horizontal/Vertical Flip This technique simply flips an image either horizontally or vertically with probability 0.1.
|
| 386 |
+
|
| 387 |
+
Rotate Here, an image is rotated by $r$ degrees, where $r$ is uniformly sampled from $[ - 5 , - 5 ]$
|
| 388 |
+
|
| 389 |
+
Intensity Each $N \times C \times 8 4 \times 8 4$ image tensor is multiplied by a single scalar $s$ , which is computed as $s = \mu + \sigma \cdot \mathrm { c l i p } ( r , - 2 , 2 )$ , where $r \sim \mathcal { N } ( 0 , 1 )$ . For our experiments we use $\mu = 1 . 0$ and $\sigma = 0 . 1$
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 6: Various image augmentations have different effect on the agent’s performance. Overall, we conclude that using image augmentations helps to fight overfitting. Moreover, we notice that random shifts proven to be the most effective technique for tasks from the DeepMind control suite.
|
| 393 |
+
|
| 394 |
+
Implementation Finally, we provide Python-like implementation for the aforementioned augmentations powered by Kornia (Riba et al., 2020).
|
| 395 |
+
|
| 396 |
+
import torch import torch.nn as nn import kornia.augmentation as aug
|
| 397 |
+
|
| 398 |
+
random_shift $=$ nn.Sequential(nn.ReplicationPad2d(4),aug.RandomCrop((84, 84)))
|
| 399 |
+
|
| 400 |
+
cutout $=$ aug.RandomErasing( $\mathrm { . p } { = } 0 \cdot 5$ )
|
| 401 |
+
|
| 402 |
+
h_flip $=$ aug.RandomHorizontalFlip $\mathrm { \cdot p = 0 ~ . ~ }$ 1)
|
| 403 |
+
|
| 404 |
+
v_flip $=$ aug.RandomVerticalFlip( $\mathrm { . p = 0 . 1 }$ )
|
| 405 |
+
|
| 406 |
+
rotate $=$ aug.RandomRotation(degree $\mathtt { S } = 5 \mathtt { . } 0$ )
|
| 407 |
+
|
| 408 |
+
intensity $=$ Intensity(scale ${ \tt a } = 0$ .1)
|
| 409 |
+
|
| 410 |
+
class Intensity(nn.Module): def __init__(self, scale): super().__init__() self.scale $\qquad = \quad \ S \subset$ ale
|
| 411 |
+
|
| 412 |
+
def forward(self, x): $\qquad \pm \quad =$ torch.randn((x.size(0), 1, 1, 1), device $= \times$ .device) noise $= \ 1 . 0 \mathrm { ~ \Omega ~ } +$ (self.scale $\star$ r.clamp(-2.0, 2.0)) return x $\star$ noise
|
| 413 |
+
|
| 414 |
+
# F K AND M HYPER-PARAMETERS ABLATION
|
| 415 |
+
|
| 416 |
+
We further ablate the K,M hyper-parameters from Algorithm 1 to understand their effect on performance. In Figure 7 we observe that increase values of K,M improves the agent’s performance. We choose to use the $[ { \cal K } = 2 , { \cal M } = 2 ]$ parametrization as it strikes a good balance between performance and computational demands.
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 7: Increasing values of K,M hyper-parameters generally correlates positively with the agent’s performance, especially on the harder tasks, such as Cheetah Run.
|
| 420 |
+
|
| 421 |
+
# G ROBUSTNESS INVESTIGATION
|
| 422 |
+
|
| 423 |
+
To demonstrate the robustness of our approach (Henderson et al., 2018), we perform a comprehensive study on the effect different hyper-parameter choices have on performance. A review of prior work (Hafner et al., 2018; 2019; Lee et al., 2019; Srinivas et al., 2020) shows consistent values for discount $\gamma = 0 . 9 9$ and target update rate $\tau = 0 . 0 1$ parameters, but variability on network architectures, mini-batch sizes, learning rates. Since our method is based on SAC (Haarnoja et al., 2018), we also check whether the initial value of the temperature is important, as it plays a crucial role in the initial phase of exploration. We omit search over network architectures since Figure 1b shows our method to be robust to the exact choice. We thus focus on three hyper-parameters: mini-batch size, learning rate, and initial temperature.
|
| 424 |
+
|
| 425 |
+
Due to computational demands, experiments are restricted to a subset of tasks from Tassa et al. (2018): Walker Walk, Cartpole Swingup, and Finger Spin. These were selected to be diverse, requiring different behaviors including locomotion and goal reaching. A grid search is performed over minibatch sizes $\{ 1 2 8 , 2 5 6 , 5 1 2 \}$ , learning rates $\{ 0 . 0 0 0 1 , 0 . 0 0 0 5 , 0 . 0 0 1 , 0 . 0 0 5 \}$ , and initial temperatures $\{ 0 . 0 0 5 , 0 . 0 1 , 0 . 0 5 , 0 . 1 \}$ . We follow the experimental setup from Appendix B, except that only 3 seeds are used due to the computation limitations, but since variance is low the results are representative.
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 8: A robustness study of our algorithm $\mathbf { ( D r Q ) }$ to changes in mini-batch size, learning rate, and initial temperature hyper-parameters on three different tasks from (Tassa et al., 2018). Each row corresponds to a different mini-batch size. The low variance of the curves and heat-maps shows DrQ to be generally robust to exact hyper-parameter settings.
|
| 429 |
+
|
| 430 |
+
Figure 8 shows performance curves for each configuration as well as a heat map over the mean performance of the final evaluation episodes, similar to Mnih et al. (2016). Our method demonstrates good stability and is largely invariant to the studied hyper-parameters. We emphasize that for simplicity the experiments in Section 5 use the default learning rate of Adam (Kingma & Ba, 2014) (0.001), even though it is not always optimal.
|
| 431 |
+
|
| 432 |
+
# H IMPROVED DATA-EFFICIENT REINFORCEMENT LEARNING FROM PIXELS
|
| 433 |
+
|
| 434 |
+
Our method allows to generate many various transformations from a training observation due to the data augmentation strategy. Thus, we further investigate whether performing more training updates per an environment step can lead to even better sample-efficiency. Following van Hasselt et al. (2019b) we compare a single update with a mini-batch of 512 transitions with 4 updates with 4 different mini-batches of size 128 samples each. Performing more updates per an environment step leads to even worse over-fitting on some tasks without data augmentation (see Figure 9a), while our method $\mathbf { D r Q }$ , that takes advantage of data augmentation, demonstrates improved sample-efficiency (see Figure 9b).
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
Figure 9: In the data-efficient regime, where we measure performance at $1 0 0 \mathrm { k }$ environment steps, $\mathbf { D r Q }$ is able to enhance its efficiency by performing more training iterations per an environment step. This is because $\mathbf { D r Q }$ allows to generate various transformations for a training observation.
|
md/train/H1K6Tb-AZ/H1K6Tb-AZ.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TESLA: TASK-WISE EARLY STOPPING AND LOSS AGGREGATION FOR DYNAMIC NEURAL NETWORK INFERENCE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
For inference operations in deep neural networks on end devices, it is desirable to deploy a single pre-trained neural network model, which can dynamically scale across a computation range without comprising accuracy. To achieve this goal, Incomplete Dot Product (IDP) has been proposed to use only a subset of terms in dot products during forward propagation. However, there are some limitations, including noticeable performance degradation in operating regions with low computational costs, and essential performance limitations since IDP uses hand-crafted profile coefficients. In this paper, we extend IDP by proposing new training algorithms involving a single profile, which may be trainable or pre-determined, to significantly improve the overall performance, especially in operating regions with low computational costs. Specifically, we propose the Task-wise Early Stopping and Loss Aggregation (TESLA) algorithm, which is showed in our 3-layer multilayer perceptron on MNIST that outperforms the original IDP by $3 2 \%$ when only $1 0 \%$ of dot products terms are used and achieves $9 4 . 7 \%$ accuracy on average. By introducing trainable profile coefficients, TESLA further improves the accuracy to $9 5 . 5 \%$ without specifying coefficients in advance. Besides, TESLA is applied to the VGG-16 model, which achieves $8 0 \%$ accuracy using only $2 0 \%$ of dot product terms on CIFAR-10 and also keeps $6 0 \%$ accuracy using only $3 0 \%$ of dot product terms on CIFAR-100, but the original IDP performs like a random guess in these two datasets at such low computation costs. Finally, we visualize the learned representations at different dot product percentages by class activation map and show that, by applying TESLA, the learned representations can adapt over a wide range of operation regions.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Inference operations in deep neural networks on end devices, such as mobile phones, embedded sensors, IoT devices, etc., have recently received increasing attention including McMahan et al. (2016), Howard et al. (2017), and Teerapittayanon et al. (2017). In such applications, it is desirable to deploy a single pre-trained CNN model on end devices, while allowing multiple operating regions to meet different power consumption, latency, and accuracy requirements. To achieve this goal, McDanel et al. (2017a) proposed the incomplete dot product (IDP) operation, where only a subset of terms is used in dot products of forward propagation. From now on, $x \%$ dot product (DP), where 0 $\leq x \leq 1 0 0$ , means the $x \%$ of terms used in dot products. As illustrated in Figure 1, $5 0 \%$ DP means half of filters are used during forward propagation, and thus only half of the output channels are retained. To reduce the deviation induced by IDP, filters are prioritized from most important to the least important by pre-determined monotonically non-increasing profile coefficients (say, $\gamma _ { 1 } , . . . , \gamma _ { N } )$ during training. Therefore, IDP can be applied at inference time with dynamically-adjusted degrees of completeness (specified by the percentage of terms being used) to trade off accuracy slightly for lowered power consumption and reduced latency. Specifically, VGG-16 model with $5 0 \%$ DP achieves $7 0 \%$ in accuracy on the CIFAR-10 dataset compared to the standard network achieves only $3 5 \%$ accuracy when using the reduced channel set.
|
| 12 |
+
|
| 13 |
+
While the original IDP design seems promising, there are two limitations. First, since the training process aims at optimizing the loss function computed using all weights of the model ( $1 0 0 \%$ DP), there will be a mismatch between training and testing. It is no surprise that inference performance significantly decreases in low DP percentages and thus narrow the dynamic computation range. To mitigate this problem, the original IDP design utilizes the multiple-profile training strategy, where different profiles can be specified to focus on different dot product ranges. In such a multipleprofile training process, however, certain subset of weights will be freezed in each training stage corresponding to the profile being focused, and hence the overall performance may not be fully optimized. Besides, each profile needs to maintain a separate first and last layer for adjusting to its own dot product range, resulting in additional memory overhead. The second limitation relates to the pre-determined nature of profile coefficients. While there are multiple ways to set the profile based on different dynamic range requirements, the original IDP design did not focus on finding a single ”best” profile that leads to the best performance. Instead, they use multiple hand-crafted profile coefficients, which make the system design less general among different applications, and hence may limit the overall performance of the system.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Comparison between complete dot product (CDP) and incomplete dot product (IDP) where $X \%$ DP implies only $X \%$ of filters are used to compute the corresponding output channel. Since only $X \%$ filters are unused, the resulting output is an approximation of the output under CDP.
|
| 17 |
+
|
| 18 |
+
To reduce the mismatch between training and testing performances, we propose the Task-wise Early Stopping and Loss Aggregation (TESLA) algorithm, in which multiple loss functions are computed in different DP percentages. By gradually aggregating these loss functions in decreasing order of DP percentages as the objective function to be optimized, TESLA significantly improves testing performances in low DP percentages without compromising accuracy in medium to high DP percentages. The loss functions can also be aggregated in random order of DP percentages to make a variant of TESLA, called Randomized TESLA (R-TESLA), which enables better performances under prespecified operating regions of end devices. Moreover, we relax the constraint of pre-determined profile coefficients and propose the alternate training procedure (ATP) to alternately train the profile coefficients along with weights of the model. By introducing trainable profile coefficients, customization among different applications can be achieved in a more generalized way, and the overall performance can also be further improved. This paper has made two major contributions: (1) We propose the Task-wise Early Stopping and Loss Aggregation (TESLA) algorithm and Randomized TESLA that can achieve dynamic scaling over a computation range in neural network inference without compromising accuracy. (2) We also propose the Alternate Training Procedure (ATP) that can learn the profile coefficients and the model weights simultaneously without the need of manual configuration of the profile coefficients.
|
| 19 |
+
|
| 20 |
+
# 2 INCOMPLETE NEURAL NETWORKS
|
| 21 |
+
|
| 22 |
+
Incomplete dot product (IDP) is a novel mechanism proposed by McDanel et al. (2017a) that can be applied to a hidden layer of MLPs or deep CNN models to dynamically lower the inference costs by computing only a subset of terms in dot products during forward propagation. By introducing a set of non-increasing coefficients $\gamma _ { i }$ , referred to as a profile, to the channels during training, the channels will be ordered implicitly in non-increasing order from the most important to the least important. By simply dropping out less important channels at inference time, it suffices to train and deploy a single network, while still supporting different levels of computation scaling without compromising accuracy significantly. In this section, we briefly introduce the main concepts of IDP.
|
| 23 |
+
|
| 24 |
+
# 2.1 INCOMPLETE DOT PRODUCT OPERATION
|
| 25 |
+
|
| 26 |
+
Mathematically, for an IDP fully-connected layer with input dimension $N$ and output dimension $M$ , the $j$ -th output component $y _ { j }$ is computed as
|
| 27 |
+
|
| 28 |
+
$$
|
| 29 |
+
y _ { j } = \sum _ { i = 1 } ^ { N } \gamma _ { i } w _ { j i } x _ { i } ,
|
| 30 |
+
$$
|
| 31 |
+
|
| 32 |
+
for $j \in \{ 1 , 2 , . . . , M \}$ , where $x _ { i }$ is the $i$ -th input component, $w _ { j i }$ is the weight corresponding to the $j$ -th output component and the $i$ -th input component, and $\gamma _ { i }$ is the $i$ -th profile coefficient.
|
| 33 |
+
|
| 34 |
+
Similar expression can be derived for the IDP operation applied to a convolutional layer of CNN, as illustrated in Figure 1. For an IDP convolutional layer with number of input channels $N$ and number of output channels $M$ , the $j$ -th output channel ${ \bf y } _ { j }$ is computed as
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathbf { y } _ { j } = \gamma _ { j } \sum _ { i = 1 } ^ { N } \mathbf { f } _ { j i } * \mathbf { x } _ { i } ,
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
for $j \in \{ 1 , 2 , . . . , M \}$ , where $\mathbf { f } _ { j i } * \mathbf { x } _ { i }$ denotes the convolution operation of the $i$ -th input channel $\mathbf { x } _ { i }$ and the $i$ -th channel of the $j$ -th filter $\mathbf { f } _ { j i }$ , and $\gamma _ { j }$ is the profile coefficient for the $j$ -th filter. Note that, instead of applying profile coefficients depthwise on each filter before convolution as is the case in the original IDP design, we multiply each $\gamma _ { j }$ to each output channel after a complete convolution to produce ${ \bf y } _ { j }$ . These two approaches, however, are equivalent with negligible difference induced by the first hidden layer. Since the output channels ${ \bf y } _ { j }$ ’s become input channels $\mathbf { x } _ { i }$ ’s to the next layer, applying $\gamma _ { j }$ ’s to ${ \bf y } _ { j }$ ’s is equivalent to applying them into the convolution operation in the next layer.
|
| 41 |
+
|
| 42 |
+
To compute IDP with a target dot product percentage, a truncated version of Eq. 1 or Eq. 2 replaces the original computation to keep only a subset of the beginning terms. As for the case with all terms are kept, we refer to such operations as complete dot product (CDP) or $1 0 0 \%$ DP, interchangeably. Note that in the training process in the original IDP design, only CDP is used.
|
| 43 |
+
|
| 44 |
+
# 2.2 MULTIPLE-PROFILE INCOMPLETE NEURAL NETWORKS
|
| 45 |
+
|
| 46 |
+
In the work of McDanel et al. (2017a), several profile coefficients are proposed and applied in a pre-determined manner. When only a single profile is applied to the model, the trade-off between computation range and performance in high DP percentage regions is also demonstrated. Generally, the faster the profile coefficients decrease, the larger computation range can be achieved, at the expense of a performance degradation in high DP percentage regions. To cover a larger computation range while maintaining the performance in high DP percentage regions, McDanel et al. (2017a) further introduced the multiple-profile incomplete neural networks (MP-IDP), where different profiles can be specified to focus on different DP ranges. During training, all the specified profiles are applied in increasing order of their operating DP ranges. When a profile is applied, only weights corresponding to its operating DP range will be updated, leaving weights corresponding to lower DP percentages freezed since they have been trained in previous stages, and weights corresponding to higher IDP percentages set to zeros since they will be trained in later stages. In such a stage-by-stage training process, the overall performance may not be fully optimized.
|
| 47 |
+
|
| 48 |
+
# 3 TASK-WISE EARLY STOPPING AND LOSS AGGREGATION
|
| 49 |
+
|
| 50 |
+
As discussed in Section 2, in the original IDP design, CDP is used during training but IDP is applied at inference time. This mismatch leads to a noticeable degradation in inference performance, especially in low DP percentages. To mitigate this problem, we propose the Task-wise Early Stopping and Loss Aggregation (TESLA) algorithm. In this paper, a task is defined as the learning process that uses only a subset of weights determined by a DP percentage to learn the optimal representations. For example, a task of $5 0 \%$ DP implies that the first half of network weights are used for dot product computations and thus only these $5 0 \%$ of weights will be updated while conducting backpropagation. With TESLA, we can optimize a network by tasks with different DP percentages to support various levels of computation scaling and meanwhile reduce the mismatch between training and inference. The design of TESLA is described as follows.
|
| 51 |
+
|
| 52 |
+
# 3.1 TASK-WISE EARLY STOPPING
|
| 53 |
+
|
| 54 |
+
Since tasks with different DP percentages may have different learning difficulties and convergence rates, we apply an early stopping mechanism to automatically adjust the learning processes of tasks. Specifically, we keep all hyper-parameters unchanged except the numbers of epoches, which are controlled by the early stopping mechanism that halts the training process as long as the task performance has not been improved for a certain number of iterations. For example, considering two tasks, one using $7 0 \%$ DP (task 1) and the other using $4 0 \%$ DP (task 2), we first optimize task 1 and then switch to optimize task 2 until the optimization process of task 1 reaches the early stopping criterion. With this task-wise early stopping, we are able to optimize all the tasks sequentially, and each task initializes its model using the weights that have been optimized for all previous tasks. However, the weights used in task 2 is exactly a subset of weights used in task 1 such that the optimization process of task 2 may contaminate the well-trained weights for task 1. To reduce this unexpected disturbance while learning multiple tasks, some kinds of loss aggregation are needed to learn a new task without sacrificing the performance of all the past tasks too much.
|
| 55 |
+
|
| 56 |
+
# Algorithm 1 Task-wise Early Stopping and Loss Aggregation, TESLA
|
| 57 |
+
|
| 58 |
+
1: Input: a task set in decreasing order, $T = L _ { i }$ ; aggregation coefficient $\alpha$
|
| 59 |
+
2: Initialization: $L _ { 1 } ^ { o b j } L _ { 1 }$ and $i \gets 1$
|
| 60 |
+
3: while $i \leq s i z e ( T )$ do
|
| 61 |
+
4: 5: $L _ { i + 1 } ^ { o b j } \alpha \times L _ { i + 1 } + ( 1 - \alpha ) \times L _ { i } ^ { o b j }$ $L _ { i } ^ { o b j }$ pping criteria
|
| 62 |
+
6: i ← i + 1
|
| 63 |
+
7: end while
|
| 64 |
+
|
| 65 |
+
# Algorithm 2 Randomized TESLA, R-TESLA
|
| 66 |
+
|
| 67 |
+
1: Input: a task set in any order, $T = L _ { i }$ ; allowable epoch, max epoch; aggregation coefficient $\alpha$
|
| 68 |
+
2: Initialization: $L _ { 1 } ^ { o b j } L _ { 1 }$ , $i \gets 0$ , and $n \gets 0$
|
| 69 |
+
3: while $n \leq$ max epoch do
|
| 70 |
+
4: optimize $L _ { i } ^ { o b j }$ until meeting early stopping criteria, which takes n epochs
|
| 71 |
+
5: 6: $L _ { i + 1 } ^ { o b j } \gets \alpha \times L _ { k } + ( 1 - \alpha ) \times L _ { i } ^ { o b j }$ $L _ { k }$
|
| 72 |
+
7: i ← i + 1
|
| 73 |
+
8: $n n + n$ epcohs
|
| 74 |
+
9: end while
|
| 75 |
+
|
| 76 |
+
# 3.2 TASK-WISE LOSS AGGREGATION
|
| 77 |
+
|
| 78 |
+
Task-wise loss aggregation is therefore proposed to jointly learn the shared representation for all tasks. By considering one new task at a time, we add the loss of the new task into the current objective function and optimize the aggregated objective function such that tasks are optimized incrementally and jointly. The aggregated objective function can be expressed as
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
L _ { 1 } ^ { o b j } = L _ { 1 } ~ \mathrm { a n d } ~ L _ { i + 1 } ^ { o b j } = \alpha \times L _ { i + 1 } + ( 1 - \alpha ) \times L _ { i } ^ { o b j } ~ , ~ \forall i = 1 , \cdots , N - 1
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $\alpha$ is the aggregation coefficient shared by all subsequent tasks and greater $\alpha$ implies that we care more about the optimization of the new task. As a consequence, the objective function in the whole learning process is an affine combination of the losses of currently considered tasks. By
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Network structures in study
|
| 88 |
+
|
| 89 |
+
Table 1: Hyper-parameters in Experiments
|
| 90 |
+
|
| 91 |
+
<table><tr><td>Experiment</td><td>MLP on MNIST</td><td>VGG-16 onCIFAR-10</td><td>VGG-16 on CIFAR-100</td></tr><tr><td>Tasks at DP %</td><td>100,70,40,10</td><td>100,50,20</td><td>100,70,50,30</td></tr><tr><td>Learning rate</td><td>0.001</td><td>0.004</td><td>0.004</td></tr><tr><td>Optimizer</td><td>Adam</td><td>SGD momentum=0.9</td><td>SGD momentum =0.9</td></tr><tr><td>Batch size</td><td>28</td><td>32</td><td>64</td></tr><tr><td>Aggregation coefficient</td><td>0.5</td><td>0.5</td><td>0.5</td></tr><tr><td>TESLA stopping criteria</td><td>not improve in4 epochs</td><td>not improve in 4 epochs</td><td>not improve in 4 epochs</td></tr><tr><td>R-TESLAstopping criteria</td><td># epochs over 50</td><td>#epochs over35</td><td>#epochs over35</td></tr><tr><td>Initial weights</td><td>random</td><td>pre-trained on ImageNet</td><td>pre-trained on ImageNet</td></tr></table>
|
| 92 |
+
|
| 93 |
+
task-wise loss aggregation, these losses are aggregated incrementally and can be jointly optimized to learn a shared representation to be relevant to all tasks.
|
| 94 |
+
|
| 95 |
+
# 3.3 TESLA AND RANDOMIZED TESLA
|
| 96 |
+
|
| 97 |
+
Task-wise Early Stopping and Loss Aggregation, TESLA. We integrate task-wise early stopping and task-wise loss aggregation as TESLA to learn dynamic representations in neural networks. The entire training process optimizes all tasks in an arbitrary order. It is obvious that we have several options to order tasks in (i) increasing, (ii) decreasing, or (iii) random DP percentages. Recall that we add a non-increasing coefficients to prioritize terms in computing dot product, and thus the beginning terms, e.g. at $1 0 \%$ DP, are more important than the terms at last $1 0 \%$ terms. Therefore, discarding the terms from the end is less harmful to the optimized parameters, so TESLA is designed to optimize tasks in decreasing order of DP percentages. The TESLA algorithm is shown in Algorithm 1.
|
| 98 |
+
|
| 99 |
+
Randomized Task-wise Early Stopping and Loss Aggregation, R-TESLA. Here Randomized means that tasks are optimized in random order. The benefits of R-TESLA is two fold. First, RTESLA provides an opportunity to turn attention back to optimize a task which had been halted before, and allows to finetune the weights, which may have been contaminated by other tasks. Second, unlike TESLA that optimizes each task only once, R-TESLA allows each task to be optimized for multiple times, which can be specified by a customized task distribution derived from the behavioral statistics of users or the specification of hardware design. The detailed procedures of R-TESLA are in Algorithm 2.
|
| 100 |
+
|
| 101 |
+
# 3.4 TRAINABLE PROFILE COEFFICIENTS
|
| 102 |
+
|
| 103 |
+
In this section we propose to learn profile coefficients along with weights of the model alternately. We initialize all coefficients as one and as long as any update of profile coefficients, we manually clip the coefficients to keep the non-increasing property. The alternate training procedure (ATP) relaxes the constraint of fixed coefficients and we demonstrate the feasibility of ATP in the experiment of the MLP model on MNIST dataset in Section 4.
|
| 104 |
+
|
| 105 |
+
# 4 EXPERIMENTS
|
| 106 |
+
|
| 107 |
+
In this section, we demonstrate the effectiveness of using TESLA and R-TESLA to learn dynamic representations in MLP and CNN models, with the widely-used datasets MNIST, CIFAR-10, and CIFAR-100. Figure 2 shows the network architectures in study. Note that while working on CIFAR100, the last fully connected layer of Figure 2(b) is replaced by a single 100-class classifier. Here we compare TESLA and R-TESLA with the original IDP design proposed by McDanel et al. (2017a) over a range of dynamic scaling during inference. All hyper-parameters and experiment settings are summarized in Table 1.
|
| 108 |
+
|
| 109 |
+
# 4.1 MULTILAYER PERCEPTRONS
|
| 110 |
+
|
| 111 |
+
First, we consider a 3-layer MLP model, in which the IDP operation is applied to the first hidden layer, as shown in Figure 2(a), and evaluate on the MNIST dataset. In this experiment, we define four tasks that optimize the model at $1 0 \%$ , $4 0 \%$ , $7 0 \%$ , and $1 0 0 \%$ DP, respectively. It is noteworthy that defining too many tasks in our experiment would not benefit much, since there must be a large amount of shared parameters among tasks which makes the model vulnerable to overfitting.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 3: Performance comparisons by a MLP model over the MNIST dataset
|
| 115 |
+
|
| 116 |
+
TESLA versus original IDP. We compare TESLA and the original IDP design under various profiles. Figure 3(a) shows that at $2 0 \%$ DP, the original IDP achieves $8 0 \%$ , $6 3 \%$ and $5 5 \%$ accuracy for the harmonic, all-one, and linear profiles respectively but TESLA keeps at least $8 8 \%$ accuracy for all profiles at $2 0 \%$ DP and reaches average accuracy of $9 4 . 7 \%$ using the linear profile. Most importantly, compared to the original IDP, TESLA performs only about $1 \%$ worse in accuracy at $1 0 0 \%$ DP but gains a significant improvement from $5 0 \%$ to $9 0 \%$ in accuracy at $1 0 \%$ DP, which is an acceptable trade-off under practical applications.
|
| 117 |
+
|
| 118 |
+
R-TESLA versus TESLA and original IDP. Figure 3(b) shows that R-TESLA outperforms the original IDP by a large margin and R-TESLA has comparable performance with TESLA in most cases. R-TESLA with the harmonic profile leads to the best average accuracy of $9 5 . 2 \%$ in this experiment. By observing the optimization progress, we find that TESLA achieves its best result after completing the last task thanks to its ordinal optimization. On the other hand, we cannot ensure that R-TESLA can make the ultimate model retains the best dynamic representations due to its random nature.
|
| 119 |
+
|
| 120 |
+
Learn profile coefficients by ATP. Here we demonstrate the feasibility of learning profile coefficients along with weights. From Figure 3(c), with the help of trainable profile coefficients, both TESLA and R-TESLA further boost by $1 \%$ in average, and we also observe that the learned profile coefficients are similar to harmonic ones as shown in Figure 3(d). This may support why performance of harmonic coefficients is the best in the original IDP. By allowing coefficients to be trainable, it is no longer to require hand-crafted profile coefficients and determine the best profile coefficients by extensive experiments.
|
| 121 |
+
|
| 122 |
+
# 4.2 CONVOLUTIONAL NEURAL NETWORKS
|
| 123 |
+
|
| 124 |
+
We choose the known VGG-16 model pre-trained on ImageNet to evaluate over CIFAR-10 and CIFAR-100 dataset so that the last few dense layers are replaced by a 10-class classifier and a 100- class classifier respectively. Here we use the linear profile coefficients to compare: (i) the original IDP design, (ii) multiple-profile IDP design (MP-IDP) as proposed in McDanel et al. (2017a), (iii) TESLA, and (iv) R-TESLA. The experimental results are summarized below.
|
| 125 |
+
|
| 126 |
+
VGG-16 on CIFAR-10. According to Figure 4(a), the performance of original IDP by all-one coefficients drops much faster than that by linear coefficients. Appling all-one coefficients is equivalent to using the original VGG-16 network; however, linear profile coefficients implicitly encourages networks to learn channel importance in order, and also brings about that pruning away later channels at different DP percentages does not hurt the performance that much. With the use of multiple profiles, MP-IDP does enlarge the computational range with an increase in accuracy to $7 5 \%$ at $5 0 \%$ DP. Furthermore, the proposed algorithms, TESLA and R-TESLA, boost the accuracy to reach $8 5 \%$ at $5 0 \%$ DP, and an even higher accuracy at $1 0 0 \%$ DP.
|
| 127 |
+
|
| 128 |
+
Following the previous experiment, here we augment another new task of $2 0 \%$ DP and observe whether TESLA can leverage up the performance at low DP percentages by adding a task of a low DP percentage. Figure 4(b) shows that TESLA and R-TESLA greatly widens the computational ranges by making accuracy reaching $7 5 \%$ at $2 0 \%$ DP. We contribute this effect to applying TESLA and R-TESLA in decreasing order of dot product percentages so that the representation learned at $1 0 0 \%$ DP drives the training of representation at $5 0 \%$ DP, which also makes the representation much easier to be learned at $2 0 \%$ DP. Compared to TESLA and R-TESLA, MP-IDP trains models in increasing order of DP percentages and thus MP-IDP doesn’t see much improvement at lower IDP percentages although adding another task at $2 0 \%$ DP.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Performance comparisons by the VGG-16 model over the CIFAR-10 and CIFAR-100 dataset
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Figure 5: CAMs at different DP percentages. Red colored text means wrong prediction and green colored text means correct prediction.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 6: CAMs of a testing image that is correctly classified at all specified DP percentages.
|
| 138 |
+
|
| 139 |
+
VGG-16 on CIFAR-100. To sufficiently illustrate the effectiveness of the proposed approaches, we evaluate over a larger dataset, CIFAR-100. Figure 4(c) shows the performance of TESLA and R-TESLA still keeps around $6 0 \%$ accuracy from $3 0 \%$ to $5 0 \%$ DP, which outperforms either original IDP or MP-IDP by a significant margin, which is consistent with the result of CIFAR-10. Specifically, both TESLA and R-TESLA sacrifice about $4 \%$ accuracy at $1 0 0 \%$ DP but gain a great improvements of $6 0 \%$ accuracy in low DP percentages.
|
| 140 |
+
|
| 141 |
+
CAM visualization. We visualize what the model sees at different DP percentages by deploying the Class Activation Mapping (CAM) technique introduced by Zhou et al. (2016a). A resulting CAM indicates how much each location contribute to the final class prediction. In this stage, we replace the max-pooling layers with average-pooling layers and train the VGG-16 network with linear coefficients optimized at $2 0 \%$ , $5 0 \%$ , $1 0 0 \%$ DP. From CAMs at different DP percentages, we found that the network is easier to make wrong prediction at $1 0 \%$ and $3 0 \%$ DP but still makes correct prediction at $2 0 \%$ DP as shown in Figure 5 since the representations at $2 0 \%$ DP are optimized. This finding implies that we can specify any DP percentages to be optimized for satisfying custom requirements. Compared to Figure 6, we also notice that the CAMs at $1 0 \%$ DP are almost the same no matter the correctness of predictions, which indicates too limited capacity to capture meaningful patterns, and thus the network at $1 0 \%$ DP behaves like a random guess.
|
| 142 |
+
|
| 143 |
+
# 5 RELATED WORK
|
| 144 |
+
|
| 145 |
+
Our work is rooted from IDP proposed by McDanel et al. (2017a), which, in addition to MLPs and regular CNNs, can also be used in conjunction with other variants of convolutional layers, such as separable convolution layer Howard et al. (2017) and binary convolutional layer McDanel et al. (2017b). As discussed throughout this paper, our work extends the original IDP design by proposing new training algorithms involving a single profile, which may be trainable or pre-determined, to significantly improve the overall performance, especially in low DP percentages.
|
| 146 |
+
|
| 147 |
+
Network pruning is a widely-studied area that also aims at compressing the CNN models. Early works of network pruning construct a threshold for dropping weights by information obtained from Hessian matrix or inverse Hessian matrix in LeCun et al. (1990); Hassibi & Stork (1993), which adds memory and computation costs. In most of the recent works, magnitude-based pruning and recovering are incorporated to compensate the potential loss incurred by inadequate pruning. For example, Guo et al. (2016) introduces the splicing operation to enable connection recovery, and Han et al. (2016) directly makes the network dense again. Li et al. (2016) also prune filters in CNNs based on magnitude, but the number of filters pruned away in each layer is decided by layer-wise sensitivity. Besides magnitude-based pruning, a Taylor expansion-based criterion is introduced in Molchanov et al. (2016) to approximate the change in the cost function induced by pruning. In addition to network pruning, some works focus on low-rank decomposition for network compression. For example, Denton et al. (2014) and Jaderberg et al. (2014) approximate the weight matrix into low-rank components by minimizing the reconstruction error. Yu et al. (2017) further decomposes the weight matrix into its low-rank and sparse component. Other works focus on grouping similar weights, such as quantization by Han et al. (2015), Gong et al. (2014), and Zhou et al. (2017) and weight sharing by Ullrich et al. (2017), aiming at reducing the level of redundancy and the required storage. Yet another approach introduces group sparsity regularizer to constrain the structure of the model in Wen et al. (2016), Zhou et al. (2016b), and Alvarez & Salzmann (2016).
|
| 148 |
+
|
| 149 |
+
While all the above techniques are promising in reducing the size of the networks, none of them supports dynamic adjustment during inference as IDP does. Furthermore, most of the above techniques involve retraining the model iteratively, resulting in computational overhead. In our proposed work, the goal of efficient inference with dynamic adjustment can be readily fulfilled by training a single model at once, and the effectiveness is expected to be further improved by incorporating with other techniques listed above.
|
| 150 |
+
|
| 151 |
+
# 6 CONCLUSION
|
| 152 |
+
|
| 153 |
+
In this paper, we extend the idea of incomplete dot product (IDP) by proposing the Task-wise Early Stopping and Loss Aggregation (TESLA) algorithm to significantly improve the performance of neural networks with dynamically computation regions at inference time without significantly compromising accuracy. A task is defined as the learning process that uses only a subset of weights specified by a DP percentage to learn the optimal representations of the network. By introducing non-increasing profile coefficients to prioritize weights or filters during training, TESLA can be used to optimize multiple tasks in decreasing order of DP percentages by aggregating the their loss functions. Additionally, we propose Randomized TESLA (R-TESLA) which optimizes tasks in random order, and show that both TESLA and R-TESLA outperform original IDP and multiple-profile IDP significantly. The visualization of the class activation maps (CAMs) provide a strong evidence that the representations learned by TESLA allow dynamically scaling across a computation range to meet various power consumption, latency and accuracy requirements on end devices.
|
| 154 |
+
|
| 155 |
+
# REFERENCES
|
| 156 |
+
|
| 157 |
+
Jose M Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In Advances in Neural Information Processing Systems, pp. 2270–2278, 2016.
|
| 158 |
+
|
| 159 |
+
Emily L Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In Advances in Neural Information Processing Systems, pp. 1269–1277, 2014.
|
| 160 |
+
|
| 161 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
|
| 162 |
+
|
| 163 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, pp. 1379–1387, 2016.
|
| 164 |
+
|
| 165 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 166 |
+
|
| 167 |
+
Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Enhao Gong, Shijian Tang, Erich Elsen, Peter Vajda, Manohar Paluri, John Tran, et al. Dsd: Dense-sparse-dense training for deep neural networks. 2016.
|
| 168 |
+
|
| 169 |
+
Babak Hassibi and David G. Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in Neural Information Processing Systems 5, pp. 164–171. 1993.
|
| 170 |
+
|
| 171 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 172 |
+
|
| 173 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
|
| 174 |
+
|
| 175 |
+
Yann LeCun, John S. Denker, and Sara A. Solla. Optimal brain damage. In Advances in Neural Information Processing Systems 2, pp. 598–605. 1990.
|
| 176 |
+
|
| 177 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 178 |
+
|
| 179 |
+
Bradley McDanel, Surat Teerapittayanon, and HT Kung. Incomplete dot products for dynamic computation scaling in neural network inference. 2017a.
|
| 180 |
+
|
| 181 |
+
Bradley McDanel, Surat Teerapittayanon, and H.T. Kung. Embedded binarized neural networks. In Proceedings of the 2017 International Conference on Embedded Wireless Systems and Networks, 2017b.
|
| 182 |
+
|
| 183 |
+
H Brendan McMahan, Eider Moore, Daniel Ramage, and Blaise Aguera y Arcas. Federated learning of deep networks using model averaging. 2016.
|
| 184 |
+
|
| 185 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. 2016.
|
| 186 |
+
|
| 187 |
+
Surat Teerapittayanon, Bradley McDanel, and HT Kung. Distributed deep neural networks over the cloud, the edge and end devices. In Distributed Computing Systems (ICDCS), 2017 IEEE 37th International Conference on, pp. 328–339. IEEE, 2017.
|
| 188 |
+
|
| 189 |
+
Karen Ullrich, Edward Meeds, and Max Welling. Soft weight-sharing for neural network compression. arXiv preprint arXiv:1702.04008, 2017.
|
| 190 |
+
|
| 191 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 192 |
+
|
| 193 |
+
Xiyu Yu, Tongliang Liu, Xinchao Wang, and Dacheng Tao. On compressing deep models by low rank and sparse decomposition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7370–7379, 2017.
|
| 194 |
+
|
| 195 |
+
Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017.
|
| 196 |
+
|
| 197 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921–2929, 2016a.
|
| 198 |
+
|
| 199 |
+
Hao Zhou, Jose M Alvarez, and Fatih Porikli. Less is more: Towards compact cnns. In European Conference on Computer Vision, pp. 662–677. Springer, 2016b.
|
md/train/H1edIiA9KQ/H1edIiA9KQ.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERATING MULTIPLE OBJECTS AT SPATIALLY DISTINCT LOCATIONS
|
| 2 |
+
|
| 3 |
+
Tobias Hinz, Stefan Heinrich, Stefan Wermter Knowledge Technology, Department of Informatics, Universitat Hamburg ¨ Vogt-Koelln-Str. 30, 22527 Hamburg, Germany https://www.inf.uni-hamburg.de/en/inst/ab/wtm/ {hinz,heinrich,wermter}@informatik.uni-hamburg.de
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent improvements to Generative Adversarial Networks (GANs) have made it possible to generate realistic images in high resolution based on natural language descriptions such as image captions. However, fine-grained control of the image layout, i.e. where in the image specific objects should be located, is still difficult to achieve. We introduce a new approach which allows us to control the location of arbitrarily many objects within an image by adding an object pathway to both the generator and the discriminator. Our approach does not need a detailed semantic layout but only bounding boxes and the respective labels of the desired objects are needed. The object pathway focuses solely on the individual objects and is iteratively applied at the locations specified by the bounding boxes. The global pathway focuses on the image background and the general image layout. We perform experiments on the Multi-MNIST, CLEVR, and the more complex MSCOCO data set. Our experiments show that through the use of the object pathway we can control object locations within images and can model complex scenes with multiple objects at various locations. We further show that the object pathway focuses on the individual objects and learns features relevant for these, while the global pathway focuses on global image characteristics and the image background.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Understanding how to learn powerful representations from complex distributions is the intriguing goal behind adversarial training on image data. While recent advances have enabled us to generate high-resolution images with Generative Adversarial Networks (GANs), currently most GAN models still focus on modeling images that either contain only one centralized object (e.g. faces (CelebA), objects (ImageNet), birds (CUB-200), flowers (Oxford-102), etc.) or on images from one specific domain (e.g. LSUN bedrooms, LSUN churches, etc.). This means that, overall, the variance between images used for training GANs tends to be low (Raj et al., 2017). However, many real-life images contain multiple distinct objects at different locations within the image and with different relations to each other. This is for example visible in the MS-COCO data set (Lin et al., 2014), which consists of images of different objects at different locations within one image. In order to model images with these complex relationships, we need models that can model images containing multiple objects at distinct locations. To achieve this, we need control over what kind of objects are generated (e.g. persons, animals, objects, etc.), the location, and the size of these objects. This is a much more challenging task than generating a single object in the center of an image.
|
| 12 |
+
|
| 13 |
+
Current work (Karacan et al., 2016; Johnson et al., 2018; Hong et al., 2018b; Wang et al., 2018) often approaches this challenge by using a semantic layout as additional conditional input. While this can be successful in controlling the image layout and object placement, it also places a high burden on the generating process since a complete scene layout must be obtained first. We propose a model that does not require a full semantic layout, but instead only requires the desired object locations and identities (see Figure 1). One part of our model, called the global pathway, is responsible for generating the general layout of the complete image, while a second path, the object pathway, is used to explicitly generate the features of different objects based on the relevant object label and location.
|
| 14 |
+
|
| 15 |
+
The generator gets as input a natural language description of the scene (if existent), the locations and labels of the various objects within the scene, and a random noise vector. The global pathway uses this to create a scene layout encoding which describes high-level features and generates a global feature representation from this. The object pathway generates a feature representation of a given object at a location described by the respective bounding box and is applied iteratively over the scene at the locations specified by the individual bounding boxes. We then concatenate the feature representations of the global and the object pathway and use this to generate the final image.
|
| 16 |
+
|
| 17 |
+
The discriminator, which also consists of a global and object pathway, gets as input the image, the bounding boxes and their respective object labels, and the textual description. The global pathway is then applied to the whole image and obtains a feature representation of the global image features. In parallel, the object pathway focuses only on the areas described by the bounding boxes and the respective object labels and obtains feature representations of these specific locations. Again, the outputs of both the global and the object pathway are merged and the discriminator is trained to distinguish between real and generated images.
|
| 18 |
+
|
| 19 |
+
In contrast to previous work we do not generate a scene layout of the whole scene but only focus on relevant objects which are placed at the specified locations, while the global consistency of the image is the responsibility of the other part of our model. To summarize our model and contributions: 1) We propose a GAN model that enables us to control the layout of a scene without the use of a scene layout. 2) Through the use of an object pathway which is responsible for learning features of different object categories, we gain control over the identity and location of arbitrarily many objects within a scene. 3) The discriminator judges not only if the image is realistic and aligned to the natural language description, but also whether the specified objects are at the given locations and of the correct object category. 4) We show that the object pathway does indeed learn relevant features for the different objects, while the global pathway focuses on general image features and the background.
|
| 20 |
+
|
| 21 |
+
# 2 RELATED WORK
|
| 22 |
+
|
| 23 |
+
Having more control over the general image layout can lead to a higher quality of images (Reed et al., 2016a; Hong et al., 2018b) and is also an important requirement for semantic image manipulation (Hong et al., 2018a; Wang et al., 2018). Approaches that try to exert some control over the image layout utilize Generative Adversarial Nets (Goodfellow et al., 2014), Refinement Networks (e.g. Chen & Koltun (2017); Xu et al. (2018a)), recurrent attention-based models (e.g. Mansimov et al. (2016)), autoregressive models (e.g. Reed et al. (2016c)), and even memory networks supplying the image generation process with previously extracted image features (Zhang et al., 2018b).
|
| 24 |
+
|
| 25 |
+
One way to exert control over the image layout is by using natural language descriptions of the image, e.g. image captions, as shown by Reed et al. (2016b), Zhang et al. (2018a), Sharma et al. (2018), and $\mathrm { X u }$ et al. (2018b). However, these approaches are trained only with images and their respective captions and it is not possible to specifically control the layout or placement of specific objects within the image. Several approaches suggested using a semantic layout of the image, generated from the image caption, to gain more fine-grained control over the final image. Karacan et al. (2016), Johnson et al. (2018), and Wang et al. (2018) use a scene layout to generate images in which given objects are drawn within their specified segments based on the generated scene layout. Hong et al. (2018b) use the image caption to generate bounding boxes of specific objects within the image and predict the object’s shape within each bounding box. This is further extended by Hong et al. (2018a) by making it possible to manipulate images on a semantic level. While these approaches offer a more detailed control over the image layout they heavily rely on a semantic scene layout for the image generating process, often implying complex preprocessing steps in which the scene layout is constructed.
|
| 26 |
+
|
| 27 |
+
The two approaches most closely related to ours are by Reed et al. (2016a) and Raj et al. (2017). Raj et al. (2017) introduce a model that consists of individual “blocks” which are responsible for different object characteristics (e.g. color, shape, etc.). However, their approach was only tested on the synthetic SHAPES data set (Andreas et al., 2016), which has only comparatively low variability and no image captions. Reed et al. (2016b) condition both the generator and the discriminator on either a bounding box containing the object or keypoints describing the object’s shape. However, the used images are still of relatively low variability (e.g. birds (Wah et al., 2011)) and only contain one object, usually located in the center of the image. In contrast, we model images with several different objects at various locations and apply our object pathway multiple times at each image, both in the generator and in the discriminator. Additionally, we use the image caption and bounding box label to obtain individual labels for each bounding box, while Reed et al. (2016b) only use the image caption as conditional information.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Both the generator and the discriminator of our model consist of a global and an object pathway. The global pathway focuses on global image characteristics, such as the background, while the object pathway is responsible for modeling individual objects at their specified location.
|
| 31 |
+
|
| 32 |
+
# 3 APPROACH
|
| 33 |
+
|
| 34 |
+
For our approach1, the central goal is to generate objects at arbitrary locations within a scene while keeping the scene overall consistent. For this we make use of a generative adversarial network (GAN) (Goodfellow et al., 2014). A GAN consists of two networks, a generator and a discriminator, where the generator tries to reproduce the true data distribution and the discriminator tries to distinguish between generated data points and data points sampled from the true distribution. We use the conditional GAN framework, in which both the generator and the discriminator get additional information, such as labels, as input. The generator $G$ (see Figure 1) gets as input a randomly sampled noise vector $z$ the location and size of the individual bounding boxes $b b o x _ { i }$ , a label for each of the bounding boxes encoded as a one-hot vector $l _ { \mathrm { o n e h o t } _ { i } }$ , and, if existent, an image caption embedding $\varphi$ obtained with a pretrained char-CNN-RNN network from Reed et al. (2016b). As a pre-processing step (A), the generator constructs labels $l a b e l _ { i }$ for the individual bounding boxes from the image caption $\varphi$ and the provided labels $l _ { \mathrm { o n e h o t } _ { i } }$ of each bounding box. For this, we concatenate the image caption embedding $\varphi$ and the one-hot vector of a given bounding box $l _ { \mathrm { o n e h o t } _ { i } }$ and create a new label embedding $l a b e l _ { i }$ by applying a matrix-multiplication followed by a non-linearity (i.e. a fully connected layer). The resulting label $l a b e l _ { i }$ contains the previous label as well as additional information from the image caption, such as color or shape, and is potentially more meaningful. In case of missing image captions, we use the one-hot embedding $l _ { \mathrm { o n e h o t } _ { i } }$ only.
|
| 35 |
+
|
| 36 |
+
The generator consists of two different streams which get combined later in the process. First, the global pathway (B) is responsible for creating a general layout of the global scene. It processes the previously generated local labels $l a b e l _ { i }$ for each of the bounding boxes and replicates them spatially at the location of each bounding box. In areas where the bounding boxes overlap the label embeddings $l a b e l _ { i }$ are summed up, while the areas with no bounding boxes remain filled with zeros. Convolutional layers are applied to this layout to obtain a high-level layout encoding which is concatenated with the noise vector $z$ and the image caption embedding $\varphi$ and the result is used to generate a general image layout $f _ { \mathrm { g l o b a l } }$ .
|
| 37 |
+
|
| 38 |
+
Second, the object pathway (C) is responsible for generating features of the objects $f _ { \mathrm { l o c a l } _ { i } }$ within the given bounding boxes. This pathway creates a feature map of a predefined resolution using convolutional layers which receive the previously generated label $l a b e l _ { i }$ as input. This feature map is further transformed with a Spatial Transformer Network (STN) (Jaderberg et al., 2015) to fit into the bounding box at the given location on an empty canvas. The same convolutional layers are applied to each of the provided labels, i.e. we have one object pathway that is applied several times across different labels $l a b e l _ { i }$ and whose output feeds onto the corresponding coordinates on the empty canvas. Again, features within overlapping bounding box areas are summed up, while areas outside of any bounding box remain zero.
|
| 39 |
+
|
| 40 |
+
As a final step, the outputs of the global and object pathways $f _ { \mathrm { g l o b a l } }$ and $f _ { \mathrm { l o c a l } _ { i } }$ are concatenated along the channel axis and are used to generate the image in the final resolution, using common GAN procedures. The specific changes of the generator compared to standard architectures are the object pathway that generates additional features at specific locations based on provided labels, as well as the layout encoding which is used as additional input to the global pathway. These two extensions can be added to the generator in any existing architecture with limited extra effort.
|
| 41 |
+
|
| 42 |
+
The discriminator receives as input an image (either original or generated), the location and size of the bounding boxes $b b o x _ { i }$ , the labels for the bounding boxes as one-hot vectors $l _ { \mathrm { o n e h o t } _ { i } }$ , and, if existent, the image caption embedding $\varphi$ . Similarly to the generator, the discriminator also possesses both a global (D) and an object (E) pathway respectively. The global pathway takes the image and applies multiple convolutional layers to obtain a representation $f _ { \mathrm { g l o b a l } }$ of the whole image. The object pathway first uses a STN to extract the objects from within the given bounding boxes and then concatenates these extracted features with the spatially replicated bounding box label $l _ { \mathrm { o n e h o t } _ { i } }$ Next, convolutional layers are applied and the resulting features $f _ { \mathrm { l o c a l } _ { i } }$ are again added onto an empty canvas within the coordinates specified by the bounding box. Note, similarly to the generator we only use one object pathway that is applied to multiple image locations, where the outputs are then added onto the empty canvas, summing up overlapping parts and keeping areas outside of the bounding boxes set to zero. Finally, the outputs of both the object and global pathways $f _ { \mathrm { l o c a l } _ { i } }$ and $f _ { \mathrm { g l o b a l } }$ are concatenated along the channel axis and we again apply convolutional layers to obtain a merged feature representation. At this point, the features are concatenated either with the spatially replicated image caption embedding $\varphi$ (if existent) or the sum of all one-hot vectors $l _ { \mathrm { o n e h o t } _ { i } }$ along the channel axis, one more convolutional layer is applied, and the output is classified as either generated or real.
|
| 43 |
+
|
| 44 |
+
For the general training, we can utilize the same procedure that is used in the GAN architecture that is modified with our proposed approach. In our work we mostly use the StackGAN (Zhang et al., 2018a) and AttnGAN (Xu et al., 2018b) frameworks which use a modified objective function taking into consideration the additional conditional information and provided image captions. As such, our discriminator $D$ and our generator $G$ optimize the following objective function:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\operatorname* { m i n } _ { G } \operatorname* { m a x } _ { D } V ( D , G ) = \mathbb { E } _ { ( x , c ) \sim p _ { \mathrm { d a t a } } } [ l o g D ( x , c ) ] + \mathbb { E } _ { ( z ) \sim p _ { z } , ( c ) \sim p _ { \mathrm { d a t a } } } [ l o g ( 1 - D ( G ( z , c ) , c ) ) ] ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $x$ is an image, $c$ is the conditional information for this image (e.g. $l a b e l _ { i }$ , bounding boxes $b b o x _ { i }$ , or an image caption $\varphi$ ), $z$ is a randomly sampled noise vector used as input for $G$ , and $p _ { \mathrm { d a t a } }$ is the true data distribution. Zhang et al. (2018a) and others use an additional technique called conditioning augmentation for the image captions which helps improve the training process and the quality of the generated images. In the experiments in which we use image captions (MS-COCO) we also make use of this technique2.
|
| 51 |
+
|
| 52 |
+
# 4 EVALUATION AND ANALYSIS
|
| 53 |
+
|
| 54 |
+
For the evaluation, we aim to study the quality of the generated images with a particular focus on the generalization capabilities and the contribution of specific parts of our model, in both controllable and large-scale cases. Thus, in the following sections, we evaluate our approach on three different data sets: the Multi-MNIST data set, the CLEVR data set, and the MS-COCO data set.
|
| 55 |
+
|
| 56 |
+
# 4.1 MULTI-MNIST
|
| 57 |
+
|
| 58 |
+
In our first experiment, we used the Multi-MNIST data set (Eslami et al., 2016) for testing the basic functionality of our proposed model. Using the implementation provided by Eslami et al. (2016), we created 50,000 images of resolution $6 4 \times 6 4$ px that contain exactly three normal-sized MNIST digits in non-overlapping locations on a black background.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Multi-MNIST images generated by the model. Training included only images with three individual normal-sized digits. Highlighted bounding boxes and yellow ground truth for visualization.
|
| 62 |
+
|
| 63 |
+
As a first step, we tested whether our model can learn to generate digits at the specified locations and whether we can control the digit identity, the generated digit’s size, and the number of generated digits per image. According to the results, we can control the location of individual digits, their identity, and their size, even though all training images contain exactly three digits in normal size. Figure 2 shows that we can control how many digits are generated within an image (rows A–B, for two to five digits) and various sizes of the bounding box (row C). As a second step, we created an additional Multi-MNIST data set in which all training images contain only digits 0–4 in the top half and only digits 5–9 in the bottom half of the image. For testing digits in the opposite half, we can see that the model is indeed capable of generalizing the position (row D, left), i.e. it can generate digits 0–4 in the bottom half of the image and digits 5–9 in the top half of the image. Nevertheless, we also observed that this does not always work perfectly, as the network sometimes alters digits towards the ones it has seen during training at the respective locations, e.g. producing a “4” more similar to a “9” if in bottom half of the image, or generating a “7” more similar to a “1” if in top half of the image.
|
| 64 |
+
|
| 65 |
+
As a next step, we created a Multi-MNIST data set with images that only contain digits in the top half of the image, while the bottom half is always empty. We can see (Figure 2, row D, right) that the resulting model is not able to generate digits in the bottom half of the image (see Figure 6 in the Appendix for more details on this). Controlling for the location still works, i.e. bounding boxes are filled with “something”, but the digit identity is not clearly recognizable. Thus, the model is able to control both the object identity and the object location within an image and can generalize to novel object locations to some extent.
|
| 66 |
+
|
| 67 |
+
To test the impact of our model extensions, i.e. the object pathway in both the generator and the discriminator as well as the layout encoding, we performed ablation studies on the previously created Multi-MNIST data set with three digits at random locations. We first disabled the use of the layout encoding in the generator and left the rest of the model unchanged. In the results (Figure 2, row E, left), we can see that, overall, both the digit identity and the digit locations are still correct, but minor imperfections can be observed within various images. This is most likely due to the fact that the global pathway of the generator has no information about the digit identity and location until its features get merged with the object pathway. As a next test, we disabled the object pathway of the discriminator and left the rest of the model unmodified. Again, we see (row E, right) that we can still control the digit location, although, again, minor imperfections are visible. More strikingly, we have a noticeably higher error rate in the digit identity, i.e. the wrong digit is generated at a given location, most likely due to the fact that there is not object pathway in the discriminator controlling the object identity at the various locations. In comparison, the imperfections are different when only the object pathway of the generator is disabled (row F, left). The layout encoding and the feedback of the discriminator seem to be enough to still produce the digits in the correct image location, but the digit identity is often incorrect or not recognizable at all. Finally, we tested disabling the object pathway in both the discriminator and the generator (see row F, right). This leads to a loss of control of both image location as well as identity and sometimes even results in images with more or fewer than three digits per image. This shows that only the layout encoding, without any of the object pathways, is not enough to control the digit identity and location. Overall, these results indicate that we do indeed need both the layout encoding, for a better integration of the global and object pathways, and the object pathways in both the discriminator and the generator, for optimal results.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: Images from the CLEVR data set. The left image of each pair shows the rendered image according to specific attributes. The right image of each pair is the image generated by our model.
|
| 71 |
+
|
| 72 |
+
# 4.2 CLEVR
|
| 73 |
+
|
| 74 |
+
In our second experiment we used more complex images containing multiple objects of different colors and shapes. The goal of this experiment was to evaluate the generalization ability of our object pathway across different object characteristics. For this, we performed tests similar to (Raj et al., 2017), albeit on the more complex CLEVR data set (Johnson et al., 2017). In the CLEVR data set objects are characterized by multiple properties, in our case the shape, the color, and the size. Based on the implementation provided by Johnson et al. (2017), we rendered 25,000 images with a resolution of $6 4 \times 6 4$ pixels containing $2 - 4$ objects per image. The label for a given bounding box of an object is the object shape and color (both encoded as one-hot encoding and then concatenated), while the object size is specified through the height and width of the bounding box.
|
| 75 |
+
|
| 76 |
+
Similar to the first experiment, we tested our model for controlling the object characteristics, size, and location. In the first row of Figure 3 we present the results of the trained model, where the left image of each pair shows the originally rendered one, while the right image was generated by our model. We can confirm that the model can control both the location and the objects’ shape and color characteristics. The model can also generate images containing an arbitrary number of objects (forth and fifths pair), even though a maximum of four objects per image was seen during training.
|
| 77 |
+
|
| 78 |
+
The CLEVR data set offers a split specifically intended to test the generalization capability of a model, in which cylinders can be either red, green, purple, or cyan and cubes can be either gray, blue, brown, or yellow during training, while spheres can have any of these colors. During testing, the colors between cylinders and cubes are reversed. Based on these restrictions, we created a second data set of 25,000 training images for testing our model. Results of the test are shown in the second row of Figure 3 (again, left image of each pair shows the originally rendered one, while the right image was generated by our model). We can see that the color transfer to novel shape-color combinations takes place, but, similarly to the Multi-MNIST results, we can see some artifacts, where e.g. some cubes look a bit more like cylinders and vice versa. Overall, the CLEVR experiment confirms the indication that our model can control object characteristics (provided through labels) and object locations (provided through bounding boxes) and can generalize to novel object locations, novel amounts of objects per image, and novel object characteristic combinations within reasonable boundaries.
|
| 79 |
+
|
| 80 |
+
<table><tr><td>Model</td><td>Resolution</td><td>IS个</td><td>FID↓</td></tr><tr><td>GAN-INT-CLS Reed et al. (2016b) StackGAN-V2 Zhang et al. (2018a) StackGAN Zhang et al. (2018a) PPGN Nguyen et al. (2017) ChatPainter (StackGAN) Sharma et al. (2018) Semantic Layout Hong et al. (2018b) HDGan Zhang et al. (2018c)</td><td>64× 64 256 ×256 256× 256 227× 227 256× 256 128×128 256× 256</td><td>7.88 ±0.07 8.30± 0.10 8.45 ± 0.031 9.58 ± 0.21 9.74 ± 0.02 11.46 ± 0.09²</td><td>60.62 81.59 74.05</td></tr><tr><td>AttnGAN Xu et al. (2018b) StackGAN + Object Pathways (Ours)5 AttnGAN + Object Pathways (Ours)</td><td>256× 256 256×256 256 ×256</td><td>11.86 ± 0.18 23.61±0.214 12.12 ± 0.31 24.76 ± 0.43</td><td>71.27 ± 0.123 33.10 ± 0.113 55.30 ± 1.78 33.35 ± 1.15</td></tr></table>
|
| 81 |
+
|
| 82 |
+
1 Recently updated to $1 0 . 6 2 \pm 0 . 1 9$ in its source code. 2 When using the ground truth bounding boxes at test time (as we do) the IS increases to $1 1 . 9 4 \pm 0 . 0 9$ . 3 FID score was calculated with samples generated with the pretrained model provided by the authors. 4 The authors report a “best” value of $2 5 . 8 9 \pm 0 . 4 7$ , but when calculating the IS with the pretrained model provided by the authors we only obtain an IS of 23.61. Other researchers on the authors’ Github website report a similar value for the pretrained model. 5 We use the updated source code (IS of 10.62) as our baseline model.
|
| 83 |
+
|
| 84 |
+
Table 1: Comparison of the Inception Score (IS) and Frechet Inception Distance (FID) on the MS- ´ COCO data set for different models. Note: the IS and FID values of our models are not necessarily directly comparable to the other models, since our model gets at test time, in addition to the image caption, up to three bounding boxes and their respective object labels as input.
|
| 85 |
+
|
| 86 |
+
# 4.3 MS-COCO
|
| 87 |
+
|
| 88 |
+
For our final experiment, we used the MS-COCO data set (Lin et al., 2014) to evaluate our model on natural images of complex scenes. In order to keep our evaluation comparable to previous work, we used the 2014 train/test split consisting of roughly 80,000 training and 40,000 test images and rescaled the images to a resolution of $2 5 6 \times 2 5 6 \ : \mathrm { p x }$ . At train-time, we used the bounding boxes and object labels of the three largest objects within an image, i.e. we used zero to three bounding boxes per image. Similarly to work by Johnson et al. (2018) we only considered objects that cover at least $2 \%$ of the image for the bounding boxes. To evaluate our results quantitatively, we computed both the Inception Score (IS, larger is better), which tries to evaluate how recognizable and diverse objects within images are (Salimans et al., 2016), as well as the Frechet Inception Distance (FID, smaller is ´ better), which compares the statistics of generated images with real images (Heusel et al., 2017). As a qualitative evaluation, we generated images that contain more than one object, and checked, whether the bounding boxes can control the object placement. We tested our approach with two commonly used architectures for text-to-image synthesis, namely the StackGAN (Zhang et al., 2017) and the AttnGAN (Xu et al., 2018b), and compared the images generated by these and our models.
|
| 89 |
+
|
| 90 |
+
In the StackGAN, the training process is divided into two steps: first, it learns a generator for images with a resolution of $6 4 \times 6 4$ px based on the image captions, and second, it trains a second generator, which uses the smaller images $( 6 4 \times 6 4 \ : \mathrm { p x } )$ from the first generator and the image caption as input to generate images with a resolution of $2 5 6 \times 2 5 6$ px. Here, we added the object pathways and the layout encoding at the beginning of both the first generator and the second generator and used the object pathway in both discriminators. The other parts of StackGAN architecture and all hyperparameters remain the same as in the original training procedure for the MS-COCO data set. We trained the model three times from scratch and randomly sampled 3 times 30,000 image captions from the test set for each model. We then calculated the IS and FID values on each of the nine samples of 30,000 generated images and report the averaged values. As presented in Table 1, our StackGAN with added object pathways outperforms the original StackGAN both on the IS and the FID, increasing the IS from 10.62 to 12.12 and decreasing the FID from 74.05 to 55.30. Note, however, that this might also be due to the additional information our model is provided with as it receives up to three bounding boxes and respective bounding box labels per image in addition to the image caption.
|
| 91 |
+
|
| 92 |
+
We also extended the AttnGAN by Xu et al. (2018b), the current state-of-the-art model on the MS-COCO data set (based on the Inception Score), with our object pathway to evaluate its impact on a different model. As opposed to the StackGAN, the AttnGAN consists of only one model which is trained end-to-end on the image captions by making use of multiple, intermediate, discriminators. Three discriminators judge the output of the generator at an image resolution of $6 4 \times 6 4$ , $1 2 8 \times 1 2 8$ , and $2 5 6 \times 2 5 6 \ : \mathrm { p x }$ . Through this, the image generation process is guided at multiple levels, which helps during the training process. Additionally, the AttnGAN implements an attention technique through which the networks focus on specific areas of the image for specific words in the image caption and adds an additional loss that checks if the image depicts the content as described by the image caption. There, in the same way as for the StackGAN, we added our object pathway at the beginning of the generator as well as to the discriminator that judges the generator outputs at a resolution of $6 4 \times 6 4 \mathrm { p x }$ . All other discriminators, the higher layers of the generator, and all other hyperparameters and training details stay unchanged. Table 1 shows that adding the object pathway to the AttnGAN increases the IS of our baseline model (the pretrained model provided by the authors) from 23.61 to 24.76, while the FID is roughly the same as for the baseline model.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: Examples of images generated from the given caption from the MS-COCO data set. A) shows the original images and the respective image captions, $B$ ) shows images generated by our StackGAN $\mathrm { + O P }$ (with the corresponding bounding boxes for visualization), and $C _ { \cdot }$ ) shows images generated by the original StackGAN (Zhang et al., 2017)3
|
| 96 |
+
|
| 97 |
+
To evaluate whether the StackGAN model equipped with an object pathway $\mathrm { \ S t a c k G A N + O P }$ ) actually generates objects at the given positions we generated images that contain multiple objects and inspected them visually. Figure 4 shows some example images, more results can be seen in the Appendix in Figures 7 and 9. We can observe that the $\mathrm { S t a c k G A N + O P }$ indeed generates images in which the objects are at appropriate locations. In order to more closely inspect our global and object pathways, we can also disable them during the image generation process. Figure 5 shows additional examples, in which we generate the same image with either the global or the object pathway disabled during the generation process. Row C of Figure 5 shows images in which the object pathway was disabled and, indeed, we observe that the images contain mostly background information and objects at the location of the bounding boxes are either not present or of much less detail than when the object pathway is enabled. Conversely, row D of Figure 5 shows images which were generated when the global pathway was disabled. As expected, areas outside of the bounding boxes are empty, but we also observe that the bounding boxes indeed contain images that resemble the appropriate objects. These results indicate, as in the previous experiments, that the global pathway does indeed model holistic image features, while the object pathway focuses on specific, individual objects.
|
| 98 |
+
|
| 99 |
+
When we add the object pathway to the AttnGAN $\mathrm { \Delta A t t n G A N + O P ) }$ we can observe similar results4. Again, we are able to control the location and identity of objects through the object pathway, however, we observe that the AttnGAN+OP, as well as the AttnGAN in general, tends to place objects corresponding to specific features at many locations throughout the image. For example, if the caption contains the word “traffic light” the AttnGAN tends to place objects similar to traffic lights throughout the whole image. Since our model only focuses on generating objects at given locations, while not enforcing that these objects only occur at these locations, this behavior leads to the result that the AttnGAN+OP generates desired objects at the desired locations, but might also place the same object at other locations within the image. Note, however, that we only added the object pathway to the lowest generator and discriminator and that we might gain even more control over the object location by introducing object pathways to the higher generators and discriminators, too.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 5: Examples of images generated from the given caption from the MS-COCO data set. A) shows the original images and the respective image captions, $B$ ) shows images generated by our $\mathrm { S t a c k G A N + O P }$ (with the corresponding bounding boxes for visualization) with the object pathway enabled, $C _ { \epsilon }$ ) shows images generated by the our StackGAN $\mathrm { + O P }$ when the object pathway is disabled, and $D$ ) shows images generated by the our StackGAN $\mathrm { + O P }$ when the global pathway is disabled.
|
| 103 |
+
|
| 104 |
+
In order to further evaluate the quality of the generations, we ran an object detection test on the generated images using a pretrained YOLOv3 network (Redmon & Farhadi, 2018). Here, the goal is to measure how often an object detection framework, which was trained on MS-COSO as well, can detect a specified object at a specified location5. The results confirm the previously made observations: For both the StackGAN and the AttnGAN the object pathway seems to improve the image quality, since YOLOv3 detects a given object more often correctly when the images are generated with an object pathway as opposed to images generated with the baseline models. The StackGAN generates objects at the given bounding box, resulting in an Intersection over Union (IoU) of greater than 0.3 for all tested labels and greater than 0.5 for $8 6 . 7 \%$ of the tested labels. In contrast, the AttnGAN tends to place salient object features throughout the image, which leads to an even higher detection rate by the YOLOv3 network, but a smaller average IoU (only $5 3 . 3 \%$ of the labels achieve an IoU greater than 0.3). Overall, our experiments on the MS-COCO data set indicate that it is possible to add our object pathway to pre-existing GAN models without having to change the overall model architecture or training process. Adding the object pathway provides us with more control over the image generation process and can, in some cases, increase the quality of the generated images as measured via the IS or FID.
|
| 105 |
+
|
| 106 |
+
# 4.4 DISCUSSION
|
| 107 |
+
|
| 108 |
+
Our experiments indicate that we do indeed get additional control over the image generation process through the introduction of object pathways in GANs. This enables us to control the identity and location of multiple objects within a given image based on bounding boxes and thereby facilitates the generation of more complex scenes. We further find that the division of work on a global and object pathway seems to improve the image quality both subjectively and based on quantitative metrics such as the Inception Score and the Frechet Inception Distance. ´
|
| 109 |
+
|
| 110 |
+
The results further indicate that the focus on global image statistics by the global pathway and the more fine-grained attention to detail of specific objects by the object pathway works well. This is visualized for example in rows C and D of Figure 5. The global pathway (row C) generates features for the general image layout and background but does not provide sufficient details for individual objects. The object pathway (row D), on the other hand, focuses entirely on the individual objects and generates features specifically for a given object at a given location. While this is the desired behavior of our model it can also lead to sub-optimal images if there are not bounding boxes for objects that should be present within the image. This can often be the case if the foreground object is too small (in our case less than $2 \%$ of the total image) and is therefore not specifically labeled. In this case, the objects are sometimes not modeled in the image at all, despite being prominent in the respective image caption, since the object pathway does not generate any features. We can observe this, for example, in images described as “many sheep are standing on the grass”, where the individual sheep are too small to warrant a bounding box. In this case, our model will often only generate an image depicting grass and other background details, while not containing any sheep at all.
|
| 111 |
+
|
| 112 |
+
Another weakness is that bounding boxes that overlap too much (empirically an overlap of more than roughly $30 \%$ ) also often lead to sub-optimal objects at that location. Especially in the overlapping section of bounding boxes we often observe local inconsistencies or failures. This might be the result of our merging of the different features within the object pathway since they are simply added to each other at overlapping areas. A more sophisticated merging procedure could potentially alleviate this problem.Another approach would be to additionally enhance the bounding box layout by predicting the specific object shape within each bounding box, as done for example by Hong et al. (2018b).
|
| 113 |
+
|
| 114 |
+
Finally, currently our model does not generate the bounding boxes and labels automatically. Instead, they have to be provided at test time which somewhat limits the usability for unsupervised image generation. However, even when using ground truth bounding boxes, our models still outperform other current approaches that are tested with ground truth bounding boxes (e.g. Hong et al. (2018b)) based on the IS and FID. This is even without the additional need of learning to specify the shape within each bounding box as done by Hong et al. (2018b). In the future, this limitation can be avoided by extracting the relevant bounding boxes and labels directly from the image caption, as it is done for example by Hong et al. (2018b), Xu et al. (2018a), and Tan et al. (2018).
|
| 115 |
+
|
| 116 |
+
# 5 CONCLUSION
|
| 117 |
+
|
| 118 |
+
With the goal of understanding how to gain more control over the image generation process in GANs, we introduced the concept of an additional object pathway. Such a mechanism for differentiating between a scene representation and object representations allows us to control the identity, location, and size of arbitrarily many objects within an image, as long as the objects do not overlap too strongly. In parallel, a global pathway, similar to a standard GAN, focuses on the general scene layout and generates holistic image features. The object pathway, on the other hand, gets as input an object label and uses this to generate features specifically for this object which are then placed at the location given by a bounding box The object pathway is applied iteratively for each object at each given location and as such, we obtain a representation of individual objects at individual locations and of the general image layout (background, etc.) as a whole. The features generated by the object and global pathway are then concatenated and are used to generate the final image output. Our tests on synthetic and real-world data sets suggest that the object pathway is an extension that can be added to common GAN architectures without much change to the original architecture and can, along with more fine-grained control over the image layout, also lead to better image quality.
|
| 119 |
+
|
| 120 |
+
# ACKNOWLEDGMENTS
|
| 121 |
+
|
| 122 |
+
The authors gratefully acknowledge partial support from the German Research Foundation DFG under project CML (TRR 169) and the European Union under project SECURE (No 642667). We also thank the NVIDIA Corporation for their support through the GPU Grant Program.
|
| 123 |
+
|
| 124 |
+
# REFERENCES
|
| 125 |
+
|
| 126 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 39–48, 2016.
|
| 127 |
+
|
| 128 |
+
Qifeng Chen and Vladlen Koltun. Photographic image synthesis with cascaded refinement networks. In IEEE International Conference on Computer Vision, pp. 1520–1529, 2017.
|
| 129 |
+
|
| 130 |
+
S. M. Ali Eslami, Nicolas Heess, Theophane Weber, Yuval Tassa, David Szepesvari, koray kavukcuoglu, and Geoffrey E Hinton. Attend, infer, repeat: Fast scene understanding with generative models. In Advances in Neural Information Processing Systems, pp. 3225–3233, 2016.
|
| 131 |
+
|
| 132 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2672–2680, 2014.
|
| 133 |
+
|
| 134 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 135 |
+
|
| 136 |
+
Seunghoon Hong, Xinchen Yan, Thomas Huang, and Honglak Lee. Learning hierarchical semantic image manipulation through structured representations. In Advances in Neural Information Processing Systems, pp. 2712–2722, 2018a.
|
| 137 |
+
|
| 138 |
+
Seunghoon Hong, Dingdong Yang, Jongwook Choi, and Honglak Lee. Inferring semantic layout for hierarchical text-to-image synthesis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7986–7994, 2018b.
|
| 139 |
+
|
| 140 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in Neural Information Processing Systems, pp. 2017–2025, 2015.
|
| 141 |
+
|
| 142 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1988–1997, 2017.
|
| 143 |
+
|
| 144 |
+
Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1219–1228, 2018.
|
| 145 |
+
|
| 146 |
+
Levent Karacan, Zeynep Akata, Aykut Erdem, and Erkut Erdem. Learning to generate images of outdoor scenes from attributes and semantic layouts. arXiv preprint arXiv:1612.00215, 2016.
|
| 147 |
+
|
| 148 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ European Conference on Computer Vision, pp. 740–755, 2014.
|
| 149 |
+
|
| 150 |
+
Elman Mansimov, Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Generating images from captions with attention. In International Conference on Learning Representations, 2016.
|
| 151 |
+
|
| 152 |
+
Anh Nguyen, Yoshua Bengio, and Alexey Dosovitskiy. Plug & play generative networks: Conditional iterative generation of images in latent space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4467–4477, 2017.
|
| 153 |
+
|
| 154 |
+
Amit Raj, Cusuh Ham, Huda Alamri, Vincent Cartillier, Stefan Lee, and James Hays. Compositional generation of images. In Advances in Neural Information Processing Systems ViGIL, 2017.
|
| 155 |
+
|
| 156 |
+
Joseph Redmon and Ali Farhadi. Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767, 2018.
|
| 157 |
+
|
| 158 |
+
Scott Reed, Zeynep Akata, Santosh Mohan, Samuel Tenka, Bernt Schiele, and Honglak Lee. Learning what and where to draw. In Advances in Neural Information Processing Systems, pp. 217–225, 2016a.
|
| 159 |
+
|
| 160 |
+
Scott Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In International Conference on Machine Learning, pp. 1060–1069, 2016b.
|
| 161 |
+
|
| 162 |
+
Scott Reed, Aaron van den Oord, Nal Kalchbrenner, Victor Bapst, Matt Botvinick, and Nando ¨ de Freitas. Generating interpretable images with controllable structure. 2016c.
|
| 163 |
+
|
| 164 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016.
|
| 165 |
+
|
| 166 |
+
Shikhar Sharma, Dendi Suhubdy, Vincent Michalski, Samira Ebrahimi Kahou, and Yoshua Bengio. Chatpainter: Improving text to image generation using dialogue. In International Conference on Learning Representations Workshop, 2018.
|
| 167 |
+
|
| 168 |
+
Fuwen Tan, Song Feng, and Vicente Ordonez. Text2scene: Generating abstract scenes from textual descriptions. arXiv preprint arXiv:1809.01110, 2018.
|
| 169 |
+
|
| 170 |
+
Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
|
| 171 |
+
|
| 172 |
+
Ting-Chun Wang, Ming-Yu Liu, Jun-Yan Zhu, Andrew Tao, Jan Kautz, and Bryan Catanzaro. Highresolution image synthesis and semantic manipulation with conditional gans. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8798–8807, 2018.
|
| 173 |
+
|
| 174 |
+
Kun Xu, Haoyu Liang, Jun Zhu, Hang Su, and Bo Zhang. Deep structured generative models. In ICML Workshop on Theoretical Foundations and Applications of Deep Generative Models, 2018a.
|
| 175 |
+
|
| 176 |
+
Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018b.
|
| 177 |
+
|
| 178 |
+
Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaolei Huang, Xiaogang Wang, and Dimitris Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In IEEE International Conference on Computer Vision, pp. 5907–5915, 2017.
|
| 179 |
+
|
| 180 |
+
Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, and Dimitris Metaxas. Stackgan $^ { + + }$ : Realistic image synthesis with stacked generative adversarial networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, pp. 1–16, 2018a.
|
| 181 |
+
|
| 182 |
+
Shengyu Zhang, Hao Dong, Wei Hu, Yike Guo, Chao Wu, Di Xie, and Fei Wu. Text-to-image synthesis via visual-memory creative adversarial network. In Pacific Rim Conference on Multimedia, pp. 417–427, 2018b.
|
| 183 |
+
|
| 184 |
+
Zizhao Zhang, Yuanpu Xie, and Lin Yang. Photographic text-to-image synthesis with a hierarchicallynested adversarial network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6199–6208, 2018c.
|
| 185 |
+
|
| 186 |
+
# A IMPLEMENTATION DETAILS
|
| 187 |
+
|
| 188 |
+
Here we provide some more details about the exact implementation of our experiments.
|
| 189 |
+
|
| 190 |
+
# A.1 MULTI-MNIST AND CLEVR
|
| 191 |
+
|
| 192 |
+
To train our GAN approach on the Multi-MNIST (CLEVR) data set we use the Stage-I Generator and Discriminator from the StackGAN MS-COCO architecture6. In our following description an upsample block describes the following sequence: nearest neighbor upsampling with factor 2, a convolutional layer with $X$ filters (filter size $3 \times 3$ , stride 1, padding 1), batch normalization, and a ReLU activation. The bounding box labels are one-hot vectors of size [1, 10] encoding the digit identity (CLEVR: [1, 13] encoding object shape and color). Please refer to Table 2 for detailed information on the individual layers described in the following. For all leaky ReLU activations alpha was set to 0.2.
|
| 193 |
+
|
| 194 |
+
In the object pathway of the generator we first create a zero tensor $\mathbb { O } _ { G }$ which will contain the feature representations of the individual objects. We then spatially replicate each bounding box label into a $4 \times 4$ layout of shape $( 1 0 , 4 , 4 )$ (CLEVR: $( 1 3 , 4 , 4 ) ,$ ) and apply two upsampling blocks. The resulting tensor is then added to the tensor $\mathbb { O } _ { G }$ at the location of the bounding box using a spatial transformer network.
|
| 195 |
+
|
| 196 |
+
In the global pathway of the generator we first obtain the layout encoding. For this we create a tensor of shape (10, 16, 16) (CLEVR: (13, 16, 16)) that contains the one-hot labels at the location of the bounding boxes and is zero everywhere else. We then apply three convolutional layers, each followed by batch normalization and a leaky ReLU activation. We reshape the output to shape $( 1 , 6 4 )$ and concatenate it with the noise tensor of shape $( 1 , 1 0 0 )$ (sampled from a random normal distribution) to form a tensor of shape $( 1 , 1 6 4 )$ . This tensor is then fed into a dense layer, followed by batch normalization and a ReLU activation and the output is reshaped to $( - 1 , 4 , 4 )$ . We then apply two upsampling blocks to obtain a tensor of shape $( - 1 , 1 6 , 1 6 )$ .
|
| 197 |
+
|
| 198 |
+
At this point, the outputs of the object and the global pathway are concatenated along the channel axis to form a tensor of shape $( - 1 , 1 6 , 1 6 )$ . We then apply another two upsampling blocks resulting in a tensor of shape $( - 1 , 6 4 , 6 \dot { 4 } )$ followed by a convolutional layer and a TanH activation to obtain the final image of shape $( - 1 , 6 4 , 6 4 )$ .
|
| 199 |
+
|
| 200 |
+
In the object pathway of the discriminator we first create a zero tensor $\mathbb { O } _ { D }$ which will contain the feature representations of the individual objects. We then use a spatial transfomer network to extract the image features at the locations of the bounding boxes and reshape them to a tensor of shape $( 1 , 1 6 , 1 6 )$ (CLEVR: $( 3 , 1 6 , 1 6 ) _ { \cdot }$ ). The one-hot label of each bounding box are spatially replicated to a shape of (10, 16, 16) (CLEVR: (13, 16, 16)) and concatenated with the previously extracted features to form a tensor of shape (11, 16, 16) (CLEVR: (16, 16, 16)). We then apply a convolutional layer, batch normalization and a leaky ReLU activation to the concatenation of features and label and, again, use a spatial transformer network to resize the output to the shape of the respective bounding box before adding it to the tensor $\mathbb { O } _ { D }$ .
|
| 201 |
+
|
| 202 |
+
In the global pathway of the discriminator, we apply two convolutional layers, each followed by batch normalization and a leaky ReLU activation and concatenate the resulting tensor with the output of the object pathway. After this, we again apply two convolutional layers, each followed by batch normalization and a leaky ReLU activation. We concatenate the resulting tensor with the conditioning information about the image content, in this case, the sum of all one-hot vectors. To this tensor we apply another convolutional layer, batch normalization, a leaky ReLU activation, and another convolutional layer, to obtain the final output of the discriminator of shape (1).
|
| 203 |
+
|
| 204 |
+
Similarly to the procedure of StackGAN and other conditional GANs we train the discriminator to classify real images with correct labels (the sum of one-hot vectors supplied in the last step of the process) as real, while generated images with correct labels and real images with (randomly sampled) incorrect labels should be classified as fake.
|
| 205 |
+
|
| 206 |
+
# A.2 MS-COCO
|
| 207 |
+
|
| 208 |
+
StackGAN-Stage-I For training the Stage-I generator and discriminator (images of size $6 4 \times 6 4$ pixels) we follow the same procedure and architecture outlined in the previous section about the training on the Multi-MNIST and CLEVR data sets. The only difference is that we now have image captions as an additional description of the image. As such, to obtain the bounding box labels we concatenate the image caption embedding7 and the one-hot encoded bounding box label and apply a dense layer with 128 units, batch normalization, and a ReLU activation to it, to obtain a label of shape $( 1 , 1 2 8 )$ for each bounding box. In the final step of the discriminator when we concatenate the feature representation with the conditioning vector, we use the image encoding as conditioning vector and do not use any bounding box labels at this step. The rest of the training proceeds as described in the previous section, except that the bounding box labels now have a shape of $( 1 , 1 2 8 )$ . All other details can be found in Table 2.
|
| 209 |
+
|
| 210 |
+
StackGAN-Stage-II In the second part of the training, we train a second generator and discriminator to generate images with a resolution of $2 5 6 \times 2 5 6$ pixels. The generator gets as input images with a resolution of $6 4 \times 6 4$ pixels (generated by the trained Stage-I generator) and the image caption and uses them to generate images with a $2 5 6 \times 2 5 6$ pixels resolution. A new discriminator is trained to distinguish between real and generated images.
|
| 211 |
+
|
| 212 |
+
On the Stage-II generator we perform the following modifications we use the same procedure as in the Stage-I generator to obtain the bounding box labels. To obtain an image encoding from the generated $6 4 \times 6 4$ image we use three convolutional layers, each followed by batch normalization and a ReLU activation to obtain a feature representation of shape $[ - 1 , 1 6 , 1 6 ]$ . Additionally, we replicate each bounding box label (obtained with the dense layer) spatially at the locations of the bounding boxes on an empty canvas of shape [128, 16, 16] and then concatenate it along the channel axis with the image encoding and the spatially replicated image caption embedding. As in the standard StackGAN we then apply more convolutional layers with residual connections to obtain the final image embedding of shape $[ - 1 , 1 6 , 1 6 ]$ , which provides the input for both the object and the global pathway.
|
| 213 |
+
|
| 214 |
+
The generator’s object pathway gets as input the image encoding described in the previous step. First, we create a zero tensor $\mathbb { O } _ { G }$ which will contain the feature representations of the individual objects. We then use a spatial transformer network to extract the features from within the bounding box and reshapes those features to $[ - 1 , 1 6 , 1 6 ]$ . After this, we apply two upsample blocks and then use a spatial transformer network to add the features to $\mathbb { O } _ { G }$ within the bounding box region. This is done for each of the bounding boxes within the image.
|
| 215 |
+
|
| 216 |
+
The generator’s global pathway gets as input the image encoding and uses the same convolutional layers and upsampling procedures as the original StackGAN Stage-II generator. The outputs of the object and global pathway are merged at the resolution of $[ - 1 , 6 4 , 6 4 ]$ by concatenating the two outputs along the channel axis. After this, we continue using the standard StackGAN architecture to generate images of shape [3, 256, 256].
|
| 217 |
+
|
| 218 |
+
The Stage-II discriminator’s object pathway first creates a zero tensor $\mathbb { O } _ { D }$ which will contain the feature representations of the individual objects. It gets as input the image (resolution of $2 5 6 \times 2 5 6$ pixels) and we use a spatial transformer network to extract the features from the bounding box and reshape those features to a shape of [3, 32, 32]. We spatially replicate the bounding box label (one-hot encoding) to a shape of $[ - 1 , \bar { 3 2 } , 3 2 ]$ and concatenate it with the extracted features along the channel axis. This is then given to the object pathway which consists of two convolutional layers with batch normalization and a LeakyReLU activation. The output of the object pathway is again transformed to the width and height of the bounding box with a spatial transformer network and then added to $\mathbb { O } _ { D }$ This procedure is performed with each of the bounding boxes within the image (maximum of three during training).
|
| 219 |
+
|
| 220 |
+
The Stage-II discriminator’s global pathway consists of the standard StackGAN layers, i.e. it gets as input the image $( 2 5 6 \times 2 5 6$ pixels) and applies convolutional layers with stride 2 to it. The outputs of the object and global pathways are merged at the resolution of $[ - 1 , 3 2 , 3 2 ]$ by concatenating the two outputs along the channel axis We then apply more convolutional with stride 2 to decrease the resolution. After this, we continue in the same way as the original StackGAN.
|
| 221 |
+
|
| 222 |
+
AttnGAN On the AttnGAN8 we only modify the training at the lower layers of the generator and the first discriminator (working on images of $6 4 \times 6 4$ pixels resolution). For this, we perform the same modifications as described in the StackGAN-Stage-I generator and discriminator. In the generator we obtain the bounding box labels in the same way as in the StackGAN, by concatenating the image caption embedding with the respective one-hot vector and applying a dense layer with 100 units, batch normalization, and a ReLU activation to obtain a bounding box label. In contrast to the previous architectures, we follow the AttnGAN implementation in use the gated linear unit function (GLU) as standard activation for our convolutional layers in the generator.
|
| 223 |
+
|
| 224 |
+
In the generator’s object pathway we first create a zero tensor $\mathbb { O } _ { G }$ of shape (192, 16, 16) which will contain the feature representations of the individual objects. We then spatially replicate each bounding box label into a $4 \times 4$ layout of shape $( 1 0 0 , 4 , 4 )$ and apply two upsampling blocks with 768 and 384 filters (filter size $\mathrm { = 3 }$ , stride ${ \mathrm { : = } } 1$ , padding ${ = } 1$ ). The resulting tensor is then added to the tensor $\mathbb { O } _ { G }$ at the location of the bounding box using a spatial transformer network.
|
| 225 |
+
|
| 226 |
+
In the global pathway of the generator we first obtain the layout encoding in the same way as in the StackGAN-I generator, except that the three convolutional layers of the layout encoding now have 50, 25, and 12 filters respectively (filter size $\scriptstyle = 3$ , stride ${ \it \Omega } = 2 { \it \Omega }$ , padding ${ \tt = } 1$ ). We concatenate it with the noise tensor of shape $( 1 , 1 0 0 )$ (sampled from a random normal distribution) and the image caption embedding to form a tensor of shape (1, 248). This tensor is then fed into a dense layer with 24,576 units, followed by batch normalization and a ReLU activation and the output is reshaped to (768, 4, 4). We then apply two upsampling blocks with 768 and 384 filters to obtain a tensor of shape (192, 16, 16).
|
| 227 |
+
|
| 228 |
+
At this point the outputs of the object and the global pathways are concatenated along the channel axis to form a tensor of shape (384, 16, 16). We then apply another two upsampling blocks with 192 and 96 filters, resulting in a tensor of shape (48, 64, 64). This feature representation is then used by the following layers of the AttnGAN generator in the same way as detailed in the original paper and implementation.
|
| 229 |
+
|
| 230 |
+
In the object pathway of the discriminator we first create a zero tensor $\mathbb { O } _ { D }$ which will contain the feature representations of the individual objects. We then use a spatial transfomer network to extract the image features at the locations of the bounding boxes and reshape them to a tensor of shape (3, 16, 16). The one-hot label of each bounding box is spatially replicated to a shape of $( - 1 , 1 6 , 1 6 )$ and concatenated with the previously extracted features. We then apply a convolutional layer with 192 filters (filter size ${ = } 4$ , stride ${ \boldsymbol { \mathbf { \mathit { \varepsilon } } } } = 1$ , padding ${ \mathrm { = } } 1$ ), batch normalization and a leaky ReLU activation to the concatenation of features and label and, again, use a spatial transformer network to resize the output to the shape of the respective bounding box before adding it to the tensor $\mathbb { O } _ { D }$ .
|
| 231 |
+
|
| 232 |
+
In the global pathway of the discriminator we apply two convolutional layers with 96 and 192 filters (filter size ${ = } 4$ , stride ${ \it \Omega } = 2 { \it \Omega }$ , padding ${ = } 1$ ), each followed by batch normalization and a leaky ReLU activation and concatenate the resulting tensor with the output of the object pathway. After this, we again apply two convolutional layers with 384 and 768 filters (filter size ${ = } 4$ , stride ${ \boldsymbol { \mathbf { \mathit { \sigma } } } } = 2 { \boldsymbol { \mathbf { \mathit { \varepsilon } } } }$ , padding ${ \tt = } 1$ ), each followed by batch normalization and a leaky ReLU activation. We concatenate the resulting tensor with the spatially replicated image caption embedding. To this tensor we apply another convolutional layer with 768 filters (filter size $\scriptstyle = 3$ , stride ${ = } 1$ , padding ${ \boldsymbol { \mathbf { \rho } } } = 1$ ), batch normalization, a leaky ReLU activation, and another convolutional layer with one filter (filter size ${ = } 4$ , stride ${ = } 4$ , padding ${ = } 0$ ), to obtain the final output of the discriminator of shape (1). The rest of the training and all other hyperparameters and architectural values are left the same as in the original implementation.
|
| 233 |
+
|
| 234 |
+
<table><tr><td>ublisnedasaconierencepaperatiCLR2019</td><td>Multi-MNIST</td><td>CLEVR</td><td>MS-COCO-I</td><td>MS-COCO-II</td></tr><tr><td></td><td></td><td></td><td>Adam (beta1 = 0.5, betaz = 0.999)</td><td></td></tr><tr><td>Optimizer</td><td>0.0002</td><td>0.0002</td><td>0.0002</td><td>0.0002</td></tr><tr><td>Learning Rate Schedule: halve every</td><td></td><td></td><td></td><td></td></tr><tr><td>x epochs</td><td>10</td><td>20</td><td>20</td><td>20</td></tr><tr><td>Training Epochs</td><td>20</td><td>40</td><td>120</td><td>110</td></tr><tr><td>Batch Size</td><td>128</td><td>128</td><td>128</td><td>40</td></tr><tr><td>Weight Initialization</td><td>N(0,0.02)</td><td>N(0,0.02)</td><td>N(0,0.02)</td><td>N(0,0.02)</td></tr><tr><td>Z-Dim/ Img-Caption-Dim</td><td>100/10</td><td>100/13</td><td>100/128</td><td>100/128</td></tr><tr><td>Generator</td><td></td><td></td><td></td><td></td></tr><tr><td>Image Encoder</td><td></td><td></td><td></td><td></td></tr><tr><td>Conv (fs=3, s=1, p=1) Conv (fs=4, s=2, p=1)</td><td></td><td></td><td></td><td>192</td></tr><tr><td>Conv (fs=4, s=2, p=1)</td><td></td><td></td><td></td><td>384</td></tr><tr><td>Concat with image</td><td></td><td></td><td></td><td>768</td></tr><tr><td>caption and bbox labels</td><td></td><td></td><td></td><td>(1024,16,16)</td></tr><tr><td>Conv (fs=3, str=1, pad=1)</td><td></td><td></td><td></td><td>768</td></tr><tr><td>4 × Res. (fs=3,s=1,p=1)</td><td></td><td></td><td></td><td>768</td></tr><tr><td> Object Pathway</td><td></td><td></td><td></td><td></td></tr><tr><td>Og Shape</td><td>(256,16,16)</td><td>(192,16,16)</td><td>(384,16,16)</td><td>(192,64,64)</td></tr><tr><td>Upsample (fs=3, s=1, p=1)</td><td>512</td><td>384</td><td>768</td><td>384</td></tr><tr><td>Upsample (fs=3,s=1, p=1)</td><td>256</td><td>192</td><td>384</td><td>192</td></tr><tr><td>Output Shape Global Pathway</td><td>(256,16,16)</td><td>(192,16,16)</td><td>(384,16,16)</td><td>(192,64,64)</td></tr><tr><td>Layout Encoding</td><td></td><td></td><td></td><td></td></tr><tr><td>Conv (fs=3,s=2, p=1)</td><td>64</td><td>64</td><td>64</td><td></td></tr><tr><td>Conv (fs=3, s=2, p=1)</td><td>32</td><td>32</td><td>32</td><td></td></tr><tr><td>Conv (fs=3, s=2, p=1)</td><td>16</td><td>16</td><td>16</td><td></td></tr><tr><td>Dense Layer Units</td><td>16,384</td><td>12,288</td><td>24,576</td><td></td></tr><tr><td>Upsample (fs=3, s=1, p=1)</td><td>512</td><td>384</td><td>768</td><td>384</td></tr><tr><td>Upsample (fs=3,s=1, p=1)</td><td>256</td><td>192</td><td>384</td><td>192</td></tr><tr><td> Output Shape</td><td>(256,16,16)</td><td>192,16,16)</td><td>(384,16,16)</td><td>(192,64,64)</td></tr><tr><td>Concat outputs of object</td><td>(512,16,16)</td><td>(384,16,16)</td><td>(768,16,16)</td><td>(384,64,64)</td></tr><tr><td> and global pathways</td><td>128</td><td>96</td><td>192</td><td></td></tr><tr><td>Upsample (fs=3, s=1, p=1) Upsample (fs=3, s=1, p=1)</td><td>64</td><td>48</td><td>96</td><td>96 48</td></tr><tr><td>Conv (fs=3,s=1, p=1)</td><td>1</td><td>3</td><td>3</td><td>3</td></tr><tr><td>Generator Output</td><td>(1,64,64)</td><td>(3,64,64)</td><td>(3,64,64)</td><td>(3,256,256)</td></tr><tr><td>Discriminator</td><td></td><td></td><td></td><td></td></tr><tr><td> Object Pathway</td><td></td><td></td><td></td><td></td></tr><tr><td>OD Shape</td><td>(128,16,16)</td><td>(96,16,16)</td><td>(192,16,16)</td><td>(192,32,32)</td></tr><tr><td>Conv (fs=4, s=1, p=1)</td><td>128</td><td>96</td><td>192</td><td>192</td></tr><tr><td>Conv (fs=4, s=1, p=1)</td><td></td><td></td><td></td><td>192</td></tr><tr><td> Output Shape</td><td>(128,16,16)</td><td>(96,16,16)</td><td>(192,16,16)</td><td>(192,32,32)</td></tr><tr><td>Global Pathway</td><td></td><td></td><td></td><td></td></tr><tr><td>Conv (fs=4, s=2, p=1)</td><td>64</td><td>48</td><td>96</td><td>96</td></tr><tr><td>Conv (fs=4, s=2, p=1)</td><td>128</td><td>96</td><td>192</td><td>192</td></tr><tr><td>Conv (fs=4, s=2, p=1)</td><td></td><td></td><td></td><td>384</td></tr><tr><td> Output Shape</td><td>(128,16,16)</td><td>(96,16,16)</td><td>(192,16,16)</td><td>(384,32,32)</td></tr><tr><td>Concat outputs of object</td><td>(256,16,16)</td><td>(192,16,16)</td><td>(384,16,16)</td><td>(576,32,32)</td></tr><tr><td> and global pathways</td><td>256</td><td></td><td></td><td></td></tr><tr><td>Conv (fs=4, s=2, p=1) Conv (fs=4, s=2, p=1)</td><td>512</td><td>192</td><td>384 768</td><td>768</td></tr><tr><td>Conv (fs=4, s=2, p=1)</td><td></td><td>384</td><td></td><td>1,536 3,072</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Conv (fs=3, s=1,p=1)</td><td></td><td></td><td></td><td>1,536</td></tr><tr><td>Conv (fs=3, s=1,p=1)</td><td></td><td></td><td></td><td>768</td></tr><tr><td>Concat with</td><td>(522,4,4)</td><td>(397,4,4)</td><td>(896,4,4)</td><td>(896,4,4)</td></tr><tr><td>conditioning vector Conv (fs=3, s=1, p=1)</td><td>512</td><td>384</td><td>768</td><td>768</td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 2: Overview of the individual layers used in our networks to generate images of resolution $6 4 \times 6 4 / 2 5 6 \times 2 5 6$ pixels. Values in brackets $( C , H , W )$ represent the tensor’s shape. Numbers in the columns after convolutional, residual, or dense layers describe the number of filters / units in that layer. $\scriptstyle ( \mathbf { f s } = x , \mathbf { s } = y , \mathbf { p } = z )$ describes filter size, stride, and padding for that convolutional / residual layer.
|
| 237 |
+
|
| 238 |
+
# B ADDITIONAL EXAMPLES OF MULTI-MNIST RESULTS: TRAINING AND TEST SET OVER COMPLEMENTARY REGIONS
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 6: Systematic test of digits over vertically different regions. Training set included three normal-sized digits only in the top half of the image. Highlighted bounding boxes and yellow ground truth for visualization. We can see that the model fails to generate recognizable digits once their location is too far in the bottom half of the image, as this location was never observed during training.
|
| 242 |
+
|
| 243 |
+
# C ADDITIONAL EXAMPLES OF MS-COCO RESULTS: STACKGAN
|
| 244 |
+
|
| 245 |
+
Figure 7 shows results of text-to-image synthesis on the MS-COCO data set with the StackGAN architecture. Rows A show the original image and image caption, rows B show the images generated by our StackGAN $^ +$ Object Pathway and the given bounding boxes for visualization, and rows C show images generated by the original StackGAN (pretrained model obtained from https: //github.com/hanzhanggit/StackGAN-Pytorch). The last block of examples (last row) show typical failure cases of our model, where there is no bounding box for the foreground object present. As a result our model only generates the background, without the appropriate foreground object, even though the foreground object is very clearly described in the image caption. Figure 9 provides similar results but for random bounding box positions. The first six examples show images generated by our StackGAN where we changed the location and size of the respective bounding boxes. The last three examples show failure cases in which we changed the location of the bounding boxes to “unusual” locations. For the image with the child on the bike, we put the bounding box of the bike somewhere in the top half of the image and the bounding box for the child somewhere in the bottom part. Similarly, for the man sitting on a bench, we put the bench in the top and the man in the bottom half of the image. Finally, for the image depicting a pizza on a plate, we put the plate location in the top half of the image and the pizza in the bottom half.
|
| 246 |
+
|
| 247 |
+
# D ADDITIONAL EXAMPLES OF MS-COCO RESULTS: ATTNGAN
|
| 248 |
+
|
| 249 |
+
Figure 8 shows results of text-to-image synthesis on the MS-COCO data set with the AttnGAN architecture. Rows A show the original image and image caption, rows B show the images generated by our AttnGAN $^ +$ Object Pathway and the given bounding boxes for visualization, and rows C show images generated by the original AttnGAN (pretrained model obtained from https: //github.com/taoxugit/AttnGAN). The last block of examples (last row) show typical failure cases, in which the model does generate the appropriate object within the bounding box, but also places the same object at multiple other locations within the image. Similarly as for StackGAN, Figure 10 shows images generated by our AttnGAN where we randomly change the location of the various bounding boxes. Again, the last three examples show failure cases where we put the locations of the bounding boxes at “uncommon” positions. In the image depicting the sandwiches we put the location of the plate in the top half of the image, in the image with the dogs we put the dogs’ location in the top half, and in the image with the motorbike we put the human in the left half and the motorbike in the right half of the image.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 7: Additional StackGAN examples – refer to page 17 for information about the figure.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 8: Additional AttnGAN examples – refer to page 17 for more information about the figure.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
Figure 9: StackGAN examples with random locations – refer to page 17 for more information.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 10: AttnGAN examples with random locations – refer to page 17 for more information.
|
| 262 |
+
|
| 263 |
+
<table><tr><td rowspan=1 colspan=1>Label</td><td rowspan=1 colspan=1>Occurrences</td><td rowspan=1 colspan=1>Words in captions</td></tr><tr><td rowspan=4 colspan=1>PersonDining table</td><td rowspan=1 colspan=1>13773</td><td rowspan=5 colspan=1>person,people,human,man,men,woman,women,childtable, deskcar,auto, vehicle,cab</td></tr><tr><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>3130</td></tr><tr><td rowspan=1 colspan=1>Car</td><td rowspan=1 colspan=1>1694</td></tr><tr><td rowspan=1 colspan=1>Cat</td><td rowspan=1 colspan=1>1658</td><td rowspan=1 colspan=1>cat</td></tr><tr><td rowspan=1 colspan=1>Dog</td><td rowspan=1 colspan=1>1543</td><td rowspan=1 colspan=1>dog</td></tr><tr><td rowspan=1 colspan=1>Bus</td><td rowspan=1 colspan=1>1198</td><td rowspan=1 colspan=1>bus</td></tr><tr><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1>1188</td><td rowspan=1 colspan=1>train</td></tr><tr><td rowspan=1 colspan=1>Bed</td><td rowspan=1 colspan=1>984</td><td rowspan=1 colspan=1>bed</td></tr><tr><td rowspan=1 colspan=1>Pizza</td><td rowspan=1 colspan=1>906</td><td rowspan=1 colspan=1>pizza</td></tr><tr><td rowspan=1 colspan=1>Horse</td><td rowspan=1 colspan=1>874</td><td rowspan=1 colspan=1>horse</td></tr><tr><td rowspan=1 colspan=1>Giraffe</td><td rowspan=1 colspan=1>828</td><td rowspan=1 colspan=1>giraffe</td></tr><tr><td rowspan=1 colspan=1>Toilet</td><td rowspan=1 colspan=1>797</td><td rowspan=1 colspan=1>toilet</td></tr><tr><td rowspan=1 colspan=1>Bear</td><td rowspan=1 colspan=1>777</td><td rowspan=1 colspan=1>bear</td></tr><tr><td rowspan=1 colspan=1>Bench</td><td rowspan=1 colspan=1>732</td><td rowspan=1 colspan=1>bench</td></tr></table>
|
| 264 |
+
|
| 265 |
+
Table 3: Words that were used to identify given labels in the image caption for the YOLOv3 object detection test.
|
| 266 |
+
|
| 267 |
+
<table><tr><td>Label</td><td>Occurrences</td><td>Words in captions</td></tr><tr><td>Umbrella</td><td>727</td><td>umbrella</td></tr><tr><td>Elephant</td><td>708</td><td>elephant</td></tr><tr><td>Chair</td><td>632</td><td>chair, stool</td></tr><tr><td>Zebra</td><td>627</td><td>zebra</td></tr><tr><td>Boat</td><td>627</td><td>boat</td></tr><tr><td>Bird</td><td>610</td><td>bird</td></tr><tr><td>Aeroplane</td><td>602</td><td>plane</td></tr><tr><td>Bicycle</td><td>600</td><td>bicycle</td></tr><tr><td>Surfboard</td><td>595</td><td>surfboard</td></tr><tr><td>Kite</td><td>593</td><td>kite</td></tr><tr><td>Truck</td><td>561</td><td>truck</td></tr><tr><td>Stop sign</td><td>522</td><td>stop</td></tr><tr><td>TV Monitor</td><td>471</td><td>tv,monitor, screen</td></tr><tr><td>Sofa</td><td>467</td><td>sofa, couch</td></tr><tr><td>Sandwich</td><td>387</td><td>sandwich</td></tr><tr><td>Sheep</td><td>368</td><td>sheep</td></tr></table>
|
| 268 |
+
|
| 269 |
+
# E OBJECT DETECTION ON MS-COCO IMAGES
|
| 270 |
+
|
| 271 |
+
To further inspect the quality of the location and recognizability of the generated objects within an image, we ran a test on object detection using a YOLOv3 network Redmon & Farhadi (2018) that was also pretrained on the MS-COCO data set9. We use the Pytorch implementation from https://github.com/ayooshkathuria/pytorch-yolo-v3 to get the bounding box and label predictions for our images. We follow the standard guidelines and keep all hyperparameters for the YOLOv3 network as in the implementation. We picked the 30 most common training labels (based on how many captions contain these labels) and evaluate the models on these labels, see Table 3.
|
| 272 |
+
|
| 273 |
+
In the following, we evaluate how often the pretrained YOLOv3 network recognizes a specific object within a generated image that should contain this object based on the image caption. For example, we expect an image generated from the caption “a young woman taking a picture with her phone” to contain a person somewhere in the image and we check whether the YOLOv3 network actually recognizes a person in the generated image. Since the baseline StackGAN and AttnGAN only receive the image caption as input (no bounding boxes and no bounding box labels) we decided to only use captions that clearly imply the presence of the given label (see Table 3). We chose this strategy in order to allow for a fair comparison of the resulting presence or absence of a given object. Specifically, for a given label we choose all image captions from the test set that contain one of the associated words for this label (associated words were chosen manually, see Table 3) and then generated three images for each caption with each model. Finally, we counted the number of images in which the given object was detected by the YOLOv3 network. Table 4 shows the ratio of images for each label and each model in which the given object was detected at any location within the image.
|
| 274 |
+
|
| 275 |
+
Additionally, for our models that also receive the bounding boxes as input, we calculated the Intersection over Union (IoU) between the ground truth bounding box (the bounding box supplied to the model) and the bounding box predicted by the YOLOv3 network for the recognized object. Table 4 presents the average IoU (for the models that have an object pathway) for each object in the images in which YOLOv3 detected the given object. For each image in which YOLOv3 detected the given object, we calculated the IoU between the predicted bounding box and the ground truth bounding box for the given object. In the cases in which either an image contains multiple instances of the given object (i.e. multiple different bounding boxes for this object were given to the generator) or YOLOv3 detects the given object multiple times we used the maximum IoU between all predicted and ground truth bounding boxes for our statistics.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 11: Distribution of recall and IoU values in the YOLOv3 object detection test.
|
| 279 |
+
|
| 280 |
+
Figure 11 visualizes how the IoU and recall values are distributed for the different models, and Table 4 summarizes the results with the 30 tested labels. We can observe that the StackGAN with object pathway outperforms the original StackGAN when comparing the recall of the YOLOv3 network, i.e. in how many images with a given label the YOLOv3 network actually detected the given object. The recall of the original StackGAN is higher than $1 0 \%$ for $2 6 . 7 \%$ of the labels, while our StackGAN with object pathway results in a recall greater than $1 0 \%$ for $6 0 \%$ of the labels. The IoU is greater than 0.3 for every label, while $8 6 . 7 \%$ of the labels result an IoU of greater than 0.5 (original images: $1 0 0 \%$ ) and $3 0 \%$ have an IoU of greater than 0.7 (original images: $9 6 . 7 \%$ ). This indicates that we can indeed control the location and identity of various objects within the generated images.
|
| 281 |
+
|
| 282 |
+
Compared to the StackGAN, the AttnGAN achieves a much greater recall, with $8 0 \%$ and $8 3 . 3 \%$ of the labels having a recall of greater than $1 0 \%$ for the original AttnGAN and the AttnGAN with object pathway respectively. The difference in recall values between the original AttnGAN and the AttnGAN with object pathway is also smaller, with our AttnGAN having a higher (lower) recall than the original AttnGAN (we only count cases where the difference is at least $5 \%$ ) in $2 6 . 7 \%$ $( 1 3 . 3 \% )$ of the labels. The average IoU, on the other hand, is a lot smaller for the AttnGAN than for the StackGAN. We only achieve an IoU greater than 0.3 (0.5, 0.7) for $5 3 . 3 \%$ $( 3 . 3 \% , 0 \% )$ of the labels. As mentioned in the discussion (subsection 4.4), we attribute this to the observation that the AttnGAN tends to place seemingly recognizable features of salient objects at arbitrary locations throughout the image. This might attribute to the overall higher recall but may negatively affect the IoU.
|
| 283 |
+
|
| 284 |
+
Overall, these results further confirm our previous experiments and highlight that the addition of the object pathway to the different models does not only enable the direct control of object location and identity but can also help to increase the image quality. The increase in image quality is supported by a higher Inception Score, lower Frechet Inception Distance (for StackGAN) and a higher performance ´ of the YOLOv3 network in detecting objects within generated images.
|
| 285 |
+
|
| 286 |
+
Table 4: Results of YOLOv3 detections on generated and original images. Recall provides the fraction of images in which YOLOv3 detected the given object. IoU (Intersection over Union) measures the maximum IoU per image in which the given object was detected.
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan=2 colspan=1>Label</td><td rowspan=2 colspan=2>Orig. Img.Recall IoU</td><td rowspan=2 colspan=1>StackGANRecall</td><td rowspan=2 colspan=2>StackGAN+ OPRecall IoU</td><td rowspan=1 colspan=1>AttnGAN</td><td rowspan=2 colspan=2>AttnGAN + OPRecall IoU</td></tr><tr><td rowspan=1 colspan=1>Recall</td></tr><tr><td rowspan=1 colspan=1>Person</td><td rowspan=1 colspan=1>.943</td><td rowspan=1 colspan=1>.824</td><td rowspan=1 colspan=1>.355</td><td rowspan=1 colspan=1>.451± .019</td><td rowspan=1 colspan=1>.624± .012</td><td rowspan=1 colspan=1>.598</td><td rowspan=1 colspan=1>.610 ± .008</td><td rowspan=1 colspan=1>.276 ± .006</td></tr><tr><td rowspan=1 colspan=1>Dining table</td><td rowspan=1 colspan=1>.355</td><td rowspan=1 colspan=1>.774</td><td rowspan=1 colspan=1>.007</td><td rowspan=1 colspan=1>.022 ± .004</td><td rowspan=1 colspan=1>.734± .011</td><td rowspan=1 colspan=1>.069</td><td rowspan=1 colspan=1>.045± .022</td><td rowspan=1 colspan=1>.490 ± .018</td></tr><tr><td rowspan=1 colspan=1>Car</td><td rowspan=1 colspan=1>.433</td><td rowspan=1 colspan=1>.792</td><td rowspan=1 colspan=1>.012</td><td rowspan=1 colspan=1>.047± .007</td><td rowspan=1 colspan=1>.622 ± .020</td><td rowspan=1 colspan=1>.006</td><td rowspan=1 colspan=1>.063± .010</td><td rowspan=1 colspan=1>.144 ± .043</td></tr><tr><td rowspan=1 colspan=1>Cat</td><td rowspan=1 colspan=1>.715</td><td rowspan=1 colspan=1>.821</td><td rowspan=1 colspan=1>.021</td><td rowspan=1 colspan=1>.104± .100</td><td rowspan=1 colspan=1>.622 ± .008</td><td rowspan=1 colspan=1>.423</td><td rowspan=1 colspan=1>.430± .066</td><td rowspan=1 colspan=1>.350 ± .012</td></tr><tr><td rowspan=1 colspan=1>Dog</td><td rowspan=1 colspan=1>.703</td><td rowspan=1 colspan=1>.819</td><td rowspan=1 colspan=1>.068</td><td rowspan=1 colspan=1>.150± .007</td><td rowspan=1 colspan=1>.601 ± .004</td><td rowspan=1 colspan=1>.450</td><td rowspan=1 colspan=1>.488± .048</td><td rowspan=1 colspan=1>.311 ± .007</td></tr><tr><td rowspan=1 colspan=1>Bus</td><td rowspan=1 colspan=1>.747</td><td rowspan=1 colspan=1>.877</td><td rowspan=1 colspan=1>.161</td><td rowspan=1 colspan=1>.393 ± .031</td><td rowspan=1 colspan=1>.794± .009</td><td rowspan=1 colspan=1>.352</td><td rowspan=1 colspan=1>.416± .032</td><td rowspan=1 colspan=1>.374± .006</td></tr><tr><td rowspan=1 colspan=1>Train</td><td rowspan=1 colspan=1>.900</td><td rowspan=1 colspan=1>.835</td><td rowspan=1 colspan=1>.133</td><td rowspan=1 colspan=1>.310 ± .033</td><td rowspan=1 colspan=1>.700± .007</td><td rowspan=1 colspan=1>.393</td><td rowspan=1 colspan=1>.438 ± .110</td><td rowspan=1 colspan=1>.355 ± .036</td></tr><tr><td rowspan=1 colspan=1>Bed</td><td rowspan=1 colspan=1>.775</td><td rowspan=1 colspan=1>.789</td><td rowspan=1 colspan=1>.032</td><td rowspan=1 colspan=1>.141 ± .018</td><td rowspan=1 colspan=1>.701± .001</td><td rowspan=1 colspan=1>.539</td><td rowspan=1 colspan=1>.552± .030</td><td rowspan=1 colspan=1>.505 ± .002</td></tr><tr><td rowspan=1 colspan=1>Pizza</td><td rowspan=1 colspan=1>.912</td><td rowspan=1 colspan=1>.842</td><td rowspan=1 colspan=1>.119</td><td rowspan=1 colspan=1>.485 ± .101</td><td rowspan=1 colspan=1>.786 ± .004</td><td rowspan=1 colspan=1>.444</td><td rowspan=1 colspan=1>.660 ± .054</td><td rowspan=1 colspan=1>.395 ± .016</td></tr><tr><td rowspan=1 colspan=1>Horse</td><td rowspan=1 colspan=1>.933</td><td rowspan=1 colspan=1>.842</td><td rowspan=1 colspan=1>.129</td><td rowspan=1 colspan=1>.330 ± .048</td><td rowspan=1 colspan=1>.585± .039</td><td rowspan=1 colspan=1>.532</td><td rowspan=1 colspan=1>.619± .027</td><td rowspan=1 colspan=1>.300 ± .006</td></tr><tr><td rowspan=1 colspan=1>Giraffe</td><td rowspan=1 colspan=1>.972</td><td rowspan=1 colspan=1>.857</td><td rowspan=1 colspan=1>.173</td><td rowspan=1 colspan=1>.467 ± .035</td><td rowspan=1 colspan=1>.606 ± .030</td><td rowspan=1 colspan=1>.472</td><td rowspan=1 colspan=1>.650± .084</td><td rowspan=1 colspan=1>.365 ± .030</td></tr><tr><td rowspan=1 colspan=1>Toilet</td><td rowspan=1 colspan=1>.898</td><td rowspan=1 colspan=1>.826</td><td rowspan=1 colspan=1>.005</td><td rowspan=1 colspan=1>.122 ± .021</td><td rowspan=1 colspan=1>.690 ± .010</td><td rowspan=1 colspan=1>.201</td><td rowspan=1 colspan=1>.220± .021</td><td rowspan=1 colspan=1>.224± .011</td></tr><tr><td rowspan=1 colspan=1>Bear</td><td rowspan=1 colspan=1>.381</td><td rowspan=1 colspan=1>.859</td><td rowspan=1 colspan=1>.015</td><td rowspan=1 colspan=1>.120 ± .018</td><td rowspan=1 colspan=1>.720 ± .036</td><td rowspan=1 colspan=1>.319</td><td rowspan=1 colspan=1>.303±.028</td><td rowspan=1 colspan=1>.357 ± .010</td></tr><tr><td rowspan=1 colspan=1>Bench</td><td rowspan=1 colspan=1>.828</td><td rowspan=1 colspan=1>.798</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.030 ± .008</td><td rowspan=1 colspan=1>.627± .034</td><td rowspan=1 colspan=1>.094</td><td rowspan=1 colspan=1>.094± .031</td><td rowspan=1 colspan=1>.308 ± .018</td></tr><tr><td rowspan=1 colspan=1>Umbrella</td><td rowspan=1 colspan=1>.912</td><td rowspan=1 colspan=1>.762</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.023± .009</td><td rowspan=1 colspan=1>.578 ± .030</td><td rowspan=1 colspan=1>.060</td><td rowspan=1 colspan=1>.063± .017</td><td rowspan=1 colspan=1>.154± .053</td></tr><tr><td rowspan=1 colspan=1>Elephant</td><td rowspan=1 colspan=1>.940</td><td rowspan=1 colspan=1>.867</td><td rowspan=1 colspan=1>.060</td><td rowspan=1 colspan=1>.414± .069</td><td rowspan=1 colspan=1>.688 ± .033</td><td rowspan=1 colspan=1>.350</td><td rowspan=1 colspan=1>.500± .141</td><td rowspan=1 colspan=1>.353 ± .006</td></tr><tr><td rowspan=1 colspan=1>Chair</td><td rowspan=1 colspan=1>.757</td><td rowspan=1 colspan=1>.755</td><td rowspan=1 colspan=1>.014</td><td rowspan=1 colspan=1>.039 ± .004</td><td rowspan=1 colspan=1>.488 ± .039</td><td rowspan=1 colspan=1>.070</td><td rowspan=1 colspan=1>.093 ± .005</td><td rowspan=1 colspan=1>.225 ± .001</td></tr><tr><td rowspan=1 colspan=1>Zebra</td><td rowspan=1 colspan=1>.972</td><td rowspan=1 colspan=1>.875</td><td rowspan=1 colspan=1>.732</td><td rowspan=1 colspan=1>.781± .023</td><td rowspan=1 colspan=1>.686 ± .017</td><td rowspan=1 colspan=1>.870</td><td rowspan=1 colspan=1>.766± .063</td><td rowspan=1 colspan=1>.315 ± .022</td></tr><tr><td rowspan=1 colspan=1>Boat</td><td rowspan=1 colspan=1>.795</td><td rowspan=1 colspan=1>.709</td><td rowspan=1 colspan=1>.077</td><td rowspan=1 colspan=1>.010± .011</td><td rowspan=1 colspan=1>.594± .021</td><td rowspan=1 colspan=1>.168</td><td rowspan=1 colspan=1>.202 ± .027</td><td rowspan=1 colspan=1>.206 ± .020</td></tr><tr><td rowspan=1 colspan=1>Bird</td><td rowspan=1 colspan=1>.837</td><td rowspan=1 colspan=1>.781</td><td rowspan=1 colspan=1>.059</td><td rowspan=1 colspan=1>.097± .027</td><td rowspan=1 colspan=1>.500 ± .066</td><td rowspan=1 colspan=1>.322</td><td rowspan=1 colspan=1>.357 ± .042</td><td rowspan=1 colspan=1>.250 ± .020</td></tr><tr><td rowspan=1 colspan=1>Aeroplane</td><td rowspan=1 colspan=1>.912</td><td rowspan=1 colspan=1>.812</td><td rowspan=1 colspan=1>.125</td><td rowspan=1 colspan=1>.223 ± .043</td><td rowspan=1 colspan=1>.667± .026</td><td rowspan=1 colspan=1>.499</td><td rowspan=1 colspan=1>.415 ± .010</td><td rowspan=1 colspan=1>.320 ± .035</td></tr><tr><td rowspan=1 colspan=1>Bicycle</td><td rowspan=1 colspan=1>.825</td><td rowspan=1 colspan=1>.760</td><td rowspan=1 colspan=1>.007</td><td rowspan=1 colspan=1>.053 ± .020</td><td rowspan=1 colspan=1>.558 ± .052</td><td rowspan=1 colspan=1>.170</td><td rowspan=1 colspan=1>.191± .013</td><td rowspan=1 colspan=1>.233 ± .024</td></tr><tr><td rowspan=1 colspan=1>Surfboard</td><td rowspan=1 colspan=1>.873</td><td rowspan=1 colspan=1>.780</td><td rowspan=1 colspan=1>.030</td><td rowspan=1 colspan=1>.067 ± .019</td><td rowspan=1 colspan=1>.459 ± .056</td><td rowspan=1 colspan=1>.104</td><td rowspan=1 colspan=1>.110± .025</td><td rowspan=1 colspan=1>.143 ± .016</td></tr><tr><td rowspan=1 colspan=1>Kite</td><td rowspan=1 colspan=1>.772</td><td rowspan=1 colspan=1>.633</td><td rowspan=1 colspan=1>.029</td><td rowspan=1 colspan=1>.057± .028</td><td rowspan=1 colspan=1>.426 ± .086</td><td rowspan=1 colspan=1>.260</td><td rowspan=1 colspan=1>.162 ± .068</td><td rowspan=1 colspan=1>.120 ± .018</td></tr><tr><td rowspan=1 colspan=1>Truck</td><td rowspan=1 colspan=1>.887</td><td rowspan=1 colspan=1>.832</td><td rowspan=1 colspan=1>.082</td><td rowspan=1 colspan=1>.243 ± .062</td><td rowspan=1 colspan=1>.717 ± .022</td><td rowspan=1 colspan=1>.378</td><td rowspan=1 colspan=1>.367± .027</td><td rowspan=1 colspan=1>.393 ± .019</td></tr><tr><td rowspan=1 colspan=1>Stop Sign</td><td rowspan=1 colspan=1>.527</td><td rowspan=1 colspan=1>.874</td><td rowspan=1 colspan=1>.001</td><td rowspan=1 colspan=1>.261± .057</td><td rowspan=1 colspan=1>.780 ± .011</td><td rowspan=1 colspan=1>.070</td><td rowspan=1 colspan=1>.124± .048</td><td rowspan=1 colspan=1>.101± .014</td></tr><tr><td rowspan=1 colspan=1>TV Monitor</td><td rowspan=1 colspan=1>.818</td><td rowspan=1 colspan=1>.833</td><td rowspan=1 colspan=1>.037</td><td rowspan=1 colspan=1>.264± .005</td><td rowspan=1 colspan=1>.765 ± .016</td><td rowspan=1 colspan=1>.529</td><td rowspan=1 colspan=1>.435 ± .314</td><td rowspan=1 colspan=1>.243± .066</td></tr><tr><td rowspan=1 colspan=1>Sofa</td><td rowspan=1 colspan=1>.878</td><td rowspan=1 colspan=1>.794</td><td rowspan=1 colspan=1>.012</td><td rowspan=1 colspan=1>.087 ± .024</td><td rowspan=1 colspan=1>.628 ± .044</td><td rowspan=1 colspan=1>.170</td><td rowspan=1 colspan=1>.191 ± .057</td><td rowspan=1 colspan=1>.329 ± .028</td></tr><tr><td rowspan=1 colspan=1>Sandwich</td><td rowspan=1 colspan=1>.792</td><td rowspan=1 colspan=1>.796</td><td rowspan=1 colspan=1>.045</td><td rowspan=1 colspan=1>.139 ± .049</td><td rowspan=1 colspan=1>.628 ± .014</td><td rowspan=1 colspan=1>.340</td><td rowspan=1 colspan=1>.370± .054</td><td rowspan=1 colspan=1>.318 ± .031</td></tr><tr><td rowspan=1 colspan=1>Sheep</td><td rowspan=1 colspan=1>.943</td><td rowspan=1 colspan=1>.727</td><td rowspan=1 colspan=1>.004</td><td rowspan=1 colspan=1>.091± .006</td><td rowspan=1 colspan=1>.460 ± .011</td><td rowspan=1 colspan=1>.250</td><td rowspan=1 colspan=1>.304± .037</td><td rowspan=1 colspan=1>.116 ± .022</td></tr></table>
|
md/train/H1ltQ3R9KQ/H1ltQ3R9KQ.md
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAUSAL REASONING FROM META REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Discovering and exploiting the causal structure in the environment is a crucial challenge for intelligent agents. Here we explore whether modern deep reinforcement learning can be used to train agents to perform causal reasoning. We adopt a meta-learning approach, where the agent learns a policy for conducting experiments via causal interventions, in order to support a subsequent task which rewards making accurate causal inferences. We also found the agent could make sophisticated counterfactual predictions, as well as learn to draw causal inferences from purely observational data. Though powerful formalisms for causal reasoning have been developed, applying them in real-world domains can be difficult because fitting to large amounts of high dimensional data often requires making idealized assumptions. Our results suggest that causal reasoning in complex settings may benefit from powerful learning-based approaches. More generally, this work may offer new strategies for structured exploration in reinforcement learning, by providing agents with the ability to perform—and interpret—experiments.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many machine learning algorithms are rooted in discovering patterns of correlation in data. While this has been sufficient to excel in several areas (Krizhevsky et al., 2012; Cho et al., 2014), sometimes the problems we are interested in are fundamentally causal. Answering questions such as “Does smoking cause cancer?” or “Was this person denied a job due to racial discrimination?” or “Did this marketing campaign cause sales to go up?” all require an ability to reason about causes and effects and cannot be achieved by purely associative inference. Even for problems that are not obviously causal, like image classification, it has been suggested that some failure modes emerge from lack of causal understanding. Causal reasoning may be an essential component of natural intelligence and is present in human babies, rats and even birds (Leslie, 1982; Gopnik et al., 2001; 2004; Blaisdell et al., 2006; Lagnado et al., 2013). There is a rich literature on formal approaches for defining and performing causal reasoning (Pearl, 2000; Spirtes et al., 2000; Dawid, 2007; Pearl et al., 2016).
|
| 12 |
+
|
| 13 |
+
Here we investigate whether procedures for learning and using causal structure can be produced by meta-learning. The approach of meta-learning is to learn the learning (or inference) procedure itself, directly from data. We adopt the specific method of Duan et al. (2016) and Wang et al. (2016), training a recurrent neural network (RNN) through model-free reinforcement learning. We train on a large family of tasks, each underpinned by a different causal structure.
|
| 14 |
+
|
| 15 |
+
The use of meta-learning avoids the need to manually implement explicit causal reasoning methods in an algorithm, offers advantages of scalability by amortizing computations, and allows automatic incorporation of complex prior knowledge (Andrychowicz et al., 2016; Wang et al., 2016; Finn et al., 2017). Additionally, by learning end-to-end, the algorithm has the potential to find the internal representations of causal structure best suited for the types of causal inference required.
|
| 16 |
+
|
| 17 |
+
# 2 PROBLEM SPECIFICATION AND APPROACH
|
| 18 |
+
|
| 19 |
+
This work probed how an agent could learn to perform causal reasoning in three distinct settings – observational, interventional, and counterfactual – corresponding to different types of data available to the agent during the first phase of an episode.
|
| 20 |
+
|
| 21 |
+
In the observational setting (Experiment 1), the agent could only obtain passive observations from the environment. This type of data allows an agent to infer associations (associative reasoning) and, when the structure of the underlying causal model permits it, to estimate the effect that changing a variable in the environment has on another variable, namely to estimate causal effects (cause-effect reasoning).
|
| 22 |
+
|
| 23 |
+
In the interventional setting (Experiment 2), the agent could directly set the values of some variables in the environment. This type of data in principle allows an agent to estimate causal effects for any underlying causal model.
|
| 24 |
+
|
| 25 |
+
In the counterfactual setting (Experiment 3), the agent first had an opportunity to learn about the causal graph through interventions. At the last step of the episode, it was asked a counterfactual question of the form “What would have happened if a different intervention had been made in the previous time-step?”.
|
| 26 |
+
|
| 27 |
+
Next we will formalize these three settings and patterns of reasoning possible in each, using the graphical model framework (Pearl, 2000; Spirtes et al., 2000; Dawid, 2007)1, and introduce the meta-learning methods that we will use to train agents that are capable of such reasoning.
|
| 28 |
+
|
| 29 |
+
# 2.1 CAUSALITY
|
| 30 |
+
|
| 31 |
+
Causal relationships among random variables can be expressed using causal directed acyclic graphs (DAGs) (see Appendix). A causal DAG is a graphical model that captures both independence and causal relations. Each node $X _ { i }$ corresponds to a random variable, and the joint distribution $p ( X _ { 1 } , \ldots , X _ { N } )$ is given by the product of conditional distributions of each node $X _ { i }$ given its parent nodes $\operatorname { p a } ( X _ { i } )$ , i.e. $\begin{array} { r } { p ( X _ { 1 : N } \equiv X _ { 1 } , . . . , X _ { N } ) = \prod _ { i = 1 } ^ { N } p ( X _ { i } | \mathsf { p a } ( X _ { i } ) ) . } \end{array}$ .
|
| 32 |
+
|
| 33 |
+
Edges carry causal semantics: if there exists a directed path from $X _ { i }$ to $X _ { j }$ , then $X _ { i }$ is a potential cause of $X _ { j }$ . Directed paths are also called causal paths. The causal effect of $X _ { i }$ on $X _ { j }$ is the conditional distribution of $X _ { j }$ given $X _ { i }$ restricted to only causal paths.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
An example causal DAG $\mathcal { G }$ is given in the figure on the left, where $E$ represents hours of exercise in a week, $H$ cardiac health, and $A$ age. The causal effect of $E$ on $H$ is the conditional distribution restricted to the path $E \to H$ i.e. excluding the path $E \left. A \right. H$ . The variable $A$ is called a confounder, as it confounds the causal effect with non-causal statistical influence.
|
| 38 |
+
|
| 39 |
+
Simply observing cardiac health conditioning on exercise level from $p ( H | E )$ (associative reasoning) cannot answer if change in exercise levels cause changes in cardiac health (cause-effect reasoning), since there is always the possibility that correlation between the two is because of the common confounder of age.
|
| 40 |
+
|
| 41 |
+
Cause-effect Reasoning. The causal effect can be seen as the conditional distribution $p _ { E = e } ( H | E =$ $e ) ^ { 2 }$ on the graph $\mathscr { G } _ { E = e }$ above (right), resulting from intervening on $E$ by replacing $p ( E | A )$ with a delta distribution $\delta _ { E = e }$ (thereby removing the link from $A$ to $E$ ) and leaving the remaining conditional distributions $p ( H | E , A )$ and $p ( A )$ unaltered. The rules of do-calculus (Pearl, 2000; Pearl et al., 2016) tell us how to compute $\scriptstyle p \to E = e \left( H | E = e \right)$ using observations from $\mathcal { G }$ . In this case $\begin{array} { r } { p _ { E = e } ( H | E = e ) = } \end{array}$ $\textstyle \sum _ { A } p ( H | E { = } e , A ) { \bar { p } } ( A ) ^ { 3 }$ . Therefore, do-calculus enables us to reason in the intervened graph $\mathscr { G } _ { E = e }$ even if our observations are from $\mathcal { G }$ . This is the scenario captured by our observational setting outlined above.
|
| 42 |
+
|
| 43 |
+
Such inferences are always possible if the confounders are observed, but in the presence of unobserved confounders, for many DAG structures the only way to compute causal effects is by collecting observations directly from $\mathcal { G } _ { E }$ , i.e. by actively intervening on the world to fix the value of the variable $E = e$ and observing the remaining variables. In our interventional setting, outlined above, the agent has access to such interventions.
|
| 44 |
+
|
| 45 |
+
Counterfactual Reasoning. Cause-effect reasoning can be used to correctly answer predictive questions of the type “Does exercising improve cardiac health?” by accounting for causal structure and confounding. However, it cannot answer retrospective questions about what would have happened. For example, given an individual $i$ who has died of a heart attack, this method would not be able to answer questions of the type “What would the cardiac health of this individual have been had they done more exercise?”. This type of question requires estimating unobserved sources of noise and then reasoning about the effects of this noise under a graph conditioned on a different intervention.
|
| 46 |
+
|
| 47 |
+
# 2.2 META-LEARNING
|
| 48 |
+
|
| 49 |
+
Meta-learning refers to a broad range of approaches in which aspects of the learning algorithm itself are learned from the data. Many individual components of deep learning algorithms have been successfully meta-learned, including the optimizer (Andrychowicz et al., 2016), initial parameter settings (Finn et al., 2017), a metric space (Vinyals et al., 2016), and use of external memory (Santoro et al., 2016).
|
| 50 |
+
|
| 51 |
+
Following the approach of (Duan et al., 2016; Wang et al., 2016), we parameterize the entire learning algorithm as a recurrent neural network (RNN), and we train the weights of the RNN with model-free reinforcement learning (RL). The RNN is trained on a broad distribution of problems which each require learning. When trained in this way, the RNN is able to implement a learning algorithm capable of efficiently solving novel learning problems in or near the training distribution.
|
| 52 |
+
|
| 53 |
+
Learning the weights of the RNN by model-free RL can be thought of as the “outer loop” of learning. The outer loop shapes the weights of the RNN into an “inner loop” learning algorithm. This inner loop algorithm plays out in the activation dynamics of the RNN and can continue learning even when the weights of the network are frozen. The inner loop algorithm can also have very different properties from the outer loop algorithm used to train it. For example, in previous work this approach was used to negotiate the exploration-exploitation tradeoff in multi-armed bandits (Duan et al., 2016) and learn algorithms which dynamically adjust their own learning rates (Wang et al., 2016; 2018). In the present work we explore the possibility of obtaining a causally-aware inner-loop learning algorithm. See the Appendix for a more formal approach to meta-learning.
|
| 54 |
+
|
| 55 |
+
# 3 TASK SETUP AND AGENT ARCHITECTURE
|
| 56 |
+
|
| 57 |
+
In the experiments, in each episode the agent interacted with a different causal DAG $\mathcal { G }$ . $\mathcal { G }$ was drawn randomly from the space of possible DAGs under the constraints given in the next paragraph. Each episode consisted of $T$ steps, and was divided into two phases: information and quiz. The information phase, corresponding to the first $T - 1$ steps, allowed the agent to collect information by interacting with or passively observing samples from $\mathcal { G }$ . The agent could potentially use this information to infer the connectivity and weights of $\mathcal { G }$ . The quiz phase, corresponding to the final step $T$ , required the agent to exploit the causal knowledge it collected in the information phase, to select the node with the highest value under a random external intervention.
|
| 58 |
+
|
| 59 |
+
Causal graphs, observations, and actions. We generated all graphs on $N { = } 5$ nodes, with edges only in the upper triangular of the adjacency matrix (this guarantees that all the graphs obtained are DAGs), with edge weights, $w _ { j i } \in \{ - 1 , 0 , 1 \}$ (uniformly sampled), and removed 300 for held-out testing. The remaining 58749 (or $3 ^ { N ( N - 1 ) / 2 } - 3 0 0 )$ were used as the training set. Each node’s value, $X _ { i } \in \mathbb { R }$ , was Gaussiandistributed. The values of parentless nodes were drawn from $\mathcal { N } ( \mu = 0 . 0 , \sigma = 0 . 1 )$ . The conditional probability of a node with parents was $\begin{array} { r } { p ( X _ { i } | \mathsf { p a } ( X _ { i } ) ) = \mathcal { N } ( \mu = \sum _ { j } w _ { j i } X _ { j } , \sigma = 0 . 1 ) } \end{array}$ , where $\operatorname { p a } ( X _ { i } )$ represents the parents of node $X _ { i }$ in $\mathcal { G }$ . The values of the 4 observable nodes (the root node, was always hidden), were concatenated to create $v _ { t }$ and provided to the agent in its observation vector, $O _ { t } = [ v _ { t } , m _ { t } ]$ where $m _ { t }$ is a one-hot vector indicating external intervention during the quiz phase (explained below).4
|
| 60 |
+
|
| 61 |
+
In both phases, on each step, $t$ , the agent’s action, $a _ { t }$ , was a discrete choice from the range $\left\{ 1 . . . 2 ( N { - } 1 ) \right\}$ . Action choices in $\{ 1 . . . N - 1 \}$ corresponded to information actions, and choices in $\{ N \ldots 2 ( N - 1 ) \}$ corresponded to quiz actions.
|
| 62 |
+
|
| 63 |
+
Information phase. In the information phase, an information action, $a _ { t }$ , caused an intervention on the $a _ { t }$ -th node, setting its value to $X _ { a _ { t } } = 5$ . We choose an intervention value outside the likely range of sampled observations, to facilitate learning of the causal graph. The observation from the intervened graph, $\mathscr { G } _ { X _ { a _ { t } } = 5 }$ , was sampled similarly to $\mathcal { G }$ , except the incoming edges to $X _ { a _ { t } }$ were severed, and its intervened value was used for conditioning its children’s values. The node values in $\mathscr { G } _ { X _ { a _ { t } } = 5 }$ were distributed as $p _ { X _ { i } = 5 } ( X _ { 1 : N \backslash i } | X _ { i } = 5 )$ . If a quiz action was chosen during the information phase, it was ignored, the $\mathcal { G }$ values were sampled as if no intervention had been made, and the agent was given a penalty of $r _ { t } = - 5$ in order to encourage it to take quiz actions at only during quiz phase. After the action was selected, an observation was provided to the agent. The default length of this phase was fixed to $T = N = 5$ since in the noise-free limit, a minimum of $T - 1 = 4$ interventions are required in general to resolve the causal structure, and score perfectly on the test phase.
|
| 64 |
+
|
| 65 |
+
Quiz phase. In the quiz phase, one non-hidden node was selected at random to be intervened on externally, $X _ { j }$ , and its value was set to $- 5$ . We chose an intervention value of $- 5$ never previously observed by the agent in that episode, thus disallowing the agent from memorizing the results of interventions in the information phase to perform well on the quiz phase. The agent was informed of this by the observed $m _ { T - 1 }$ (a one-hot vector which indicated which node would be intervened on), from the final pre-quiz phase time-step, $T - 1$ . Note, $m _ { t }$ was set to a zero-vector for steps $t < T - 1$ . A quiz action, $a _ { T }$ , chosen by the agent indicated the node whose value would be given to the agent as a reward. In other words, the agent would receive reward, $r _ { T } = X _ { a _ { T } - ( N - 1 ) }$ . Again, if a quiz action was chosen during the information phase, the node values were not sampled and the agent was simply given a penalty of $r _ { T } = - 5$ .
|
| 66 |
+
|
| 67 |
+
Active vs passive agents. Our agents had to perform two distinct tasks during the information phase: a) actively choose which nodes to set values on, and b) infer the causal DAG from its observations. We refer to this setup as the “active” condition. To control for (a), we created the “passive” condition, where the agent’s information phase actions are not learned. To provide a benchmark for how well the active agent can perform task (a), we fixed the passive agent’s intervention policy to be an exhaustive sweep through all observable nodes. This is close to optimal for this domain – in fact it is the optimal policy for noise-free conditional node values. We also compared the active agent’s performance to a baseline agent whose policy is to intervene randomly on the observable nodes in the information phase, in the Appendix.
|
| 68 |
+
|
| 69 |
+
Two kinds of learning The “inner loop” of learning (see Section 2.2) occurs within each episode where the agent is learning from the evidence it gathers during the information phase in order to perform well in the quiz phase. The same agent then enters a new episode, where it has to repeat the task on a different DAG. Test performance is reported on DAGs that the agent has never previously seen, after all the weights of the RNN have been fixed. Hence, the only transfer from training to test (or the “outer loop” of learning) is the ability to discover causal dependencies based on observations in the information phase, and to perform causal inference in the quiz phase.
|
| 70 |
+
|
| 71 |
+
# Agent Architecture and Training
|
| 72 |
+
|
| 73 |
+
We used a long short-term memory (LSTM) network (Hochreiter & Schmidhuber, 1997) (with 96 hidden units) that, at each time-step $t$ , receives a concatenated vector containing $\left[ o _ { t } , a _ { t - 1 } , r _ { t - 1 } \right]$ as input, where $o _ { t }$ is the observation5, $a _ { t - 1 }$ is the previous action (as a one-hot vector) and $r _ { t - 1 }$ the reward (as a single real-value)6. The outputs, calculated as linear projections of the LSTM’s hidden state, are a set of policy logits (with dimensionality equal to the number of available actions), plus a scalar baseline. The policy logits are transformed by a softmax function, and then sampled to give a selected action.
|
| 74 |
+
|
| 75 |
+
Learning was by asynchronous advantage actor-critic (Mnih et al., 2016). In this framework, the loss function consists of three terms – the policy gradient, the baseline cost and an entropy cost. The baseline cost was weighted by 0.05 relative to the policy gradient cost. The weighting of the entropy cost was annealed over the course of training from 0.05 to 0. Optimization was done by RMSProp with $\epsilon = 1 0 ^ { - 5 }$ , momentum $= 0 . 9$ and decay $= 0 . 9 5$ . Learning rate was annealed from $3 \times 1 0 ^ { - 6 }$ to 0. For all experiments, after training, the agent was tested with the learning rate set to zero, on a held-out test set.
|
| 76 |
+
|
| 77 |
+
# 4 EXPERIMENTS
|
| 78 |
+
|
| 79 |
+
Our three experiments (observational, interventional, and counterfactual) differed in the properties of the $v _ { t }$ that was observed by the agent during the information phase, and thereby limited the extent of causal reasoning possible within each data setting. Our measure of performance is the reward earned in the quiz phase for held-out DAGs. Choosing a random node node in the quiz phase results in a reward of $- 5 / 4 = - 1 . 2 5$ , since one node (the externally intervened node) always has value $- 5$ and the others have on average 0 value. By learning to simply avoid the externally intervened node, the agent can earn on average 0 reward. Consistently picking the node with the highest value in the quiz phase requires the agent to perform causal reasoning. For each agent, we take the average reward earned across 1200 episodes (300 held-out test DAGs, with 4 possible external interventions). We train 12 copies of each agent and report the average reward earned by these, with error bars showing $9 5 \%$ confidence intervals.
|
| 80 |
+
|
| 81 |
+
# 4.1 EXPERIMENT 1: OBSERVATIONAL SETTING
|
| 82 |
+
|
| 83 |
+
In Experiment 1, the agent could neither intervene to set the value of variables in the environment, nor observe any external interventions. In other words, it only received observations from $\mathcal { G }$ , not $\mathscr { G } _ { X _ { j } }$ (where $X _ { j }$ is a node that has been intervened on). This limits the extent of causal inference possible. In this experiment, we tested six agents, four of which were learned: “Observational”, “Long Observational”, “Active Conditional”, “Passive Conditional”, “Observational MAP Baseline”(not learned) and the “Optimal Associative Baseline” (not learned). We also ran two other standard RL baselines—see the Appendix for details.
|
| 84 |
+
|
| 85 |
+
Observational Agents: In the information phase, the actions of the agent were ignored7, and the observational agent always received the values of the observable nodes as sampled from the joint distribution associated with $\mathcal { G }$ . In addition to the default $T = 5$ episode length, we also trained this agent with $4 \times$ longer episode length (Long Observational Agent), to measure performance increase with more observational data.
|
| 86 |
+
|
| 87 |
+
Conditional Agents: The information phase actions corresponded to observing a world in which the selected node $X _ { j }$ is equal to $X _ { j } = 5$ , and the remaining nodes are sampled from the conditional distribution $p ( X _ { 1 : N \backslash j } | X _ { j } = \mathsf { \bar { 5 } } )$ , where $X _ { 1 : N \backslash j }$ indicates the set of all nodes except $X _ { j }$ . This differs from intervening on the variable $X _ { j }$ by setting it to the value $X _ { j } = 5$ , since here we take a conditional sample from $\mathcal { G }$ rather than from $\mathscr { G } _ { X _ { j } = 5 }$ (i.e. from $p _ { X _ { j } = 5 } ( X _ { 1 : N \backslash j } | X _ { j } = 5 ) \rangle$ ), and inference about the corresponding node’s parents is possible. Therefore, this agent still has access to only observational data, as with the observational agents. However, on average it receives more diagnostic information about the relation between the random variables in $\mathcal { G }$ , since it can observe samples where a node takes a value far outside the likely range of sampled observations. We run active and passive versions of this agent as described in Section 3
|
| 88 |
+
|
| 89 |
+
Optimal Associative Baseline: This baseline receives the true joint distribution $p ( X _ { 1 : N } )$ implied by the DAG in that episode, therefore it has full knowledge of the correlation structure of the environment8. It can therefore do exact associative reasoning of the form $p ( X _ { j } | X _ { i } = x )$ , but cannot do any cause-effect reasoning of the form $p _ { X _ { i } = x } ( X _ { j } | X _ { i } = x ) \bar $ . In the quiz phase, this baseline chooses the node that has the maximum value according to the true $p ( X _ { j } | X _ { i } = x )$ in that episode, where $X _ { i }$ is the node externally intervened upon, and $x = - 5$ .
|
| 90 |
+
|
| 91 |
+
Observational MAP Baseline: This baseline follows the traditional method of separating causal induction and causal inference. We first carry out exact maximum a posteriori (MAP) inference over the space of DAGs in each episode (i.e. causal induction) by selecting the DAG $( \mathcal { G } ^ { \mathrm { M A P } } )$ of the 59049 unique possibilities that maximizes the likelihood of the data observed, $v _ { 1 : T }$ , by the Observational Agent in that episode. This is equivalent to maximizing the posterior probability since the prior over graphs is uniform.
|
| 92 |
+
|
| 93 |
+
# RESULTS
|
| 94 |
+
|
| 95 |
+
We focus on three key questions in this experiment: (i) Can our agents learn to do associative reasoning with observational data?, (ii) Can they learn to do cause-effect reasoning from observational data?, and (iii) In addition to making causal inferences, can our agent also choose good actions in the information phase to generate the data it observes?
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 2: Experiment 1. Agents do associative and cause-effect reasoning from observational data. a) Average reward earned by the agents tested in this experiment. See main text for details. b) Performance split by the presence or absence of at least one parent (Parent and Orphan respectively) on the externally intervened node. c) Quiz phase for a test DAG. Green (red) edges indicate a weight of $+ 1$ $( - 1 )$ . Black represents the intervened node, green (red) nodes indicate a positive (negative) value at that node, white indicates a zero value. The blue circles indicate the agent’s choice. Left panel: $\mathcal { G }$ and the nodes taking the mean values prescribed by $p ( X _ { 1 : N \backslash j } | X _ { j } = - 5 )$ , including backward inference to the intervened node’s parent. The Optimal Associative Baseline’s choice is consistent with maximizing these (incorrect) node values. Right panel: $\mathscr { G } _ { X _ { j } = - 5 }$ and the nodes taking the mean values prescribed by $p _ { X _ { j } = - 5 } ( X _ { 1 : N \backslash j } | X _ { j } = - 5 )$ . We see that the Passive-Conditional Agent’s choice is consistent with maximizing these (correct) node values.
|
| 99 |
+
|
| 100 |
+
For (i), we see that the Observational Agents achieve reward above the random baseline (see the Appendix), and that more observations (Long Observational Agent) lead to better performance (Fig. 2a), indicating that the agent is indeed learning the statistical dependencies between the nodes. We see that the performance of the Passive-Conditional Agent is better than either of the Observational Agents, since the data it observes is very informative about the statistical dependencies in the environment. Finally, we see that the PassiveConditional Agent’s performance is comparable (in fact surpasses as discussed below) the performance of the Optimal Associative Baseline, indicating that it is able to do perfect associative inference.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 1: Active and Passive Conditional Agents
|
| 104 |
+
|
| 105 |
+
For (ii), we see the crucial result that the Passive-Conditional Agent’s performance is significantly above the Optimal Associative Baseline, i.e. it performs better than what is possible using only correlations. We compare their performances, split by whether or the node that was intervened on in the quiz phase of the episode has a parent (Fig. 2b). If the intervened node $X _ { j }$ has no parents, then $\mathscr { G } { = } \mathscr { G } _ { X _ { j } }$ , and there is no advantage to being able to do cause-effect reasoning. We see indeed that the Passive-Conditional agent performs better than the Optimal Associative Baseline only when the intervened node has parents (denoted by hatched bars in Fig. 2b), indicating that this agent is able to carry out some cause-effect reasoning, despite access to only observational data – i.e. it learns some form of do-calculus. We show the quiz phase for an example test DAG in Fig. 2c, seeing that the Optimal Associative Baseline chooses according to the node values predicted by $\mathcal { G }$ whereas the Passive-Conditional Agent chooses according the node values predicted by $\mathscr { G } _ { X _ { j } }$ .
|
| 106 |
+
|
| 107 |
+
For (iii), we see (Fig. 2) that the Active-Conditional Agent’s performance is only marginally below the performance of the Passive-Conditional Agent, indicating that when the agent is allowed to choose its actions, it makes reasonable choices that allow good performance.
|
| 108 |
+
|
| 109 |
+
# 4.2 EXPERIMENT 2: INTERVENTIONAL SETTING
|
| 110 |
+
|
| 111 |
+
In Experiment 2, the agent receives interventional data in the information phase – it can choose to intervene on any observable node, $X _ { j }$ , and observe a sample from the resulting graph $\mathscr { G } _ { X _ { j } }$ . As discussed in Section 2.1, access to intervention data permits cause-effect reasoning even in the presence of unobserved confounders, a feat which is in general impossible with access only to observational data. In this experiment, we test four new agents, two of which were learned: “Active Interventional”, “Passive Interventional”, “Interventional MAP Baseline”(not learned), and “Optimal Cause-Effect Baseline” (not learned).
|
| 112 |
+
|
| 113 |
+
Interventional Agents: The information phase actions correspond to performing an intervention on the selected node $X _ { j }$ and sampling from $\mathscr { G } _ { X _ { j } }$ (see Section 3 for details). We run active and passive versions of this agent as described in Section 3.
|
| 114 |
+
|
| 115 |
+
Interventional MAP Baseline: This baseline infers a DAG by maximizing the likelihood of the data observed by the Passive Interventional Agent in that episode. In the quiz phase, we predict the values of each node according to ${ \mathcal { G } } _ { X _ { j } } ^ { \mathrm { M A P } }$ where $X _ { j }$ is the node externally intervened upon (i.e. causal inference), and choose the node with the highest value.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 4: Experiment 2. Agents do cause-effect reasoning from interventional data. a) Average reward earned by the agents tested in this experiment. See main text for details. b) Performance split by the presence or absence of unobserved confounders (abbreviated as Conf. and Unconf. respectively) on the externally intervened node. c) Quiz phase for a test DAG. See Fig. 2 for a legend. Here, the left panel shows the full $\mathcal { G }$ and the nodes taking the mean values prescribed by $p ( X _ { 1 : N \backslash j } | \bar { X } _ { j } = - 5 )$ . We see that the Passive-Cond Agent’s choice is consistent with choosing based on these (incorrect) node values. The right panel shows $\mathscr { G } _ { X _ { j } = - 5 }$ and the nodes taking the mean values prescribed by $p _ { X _ { j } = - 5 } ( X _ { 1 : N \backslash j } | X _ { j } = - \mathrm { \bar { 5 } } )$ We see that the Passive-Int. Agent’s choice is consistent with maximizing on these (correct) node value.
|
| 119 |
+
|
| 120 |
+
Optimal Cause-Effect Baseline: This baseline receives the true DAG, $\mathcal { G }$ . In the quiz phase, it chooses the node that has the maximum value according to $\mathscr { G } _ { X _ { j } }$ , where $X _ { j }$ is the node externally intervened upon.
|
| 121 |
+
|
| 122 |
+
# RESULTS
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Active and Passive Interventional Agents
|
| 126 |
+
|
| 127 |
+
We focus on three key questions in this experiment: (i) Can our agents learn to do cause-effect reasoning from interventional data?, (ii) How does the cause-effect reasoning in our agents which have access to interventional data differ from the cause-effect reasoning measured in Experiment 1 (in agents that have access only to observational data)? (iii) In addition to making causal inferences, can our agent also choose good actions in the information phase to generate the data it observes?
|
| 128 |
+
|
| 129 |
+
For (i) we see in Fig. 4a that the Passive-Interventional Agent’s performance is comparable to the Optimal Cause-Effect Baseline, indicating that it is able to do close to perfect cause-effect reasoning in this domain.
|
| 130 |
+
|
| 131 |
+
For (ii) we see in Fig. 4a the crucial result that the Passive-Interventional Agent’s performance is significantly better than the Passive-Conditional Agent. We compare the performances of these two agents, split by whether the node that was intervened on in the quiz phase of the episode had unobserved confounders with other variables in the graph (Fig. 4b). In confounded cases, as described in Section 2.1, cause-effect reasoning is impossible with only observational data. We see that the performance of the Passive-Interventional Agent does not vary significantly with confoundedness, whereas the performance of the Passive-Conditional Agent is significantly lower in the confounded cases. This indicates that the improvement in the performance of the agent that has access to interventional data (as compared to the agents that had access to only observational data) is largely driven by its ability to also do cause-effect reasoning in the presence of confounders. This is highlighted by Fig. 4c, which shows the quiz phase for an example DAG, where the Passive-Conditional agent is unable to resolve the confounder, but the Passive-Interventional agent can.
|
| 132 |
+
|
| 133 |
+
For (iii), we see in Fig. 3 that the Active-Interventional Agent’s performance is only marginally below the performance of the near optimal Passive-Interventional Agent, indicating that when the agent is allowed to choose its actions, it makes reasonable choices that allow good performance.
|
| 134 |
+
|
| 135 |
+
# 4.3 EXPERIMENT 3: COUNTERFACTUAL SETTING
|
| 136 |
+
|
| 137 |
+
In Experiment 3, the agent was again allowed to make interventions as in Experiment 2, but in this case the quiz phase task entailed answering a counterfactual question. We explain here what a counterfactual question in this domain looks like. Consider the conditional distribution $\scriptstyle { p ( \bar { X } _ { i } | \mathsf { p a } ( X _ { i } ) ) = N ( \sum _ { j } w _ { j i } X _ { j } , 0 . 1 ) }$ as described in Section 3 as $\begin{array} { r } { X _ { i } = \sum _ { j } w _ { j i } X _ { j } + \epsilon } \end{array}$ where $\epsilon$ is distributed as $\mathcal { N } ( 0 . 0 , 0 . 1 )$ , and represents the specific randomness introduced when taking one sample from the DAG. After observing the nodes $X _ { 1 : N }$ in the DAG in one sample, we can infer this specific randomness $\epsilon _ { i }$ for each node $X _ { i }$ (i.e. abduction as described in the Appendix) and answer counterfactual questions like “What would the values of the nodes be, had $X _ { j }$ in that particular sample taken on a different value than what we observed?”, for any of the nodes $X _ { j }$ . We test 2 new learned agents: “Active Counterfactual” and “Passive Counterfactual”.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: Experiment 3. Agents do counterfactual reasoning. a) Average reward earned by the agents tested in this experiment. See main text for details. b) Performance split by if the maximum node value in the quiz phase is degenerate (Deg.) or distinct (Dist.). c) Quiz phase for an example test-DAG. See Fig. 2 for a legend. Here, the left panel shows $\mathscr { G } _ { X _ { j } = - 5 }$ and the nodes taking the mean values prescribed by $p _ { X _ { j } = - 5 } ( X _ { 1 : N \backslash j } | X _ { j } = - \bar { 5 } )$ . We see that the Passive-Int. Agent’s choice is consistent with maximizing on these node values, where it makes a random choice between two nodes with the same value. The right panel panel shows $\mathscr { G } _ { X _ { j } = - 5 }$ and the nodes taking the exact values prescribed by the means of $p _ { X _ { j } = - 5 } ( X _ { 1 : N \backslash j } | X _ { j } = - 5 )$ , combined with the specific randomness inferred from the previous time step. As a result of accounting for the randomness, the two previously degenerate maximum values are now distinct. We see that the Passive-CF. agent’s choice is consistent with maximizing on these node values.
|
| 141 |
+
|
| 142 |
+
Counterfactual Agents: This agent is exactly analogous to the Interventional agent, with the addition that the exogenous noise in the last information phase step $t = T - 1$ (where say $X _ { p } = + 5$ ), is stored and the same noise is used in the quiz phase step $t = T$ (where say $X _ { f } = - 5$ ). While the question our agents have had to answer correctly so far in order to maximize their reward in the quiz phase was “Which of the nodes $X _ { 1 : N \backslash j }$ will have the highest value when $X _ { f }$ is set to $- 5 ? ^ { \prime }$ , in this setting, we ask “Which of the nodes $X _ { 1 : N \backslash j }$ would have had the highest value in the last step of the information phase, if instead of having $X _ { p } = + 5$ , we had $X _ { f } = - 5 ? ^ { \prime }$ . We run active and passive versions of this agent as described in Section 3.
|
| 143 |
+
|
| 144 |
+
Optimal Counterfactual Baseline: This baseline receives the true DAG and does exact abduction based on the exogenous noise observed in the penultimate step of the information phase, and combines this correctly with the appropriate interventional inference on the true DAG in the quiz phase.
|
| 145 |
+
|
| 146 |
+
# RESULTS
|
| 147 |
+
|
| 148 |
+
We focus on two key questions in this experiment: (i) Can our agents learn to do counterfactual reasoning?, (ii) In addition to making causal inferences, can our agent also choose good actions in the information phase to generate the data it observes?
|
| 149 |
+
|
| 150 |
+
For (i), we see that the Passive-Counterfactual Agent achieves higher reward than the Passive-Interventional Agent and the Optimal Cause-Effect Baseline. To evaluate whether this difference results from the agent’s use of abduction (see the Appendix for details), we split the test set into two groups, depending on whether or not the decision for which node will have the highest value in the quiz phase is affected by exogenous noise, i.e. whether or not the node with the maximum value in the quiz phase changes if the noise is resampled. This is most prevalent in cases where the maximum expected reward is degenerate, i.e. where several nodes give the same maximum reward (denoted by hatched bars in Figure 5b). Here, agents with no access to the noise have no basis for choosing one over the other, but different noise samples can give rise to significant differences in the actual values that these degenerate nodes have. We see indeed that there is no difference in the rewards received by the Passive-Counterfactual and Passive-Interventional Agents in the cases where the maximum values are distinct, however the Passive-Counterfactual Agent significantly outperforms the Passive-Interventional Agent in cases where there are degenerate maximum values.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 6: Active and Passive Counterfactual Agents
|
| 154 |
+
|
| 155 |
+
For (ii), we see in Fig. 6 that the Active-Counterfactual Agent’s performance is only marginally below the performance of the Passive-Counterfactual agent, indicating that when the agent is allowed to choose its actions, it makes reasonable choices that allow good performance.
|
| 156 |
+
|
| 157 |
+
# 5 SUMMARY OF RESULTS
|
| 158 |
+
|
| 159 |
+
We introduced and tested a framework for learning causal reasoning in various data settings—observational, interventional, and counterfactual—using deep meta-RL. Crucially, our approach did not require explicit encoding of formal principles of causal inference. Rather, by optimizing an agent to perform a task that depended on causal structure, the agent learned implicit strategies to use the available data for causal reasoning, including drawing inferences from passive observation, actively intervening, and making counterfactual predictions. Below, we summarize the keys results from each of the three experiments.
|
| 160 |
+
|
| 161 |
+
In Section 4.1 and Fig. 2, we show that the agent learns to perform do-calculus. In Fig. 2(a) we see that, compared to the highest possible reward achievable without causal knowledge, the trained agent received more reward. This observation is corroborated by Fig. 2(b) which shows that performance increased selectively in cases where do-calculus made a prediction distinguishable from the predictions based on correlations. These are situations where the externally intervened node had a parent – meaning that the intervention resulted in a different graph.
|
| 162 |
+
|
| 163 |
+
In Section 4.2 and Fig. 4, we show that the agent learns to resolve unobserved confounders using interventions (a feat impossible with only observational data). In Fig. 4(a) we see that the agent with access to interventional data performs better than an agent with access to only observational data. Fig. 4(b) shows that the performance increase is greater in cases where the intervened node shared an unobserved parent (a confounder) with other variables in the graph. In this section we also compare the agent’s performance to a MAP estimate of the causal structure and find that the agent’s performance matches it, indicating that the agent is indeed doing close to optimal causal inference.
|
| 164 |
+
|
| 165 |
+
In Section 4.3 and Fig. 5, we show that the agent learns to use counterfactuals. In Fig. 5(a) we see that the agent with additional access to the specific randomness in the test phase performs better than an agent with access to only interventional data. In Fig. 5(b), we find that the increased performance is observed only in cases where the maximum mean value in the graph is degenerate, and optimal choice is affected by the exogenous noise – i.e. where multiple nodes have the same value on average and the specific randomness can be used to distinguish their actual values in that specific case.
|
| 166 |
+
|
| 167 |
+
# 6 DISCUSSION AND FUTURE WORK
|
| 168 |
+
|
| 169 |
+
This work is the first demonstration that causal reasoning can arise out of model-free reinforcement learning. This opens up the possibility of leveraging powerful learning-based methods for causal inference in complex settings. Traditional formal approaches usually decouple the two problems of causal induction (i.e. inferring the structure of the underlying model) and causal inference (i.e. estimating causal effects and answering counterfactual questions), and despite advances in both (Ortega & Stocker, 2015; Bramley et al., 2017; Parida et al., 2018; Sen et al., 2017; Forney et al., 2017; Lattimore et al., 2016), inducing models often requires assumptions that are difficult to fit to complex real-world conditions. By learning these end-to-end, our method can potentially find representations of causal structure best tuned to the specific causal inferences required. Another key advantage of our meta-RL approach is that it allows the agent to learn to interact with the environment in order to acquire necessary observations in the service of its task—i.e. to perform active learning. In our experimental domain, our agents’ active intervention policy was close to optimal, which demonstrates the promise of agents that can learn to experiment on their environment and perform rich causal reasoning on the observations.
|
| 170 |
+
|
| 171 |
+
Future work should explore agents that perform experiments to support structured exploration in RL, and optimal experiment design in complex domains where large numbers of blind interventions are prohibitive. To this end, follow-up work should focus on scaling up our approach to larger environments, with more complex causal structure and a more diverse range of tasks. Though the results here are a first step in this direction which use relatively standard deep RL components, our approach will likely benefit from more advanced architectures (e.g. Espeholt et al., 2018; Hessel et al., 2018; Hester et al., 2017) that allow longer more complex episodes, as well as models which are more explicitly compositional (e.g. Battaglia et al., 2018; Andreas et al., 2016) or have richer semantics (e.g. Ganin et al., 2018), that more explicitly leverage symmetries like equivalance classes in the environment.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 39–48, 2016.
|
| 176 |
+
|
| 177 |
+
M. Andrychowicz, M. Denil, S. Gomez, M. W. Hoffman, D. Pfau, T. Schaul, B. Shillingford, and N. De Freitas. Learning to learn by gradient descent by gradient descent. In Advances in Neural Information Processing Systems, pp. 3981–3989, 2016.
|
| 178 |
+
|
| 179 |
+
D. Barber. Bayesian Reasoning and Machine Learning. Cambridge University Press, 2012.
|
| 180 |
+
|
| 181 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 182 |
+
|
| 183 |
+
C. M. Bishop. Pattern Recognition and Machine Learning. Springer, 2006.
|
| 184 |
+
|
| 185 |
+
A. P. Blaisdell, K. Sawa, K. J. Leising, and M. R. Waldmann. Causal reasoning in rats. Science, 311(5763): 1020–1022, 2006.
|
| 186 |
+
|
| 187 |
+
N. R. Bramley, P. Dayan, T. L. Griffiths, and D. A. Lagnado. Formalizing neuraths ship: Approximate algorithms for online causal learning. Psychological review, 124(3):301, 2017.
|
| 188 |
+
|
| 189 |
+
K. Cho, B. Van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning ¨ phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 190 |
+
|
| 191 |
+
P. Dawid. Fundamentals of statistical causality. Technical report, University Colledge London, 2007.
|
| 192 |
+
|
| 193 |
+
Y. Duan, J. Schulman, X. Chen, P. L. Bartlett, I. Sutskever, and P. Abbeel. Rl2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016. URL http: //arxiv.org/abs/1611.02779.
|
| 194 |
+
|
| 195 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561, 2018.
|
| 196 |
+
|
| 197 |
+
C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
|
| 198 |
+
|
| 199 |
+
Andrew Forney, Judea Pearl, and Elias Bareinboim. Counterfactual data-fusion for online reinforcement learners. In International Conference on Machine Learning, pp. 1156–1164, 2017.
|
| 200 |
+
|
| 201 |
+
Yaroslav Ganin, Tejas Kulkarni, Igor Babuschkin, SM Eslami, and Oriol Vinyals. Synthesizing programs for images using reinforced adversarial learning. arXiv preprint arXiv:1804.01118, 2018.
|
| 202 |
+
|
| 203 |
+
A. Gopnik, D. M. Sobel, L. E. Schulz, and C. Glymour. Causal learning mechanisms in very young children: two-, three-, and four-year-olds infer causal relations from patterns of variation and covariation. Developmental psychology, 37(5):620, 2001.
|
| 204 |
+
|
| 205 |
+
A. Gopnik, C. Glymour, D. M. Sobel, L. E. Schulz, T. Kushnir, and D. Danks. A theory of causal learning in children: causal maps and bayes nets. Psychological review, 111(1):3, 2004.
|
| 206 |
+
|
| 207 |
+
Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. arXiv preprint arXiv:1809.04474, 2018.
|
| 208 |
+
|
| 209 |
+
Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Gabriel Dulac-Arnold, et al. Deep q-learning from demonstrations. arXiv preprint arXiv:1704.03732, 2017.
|
| 210 |
+
|
| 211 |
+
S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997.
|
| 212 |
+
|
| 213 |
+
D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques. MIT Press, 2009.
|
| 214 |
+
|
| 215 |
+
A. Krizhevsky, I. Sutskever, and g. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 216 |
+
|
| 217 |
+
David A Lagnado, Tobias Gerstenberg, and Ro’i Zultan. Causal responsibility and counterfactuals. Cognitive science, 37(6):1036–1073, 2013.
|
| 218 |
+
Finnian Lattimore, Tor Lattimore, and Mark D Reid. Causal bandits: Learning good interventions via causal inference. In Advances in Neural Information Processing Systems, pp. 1181–1189, 2016.
|
| 219 |
+
A. M. Leslie. The perception of causality in infants. Perception, 11(2):173–186, 1982.
|
| 220 |
+
V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. P. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. CoRR, abs/1602.01783, 2016. URL http: //arxiv.org/abs/1602.01783.
|
| 221 |
+
K. P. Murphy. Machine Learning: a Probabilistic Perspective. MIT Press, 2012.
|
| 222 |
+
P. A. Ortega and D. D. Lee A. A. Stocker. Causal reasoning in a prediction task with hidden causes. 37th Annual Cognitive Science Society Meeting CogSci, 2015.
|
| 223 |
+
P. K. Parida, T. Marwala, and S. Chakraverty. A multivariate additive noise model for complete causal discovery. Neural Networks, 103:44–54, 2018.
|
| 224 |
+
J. Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988.
|
| 225 |
+
J. Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, 2000.
|
| 226 |
+
J. Pearl, M. Glymour, and N. P. Jewell. Causal Inference in Statistics: A Primer. Wiley, 2016.
|
| 227 |
+
A. Santoro, S. Bartunov, M. Botvinick, D. Wierstra, and T. Lillicrap. Meta-learning with memoryaugmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 228 |
+
Rajat Sen, Karthikeyan Shanmugam, Alexandros G Dimakis, and Sanjay Shakkottai. Identifying best interventions through online importance sampling. arXiv preprint arXiv:1701.02789, 2017.
|
| 229 |
+
P. Spirtes, C. N. Glymour, R. Scheines, D. Heckerman, C. Meek, G. Cooper, and T. Richardson. Causation, prediction, and search. MIT press, 2000.
|
| 230 |
+
O. Vinyals, C. Blundell, T. Lillicrap, D. Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 231 |
+
J. X. Wang, Z. Kurth-Nelson, D. Tirumala, H. Soyer, J. Z. Leibo, R. Munos, C. Blundell, D. Kumaran, and M. Botvinick. Learning to reinforcement learn. CoRR, abs/1611.05763, 2016. URL http: //arxiv.org/abs/1611.05763.
|
| 232 |
+
J. X. Wang, Z. Kurth-Nelson, D. Kumaran, D. Tirumala, H. Soyer, J. Z. Leibo, D. Hassabis, and M. Botvinick. Prefrontal cortex as a meta-reinforcement learning system. Nature Neuroscience, 21, 2018.
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
A ADDITIONAL BASELINES
|
| 236 |
+
Figure 7: Reward distribution
|
| 237 |
+
|
| 238 |
+
We can also compare the performance of these agents to two standard model-free RL baselines. The Q-total agent learns a Q-value for each action across all steps for all the episodes. The Q-episode agent learns a Q-value for each action conditioned on the input at each time step $\left[ o _ { t } , a _ { t - 1 } , r _ { t - 1 } \right]$ , but with no LSTM memory to store previous actions and observations. Since the relationship between action and reward is random between episodes, Q-total was equivalent to selecting actions randomly, resulting in a considerably negative reward. The Q-episode agent essentially makes sure to not choose the arm that is indicated by $m _ { t }$ to be the external intervention (which is assured to be equal to $- 5 )$ , and essentially chooses randomly otherwise, giving an average reward of 0.
|
| 239 |
+
|
| 240 |
+
# B FORMAL DESCRIPTION OF META-LEARNING
|
| 241 |
+
|
| 242 |
+
Consider a distribution $\mathcal { D }$ over Markov Decision Processes (MDPs). We train an agent with memory (in our case an RNN-based agent) on this distribution. In each episode, we sample a task $m \sim \mathcal { D }$ . At each step $t$ within an episode, the agent sees an observation $o _ { t }$ , executes an action $a _ { t }$ , and receives a reward $r _ { t }$ . Both $a _ { t - 1 }$ and $r _ { t - 1 }$ are given as additional inputs to the network. Thus, via the recurrence of the network, each action is a function of the entire trajectory $\mathcal { H } _ { t } = \left\{ o _ { 0 } , a _ { 0 } , r _ { 0 } , . . . , o _ { t - 1 } , a _ { t - 1 } , r _ { t - 1 } , o _ { t } \right\}$ of the episode. Because this function is parameterized by the neural network, its complexity is limited only by the size of the network.
|
| 243 |
+
|
| 244 |
+
# C ABDUCTION-ACTION-PREDICTION METHOD FOR COUNTERFACTUAL REASONING
|
| 245 |
+
|
| 246 |
+
Pearl et al. (2016)’s “abduction-action-prediction” method prescribes one method for answering counterfactual queries, by estimating the specific unobserved makeup of individual $i$ and by transferring it to the counterfactual world. Assume, for example, the following model for $\mathcal { G }$ of Section 2.1: $E = w _ { A E } A + \eta$ , $H = w _ { A H } A + w _ { E H } E + \epsilon$ , where the weights $w _ { i j }$ represent the known causal effects in $\mathcal { G }$ and $\epsilon$ and $\eta$ are terms of (e.g.) Gaussian noise that represent the unobserved randomness in the makeup of each individual9. Suppose that for individual $i$ we observe: $A = a ^ { i }$ , $E = e ^ { i }$ , $H = h ^ { i }$ . We can answer the counterfactual question of “What if individual $i$ had done more exercise, i.e. $E { = } e ^ { \prime }$ , instead?” by: a) Abduction: estimate the individual’s specific makeup with $\epsilon ^ { i } = h ^ { i } - w _ { A H } a ^ { i } - w _ { E H } e ^ { i }$ , b) Action: set $E$ to more exercise $e ^ { \prime }$ , c) Prediction: predict a new value for cardiac health as $h ^ { \prime } { = } w _ { A H } a ^ { i } { + } w _ { E H } e ^ { \prime } { + } { \epsilon } ^ { i }$ .
|
| 247 |
+
|
| 248 |
+
# D EXPERIMENT 4: NON-LINEAR CAUSAL GRAPHS
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure 8: Experiment 4 results
|
| 252 |
+
|
| 253 |
+
The purview of the previous experiments was to show a proof of concept on a simple tractable system, demonstrating that causal induction and inference can be learned and implemented via a meta-learned agent. In this experiment, we generalize some of the results to nonlinear, non-Gaussian causal graphs which are more typical of real-world causal graphs and to demonstrate that our results hold without loss of generality on such systems.
|
| 254 |
+
|
| 255 |
+
Here we investigate causal DAGs with a quadratic dependence on the parents by changing the conditional distribution to $\begin{array} { r } { \overline { { p } } ( X _ { i } | \mathfrak { p a } ( X _ { i } ) ) = \mathcal { N } ( \frac { 1 } { N _ { i } } \overset { \cdot } { \sum _ { j } } w _ { j i } ( X _ { j } \overset { \cdot } { + } X _ { j } ^ { 2 } ) , \sigma ) } \end{array}$ . Here, although each node is normally distributed given its parents, the joint distribution is not multivariate Gaussian due to the non-linearity in how the means are determined. We find that the Long-Observational achieves more reward than the Observational agent indicating that the agent is in fact learning the statistical dependencies between the nodes, within an episode. We also find that although the Active-Interventional agent is not far behind the performance of the MAP baseline, and achieves reward well above the Long-Observational10 The fact that the MAP baseline gets so close to the Optimal Cause-Effect baseline indicates that the Active agent is choosing close to optimal actions.
|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
E EXPERIMENT 5: LARGER CAUSAL GRAPHS WITH GENERALIZATION TO NEW EQUIVALENCE CLASSES
|
| 259 |
+
Figure 9: (a) Comparing agent performances with different data. (b) Comparing information phase intervention policies.
|
| 260 |
+
|
| 261 |
+
In the experiments reported in the main paper, the test set was a random subset of all graphs, and training examples were generated randomly subject to the constraint that they not be in the test set. However, this raised the possibility that any test graph might have an equivalent graph in the training set, which could result in a type of overfitting. We therefore ran a new set of experiments where
|
| 262 |
+
|
| 263 |
+
the entire equivalence class of each test graph was held out from the training set11. Performance on the test set therefore indicates generalization of the inference procedures learned to previously unseen equivalence classes of causal DAGs. For these experiments, we used graphs with $N { = } 6$ nodes, because 5-node graphs have too few equivalence classes to partition in this way. All other details were the same as in the main paper.
|
| 264 |
+
|
| 265 |
+
We see in Fig. 9a that the agents learn to generalize well to these held out examples, and we find the same pattern of behavior noted in the main text where the rewards earned are ordered such that Observational agent $<$ Passive-Conditional agent $<$ Passive-Interventional agent $<$ Passive-Counterfactual agent. We see additionally in Fig. 9b that the Active-Interventional agent performs at par with the Passive-Interventional agent (which is allowed to see the results of interventions on all nodes) and significantly better than an additional baseline we use here of the Random-Interventional agent whose information phase policy is to intervene on nodes at random, indicating that the intervention policy learned by the Active agent is good.
|
| 266 |
+
|
| 267 |
+
# F GRAPHICAL MODELS AND BELIEF NETWORKS
|
| 268 |
+
|
| 269 |
+
Graphical models (Pearl, 1988; Bishop, 2006; Koller & Friedman, 2009; Barber, 2012; Murphy, 2012) are a marriage between graph and probability theory that allows to graphically represent and assess statistical dependence. In the following sections, we give some basic definitions and describe a method $d \cdot$ -separation) for graphically assessing statistical independence in belief networks.
|
| 270 |
+
|
| 271 |
+
# BASIC DEFINITIONS
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 10: (a): Directed acyclic graph. The node $X _ { 3 }$ is a collider on the path $X _ { 1 } \right. X _ { 3 } \left. X _ { 2 }$ and a non-collider on the path $X _ { 2 } X _ { 3 } X _ { 4 }$ . (b): Cyclic graph obtained from (a) by adding a link from $X _ { 4 }$ to $X _ { 1 }$ .
|
| 275 |
+
|
| 276 |
+
A graph is a collection of nodes and links connecting pairs of nodes. The links may be directed or undirected, giving rise to directed or undirected graphs respectively.
|
| 277 |
+
|
| 278 |
+
A path from node $X _ { i }$ to node $X _ { j }$ is a sequence of linked nodes starting at $X _ { i }$ and ending at $X _ { j }$ . A directed path is a path whose links are directed and pointing from preceding towards following nodes in the sequence.
|
| 279 |
+
|
| 280 |
+
A directed acyclic graph (DAG) is a directed graph with no directed paths starting and ending at the same node. For example, the directed graph in Fig. 10(a) is acyclic. The addition of a link from $X _ { 4 }$ to $X _ { 1 }$ gives rise to a cyclic graph (Fig. 10(b)).
|
| 281 |
+
|
| 282 |
+
A node $X _ { i }$ with a directed link to $X _ { j }$ is called parent of $X _ { j }$ . In this case, $X _ { j }$ is called child of $X _ { i }$ .
|
| 283 |
+
|
| 284 |
+
A node is a collider on a specified path if it has (at least) two parents on that path. Notice that a node can be a collider on a path and a non-collider on another path. For example, in Fig. 10(a) $X _ { 3 }$ is a collider on the path $X _ { 1 } \right. X _ { 3 } \left. X _ { 2 }$ and a non-collider on the path $X _ { 2 } X _ { 3 } X _ { 4 }$ .
|
| 285 |
+
|
| 286 |
+
A node $X _ { i }$ is an ancestor of a node $X _ { j }$ if there exists a directed path from $X _ { i }$ to $X _ { j }$ . In this case, $X _ { j }$ is a descendant of $X _ { i }$ .
|
| 287 |
+
|
| 288 |
+
A graphical model is a graph in which nodes represent random variables and links express statistical relationships between the variables.
|
| 289 |
+
|
| 290 |
+
A belief network is a directed acyclic graphical model in which each node $X _ { i }$ is associated with the conditional distribution $p ( X _ { i } | \mathfrak { p a } ( X _ { i } ) )$ , where $\mathsf { p a } ( X _ { i } )$ indicates the parents of $X _ { i }$ . The joint distribution of all nodes in the graph, $p ( X _ { 1 : N } )$ , is given by the product of all conditional distributions, i.e.
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
p ( X _ { 1 : N } ) { = } \prod _ { i = 1 } ^ { N } p ( X _ { i } | \mathsf { p a } ( X _ { i } ) ) .
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
# ASSESSING STATISTICAL INDEPENDENCE IN BELIEF NETWORKS
|
| 297 |
+
|
| 298 |
+
Given the sets of random variables $x , y$ and $\mathcal { Z }$ , $\mathcal { X }$ and $\mathcal { V }$ are statistically independent given $\mathcal { Z } \left( \mathcal { X } \perp \perp \mathcal { Y } | \mathcal { Z } \right)$ if all paths from any element of $\mathcal { X }$ to any element of $\mathcal { V }$ are closed (or blocked). A path is closed if at least one of the following conditions is satisfied:
|
| 299 |
+
|
| 300 |
+
(Ia) There is a non-collider on the path which belongs to the conditioning set $\mathcal { Z }$ . (Ib) There is a collider on the path such that neither the collider nor any of its descendants belong to the conditioning set $\mathcal { Z }$ .
|
md/train/HJC2SzZCW/HJC2SzZCW.md
ADDED
|
@@ -0,0 +1,533 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SENSITIVITY AND GENERALIZATION IN NEURAL NETWORKS: AN EMPIRICAL STUDY
|
| 2 |
+
|
| 3 |
+
Roman Novak, Yasaman Bahri∗, Daniel A. Abolafia, Jeffrey Pennington, Jascha Sohl-Dickstein
|
| 4 |
+
|
| 5 |
+
Google Brain
|
| 6 |
+
|
| 7 |
+
{romann, yasamanb, danabo, jpennin, jaschasd}@google.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
In practice it is often found that large over-parameterized neural networks generalize better than their smaller counterparts, an observation that appears to conflict with classical notions of function complexity, which typically favor smaller models. In this work, we investigate this tension between complexity and generalization through an extensive empirical exploration of two natural metrics of complexity related to sensitivity to input perturbations. Our experiments survey thousands of models with various fully-connected architectures, optimizers, and other hyper-parameters, as well as four different image classification datasets.
|
| 12 |
+
|
| 13 |
+
We find that trained neural networks are more robust to input perturbations in the vicinity of the training data manifold, as measured by the norm of the input-output Jacobian of the network, and that it correlates well with generalization. We further establish that factors associated with poor generalization – such as full-batch training or using random labels – correspond to lower robustness, while factors associated with good generalization – such as data augmentation and ReLU non-linearities – give rise to more robust functions. Finally, we demonstrate how the input-output Jacobian norm can be predictive of generalization at the level of individual test points.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
The empirical success of deep learning has thus far eluded interpretation through existing lenses of computational complexity (Blum & Rivest, 1988), numerical optimization (Choromanska et al., 2015; Goodfellow & Vinyals, 2014; Dauphin et al., 2014) and classical statistical learning theory (Zhang et al., 2016): neural networks are highly non-convex models with extreme capacity that train fast and generalize well. In fact, not only do large networks demonstrate good test performance, but larger networks often generalize better, counter to what would be expected from classical measures, such as VC dimension. This phenomenon has been observed in targeted experiments (Neyshabur et al., 2015), historical trends of Deep Learning competitions (Canziani et al., 2016), and in the course of this work (Figure 1).
|
| 18 |
+
|
| 19 |
+
This observation is at odds with Occam’s razor, the principle of parsimony, as applied to the intuitive notion of function complexity (see A.2 for extended discussion). One resolution of the apparent contradiction is to examine complexity of functions in conjunction with the input domain. $f ( x ) =$ $x ^ { 3 } \sin ( x )$ may seem decisively more complex than $g ( x ) \ = \ x$ . But restrained to a narrow input domain of $[ - 0 . 0 1 , 0 . 0 1 ]$ they appear differently: $g$ remains a linear function of the input, while $f ( x ) = \mathcal { O } \left( x ^ { 4 } \right)$ resembles a constant 0. In this work we find that such intuition applies to neural networks, that behave very differently close to the data manifold than away from it (§4.1).
|
| 20 |
+
|
| 21 |
+
We therefore analyze the complexity of models through their capacity to distinguish different inputs in the neighborhood of datapoints, or, in other words, their sensitivity. We study two simple metrics presented in $\ S$ and find that one of them, the norm of the input-output Jacobian, correlates with generalization in a very wide variety of scenarios.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: 2160 networks trained to $100 \%$ training accuracy on CIFAR10 (see $\ S$ for experimental details). Left: while increasing capacity of the model allows for overfitting (top), very few models do, and a model with the maximum parameter count yields the best generalization (bottom right). Right: train loss does not correlate well with generalization, and the best model (minimum along the $y$ -axis) has training loss many orders of magnitude higher than models that generalize worse (left). This observation rules out underfitting as the reason for poor generalization in low-capacity models. See (Neyshabur et al., 2015) for similar findings in the case of achievable 0 training loss.
|
| 25 |
+
|
| 26 |
+
This work considers sensitivity only in the context of image classification tasks. We interpret the observed correlation with generalization as an expression of a universal prior on (natural) image classification functions that favor robustness (see $\ S \mathrm { A } . 2$ for details). While we expect a similar prior to exist in many other perceptual settings, care should be taken when extrapolating our findings to tasks where such a prior may not be justified (e.g. weather forecasting).
|
| 27 |
+
|
| 28 |
+
# 1.1 PAPER OUTLINE
|
| 29 |
+
|
| 30 |
+
We first define sensitivity metrics for fully-connected neural networks in §3. We then relate them to generalization through a sequence of experiments of increasing level of nuance:
|
| 31 |
+
|
| 32 |
+
• In §4.1 we begin by comparing the sensitivity of trained neural networks on and off the training data manifold, i.e. in the regions of best and typical (over the whole input space) generalization.
|
| 33 |
+
• In §4.2 we compare sensitivity of identical trained networks that differ in a single hyperparameter which is important for generalization. Further, $\ S$ associates sensitivity and generalization in an unrestricted manner, i.e. comparing networks of a wide variety of hyper-parameters such as width, depth, non-linearity, weight initialization, optimizer, learning rate and batch size.
|
| 34 |
+
• Finally, $\ S$ explores how predictive sensitivity (as measured by the Jacobian norm) is for individual test points.
|
| 35 |
+
|
| 36 |
+
# 1.2 SUMMARY OF CONTRIBUTIONS
|
| 37 |
+
|
| 38 |
+
The novelty of this work can be summarized as follows:
|
| 39 |
+
|
| 40 |
+
• Study of the behavior of trained neural networks on and off the data manifold through sensitivity metrics (§4.1). • Evaluation of sensitivity metrics on trained neural networks in a very large-scale experimental setting and finding that they correlate with generalization (§4.2, §4.3, §4.4).
|
| 41 |
+
|
| 42 |
+
§2 puts our work in context of related research studying complexity, generalization, or sensitivity metrics similar to ours.
|
| 43 |
+
|
| 44 |
+
# 2 RELATED WORK
|
| 45 |
+
|
| 46 |
+
# 2.1 COMPLEXITY METRICS
|
| 47 |
+
|
| 48 |
+
We analyze complexity of fully-connected neural networks for the purpose of model comparison through the following sensitivity measures (see §3 for details):
|
| 49 |
+
|
| 50 |
+
• estimating the number of linear regions a network splits the input space into;
|
| 51 |
+
• measuring the norm of the input-output Jacobian within such regions.
|
| 52 |
+
|
| 53 |
+
A few prior works have examined measures related to the ones we consider. In particular, Pascanu et al. (2013); Montufar et al. ´ (2014); Raghu et al. (2016) have investigated the expressive power of fully-connected neural networks built out of piecewise-linear activation functions. Such functions are themselves piecewise-linear over their input domain, so that the number of linear regions into which input space is divided is one measure of how nonlinear the function is. A function with many linear regions has the capacity to build complex, flexible decision boundaries. It was argued in (Pascanu et al., 2013; Montufar et al. ´ , 2014) that an upper bound to the number of linear regions scales exponentially with depth but polynomially in width, and a specific construction was examined. Raghu et al. (2016) derived a tight analytic bound and considered the number of linear regions for generic networks with random weights, as would be appropriate, for instance, at initialization. However, the evolution of this measure after training has not been investigated before. We examine a related measure, the number of hidden unit transitions along one-dimensional trajectories in input space, for trained networks. Further motivation for this measure is discussed in §3.
|
| 54 |
+
|
| 55 |
+
Another perspective on function complexity can be gained by studying their robustness to perturbations to the input. Indeed, Rasmussen & Ghahramani (2000) demonstrate on a toy problem how complexity as measured by the number of parameters may be of limited utility for model selection, while measuring the output variation allows the invocation of Occam’s razor. In this work we apply related ideas to a large-scale practical context of neural networks with up to a billion free parameters ( 4.2, 4.3) and discuss potential ways in which sensitivity permits the application of Occam’s razor to neural networks (§A.2).
|
| 56 |
+
|
| 57 |
+
Sokolic et al. (2017) provide theoretical support for the relevance of robustness, as measured by the input-output Jacobian, to generalization. They derive bounds for the generalization gap in terms of the Jacobian norm within the framework of algorithmic robustness (Xu & Mannor, 2012). Our results provide empirical support for their conclusions through an extensive number of experiments. Several other recent papers have also focused on deriving tight generalization bounds for neural networks (Bartlett et al., 2017; Dziugaite & Roy, 2017; Neyshabur et al., 2018). We do not propose theoretical bounds in this paper but establish a correlation between our metrics and generalization in a substantially larger experimental setting than undertaken in prior works.
|
| 58 |
+
|
| 59 |
+
# 2.2 REGULARIZATION
|
| 60 |
+
|
| 61 |
+
In the context of regularization, increasing robustness to perturbations is a widely-used strategy: data augmentation, noise injection (Jiang et al., 2009), weight decay (Krogh & Hertz, 1992), and max-pooling all indirectly reduce sensitivity of the model to perturbations, while Rifai et al. (2011); Sokolic et al. (2017) explicitly penalize the Frobenius norm of the Jacobian in the training objective.
|
| 62 |
+
|
| 63 |
+
In this work we relate several of the above mentioned regularizing techniques to sensitivity, demonstrating through extensive experiments that improved generalization is consistently coupled with better robustness as measured by a single metric, the input-output Jacobian norm (§4.2). While some of these findings confirm common-sense expectations (random labels increase sensitivity, Figure 4, top row), others challenge our intuition of what makes a neural network robust (ReLU-networks, with unbounded activations, tend to be more robust than saturating HardSigmoid-networks, Figure 4, third row).
|
| 64 |
+
|
| 65 |
+
# 2.3 INDUCTIVE BIAS OF SGD
|
| 66 |
+
|
| 67 |
+
One of our findings demonstrates an inductive bias towards robustness in stochastic mini-batch optimization compared to full-batch training (Figure 4, bottom row). Interpreting this regularizing effect in terms of some measure of sensitivity, such as curvature, is not new (Hochreiter & Schmidhuber, 1997; Keskar et al., 2016), yet we provide a novel perspective by relating it to reduced sensitivity to inputs instead of parameters.
|
| 68 |
+
|
| 69 |
+
The inductive bias of SGD (“implicit regularization”) has been previously studied in (Neyshabur et al., 2015), where it was shown through rigorous experiments how increasing the width of a singlehidden-layer network improves generalization, and an analogy with matrix factorization was drawn to motivate constraining the norm of the weights instead of their count. Neyshabur et al. (2017) further explored several weight-norm based measures of complexity that do not scale with the size of the model. One of our measures, the Frobenius norm of the Jacobian is of similar nature (since the Jacobian matrix size is determined by the task and not by a particular network architecture). However, this particular metric was not considered, and, to the best of our knowledge, we are the first to evaluate it in a large-scale setting (e.g. our networks are up to 65 layers deep and up to $2 ^ { 1 6 }$ units wide).
|
| 70 |
+
|
| 71 |
+
# 2.4 ADVERSARIAL EXAMPLES
|
| 72 |
+
|
| 73 |
+
Sensitivity to inputs has attracted a lot of interest in the context of adversarial examples (Szegedy et al., 2013). Several attacks locate points of poor generalization in the directions of high sensitivity of the network (Goodfellow et al., 2014; Papernot et al., 2016; Moosavi-Dezfooli et al., 2016), while certain defences regularize the model by penalizing sensitivity (Gu & Rigazio, 2014) or employing decaying (hence more robust) non-linearities (Kurakin et al., 2016). However, work on adversarial examples relates highly specific perturbations to a similarly specific kind of generalization (i.e. performance on a very small, adversarial subset of the data manifold), while this paper analyzes average-case sensitivity (§3) and typical generalization.
|
| 74 |
+
|
| 75 |
+
# 3 SENSITIVITY METRICS
|
| 76 |
+
|
| 77 |
+
We propose two simple measures of sensitivity for a fully-connected neural network (without biases) $\mathbf { f } : \bar { \mathbb { R } } ^ { d } \overset { \cdot } { } \mathbb { R } ^ { n }$ with respect to its input $\mathbf { x } \in \mathbb { R } ^ { d }$ (the output being unnormalized logits of the $n$ classes). Assume f employs a piecewise-linear activation function, like ReLU. Then f itself, as a composition of linear and piecewise-linear functions, is a piecewise-linear map, splitting the input space $\mathbf { \mathbb { R } } ^ { d }$ into disjoint regions, implementing a single affine mapping on each. Then we can measure two aspects of sensitivity by answering
|
| 78 |
+
|
| 79 |
+
1. How does the output of the network change as the input is perturbed within the linear region?
|
| 80 |
+
|
| 81 |
+
2. How likely is the linear region to change in response to change in the input?
|
| 82 |
+
|
| 83 |
+
We quantify these qualities as follows:
|
| 84 |
+
|
| 85 |
+
1. For a local sensitivity measure we adopt the Frobenius norm of the class probabilities Jacobian $\mathbf { J } ( \mathbf { x } ) = \partial \mathbf { f } _ { \sigma } \left( \mathbf { x } \right) / \partial \mathbf { x } ^ { \mathbf { T } }$ (with $\bar { J _ { i j } } ( \mathbf { x } ) = \partial \left[ \mathbf { f } _ { \sigma } \left( \mathbf { x } \right) \right] _ { i } / \partial x _ { j } )$ , where $\mathbf { f } _ { \sigma } = \sigma \circ \mathbf { f }$ with $\pmb { \sigma }$ being the softmax function1. Given points of interest $\mathbf { x } _ { \mathrm { t e s t } }$ , we estimate the sensitivity of the function in those regions with the average Jacobian norm:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathbb { E } _ { \mathbf { x } _ { \mathrm { t e s t } } } \left[ \left. \mathbf { J } \left( \mathbf { x } _ { \mathrm { t e s t } } \right) \right. _ { F } \right] ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
that we will further refer to as simply “Jacobian norm”. Note that this does not require the labels for $\mathbf { x } _ { \mathrm { t e s t } }$ .
|
| 92 |
+
|
| 93 |
+
Interpretation. The Frobenius norm $\begin{array} { r } { \| \mathbf { J } ( \mathbf { x } ) \| _ { F } = \sqrt { \sum _ { i j } J _ { i j } ( \mathbf { x } ) ^ { 2 } } } \end{array}$ estimates the averagecase sensitivity of $\mathbf { f } _ { \sigma }$ around $\mathbf { x }$ . Indeed, consider an infinitesimal Gaussian perturbation
|
| 94 |
+
|
| 95 |
+
$\Delta \mathbf { x } \sim \mathcal { N } \left( \mathbf { 0 } , \epsilon \mathbf { I } \right)$ : the expected magnitude of the output change is then
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { \Delta \mathbf { x } } \left[ \big \| \mathbf { f } _ { \sigma } \left( \mathbf { x } \right) - \mathbf { f } _ { \sigma } \left( \mathbf { x } + \Delta \mathbf { x } \right) \big \| _ { 2 } ^ { 2 } \right] \approx \mathbb { E } _ { \Delta \mathbf { x } } \left[ \big \| \mathbf { J } ( \mathbf { x } ) \Delta \mathbf { x } \big \| _ { 2 } ^ { 2 } \right] = \mathbb { E } _ { \Delta \mathbf { x } } \bigg [ \displaystyle \sum _ { i } \left( \displaystyle \sum _ { j } J _ { i j } x _ { j } \right) ^ { 2 } \bigg ] } \\ { = \displaystyle \sum _ { i j j ^ { \prime } } J _ { i j ^ { \prime } } \mathbb { E } _ { \Delta \mathbf { x } } \left[ x _ { j } x _ { j ^ { \prime } } \right] = \displaystyle \sum _ { i j } J _ { i j } ^ { 2 } \mathbb { E } _ { \Delta \mathbf { x } } \left[ x _ { j } ^ { 2 } \right] } \\ { = \epsilon \left\| \mathbf { J } \left( \mathbf { x } \right) \right\| _ { F } ^ { 2 } . } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
2. To detect a change in linear region (further called a “transition”), we need to be able to identify it. We do this analogously to Raghu et al. (2016). For a network with piecewiselinear activations, we can, given an input $\mathbf { x }$ , assign a code to each neuron in the network f, that identifies the linear region of the pre-activation of that neuron. E.g. each ReLU unit will have 0 or 1 assigned to it if the pre-activation value is less or greater than 0 respectively. Similarly, a ReLU6 unit (see definition in A.4) will have a code of 0, 1, or 2 assigned, since it has 3 linear regions2. Then, a concatenation of codes of all neurons in the network (denoted by $\mathbf { c } ( \mathbf { x } ) \dot { }$ ) uniquely identifies the linear region of the input $\mathbf { x }$ (see A.1.1 for discussion of edge cases).
|
| 102 |
+
|
| 103 |
+
Given this encoding scheme, we can detect a transition by detecting a change in the code. We then sample $k$ equidistant points $\mathbf { z } _ { 0 } , \ldots , \mathbf { z } _ { k - 1 }$ on a closed one-dimensional trajectory $\tau ( \mathbf { x } )$ (generated from a data point $\mathbf { x }$ and lying close to the data manifold; see below for details) and count transitions $t ( \mathbf { x } )$ along it to quantify the number of linear regions:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
t ( \mathbf { x } ) : = \sum _ { i = 0 } ^ { k - 1 } \left\| \mathbf { c } \left( \mathbf { z } _ { i } \right) - \mathbf { c } \left( \mathbf { z } _ { ( i + 1 ) } \% \right) \right\| _ { 1 } \approx \oint _ { \mathbf { z } \in \mathcal { T } ( \mathbf { x } ) } \left\| \frac { \partial \mathbf { c } ( \mathbf { z } ) } { \partial \left( d \mathbf { z } \right) } \right\| _ { 1 } d \mathbf { z } ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where the norm of the directional derivative $\| \partial \mathbf { c ( z ) } / \partial \left( d \mathbf { z } \right) \| _ { 1 }$ amounts to a Dirac delta function at each transition (see A.1.2 for further details).
|
| 110 |
+
|
| 111 |
+
By sampling multiple such trajectories around different points, we estimate the sensitivity metric:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathbb { E } _ { \mathbf { x } _ { \mathrm { t e s t } } } \left[ t \left( \mathbf { x } _ { \mathrm { t e s t } } \right) \right] ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
that we will further refer to as simply “transitions” or “number of transitions.”
|
| 118 |
+
|
| 119 |
+
To assure the sampling trajectory $\tau ( \mathbf { x } _ { \mathrm { t e s t } } )$ is close to the data manifold (since this is the region of interest), we construct it through horizontal translations of the image $\mathbf { x } _ { \mathrm { t e s t } }$ in pixel space (Figure App.7, right). We similarly augment our training data with horizontal and vertical translations in the corresponding experiments (Figure 4, second row).
|
| 120 |
+
|
| 121 |
+
As earlier, this metric does not require knowing the label of $\mathbf { x } _ { \mathrm { t e s t } }$
|
| 122 |
+
|
| 123 |
+
Interpretation. We can draw a qualitative parallel between the number of transitions and curvature of the function. One measure of curvature of a function $\mathbf { f }$ is the total norm of the directional derivative of its first derivative $\mathbf { f ^ { \prime } }$ along a path:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
C \left( \mathbf { f } , \mathcal { T } \left( \mathbf { x } \right) \right) : = \oint _ { \mathbf { z } \in \mathcal { T } \left( \mathbf { x } \right) } \left. \frac { \partial \mathbf { f } ^ { \prime } \left( \mathbf { z } \right) } { \partial \left( d \mathbf { z } \right) } \right. _ { F } d \mathbf { z } .
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
A piecewise-linear function $\mathbf { f }$ has a constant first derivative $\mathbf { f ^ { \prime } }$ everywhere except for the transition boundaries. Therefore, for a sufficiently large $k$ , curvature can be expressed as
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
C \left( \mathbf { f } , \mathcal { T } \left( { \mathbf { x } } \right) \right) = \frac { 1 } { 2 } \sum _ { i = 0 } ^ { k - 1 } \left\| \mathbf { f } ^ { \prime } \left( \mathbf { z } _ { i } \right) - \mathbf { f } ^ { \prime } \left( \mathbf { z } _ { \left( i + 1 \right) \mathcal { V } _ { 0 } k } \right) \right\| _ { F } ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $\mathbf { z } _ { 0 } , \ldots , \mathbf { z } _ { k - 1 }$ are equidistant samples on $\tau ( \mathbf { x } )$ . This sum is similar to $t ( \mathbf { x } )$ as defined in Equation 1, but quantifies the amount of change in between two linear regions in a nonbinary way. However, estimating it on a densely sampled trajectory is a computationallyintensive task, which is one reason we instead count transitions.
|
| 136 |
+
|
| 137 |
+
As such, on a qualitative level, the two metrics (Jacobian norm and number of transitions) track the first and second order terms of the Taylor expansion of the function.
|
| 138 |
+
|
| 139 |
+
Above we have defined two sensitivity metrics to describe the learned function around the data, on average. In $\ S 4 . 1$ we analyze these measures on and off the data manifold by simply measuring them along circular trajectories in input space that intersect the data manifold at certain points, but generally lie away from it (Figure 2, left).
|
| 140 |
+
|
| 141 |
+
# 4 EXPERIMENTAL RESULTS
|
| 142 |
+
|
| 143 |
+
In the following subsections $( \ S 4 . 2 , \ S 4 . 3 )$ each study analyzes performance of a large number (usually thousands) of fully-connected neural networks having different hyper-parameters and optimization procedures. Except where specified, we include only models which achieve $1 0 0 \%$ training accuracy. This allows us to study generalization disentangled from properties like expressivity and trainability, which are outside the scope of this work.
|
| 144 |
+
|
| 145 |
+
In order to efficiently evaluate the compute-intensive metrics (§3) in a very wide range of hyperparameters settings (see e.g. §A.5.5) we only consider fully-connected networks. Extending the investigation to more complex architectures is left for future work.
|
| 146 |
+
|
| 147 |
+
# 4.1 SENSITIVITY ON AND OFF THE TRAINING DATA MANIFOLD
|
| 148 |
+
|
| 149 |
+
We analyze the behavior of a trained neural network near and away from training data. We do this by comparing sensitivity of the function along 3 types of trajectories:
|
| 150 |
+
|
| 151 |
+
1. A random ellipse. This trajectory is extremely unlikely to pass anywhere near the real data, and indicates how the function behaves in random locations of the input space that it never encountered during training.
|
| 152 |
+
2. An ellipse passing through three training points of different class (Figure 2, left). This trajectory does pass through the three data points, but in between it traverses images that are linear combinations of different-class images, and are expected to lie outside of the natural image space. Sensitivity of the function along this trajectory allows comparison of its behavior on and off the data manifold, as it approaches and moves away from the three anchor points.
|
| 153 |
+
3. An ellipse through three training points of the same class. This trajectory is similar to the previous one, but, given the dataset used in the experiment (MNIST), is expected to traverse overall closer to the data manifold, since linear combinations of the same digit are more likely to resemble a realistic image. Comparing transition density along this trajectory to the one through points of different classes allows further assessment of how sensitivity changes in response to approaching the data manifold.
|
| 154 |
+
|
| 155 |
+
We find that, according to both the Jacobian norm and transitions metrics, functions exhibit much more robust behavior around the training data (Figure 2, center and right). We further visualize this effect in 2D in Figure 3, where we plot the transition boundaries of the last (pre-logit) layer of a neural network before and after training. After training we observe that training points lie in regions of low transition density.
|
| 156 |
+
|
| 157 |
+
The observed contrast between the neural network behavior near and away from data further strengthens the empirical connection we draw between sensitivity and generalization in 4.2, $\ S$ and $\ S 4 . 4$ ; it also confirms that, as mentioned in $\ S$ , if a certain quality of a function is to be used for model comparison, input domain should always be accounted for.
|
| 158 |
+
|
| 159 |
+
# 4.2 SENSITIVITY AND GENERALIZATION FACTORS
|
| 160 |
+
|
| 161 |
+
In §4.1 we established that neural networks implement more robust functions in the vicinity of the training data manifold than away from it.
|
| 162 |
+
|
| 163 |
+
We now consider the more practical context of model selection. Given two perfectly trained neural networks, does the model with better generalization implement a less sensitive function?
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 2: A $100 \%$ -accurate (on training data) MNIST network implements a function that is much more stable near training data than away from it. Left: depiction of a hypothetical circular trajectory in input space passing through three digits of different classes, highlighting the training point locations $( \pi / 3 , \pi , 5 \pi / 3 )$ . Center: Jacobian norm as the input traverses an elliptical trajectory. Sensitivity drops significantly in the vicinity of training data while remaining uniform along random ellipses. Right: transition density behaves analogously. According to both metrics, as the input moves between points of different classes, the function becomes less stable than when it moves between points of the same class. This is consistent with the intuition that linear combinations of different digits lie further from the data manifold than those of same-class digits (which need not hold for more complex datasets). See §A.5.2 for experimental details.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 3: Transition boundaries of the last (pre-logits) layer over a 2-dimensional slice through the input space defined by 3 training points (indicated by inset squares). Left: boundaries before training. Right: after training, transition boundaries become highly non-isotropic, with training points lying in regions of lower transition density. See §A.5.3 for experimental details.
|
| 170 |
+
|
| 171 |
+
We study approaches in the machine learning community that are commonly believed to influence generalization (Figure 4, top to bottom):
|
| 172 |
+
|
| 173 |
+
random labels;
|
| 174 |
+
• data augmentation;
|
| 175 |
+
• ReLUs;
|
| 176 |
+
• full-batch training.
|
| 177 |
+
|
| 178 |
+
We find that in each case, the change in generalization is coupled with the respective change in sensitivity (i.e. lower sensitivity corresponds to smaller generalization gap) as measured by the Jacobian norm (and almost always for the transitions metric).
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 4: Improvement in generalization (left column) due to using correct labels, data augmentation, ReLUs, mini-batch optimization (top to bottom) is consistently coupled with reduced sensitivity as measured by the Jacobian norm (center column). Transitions (right column) correlate with generalization in all considered scenarios except for comparing optimizers (bottom right). Each point on the plot corresponds to two neural networks that share all hyper-parameters and the same optimization procedure, but differ in a certain property as indicated by axes titles. The coordinates along each axis reflect the values of the quantity in the title of the plot in the respective setting (i.e. with true or random labels). All networks have reached $1 0 0 \%$ training accuracy on CIFAR10 in both settings (except for the data-augmentation study, second row; see $\ S$ for details). See §A.5.5 for experimental details (§A.5.4 for the data-augmentation study) and §4.2.1 for plot interpretation.
|
| 182 |
+
|
| 183 |
+
# 4.2.1 HOW TO READ PLOTS
|
| 184 |
+
|
| 185 |
+
In Figure 4, for many possible hyper-parameter configurations, we train two models that share all parameters and optimization procedure, but differ in a single binary setting (i.e. trained on true or random labels; with or without data augmentation; etc). Out of all such network pairs, we select only those where each network reached $100 \%$ training accuracy on the whole training set (apart from the data augmentation study). The two generalization or sensitivity values are then used as the $x$ and $y$ coordinates of a point corresponding to this pair of networks (with the plot axes labels denoting the respective value of the binary parameter considered). The position of the point with respect to the diagonal $y = x$ visually demonstrates which configuration has smaller generalization gap / lower sensitivity.
|
| 186 |
+
|
| 187 |
+
# 4.3 SENSITIVITY AND GENERALIZATION GAP
|
| 188 |
+
|
| 189 |
+
We now perform a large-scale experiment to establish direct relationships between sensitivity and generalization in a realistic setting. In contrast to $\ S 4 . 1$ , where we selected locations in the input space, and $\ S 4 . 2$ , where we varied a single binary parameter impacting generalization, we now sweep simultaneously over many different architectural and optimization choices (§A.5.5).
|
| 190 |
+
|
| 191 |
+
Our main result is presented in Figure 5, indicating a strong relationship between the Jacobian norm and generalization. In contrast, Figure App.8 demonstrates that the number of transitions is not alone sufficient to compare networks of different sizes, as the number of neurons in the networks has a strong influence on transition count.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 5: Jacobian norm correlates with generalization gap on all considered datasets. Each point corresponds to a network trained to $100 \%$ training accuracy (or at least $9 9 . 9 \%$ in the case of CIFAR100). See §A.5.4 and §A.5.5 for experimental details of bottom and top plots respectively.
|
| 195 |
+
|
| 196 |
+
# 4.4 SENSITIVITY AND PER-POINT GENERALIZATION
|
| 197 |
+
|
| 198 |
+
In §4.3 we established a correlation between sensitivity (as measured by the Jacobian norm) and generalization averaged over a large test set $1 0 ^ { 4 }$ points). We now investigate whether the Jacobian norm can be predictive of generalization at individual points.
|
| 199 |
+
|
| 200 |
+
As demonstrated in Figure 6 (top), Jacobian norm at a point is predictive of the cross-entropy loss, but the relationship is not a linear one, and not even bijective (see $\ S$ for analytic expressions explaining it). In particular, certain misclassified points (right sides of the plots) have a Jacobian norm many orders of magnitude smaller than that of the correctly classified points (left sides). However, we do remark a consistent tendency for points having the highest values of the Jacobian norm to be mostly misclassified. A similar yet noisier trend is observed in networks trained using $\ell _ { 2 }$ -loss as depicted in Figure 6 (bottom). These observations make the Jacobian norm a promising quantity to consider in the contexts of active learning and confidence estimation in future research.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 6: Jacobian norm plotted against individual test point loss. Each plot shows 5 random networks that fit the respective training set with $1 0 0 \%$ accuracy, with each network having a unique color. Top: Jacobian norm plotted against cross-entropy loss. These plots experimentally confirm the relationship established in $\ S$ and Figure App.11. Bottom: Jacobian norm plotted against $\ell _ { 2 }$ -loss, for networks trained on $\ell _ { 2 }$ -loss, exhibits a similar behavior. See $\ S$ for experimental details and Figure App.9 for similar observations on other datasets.
|
| 204 |
+
|
| 205 |
+
# 5 CONCLUSION
|
| 206 |
+
|
| 207 |
+
We have investigated sensitivity of trained neural networks through the input-output Jacobian norm and linear regions counting in the context of image classification tasks. We have presented extensive experimental evidence indicating that the local geometry of the trained function as captured by the input-output Jacobian can be predictive of generalization in many different contexts, and that it varies drastically depending on how close to the training data manifold the function is evaluated. We further established a connection between the cross-entropy loss and the Jacobian norm, indicating that it can remain informative of generalization even at the level of individual test points. Interesting directions for future work include extending our investigation to more complex architectures and other machine learning tasks.
|
| 208 |
+
|
| 209 |
+
# REFERENCES
|
| 210 |
+
|
| 211 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 212 |
+
|
| 213 |
+
Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, pp. 6241–6250, 2017.
|
| 214 |
+
|
| 215 |
+
Avrim Blum and Ronald L. Rivest. Training a 3-node neural network is np-complete. In Machine Learning: From Theory to Applications, 1988.
|
| 216 |
+
|
| 217 |
+
Alfredo Canziani, Adam Paszke, and Eugenio Culurciello. An analysis of deep neural network models for practical applications. CoRR, abs/1605.07678, 2016.
|
| 218 |
+
|
| 219 |
+
Anna Choromanska, Mikael Henaff, Michael Mathieu, Gerard Ben Arous, and Yann LeCun. The ´ loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, pp. 192–204, 2015.
|
| 220 |
+
|
| 221 |
+
Yann Dauphin, Razvan Pascanu, aglar Gulehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Ben- ¨ gio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In NIPS, 2014.
|
| 222 |
+
|
| 223 |
+
Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017.
|
| 224 |
+
|
| 225 |
+
Daniel Golovin, Benjamin Solnik, Subhodeep Moitra, Greg Kochanski, John Karro, and D Sculley. Google vizier: A service for black-box optimization. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1487–1495. ACM, 2017.
|
| 226 |
+
|
| 227 |
+
Ian J. Goodfellow and Oriol Vinyals. Qualitatively characterizing neural network optimization problems. CoRR, abs/1412.6544, 2014.
|
| 228 |
+
|
| 229 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 230 |
+
|
| 231 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. arXiv preprint arXiv:1412.5068, 2014.
|
| 232 |
+
|
| 233 |
+
Caglar Gulcehre, Marcin Moczulski, Misha Denil, and Yoshua Bengio. Noisy activation functions. In International Conference on Machine Learning, pp. 3059–3068, 2016.
|
| 234 |
+
|
| 235 |
+
Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Neural networks for machine learninglecture 6a-overview of mini-batch gradient descent, 2012.
|
| 236 |
+
|
| 237 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Flat minima. ¨ Neural Computation, 9(1):1–42, 1997.
|
| 238 |
+
|
| 239 |
+
William H Jefferys and James O Berger. Ockham’s razor and bayesian analysis. American Scientist, 80(1):64–72, 1992.
|
| 240 |
+
|
| 241 |
+
Yulei Jiang, Richard M Zur, Lorenzo L Pesce, and Karen Drukker. A study of the effect of noise injection on the training of artificial neural networks. In Neural Networks, 2009. IJCNN 2009. International Joint Conference on, pp. 1428–1432. IEEE, 2009.
|
| 242 |
+
|
| 243 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 244 |
+
|
| 245 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 246 |
+
|
| 247 |
+
Alex Krizhevsky. Convolutional deep belief networks on cifar-10. 2010.
|
| 248 |
+
|
| 249 |
+
Anders Krogh and John A Hertz. A simple weight decay can improve generalization. In Advances in neural information processing systems, pp. 950–957, 1992.
|
| 250 |
+
|
| 251 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 252 |
+
|
| 253 |
+
Jaehoon Lee, Yasaman Bahri, Roman Novak, Sam Schoenholz, Jeffrey Pennington, and Jascha Sohldickstein. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ B1EA-M-0Z.
|
| 254 |
+
|
| 255 |
+
David JC MacKay. Bayesian interpolation. 1991.
|
| 256 |
+
|
| 257 |
+
David JC MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3):448–472, 1992.
|
| 258 |
+
|
| 259 |
+
G. Montufar, R. Pascanu, K. Cho, and Y. Bengio. On the Number of Linear Regions of Deep Neural ´ Networks. Neural Information Processing Systems, February 2014.
|
| 260 |
+
|
| 261 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. arXiv preprint arXiv:1610.08401, 2016.
|
| 262 |
+
|
| 263 |
+
Iain Murray and Zoubin Ghahramani. A note on the evidence and bayesian occam’s razor, 2005.
|
| 264 |
+
|
| 265 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th international conference on machine learning (ICML-10), pp. 807–814, 2010.
|
| 266 |
+
|
| 267 |
+
Radford M. Neal. Priors for infinite networks (tech. rep. no. crg-tr-94-1). University of Toronto, 1994.
|
| 268 |
+
|
| 269 |
+
Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. Proceeding of the international Conference on Learning Representations workshop track, abs/1412.6614, 2015.
|
| 270 |
+
|
| 271 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. CoRR, abs/1706.08947, 2017.
|
| 272 |
+
|
| 273 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A PAC-bayesian approach to spectrally-normalized margin bounds for neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=Skz_WfbCZ.
|
| 274 |
+
|
| 275 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In Security and Privacy (EuroS&P), 2016 IEEE European Symposium on, pp. 372–387. IEEE, 2016.
|
| 276 |
+
|
| 277 |
+
R. Pascanu, G. Montufar, and Y. Bengio. On the number of response regions of deep feed forward networks with piece-wise linear activations. International Conference on Learning Representations, December 2013.
|
| 278 |
+
|
| 279 |
+
B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein, and S. Ganguli. Exponential expressivity in deep neural networks through transient chaos. Neural Information Processing Systems, June 2016.
|
| 280 |
+
|
| 281 |
+
M. Raghu, B. Poole, J. Kleinberg, S. Ganguli, and J. Sohl-Dickstein. On the Expressive Power of Deep Neural Networks. International Conference on Machine Learning, June 2016.
|
| 282 |
+
|
| 283 |
+
Carl E. Rasmussen and Zoubin Ghahramani. Occam’s razor. In NIPS, 2000.
|
| 284 |
+
|
| 285 |
+
Salah Rifai, Pascal Vincent, Xavier Muller, Xavier Glorot, and Yoshua Bengio. Contractive autoencoders: Explicit invariance during feature extraction. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 833–840, 2011.
|
| 286 |
+
|
| 287 |
+
David E Rumelhart, Geoffrey E Hinton, Ronald J Williams, et al. Learning representations by back-propagating errors. Cognitive modeling, 5(3):1, 1988.
|
| 288 |
+
|
| 289 |
+
Jure Sokolic, Raja Giryes, Guillermo Sapiro, and Miguel RD Rodrigues. Robust large margin deep neural networks. IEEE Transactions on Signal Processing, 2017.
|
| 290 |
+
|
| 291 |
+
Ercan Solak, Roderick Murray-Smith, William E Leithead, Douglas J Leith, and Carl E Rasmussen. Derivative observations in gaussian process models of dynamic systems. In Advances in neural information processing systems, pp. 1057–1064, 2003.
|
| 292 |
+
|
| 293 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 294 |
+
|
| 295 |
+
Matus Telgarsky. Representation benefits of deep feedforward networks. CoRR, abs/1509.08101, 2015.
|
| 296 |
+
|
| 297 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017.
|
| 298 |
+
|
| 299 |
+
Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 86(3):391–423, 2012.
|
| 300 |
+
|
| 301 |
+
C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. International Conference on Learning Representations, November 2016.
|
| 302 |
+
|
| 303 |
+
# A APPENDIX
|
| 304 |
+
|
| 305 |
+
# A.1 TRANSITION METRIC DETAILS
|
| 306 |
+
|
| 307 |
+
# A.1.1 LINEAR REGION ENCODING
|
| 308 |
+
|
| 309 |
+
The way of encoding a linear region $\mathbf { c } \left( \mathbf { z } \right)$ of a point $\mathbf { z }$ described in §3 (2) guarantees that different regions obtain different codes, but different codes might be assigned to the same region if all the neurons in any layer of the network are saturated (or if weights leading from the transitioning unit to active units are exactly zero, or exactly cancel). However, the probability of such an arrangement drops exponentially with width and hence is ignored in this work.
|
| 310 |
+
|
| 311 |
+
# A.1.2 TRANSITION COUNTING
|
| 312 |
+
|
| 313 |
+
The equality between the discrete and continuous versions of $t \left( \mathbf { x } \right)$ in Equation 1 becomes exact with a high-enough sampling density $k$ such that there are no narrow linear regions missed in between consecutive points (precisely, the encoding $\mathbf { c } \left( \mathbf { z } \right)$ has to only change at most once on the line between two consecutive points $\mathbf { z } _ { i }$ and $\mathbf { z } _ { i + 1 }$ ).
|
| 314 |
+
|
| 315 |
+
For computational efficiency we also assume that no two neurons transitions simultaneously, which is extremely unlikely in the context of random initialization and stochastic optimization.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure App.7: Depiction of a trajectory in input space used to count transitions as defined in §3 (2). An interpolation between 28 horizontal translations of a single digit results in a complex trajectory that constrains all points to lie close to the translation-augmented data, and allows for a tractable estimate of transition density around the data manifold. This metric is used to compare models in 4.2 and 4.3. Straight lines indicate boundaries between different linear regions (straight-line boundaries between linear regions is accurate for the case of a single-layer piecewise-linear network. The partition into linear regions is more complex for deeper networks (Raghu et al., 2016)).
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure App.8: Number of transitions, in contrast to Figure 5, does not generally correlate with generalization gap. Left: 2160 networks with $1 0 0 \%$ train accuracy on CIFAR10. Right: 2097 networks with at least $9 9 . 9 \%$ training accuracy on CIFAR100. See §A.5.5 for experimental details.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure App.9: Jacobian norm plotted against individual test point loss on Fashion-MNIST (Xiao et al., 2017) and CIFAR100. As in Figure 6, each plot shows 5 random networks that fit the respective training set to a $1 0 0 \%$ with each network having a unique color. See §A.5.6 for experimental details.
|
| 325 |
+
|
| 326 |
+
# A.2 DO NEURAL NETWORKS DEFY OCCAM’S RAZOR?
|
| 327 |
+
|
| 328 |
+
Here we briefly discuss the motivation of this work in the context of Occam’s razor.
|
| 329 |
+
|
| 330 |
+
Occam’s razor is a heuristic for model comparison based on their complexity. Given a dataset $\mathcal { D }$ , Occam’s razor gives preference to simpler models $\mathcal { H }$ . In the Bayesian interpretation of the heuristic (Jefferys & Berger, 1992) simplicity is defined as evidence $\mathbb { P } \left[ \mathcal { D } | \mathcal { H } \right]$ and is often computed using the Laplace approximation. Under further assumptions (MacKay, 1991), this evidence can be shown to be inversely proportional to the number of parameters in the model. Therefore, given a uniform prior $\mathbb { P } \left[ \mathcal { H } \right]$ on two competing hypothesis classes, the class posterior $\mathbb { P } \left[ \mathcal { H } | \mathcal { D } \right] \sim \bar { \mathbb { P } } \left[ \mathcal { D } | \mathcal { H } \right] \mathbb { P } \left[ \mathcal { H } \right]$ is higher for a model with fewer parameters.
|
| 331 |
+
|
| 332 |
+
An alternative, qualitative justification of the heuristic is through considering the evidence as a normalized probability distribution over the whole dataset space:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\int _ { D ^ { \prime } } \mathbb { P } \left[ \mathcal { D ^ { \prime } } | \mathcal { H } \right] d \mathcal { D ^ { \prime } } = 1
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
and remarking that models with more parameters have to spread the probability mass more evenly across all the datasets by virtue of being able to fit more of them (Figure App.10, left). This similarly suggests (under a uniform prior on competing hypothesis classes) preferring models with fewer parameters, assuming that evidence is unimodal and peaks close to the dataset of interest.
|
| 339 |
+
|
| 340 |
+
Occam’s razor for neural networks. As seen in Figure 1, the above reasoning does not apply to neural networks: the best achieved generalization is obtained by a model that has around $1 0 ^ { \bar { 4 } }$ times as many parameters as the simplest model capable of fitting the dataset (within the evaluated search space).
|
| 341 |
+
|
| 342 |
+
On one hand, Murray & Ghahramani (2005); Telgarsky (2015) demonstrate on concrete examples that a high number of free parameters in the model doesn’t necessarily entail high complexity. On the other hand, a large body of work on the expressivity of neural networks (Pascanu et al., 2013; Montufar et al. ´ , 2014; Raghu et al., 2016; Poole et al., 2016) shows that their ability to compute complex functions increases rapidly with size, while Zhang et al. (2016) validates that they also easily fit complex (even random) functions with stochastic optimization. Classical metrics like VC dimension or Rademacher complexity increase with size of the network as well. This indicates that weights of a neural network may actually correspond to its usable capacity, and hence “smear” the evidence $\mathbb { P } \left[ \mathcal { D } | \mathcal { H } \right]$ along a very large space of datasets $\mathcal { D } ^ { \prime }$ , making the dataset of interest $\mathcal { D }$ less likely.
|
| 343 |
+
|
| 344 |
+
Potential issues. We conjecture the Laplace approximation of the evidence $\mathbb { P } \left[ \mathcal { D } | \mathcal { H } \right]$ and the simplified estimation of the “Occam’s factor” in terms of the accessible volume of the parameter space might not hold for neural networks in the context of stochastic optimization, and, in particular, do not account for the combinatorial growth of the accessible volume of parameter space as width increases (MacKay, 1992). Similarly, when comparing evidence as probability distributions over datasets, the difference between two neural networks may not be as drastic as in Figure App.10 (left), but more nuanced as depicted in Figure App.10 (right), with the evidence ratio being highly dependent on the particular dataset.
|
| 345 |
+
|
| 346 |
+
We interpret our work as defining hypothesis classes based on sensitivity of the hypothesis (which yielded promising results in (Rasmussen & Ghahramani, 2000) on a toy task) and observing a strongly non-uniform prior on these classes that enables model comparison. Indeed, at least in the context of natural images classification, putting a prior on the number of parameters or Kolmogorov complexity of the hypothesis is extremely difficult. However, a statement that the true classification function is robust to small perturbations in the input is much easier to justify. As such, a prior $\mathbb { P } \left[ \mathcal { H } \right]$ in favor of robustness over sensitivity might fare better than a prior on specific network hyper-parameters.
|
| 347 |
+
|
| 348 |
+
Above is one way to interpret the correlation between sensitivity and generalization that we observe in this work. It does not explain why large networks tend to converge to less sensitive functions. We conjecture large networks to have access to a larger space of robust solutions due to solving a highly-underdetermined system when fitting a dataset, while small models converge to more extreme weight values due to being overconstrained by the data. However, further investigation is needed to confirm this hypothesis.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure App.10: Occam’s razor: simplified expectation vs hypothesized reality. All datasets $\mathcal { D } ^ { \prime }$ with input and target dimensions matching those of a particular dataset $\mathcal { D }$ are sorted according to the evidence $\mathbb { P } \left[ \mathcal { D } ^ { \prime } | \mathcal { H } \right]$ of a large model $\mathcal { H } _ { \mathrm { l } }$ from left to right along the horizontal axis. Left: a classic simplified depiction of Bayesian Occam’s razor. Evidence $\mathbb { P } [ \bar { \mathcal { D } } ^ { \prime } | \mathcal { H } ]$ of a small model $\mathcal { H } _ { \mathrm { s } }$ with few parameters has narrow support in the dataset space and is more peaked. If the model fits the dataset $\mathcal { D }$ well, it falls close to the peak and outperforms a larger model $\mathcal { H } _ { \mathrm { l } }$ with more parameters, having wider support. Right: suggested potential reality of neural networks. Evidence of the small model $\mathcal { H } _ { \mathrm { s } }$ peaks higher, but the large model $\mathcal { H } _ { \mathrm { l } }$ might nonetheless concentrate the majority of probability mass on simple functions and the evidence curves might intersect at a small angle. In this case, while a dataset $\mathcal { D }$ lying close to the intersection can be fit by both models, the Bayesian evidence ratio depends on its exact position with respect to the intersection.
|
| 352 |
+
|
| 353 |
+
# A.3 BOUNDING THE JACOBIAN NORM
|
| 354 |
+
|
| 355 |
+
Here we analyze the relationship between the Jacobian norm and the cross-entropy loss at individual test points as studied in §4.4.
|
| 356 |
+
|
| 357 |
+
Target class Jacobian. We begin by relating the derivative of the target class probability $\mathbf { J } _ { y ( \mathbf { x } ) }$ to per-point cross-entropy loss $l ( \mathbf { x } ) = - \log \left[ \mathbf { f } _ { \sigma } ( \mathbf { x } ) \right] _ { y ( \mathbf { x } ) }$ (where $y ( \mathbf x )$ is the correct integer class).
|
| 358 |
+
|
| 359 |
+
We will denote ${ \bf f } _ { \sigma } ( { \bf x } )$ by $\sigma$ and drop the $\mathbf { x }$ argument to de-clutter notation (i.e. write f instead of $\mathbf { f } \left( \mathbf { x } \right) .$ ). Then the Jacobian can be expressed as
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\mathbf { J } = \left[ \left( \sigma \mathbf { 1 } ^ { T } \right) \odot \left( \mathbf { I } - \pmb { \sigma } \mathbf { 1 } ^ { T } \right) ^ { T } \right] \left( \frac { \partial \mathbf { f } } { \partial \mathbf { x } ^ { T } } \right) ,
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
where $\odot$ is the Hadamard element-wise product. Then indexing both sides of the equation at the correct class $y$ yields
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathbf { J } _ { y } = \sigma _ { y } \left( \left( \mathbf { e } _ { y } - \pmb { \sigma } \right) ^ { T } \left( \frac { \partial \mathbf { f } } { \partial \mathbf { x } ^ { T } } \right) \right) ,
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
where $\mathbf { e } _ { y }$ is a vector of zeros everywhere except for $e _ { y } = 1$ . Taking the norm of both sides results in
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\begin{array} { c } { \displaystyle | | \mathbf { J } _ { y } | | _ { 2 } ^ { 2 } = \sigma _ { y } ^ { 2 } \sum _ { k = 1 } ^ { d } \left[ \left( 1 - \sigma _ { y } \right) ^ { 2 } \left( \frac { \partial f _ { y } } { \partial x _ { k } } \right) ^ { 2 } + \sum _ { j \neq y } ^ { n } \left( \sigma _ { j } \frac { \partial f _ { j } } { \partial x _ { k } } \right) ^ { 2 } \right] } \\ { = \displaystyle \sigma _ { y } ^ { 2 } \left[ \left( 1 - \sigma _ { y } \right) ^ { 2 } \sum _ { k = 1 } ^ { d } \left( \frac { \partial f _ { y } } { \partial x _ { k } } \right) ^ { 2 } + \sum _ { j \neq y } ^ { n } \sigma _ { j } ^ { 2 } \sum _ { k = 1 } ^ { d } \left( \frac { \partial f _ { j } } { \partial x _ { k } } \right) ^ { 2 } \right] } \\ { = \displaystyle \sigma _ { y } ^ { 2 } \left[ \left( 1 - \sigma _ { y } \right) ^ { 2 } \left\| \frac { \partial f _ { y } } { \partial \mathbf { x } ^ { T } } \right\| _ { 2 } ^ { 2 } + \sum _ { j \neq y } ^ { n } \sigma _ { j } ^ { 2 } \left\| \frac { \partial f _ { j } } { \partial \mathbf { x } ^ { T } } \right\| _ { 2 } ^ { 2 } \right] } \end{array}
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
We now assume that magnitudes of the individual logit derivatives vary little in between logits and over the input space3:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\left. \frac { \partial f _ { i } } { \partial \mathbf { x } ^ { T } } \right. _ { 2 } ^ { 2 } \approx \frac { 1 } { n } \mathbb { E } _ { \mathbf { x } _ { \mathrm { t e s t } } } \left. \frac { \partial \mathbf { f } } { \partial \mathbf { x } _ { \mathrm { t e s t } } ^ { T } } \right. _ { F } ^ { 2 } ,
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
which simplifies Equation 4 to
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\left\| \mathbf { J } _ { y } \right\| _ { 2 } ^ { 2 } \approx M \sigma _ { y } ^ { 2 } \left[ ( 1 - \sigma _ { y } ) ^ { 2 } + \sum _ { j \neq y } ^ { n } \sigma _ { j } ^ { 2 } \right] ,
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
where $M = \mathbb { E } _ { \mathbf { x } _ { \mathrm { t e s t } } } \left\| \partial \mathbf { f } / \partial \mathbf { x } _ { \mathrm { t e s t } } ^ { T } \right\| _ { F } ^ { 2 } / n$ . Since $\sigma$ lies on the $( n - 1 )$ -simplex $\Delta ^ { n - 1 }$ , under these assumptions we can bound:
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\frac { ( 1 - \sigma _ { y } ) ^ { 2 } } { n - 1 } \leqslant \sum _ { j \neq y } ^ { n } \sigma _ { j } ^ { 2 } \leqslant ( 1 - \sigma _ { y } ) ^ { 2 } ,
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
and finally
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\frac { n } { n - 1 } M \sigma _ { y } ^ { 2 } \left( 1 - \sigma _ { y } \right) ^ { 2 } \lessapprox \left\| \mathbf { J } _ { y } \right\| _ { 2 } ^ { 2 } \lessapprox 2 M \sigma _ { y } ^ { 2 } \left( 1 - \sigma _ { y } \right) ^ { 2 } ,
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
or, in terms of the cross-entropy loss $l = - \log \sigma _ { y }$
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\sqrt { \frac { n M } { n - 1 } } \mathbb { e } ^ { - l } \left( 1 - \Phi ^ { - l } \right) \lessapprox \left. \mathbf { J } _ { y } \right. _ { 2 } \lessapprox \sqrt { 2 M } \mathbb { e } ^ { - l } \left( 1 - \Phi ^ { - l } \right) .
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
We validate these approximate bounds in Figure App.11 (top).
|
| 408 |
+
|
| 409 |
+
Full Jacobian. Equation 5 establishes a close relationship between $\mathbf { J } _ { y }$ and loss $l = - \log \sigma _ { y }$ , but of course, at test time we do not know the target class $y$ . This allows us to only bound the full Jacobian norm from below:
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\sqrt { \frac { n M } { n - 1 } } \circledast ^ { - l } \left( 1 - \circledast ^ { - l } \right) \precapprox \| \mathbf { J } _ { y } \| _ { 2 } \leqslant \| \mathbf { J } \| _ { F } .
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
For the upper bound, we assume the maximum-entropy case of $\sigma _ { y }$ : $\sigma _ { i } \approx ( 1 - \sigma _ { y } ) / ( n - 1 )$ , for $i \neq y$ . The Jacobian norm is
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\left\| \mathbf { J } \right\| _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { n } \left\| \mathbf { J } _ { i } \right\| _ { 2 } ^ { 2 } = \left\| \mathbf { J } _ { y } \right\| _ { 2 } ^ { 2 } + \sum _ { i \neq y } ^ { n } \left\| \mathbf { J } _ { i } \right\| _ { 2 } ^ { 2 } ,
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where the first summand becomes:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\Vert \mathbf { J } _ { y } \Vert _ { 2 } ^ { 2 } \approx M \sigma _ { y } ^ { 2 } \left[ \left( 1 - \sigma _ { y } \right) ^ { 2 } + \left( n - 1 \right) \left( \frac { 1 - \sigma _ { y } } { n - 1 } \right) ^ { 2 } \right] = \frac { M n } { n - 1 } \sigma _ { y } ^ { 2 } \left( 1 - \sigma _ { y } \right) ^ { 2 } ,
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
and each of the others
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { l } { { \displaystyle \left\| { \bf J } _ { i } \right\| _ { 2 } ^ { 2 } \approx M \left( \frac { 1 - \sigma _ { y } } { n - 1 } \right) ^ { 2 } \left[ \left( 1 - \frac { 1 - \sigma _ { y } } { n - 1 } \right) ^ { 2 } + \left( \sigma _ { y } ^ { 2 } + ( n - 2 ) \left( \frac { 1 - \sigma _ { y } } { n - 1 } \right) ^ { 2 } \right) \right] } } \\ { { \displaystyle \qquad = \frac { M } { ( n - 1 ) ^ { 3 } } \left( 1 - \sigma _ { y } \right) ^ { 2 } \left( n \sigma _ { y } ^ { 2 } + n - 2 \right) ^ { 2 } . } } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Adding $n - 1$ of such summands to $\| \mathbf { J } _ { y } \| _ { 2 } ^ { 2 }$ results in
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\| { \bf J } \| _ { F } \approx \frac { \sqrt { M } } { ( n - 1 ) } ( 1 - \sigma _ { y } ) \sqrt { n ^ { 2 } \sigma _ { y } ^ { 2 } + n - 2 } = \frac { \sqrt { M } } { ( n - 1 ) } \left( 1 - \mathrm { e } ^ { - l } \right) \sqrt { n ^ { 2 } \mathrm { e } ^ { - 2 l } + n - 2 } ,
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
compared against the lower bound (Equation 6) and experimental data in Figure App.11.
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Cross-entropy loss
|
| 443 |
+
|
| 444 |
+
Figure App.11: Top: Jacobian norm $\left\| \mathbf { J } _ { y } \left( \mathbf { x } \right) \right\| _ { 2 } = \left\| \partial \mathbf { f } _ { \sigma } \left( \mathbf { x } \right) _ { y } / \partial \mathbf { x } ^ { T } \right\| _ { 2 }$ of the true class $y$ output probability is tightly related to the cross-entropy loss. Each point corresponds to one of the 1000 test inputs to a $100 \%$ trained network on CIFAR10, while lines depict analytic bounds from Equation 5. Bottom: Same experiment plotting the full Jacobian norm $\| \bar { \mathbf { J } } \| _ { F }$ against cross-entropy. Solid lines correspond to the lower bound from Equation 6 and the norm approximation from Equation 7. See $\ S _ { \mathrm { A } . 5 . 7 }$ for experimental details and Figures 6 and App.9 for empirical evaluation of this relationship on multiple datasets and models.
|
| 445 |
+
|
| 446 |
+
# A.4 NON-LINEARITIES DEFINITIONS
|
| 447 |
+
|
| 448 |
+
Following activation functions are used in this work:
|
| 449 |
+
|
| 450 |
+
1. ReLU (Nair & Hinton, 2010): $\mathrm { m a x } ( x , 0 )$ ;
|
| 451 |
+
2. ReLU6 (Krizhevsky, 2010): min $( \operatorname* { m a x } ( x , 0 ) , 6 )$ ;
|
| 452 |
+
3. Tanh: hyperbolic tangent, $( e ^ { x } - e ^ { - x } ) / ( e ^ { x } + e ^ { - x } )$ ;
|
| 453 |
+
4. HardTanh (Gulcehre et al., 2016): $\operatorname* { m i n } { ( \operatorname* { m a x } ( x , - 1 ) , 1 ) }$ ;
|
| 454 |
+
5. HardSigmoid (Gulcehre et al., 2016): $\operatorname* { m i n } { ( \operatorname* { m a x } ( x + 0 . 5 , 0 ) , 1 ) }$ ;
|
| 455 |
+
|
| 456 |
+
# A.5 EXPERIMENTAL SETUP
|
| 457 |
+
|
| 458 |
+
All experiments were implemented in Tensorflow (Abadi et al., 2016) and executed with the help of Vizier (Golovin et al., 2017). All networks were trained with cross-entropy loss. All networks were trained without biases. All computations were done with 32-bit precision. Learning rate decayed by a factor of 0.1 every 500 epochs.
|
| 459 |
+
|
| 460 |
+
Unless specified otherwise, initial weights were drawn from a normal distribution with zero mean and variance $2 / n$ for ReLU, ReLU6 and HardSigmoid; $1 / n$ for Tanh and HardTanh, where $n$ is the number of inputs to the current layer.
|
| 461 |
+
|
| 462 |
+
All inputs were normalized to have zero mean and unit variance, or, in other terms, lie on the $d$ - dimensional sphere of radius $\sqrt { d }$ , where $d$ is the dimensionality of the input.
|
| 463 |
+
|
| 464 |
+
All reported values, when applicable, were evaluated on the whole training and test sets of sizes 50000 and 10000 respectively. E.g. “generalization gap” is defined as the difference between train and test accuracies evaluated on the whole train and test sets.
|
| 465 |
+
|
| 466 |
+
When applicable, all trajectories/surfaces in input space were sampled with $2 ^ { 2 0 }$ points.
|
| 467 |
+
|
| 468 |
+
# A.5.1 PLOTS AND ERROR BARS
|
| 469 |
+
|
| 470 |
+
All figures except for 6 and App.11 are plotted with (pale) error bars (when applicable). The reported quantity was usually evaluated 8 times with random seeds from 1 to $8$ , unless specified otherwise. E.g. if a network is said to be $100 \%$ -accurate on the training set, it means that each of the 8 randomlyinitialized networks is $100 \%$ -accurate after training.
|
| 471 |
+
|
| 472 |
+
The error bar is centered at the mean value of the quantity and spans the standard error of the mean in each direction. If the bar appears to not be visible, it may be smaller than the mean value marker.
|
| 473 |
+
|
| 474 |
+
Weight initialization, training set shuffling, data augmentation, picking anchor points of data-fitted trajectories, selecting axes of a zero-centered elliptic trajectory depend on the random seed.
|
| 475 |
+
|
| 476 |
+
# A.5.2 SENSITIVITY ALONG A TRAJECTORY
|
| 477 |
+
|
| 478 |
+
Relevant figure 2.
|
| 479 |
+
|
| 480 |
+
A 20-layer ReLU-network of width 200 was trained on MNIST 128 times, with plots displaying the averaged values.
|
| 481 |
+
|
| 482 |
+
A random zero-centered ellipse was obtained by generating two axis vectors with normallydistributed entries of zero mean and unit variance (as such making points on the trajectory have an expected norm equal to that of training data) and sampling points on the ellipse with given axes.
|
| 483 |
+
|
| 484 |
+
A random data-fitted ellipse was generated by projecting three arbitrary input points onto a plane where they fall into vertices of an equilateral triangle, and then projecting their circumcircle back into the input space.
|
| 485 |
+
|
| 486 |
+
# A.5.3 LINEAR REGION BOUNDARIES
|
| 487 |
+
|
| 488 |
+
Relevant figure 3.
|
| 489 |
+
|
| 490 |
+
A 15-layer ReLU6-network of width 300 was trained on MNIST for $2 ^ { 1 8 }$ steps using SGD with momentum (Rumelhart et al., 1988); images were randomly translated with wrapping by up to 4 pixels in each direction, horizontally and vertically, as well as randomly flipped along each axis, and randomly rotated by 90 degrees clockwise and counter-clockwise.
|
| 491 |
+
|
| 492 |
+
The sampling grid in input space was obtain by projecting three arbitrary input points into a plane as described in §A.5.2 such that the resulting triangle was centered at 0 and it’s vertices were at a distance 0.8 form the origin. Then, a sampling grid of points in the $[ - 1 ; 1 ] ^ { \times 2 }$ square was projected back into the input space.
|
| 493 |
+
|
| 494 |
+
# A.5.4 SMALL EXPERIMENT
|
| 495 |
+
|
| 496 |
+
Relevant figures: 4 (second row) and 5 (bottom).
|
| 497 |
+
|
| 498 |
+
All networks were trained for $2 ^ { 1 8 }$ steps of batch size of 256 using SGD with momentum. Learning rate was set to 0.005 and momentum term coefficient to 0.9.
|
| 499 |
+
|
| 500 |
+
Data augmentation consisted of random translation of the input by up to 4 pixels in each direction with wrapping, horizontally and vertically. The input was also flipped horizontally with probability 0.5. When applying data augmentation (second row of Figure 4), the network is unlikely to encounter the canonical training data, hence few configurations achieved $1 0 0 \%$ training accuracy. However, we verified that all networks trained with data augmentation reached a higher test accuracy than their analogues without, ensuring that the generalization gap shrinks not simply because of lower training accuracy.
|
| 501 |
+
|
| 502 |
+
For each dataset, networks of width $\{ 1 0 0 , 2 0 0 , 5 0 0 , 1 0 0 0 , 2 0 0 0 , 3 0 0 0 \}$ , depth $\{ 2 , 3 , 5 , 1 0 , 1 5 , 2 0 \}$ and activation function ReLU, ReLU6, HardTanh, HardSigmoid were evaluated on 8 random seeds from 1 to 8.
|
| 503 |
+
|
| 504 |
+
# A.5.5 LARGE EXPERIMENT
|
| 505 |
+
|
| 506 |
+
Relevant figures: 1, 4 (except for the second row), 5 (top), App.8.
|
| 507 |
+
|
| 508 |
+
335671 networks were trained for $2 ^ { 1 9 }$ steps with random hyper-parameters; if training did not complete, a checkpoint at step $2 ^ { 1 8 }$ was used instead, if available. When using L-BFGS, the maximum number of iterations was set to 2684. The space of available hyper-parameters included5:
|
| 509 |
+
|
| 510 |
+
1. CIFAR10 and CIFAR100 datasets cropped to a $2 4 \times 2 4$ center region;
|
| 511 |
+
2. all 5 non-linearities from $\ S _ { \mathrm { ~ \tiny ~ \cdot ~ } }$ ;
|
| 512 |
+
3. SGD, Momentum, ADAM (Kingma & Ba, 2014), RMSProp (Hinton et al., 2012) and LBFGS optimizers;
|
| 513 |
+
4. learning rates from $\{ 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 0 5 \}$ , when applicable. Secondary coefficients were fixed at default values of Tensorflow implementations of respective optimizers;
|
| 514 |
+
5. batch sizes of $\{ 1 2 8 , 5 1 2 \}$ (unless using L-BFGS with the full batch of 50000);
|
| 515 |
+
6. standard deviations of initial weights from $\{ 0 . 5 , 1 , 4 , 8 \}$ multiplied by the default value described in $\ S _ { \mathrm { A } . 5 }$ ;
|
| 516 |
+
7. widths from $\{ 1 , 2 , 4 , \cdots , 2 ^ { 1 6 } \}$ ;
|
| 517 |
+
8. depths from $\{ 2 , 3 , 5 , \cdots , 2 ^ { 6 } + 1 \}$ ;
|
| 518 |
+
9. true and random training labels;
|
| 519 |
+
10. random seeds from 1 to 8.
|
| 520 |
+
|
| 521 |
+
# A.5.6 PER-POINT GENERALIZATION
|
| 522 |
+
|
| 523 |
+
Relevant figures 6, App.9.
|
| 524 |
+
|
| 525 |
+
Networks were with either cross-entropy or $\ell _ { 2 }$ -loss trained for $2 ^ { 1 9 }$ steps on whole datasets (CIFAR100, CIFAR10, Fashion-MNIST and MNIST) and evaluated on random subsets of 1000 test images.
|
| 526 |
+
|
| 527 |
+
Hyper-parameters were: non-linearity (all functions from §A.4), width (50, 100, 200, 500, 1000), depth (2, 5, 10, 20, 30), learning rate (0.0001, 0.001, 0.01), optimizer (SGD, Momentum, ADAM, RMSProp). Only one random seed (1) was used. For each dataset a random subset of 5 configurations among all the $1 0 0 \%$ -accurate (on training) networks was plotted (apart from the case of CIFAR100, where networks of training accuracy of at least $9 9 . 9 8 \%$ were selected).
|
| 528 |
+
|
| 529 |
+
# A.5.7 CROSS-ENTROPY AND SENSITIVITY ANALYSIS
|
| 530 |
+
|
| 531 |
+
Relevant figure App.11.
|
| 532 |
+
|
| 533 |
+
Networks were trained for $2 ^ { 1 8 }$ on the whole CIFAR10 training set and evaluated networks on a random test subset of size 1000. The hyper-parameters consisted of non-linearity (all functions from $\ S \mathrm { A } . 4 )$ , width (50, 100 or 200) and depth (2, 5, 10, 20). Only one random seed (1) was considered. A single random $100 \%$ -accurate (on training data) network was drawn to compare experimental measurements with analytic bounds on the Jacobian norm.
|
md/train/HJe4Cp4KwH/HJe4Cp4KwH.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GNN-FILM: GRAPH NEURAL NETWORKS WITH FEATURE-WISE LINEAR MODULATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper presents a new Graph Neural Network (GNN) type using feature-wise linear modulation (FiLM). Many standard GNN variants propagate information along the edges of a graph by computing “messages” based only on the representation of the source of each edge. In GNN-FiLM, the representation of the target node of an edge is additionally used to compute a transformation that can be applied to all incoming messages, allowing feature-wise modulation of the passed information.
|
| 8 |
+
|
| 9 |
+
Results of experiments comparing different GNN architectures on three tasks from the literature are presented, based on re-implementations of baseline methods. Hyperparameters for all methods were found using extensive search, yielding somewhat surprising results: differences between baseline models are smaller than reported in the literature. Nonetheless, GNN-FiLM outperforms baseline methods on a regression task on molecular graphs and performs competitively on other tasks.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Learning from graph-structured data has seen explosive growth over the last few years, as graphs are a convenient formalism to model the broad class of data that has objects (treated as vertices) with some known relationships (treated as edges). Example usages include reasoning about physical and biological systems, knowledge bases, computer programs, and relational reasoning in computer vision tasks. This graph construction is a highly complex form of feature engineering, mapping the knowledge of a domain expert into a graph structure which can be consumed and exploited by high-capacity neural network models.
|
| 14 |
+
|
| 15 |
+
Many neural graph learning methods can be summarised as neural message passing (Gilmer et al., 2017): nodes are initialised with some representation and then exchange information by transforming their current state (in practice with a single linear layer) and sending it as a message to all neighbours in the graph. At each node, messages are aggregated in some way and then used to update the associated node representation. In this setting, the message is entirely determined by the source node (and potentially the edge type) and the target node is not taken into consideration. A (partial) exception to this is the family of Graph Attention Networks (Velickovi ˇ c et al., 2018), where ´ the agreement between source and target representation of an edge is used to determine the weight of the message in an attention architecture. However, this weight is applied to all dimensions of the message at the same time.
|
| 16 |
+
|
| 17 |
+
A simple consequence of this observation may be to simply compute messages from the pair of source and target node state. However, the linear layer commonly used to compute messages would only allow additive interactions between the representations of source and target nodes. More complex transformation functions are often impractical, as computation in GNN implementations is dominated by the message transformation function.
|
| 18 |
+
|
| 19 |
+
However, this need for non-trivial interaction between different information sources is a common problem in neural network design. A recent trend has been the use of hypernetworks (Ha et al., 2017), neural networks that compute the weights of other networks. In this setting, interaction between two signal sources is achieved by using one of them as the input to a hypernetwork and the other as input to the computed network. While an intellectually pleasing approach, it is often impractical because the prediction of weights of non-trivial neural networks is computationally expensive.
|
| 20 |
+
|
| 21 |
+
Approaches to mitigate this exist (e.g., Wu et al. (2019) handle this in natural language processing), but are often domain-specific.
|
| 22 |
+
|
| 23 |
+
A more general mitigation method is to restrict the structure of the computed network. Recently, “feature-wise linear modulations” (FiLM) were introduced in the visual question answering domain (Perez et al., 2017). Here, the hypernetwork is fed with an encoding of a question and produces an element-wise affine function that is applied to the features extracted from a picture. This can be adapted to the graph message passing domain by using the representation of the target node to compute the affine function. This compromise between expressiveness and computational feasibility has been very effective in some domains and the results presented in this article indicate that it is also a good fit for the graph domain.
|
| 24 |
+
|
| 25 |
+
This article explores the use of hypernetworks in learning on graphs. Sect. 2 first reviews existing GNN models from the related work to identify commonalities and differences. This involves generalising a number of existing formalisms to new formulations that are able to handle graphs with different types of edges, which are often used to model different relationship between vertices. Then, two new formalisms are introduced: Relational Graph Dynamic Convolutional Networks (RGDCN), which dynamically compute the neural message passing function as a linear layer, and Graph Neural Networks with Feature-wise Linear Modulation (GNN-FiLM), which combine learned message passing functions with dynamically computed element-wise affine transformations. In Sect. 3, a range of baselines are compared in extensive experiments on three tasks from the literature, spanning classification, regression and ranking tasks on small and large graphs. Experiments were performed on re-implementations of existing model architectures in the same framework and hyperparameter setting searches were performed with the same computational budgets across all architectures. The results show that differences between baselines are smaller than the literature suggests and that the new FiLM model performs well on a number of interesting tasks.
|
| 26 |
+
|
| 27 |
+
# 2 MODEL
|
| 28 |
+
|
| 29 |
+
Notation. Let $\mathcal { L }$ be a finite (usually small) set of edge types. Then, a directed graph $\mathcal { G } = ( \nu , \mathcal { E } )$ has nodes $\nu$ and typed edges $\mathcal { E } \subseteq \mathcal { V } \times \mathcal { L } \times \mathcal { V }$ , where $( u , \ell , v ) \in \mathcal { E }$ denotes an edge from node $u$ to node $v$ of type $\ell$ , usually written as $u \xrightarrow { \ell _ { \setminus } } v$ .
|
| 30 |
+
|
| 31 |
+
Graph Neural Networks. As discussed above, Graph Neural Networks operate by propagating information along the edges of a given graph. Concretely, each node $v$ is associated with an initial representation $\boldsymbol { h } _ { v } ^ { ( 0 ) }$ (for example obtained from the label of that node, or by some other model component). Then, a GNN layer updates the node representations using the node representations of its neighbours in the graph, yielding representations $\pmb { h } _ { v } ^ { ( 1 ) }$ . This process can be unrolled through time by repeatedly applying the same update function, yielding representations $h _ { v } ^ { ( 2 ) } \ldots h _ { v } ^ { ( T ) }$ . Alternatively, several GNN layers can be stacked, which is intuitively similar to unrolling through time, but increases the GNN capacity by using different parameters for each timestep.
|
| 32 |
+
|
| 33 |
+
In Gated Graph Neural Networks (GGNN) (Li et al., 2016), the update rule uses one linear layer $W _ { \ell }$ per edge type $\ell$ to compute messages and combines the aggregated messages with the current representation of a node using a recurrent unit $r$ (e.g., GRU or LSTM cells), yielding the following definition.
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = r ( \pmb { h } _ { v } ^ { ( t ) } , \sum _ { u v \in \mathcal { E } } W _ { \ell } \pmb { h } _ { u } ^ { ( t ) } ; \pmb { \theta } _ { r } )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
The learnable parameters of the model are the edge-type-dependent weights $W _ { \ell }$ and the recurrent cell parameters $\pmb { \theta } _ { r }$ .
|
| 40 |
+
|
| 41 |
+
In Relational Graph Convolutional Networks (R-GCN) (Schlichtkrull et al., 2018), the gated unit is replaced by a simple non-linearity $\sigma$ (e.g., the hyperbolic tangent).
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \sum _ { u \not \in \mathcal { E } } \frac { 1 } { c _ { v , \ell } } \cdot W _ { \ell } \pmb { h } _ { u } ^ { ( t ) } \right)
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Here, $c _ { v , \ell }$ is a normalisation factor usually set to the number of edges of type $\ell$ ending in $v$ . The learnable parameters of the model are the edge-type-dependent weights $W _ { \ell }$ . It is important to note that in this setting, the edge type set $\mathcal { L }$ is assumed to contain a special edge type 0 for self-loops $v \xrightarrow { 0 } v$ , allowing state associated with a node to be kept.
|
| 48 |
+
|
| 49 |
+
In Graph Attention Networks (GAT) (Velickovi ˇ c et al., 2018), new node representations are com- ´ puted from a weighted sum of neighbouring node representations. The model can be generalised from the original definitional to support different edge types as follows (we will call this R-GAT below).1
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r l } & { \boldsymbol { e } _ { u , \ell , v } = \mathrm { L e a k y R e L U } ( \boldsymbol { \alpha } _ { \ell } \cdot ( W _ { \ell } \boldsymbol { h } _ { u } ^ { ( t ) } \| W _ { \ell } \boldsymbol { h } _ { v } ^ { ( t ) } ) ) } \\ & { \qquad \boldsymbol { a } _ { v } = \mathrm { s o f t m a x } ( \boldsymbol { e } _ { u , \ell , v } \mid \boldsymbol { u } \xrightarrow { \ell } \boldsymbol { v } \in \mathcal { E } ) } \\ & { \quad \boldsymbol { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \displaystyle \sum _ { u \xrightarrow { \ell } v \in \mathcal { E } } ( \boldsymbol { a } _ { v } ) _ { u \xrightarrow { \ell } v } \cdot W _ { \ell } \boldsymbol { h } _ { u } ^ { ( t ) } \right) } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Here, $\pmb { \alpha } _ { \ell }$ is a learnable row vector used to weigh different feature dimensions in the computation of an attention (“relevance”) score of the node representations, $\mathbf { \Delta x } \Vert \mathbf { \Delta y }$ is the concatenation of vectors $_ { \textbf { \em x } }$ and $\textbf { { y } }$ , and $( \pmb { a } _ { v } ) _ { u } \mathcal { L } _ { v }$ refers to the weight computed by the softmax for that edge. The learnable parameters of the model are the edge-type-dependent weights $W _ { \ell }$ and the attention parameters $\pmb { \alpha } _ { \ell }$ . In practice, GATs usually employ several attention heads that independently implement the mechanism above in parallel, using separate learnable parameters. The results of the different attention heads are then concatenated after each propagation round to yield the value of $h _ { v } ^ { ( t + 1 ) }$ .
|
| 56 |
+
|
| 57 |
+
More recently, $\mathrm { X u }$ et al. (2019) analysed the expressiveness of different GNN types, comparing their ability to distinguish similar graphs with the Weisfeiler-Lehman (WL) graph isomorphism test. Their results show that GCNs and the GraphSAGE model Hamilton et al. (2017) are strictly weaker than the WL test and hence they developed Graph Isomorphism Networks (GIN) (Xu et al., 2019), which are indeed as powerful as the WL test. While the GIN definition is limited to a single edge type, Corollary 6 of $\mathrm { X u }$ et al. (2019) shows that using the definition
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = \varphi ( ( 1 + \epsilon ) \cdot f ( \pmb { h } _ { v } ^ { ( t ) } ) + \sum _ { u v \in \mathcal { E } } f ( \pmb { h } _ { u } ^ { ( t ) } ) ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
there are choices for $\epsilon$ , $\varphi$ and $f$ such that the node representation update is sufficient for the overall network to be as powerful as the WL test. In the setting of different edge types, the function $f$ in the sum over neighbouring nodes needs to reflect different edge types to distinguish graphs such as $v \ \bot \rangle \ u \ \ll \ w$ and $v \ \bar { 2 } \gg \ u \ \ll \ w$ from each other. Using different functions $f _ { \ell }$ for different edge types makes it possible to unify the use of the current node representation $h _ { v } ^ { ( t ) }$ with the use of neighbouring node representations by again using a fresh edge type 0 for self-loops $v \ a \ $ . In that setting, the factor $( 1 + \epsilon )$ can be integrated into $f _ { 0 }$ . Finally, following an argument similar to $\mathrm { X u }$ et al. (2019), $\varphi$ and $f$ at subsequent layers can be “merged” into a single function which can be approximated by a multilayer perceptron (MLP), yielding the final R-GIN definition
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \sum _ { u \downarrow v \in \mathcal { E } } M L P ( \pmb { h } _ { u } ^ { ( t ) } ; \pmb { \theta } _ { \ell } ) \right) .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The learnable parameters here are the edge-specific weights $\pmb { \theta } _ { \ell }$ . Note that Eq. (4) is very similar to the definition of R-GCNs (Eq. (2)), only dropping the normalisation factor $\frac { \hat { \mathbf { 1 } } } { c _ { v , \ell } }$ and replacing linear layers by an MLP.
|
| 70 |
+
|
| 71 |
+
While many more GNN variants exist, the four formalisms above are broadly representative of general trends. It is notable that in all of these models, the information passed from one node to another is based on the learned weights and the representation of the source of an edge. In contrast, the representation of the target of an edge is only updated (in the GGNN case Eq. (1)), treated as another incoming message (in the R-GCN case Eq. (2) and the R-GIN case Eq. (4)), or used to weight the relevance of an edge (in the R-GAT case Eq. (3)). Sometimes unnamed GNN variants of the above are used (e.g., by Selsam et al. (2019); Paliwal et al. (2019)), replacing the linear layers to compute the messages for each edge by MLPs applied to the concatenation of the representations of source and target nodes. In the experiments, this will be called GNN-MLP, formally defined as follows.2
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \sum _ { u \xrightarrow [ ] { \ell } v \in \mathcal { E } } \frac { 1 } { c _ { v , \ell } } \cdot M L P \left( \pmb { h } _ { u } ^ { ( t ) } \| \pmb { h } _ { v } ^ { ( t ) } \ ; \ \pmb { \theta } _ { \ell } \right) \right)
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Below, we will instantiate the $M L P$ with a single linear layer to obtain what we call GNN-MLP0, which only differs from R-GCNs (Eq. (2)) in that the message passing function is applied to the concatenation of source and target state.
|
| 78 |
+
|
| 79 |
+
# 2.1 GRAPH HYPERNETWORKS
|
| 80 |
+
|
| 81 |
+
Hypernetworks (i.e., neural networks computing the parameters of another neural network) (Ha et al., 2017) have been successfully applied to a number of different tasks; naturally raising the question if they are also applicable in the graph domain.
|
| 82 |
+
|
| 83 |
+
Intuitively, a hypernetwork corresponds to a higher-order function, i.e., it can be viewed as a function computing another function. Hence, a natural idea would be to use the target of a message propagation step to compute the function computing the message; essentially allowing it to focus on features that are especially relevant for the update of the target node representation.
|
| 84 |
+
|
| 85 |
+
Relational Graph Dynamic Convolutional Networks (RGDCN) A first attempt would be to adapt (2) to replace the learnable message transformation $W _ { \ell }$ by the result of some learnable function $f$ that operates on the target representation:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \sum _ { u \downarrow v \in \mathcal { E } } f ( \pmb { h } _ { v } ^ { ( t ) } ; \pmb { \theta } _ { f , \ell } ) \pmb { h } _ { u } ^ { ( t ) } \right)
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
However, for a representation size $D$ , $f$ would need to produce a matrix of size $D ^ { 2 }$ from $D$ inputs. Hence, if implemented as a simple linear layer, $f$ would have on the order of $\mathcal { O } ( D ^ { 3 } )$ parameters, quickly making it impractical in most contexts.
|
| 92 |
+
|
| 93 |
+
This can be somewhat mitigated by splitting the node representations $h _ { v } ^ { ( t ) }$ into $C$ “chunks” $h _ { v , c } ^ { ( t ) }$ of dimension $\begin{array} { r } { K = { \frac { D } { C } } } \end{array}$ :
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { W _ { \ell , t , v , c } = f ( \pmb { h } _ { v } ^ { ( t ) } ; \pmb { \theta } _ { f , \ell , c } ) } \\ & { \qquad \mathbf { h } _ { v } ^ { ( t + 1 ) } = \displaystyle \operatorname* { l i } _ { 1 \leq c \leq C } \sigma \left( \sum _ { u } \pounds _ { v \in \mathcal { E } } W _ { \ell , t , v , c } \pmb { h } _ { u , c } ^ { ( t ) } \right) } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
The number of parameters of the model can now be reduced by tying the value of some instances of $\theta _ { f , \ell , c }$ . For example, the update function for a chunk $c$ can be computed using only the corresponding chunk of the node representation $h _ { v , c } ^ { ( t ) }$ , or the same update function can be applied to all “chunks” by setting $\pmb { \theta } _ { f , \ell , 1 } = . . . = \pmb { \theta } _ { f , \ell , C }$ . The learnable parameters of the model are only the hypernetwork parameters $\theta _ { f , \ell , c }$ . This is somewhat less desirable than the related idea of Wu et al. (2019), which operates on sequences, where sharing between neighbouring elements of the sequence has an intuitive interpretation that is not applicable in the general graph setting.
|
| 100 |
+
|
| 101 |
+
Graph Neural Networks with Feature-wise Linear Modulation (GNN-FiLM) In (6), the message passing layer is a linear transformation conditioned on the target node representation, focusing on separate chunks of the node representation at a time. In the extreme case in which the dimension of each chunk is 1, this method coincides with the ideas of Perez et al. (2017), who propose to use layers of element-wise affine transformations to modulate feature maps in the visual question answering setting; there, a natural language question is the input used to compute the affine transformation applied to the features extracted from a picture.
|
| 102 |
+
|
| 103 |
+
In the graph setting, we can use each node’s representation as an input that determines an elementwise affine transformation of incoming messages, allowing the model to dynamically up-weight and down-weight features based on the information present at the target node of an edge. This yields the following update rule, using a learnable function $g$ to compute the parameters of the affine transformation.
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r l } & { \beta _ { \ell , v } ^ { ( t ) } , \gamma _ { \ell , v } ^ { ( t ) } = g ( \pmb { h } _ { v } ^ { ( t ) } ; \pmb { \theta } _ { g , \ell } ) } \\ & { \quad \pmb { h } _ { v } ^ { ( t + 1 ) } = \sigma \left( \displaystyle \sum _ { u \in \mathcal { E } } \gamma _ { \ell , v } ^ { ( t ) } \odot W _ { \ell } \pmb { h } _ { u } ^ { ( t ) } + \beta _ { \ell , v } ^ { ( t ) } \right) } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
The learnable parameters of the model are both the hypernetwork parameters $\theta _ { g , \ell }$ and the weights $W _ { \ell }$ . In practice, implementing $g$ as a single linear layer works well.
|
| 110 |
+
|
| 111 |
+
In the case of using a single linear layer, the resulting message passing function is bilinear in source and target node representation, as the message computation is centred around $( W _ { g } \pmb { h } _ { v } ^ { ( t ) } ) \odot ( W _ { \ell } \pmb { h } _ { u } ^ { ( t ) } )$ . This is the core difference to the (linear) interaction of source and target node representations in models that use $W _ { \ell } ( \pmb { h } _ { u } ^ { ( t ) } | | \pmb { h } _ { v } ^ { ( t ) } )$ .
|
| 112 |
+
|
| 113 |
+
A simple toy example may illustrate the usefulness of such a mechanism: assuming a graph of nodes $\nu _ { A }$ and $\gamma _ { B }$ and edge types 1 and 2, a task may involve counting the number of 1-neighbours of $\nu _ { A }$ nodes and of 2-neighbours of $\gamma _ { B }$ nodes. By setting $\gamma _ { 1 , v _ { a } } = 1$ , $\gamma _ { 2 , v _ { a } } = 0$ for $v _ { a } \in \mathcal { V } _ { A }$ and $\gamma _ { 1 , v _ { b } } = 0$ , $\gamma _ { 2 , v _ { b } } = 1$ for $v _ { b } \in \mathcal { V } _ { B }$ , GNN-FiLM can solve this in a single layer. Simpler approaches can solve this by counting $A / 1 , A / 2 , B / 1$ and $B / 2$ neighbours separately in one layer and then projecting to the correct counter, but require more feature dimensions and layers for this. As this toy example illustrates, a core capability of GNN-FiLM is to learn to ignore graph edges based on the representation of target nodes.
|
| 114 |
+
|
| 115 |
+
Note that the featurewise modulation can also be viewed of an extension of the gating mechanism of GRU or LSTM cells used in GGNNs. Concretely, the “forgetting” of memories in a GRU/LSTM is similar to down-weighting messages computed for the self-loop edges and the gating of the cell input is similar to the modulation of other incoming messages. However, GGNNs apply this gating to the sum of all incoming messages (cf. Eq. (1), wheras in GNN-FiLM the modulation additionally depends on the edge type, allowing for a more fine-grained gating mechanism.
|
| 116 |
+
|
| 117 |
+
Finally, a small implementation bug brought focus to the fact that applying the non-linearity $\sigma$ after summing up messages from neighbouring nodes can make it harder to perform tasks such as counting the number of neighbours with a certain feature. In experiments, applying the non-linearity before aggregation as in the following update rule improved performance.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\pmb { h } _ { v } ^ { ( t + 1 ) } = l \left( \sum _ { u \downarrow } \sigma _ { v \in \mathcal { E } } \sigma \left( \gamma _ { \ell , v } ^ { ( t ) } \odot W _ { \ell } \pmb { h } _ { u } ^ { ( t ) } + \beta _ { \ell , v } ^ { ( t ) } \right) ; \pmb { \theta } _ { l } \right)
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
However, this means that the magnitude of node representations is now dependent on the degree of nodes in the handled graph. This can sometimes lead to instability during training, which can in turn be controlled by adding an additional layer $l$ after message passing, which can be a simple bounded nonlinearity (e.g. tanh), a fully connected layer, or layer normalisation (Ba et al., 2016), or any combination of these.
|
| 124 |
+
|
| 125 |
+
# 3 EVALUATION
|
| 126 |
+
|
| 127 |
+
# 3.1 GNN BENCHMARK TASKS
|
| 128 |
+
|
| 129 |
+
Due to the versatile nature of the GNN modelling formalism, many fundamentally different tasks are studied in the research area and it should be noted that good results on one task often do not transfer over to other tasks. This is due to the widely varying requirements of different tasks, as the following summary of tasks from the literature should illustrate.
|
| 130 |
+
|
| 131 |
+
• Cora/Citeseer/Pubmed (Sen et al., 2008): Each task consists of a single graph of $\sim 1 0 0 0 0$ nodes corresponding to documents and undirected (sic!) edges corresponding to references. The sparse $\sim 1 0 0 0$ node features are a bag of words representation of the corresponding documents. The goal is to assign a subset of nodes to a small number of classes. State of the art performance on these tasks is achieved with two propagation steps along graph edges.
|
| 132 |
+
|
| 133 |
+
• PPI (Zitnik & Leskovec, 2017): A protein-protein interaction dataset consisting of 24 graphs of $\sim \ 2 5 0 0$ nodes corresponding to different human tissues. Each node has 50 features selected by domain experts and the goal is node-level classification, where each node may belong to several of the 121 classes. State of the art performance on this task requires three propagation steps. QM9 property prediction (Ramakrishnan et al., 2014): $\sim 1 3 0 0 0 0$ graphs of $\sim 8$ nodes represent molecules, where nodes are heavy atoms and undirected, typed edges are bonds between these atoms, different edge types indicating single/double/etc. bonds. The goal is to regress each graph to a number of quantum chemical properties. State of the art performance on these tasks requires at least four propagation steps. VarMisuse (Allamanis et al., 2018): $\sim 2 3 5 0 0 0$ graphs of $\sim 2 5 0 0$ nodes each represent program fragments, where nodes are tokens in the program text and different edge types represent the program’s abstract syntax tree, data flow between variables, etc. The goal is to select one of a set of candidate nodes per graph. State of the art performance requires at least six propagation steps.
|
| 134 |
+
|
| 135 |
+
Hence, tasks differ in the complexity of edges (from undirected and untyped to directed and manytyped), the size of the considered graphs, the size of the dataset, the importance of node-level vs. graph-level representations, and the number of required propagation steps.
|
| 136 |
+
|
| 137 |
+
This article includes results on the PPI, QM9 and VarMisuse tasks. Preliminary experiments on the citation network data showed results that were at best comparable to the baseline methods, but changes of a random seed led to substantial fluctuations (mirroring the problems with evaluation on these tasks reported by Shchur et al. (2018)).
|
| 138 |
+
|
| 139 |
+
# 3.2 IMPLEMENTATION
|
| 140 |
+
|
| 141 |
+
To allow for a wider comparison, the implementation of GNN-FiLM is accompanied by implementations of a range of baseline methods. These include GGNN (Li et al., 2016) (see Eq. (1)), R-GCN (Schlichtkrull et al., 2018) (see Eq. (2)), R-GAT (Velickovi ˇ c et al., 2018) (see Eq. ´ (3)), and R-GIN (Hamilton et al., 2017) (see Eq. (4))3. Additionally, GNN-MLP0 is a variant of R-GCN using a single linear layer to compute the edge message from both source and target state (i.e., Eq. (5) instantiated with an “MLP” without hidden layers), and GNN-MLP1 is the same with a single hidden layer. The baseline methods were re-implemented in TensorFlow and individually tested to reach performance equivalent to results reported in their respective source papers. All code for the implementation of these GNNs is released on https://revealed/after/double/blind/ lifted, together with implementations of all tasks and scripts necessary to reproduce the results reported in this paper. This includes the hyperparameter settings found by search, which are stored in tasks/default hypers/ and are selected by default on the respective tasks. The code is designed to facilitate testing new GNN types on existing tasks and easily adding new tasks, allowing for rapid evaluation of new architectures.
|
| 142 |
+
|
| 143 |
+
Early on in the experiments, it became clear that the RGDCN approach (Eq. (6)) as presented is infeasible. It is extremely sensitive to the parameter initialisation and hence changes to the random seed lead to wild swings in the target metrics. Hence, no experimental results are reported for it in the following. It is nonetheless included in the article (and the implementation) to show the thought process leading to GNN-FiLM, as well as to allow other researchers to build upon this. In the following, GNN-FiLM refers to the formulation of Eq. (8), which performed better than the variant of Eq. (7) across all experiments. Somewhat surprisingly, the same trick (of moving the non-linearity before the message aggregation step) did not help the other GNN types. For all models, using each layer only for a single propagation step performed better than using fewer layers with several propagation steps.
|
| 144 |
+
|
| 145 |
+
In all experiments, models were trained until the target metric did not improve anymore for some additional epochs (25 for PPI and QM9, 5 for VarMisuse). The reported results on the held-out test data are averaged across the results of a number of training runs, each starting from different random parameter initializations.
|
| 146 |
+
|
| 147 |
+
# 3.3 EXPERIMENTAL RESULTS
|
| 148 |
+
|
| 149 |
+
# 3.3.1 PROTEIN-PROTEIN INTERACTIONS (PPI)
|
| 150 |
+
|
| 151 |
+
The models are first evaluated on the node-level classification PPI task (Zitnik & Leskovec, 2017), following the dataset split from earlier papers. Training hence used a set of 20 graphs and validation and test sets of two separate graphs each. The graphs use two edge types: the dataset-provided untyped edges as well as a fresh “self-loop” edge type to allows nodes to keep state across propagation steps.
|
| 152 |
+
|
| 153 |
+
Hyperparameters for all models were selected based on results from earlier papers and a small grid search of a number of author-selected hyperparameter ranges (see App. A for details). This resulted in three (R-GAT), four (GGNN, GNN-FiLM, GNN-MLP1, R-GCN), or five (GNN-MLP0, R-GIN) layers (propagation steps) and a node representation size of 256 (GNN-MLP0, R-GIN) or 320 (all others). All models use dropout on the node representations before all GNN layers, with a keep ratio of 0.9. After selecting hyperparameters, all models were trained ten times with different random seeds on a NVidia V100.
|
| 154 |
+
|
| 155 |
+
Tab. 1 shows the micro-averaged F1 score on the classification task on the test graphs, with standard deviations and training times in seconds computed over the ten runs. The results for all re-implemented models are better than the results reported by Velickovi ˇ c et al. (2018) ´ for the GAT model (without edge types). A cursory exploration of the reasons yielded three factors. First, the generalisation to different edge types (cf. Eq. (3)) and the subsequent use of a special self-loop edge type helps R-GAT (and all other models) significantly. Second, using dropout between layers significantly im
|
| 156 |
+
|
| 157 |
+
Table 1: GNN results on PPI task. $\mathrm { G A T ^ { * } }$ result taken from Velickovi ˇ c et al. (2018). ´
|
| 158 |
+
|
| 159 |
+
<table><tr><td>Model</td><td>Avg. Micro-F1</td><td>Time (s)</td></tr><tr><td>GAT*</td><td>0.973 ±0.002</td><td>n/a</td></tr><tr><td>GGNN</td><td>0.990 ±0.001</td><td>432.6</td></tr><tr><td>R-GCN</td><td>0.989 ±0.000</td><td>759.0</td></tr><tr><td>R-GAT</td><td>0.989 ±0.001</td><td>782.3</td></tr><tr><td>R-GIN</td><td>0.991 ±0.001</td><td>704.8</td></tr><tr><td>GNN-MLP0</td><td>0.992±0.000</td><td>556.9</td></tr><tr><td>GNN-MLP1</td><td>0.992±0.001</td><td>479.2</td></tr><tr><td>GNN-FiLM</td><td>0.992±0.000</td><td>308.1</td></tr></table>
|
| 160 |
+
|
| 161 |
+
proved the results. Third, the larger node representation sizes (compared to 256 used by Velickovi ˇ c´ et al. (2018)) improved the results again. However, the new GNN-FiLM improves slightly over these four baselines from the literature, while converging substantially faster than all baselines, mainly because it converges in significantly fewer training steps (approx. 240 epochs compared to 400-600 epochs for the other models).
|
| 162 |
+
|
| 163 |
+
# 3.3.2 QUANTUM CHEMISTRY (QM9)
|
| 164 |
+
|
| 165 |
+
All models were additionally evaluated on graph-level regression tasks on the QM9 molecule data set (Ramakrishnan et al., 2014), considering thirteen different quantum chemical properties. The ${ \sim } 1 3 0 k$ molecular graphs in the dataset were split into training, validation and test data by randomly selecting 10 000 graphs for the latter two sets. Additionally, another data split without a test set was used for the hyperparameter search (see below). The graphs use five edge types: the datasetprovided typed edges (single, double, triple and aromatic bonds between atoms) as well as a fresh “self-loop” edge type that allows nodes to keep state across propagation steps. The evaluation differs from the setting reported by Gilmer et al. (2017), as no additional molecular information is encoded as edge features, nor are the graphs augmented by master nodes or additional edges.4
|
| 166 |
+
|
| 167 |
+
Hyperparameters for all models were found using a staged search process. First, 500 hyperparameter configurations were sampled from an author-provided search space (see App. A for details) and run on the first three regression tasks. The top three configurations for each of these three tasks were then run on all thirteen tasks and the final configuration was chosen as the one with the lowest average mean absolute error across all properties, as evaluated on the validation data of that dataset split. This process led to eight layers / propagation steps for all models but GGNN and R-GIN, which showed best performance with six layers. Furthermore, all models used residual connections connecting every second layer and GGNN, R-GCN, GNN-FiLM and GNN-MLP0 additionally used layer normalisation (as in Eq. (8)).
|
| 168 |
+
|
| 169 |
+
Table 2: GNN average error rates and standard deviations on QM9 target values.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Property</td><td>GGNN</td><td>R-GCN</td><td>R-GAT</td><td>R-GIN</td><td>GNN-MLP0</td><td>GNN-MLP1</td><td>GNN-FiLM</td></tr><tr><td>mu</td><td>3.85 ±0.16</td><td>3.21 ±0.06</td><td>2.68 ±0.06</td><td>2.64 ±0.11</td><td>2.36 ±0.04</td><td>2.44 ±0.12</td><td>2.38 ±0.13</td></tr><tr><td>alpha</td><td>5.22 ±0.86</td><td>4.22 ±0.45</td><td>4.65 ±0.44</td><td>4.67 ±0.52</td><td>4.27 ±0.36</td><td>4.63 ±0.54</td><td>3.75 ±0.11</td></tr><tr><td>HOMO</td><td>1.67 ±0.07</td><td>1.45 ±0.01</td><td>1.48 ±0.03</td><td>1.42 ±0.01</td><td>1.25 ±0.04</td><td>1.29 ±0.06</td><td>1.22 ±0.07</td></tr><tr><td>LUMO</td><td>1.74 ±0.06</td><td>1.62 ±0.04</td><td>1.53 ±0.07</td><td>1.50 ±0.09</td><td>1.35 ±0.04</td><td>1.50 ±0.19</td><td>1.30 ±0.05</td></tr><tr><td>gap</td><td>2.60 ±0.06</td><td>2.42 ±0.14</td><td>2.31 ±0.06</td><td>2.27 ±0.09</td><td>2.04 ±0.05</td><td>2.06 ±0.10</td><td>1.96 ±0.06</td></tr><tr><td>R2</td><td>35.94 ±35.68</td><td>16.38 ±0.49</td><td>52.39 ±42.58</td><td>15.63 ±1.40</td><td>14.86 ±1.62</td><td>15.81 ±1.42</td><td>15.59 ±1.38</td></tr><tr><td>ZPVE</td><td>17.84 ±3.61</td><td>17.40 ±3.56</td><td>14.87 ±2.88</td><td>12.93 ±1.81</td><td>12.00 ±1.66</td><td>14.12 ±1.10</td><td>11.00 ±0.74</td></tr><tr><td>UO</td><td>8.65 ±2.46</td><td>7.82 ±0.80</td><td>7.61 ±0.46</td><td>5.88 ±1.01</td><td>5.55 ±0.38</td><td>6.94 ±0.64</td><td>5.43 ±0.96</td></tr><tr><td>U</td><td>9.24 ±2.26</td><td>8.24 ±1.25</td><td>6.86 ±0.53</td><td>18.71 ±23.36</td><td>6.20 ±0.88</td><td>7.00 ±1.06</td><td>5.95 ±0.46</td></tr><tr><td>H</td><td>9.35 ±0.96</td><td>9.05 ±1.21</td><td>7.64 ±0.92</td><td>5.62 ±0.81</td><td>5.96 ±0.45</td><td>7.98 ±0.88</td><td>5.59 ±0.57</td></tr><tr><td>G</td><td>7.14 ±1.15</td><td>7.00 ±1.51</td><td>6.54 ±0.36</td><td>5.38±0.75</td><td>5.09 ±0.57</td><td>7.14 ±0.51</td><td>5.17 ±1.13</td></tr><tr><td>Cv</td><td>8.86 ±9.07</td><td>3.93 ±0.48</td><td>4.11 ±0.27</td><td>3.53 ±0.37</td><td>3.38 ±0.20</td><td>4.60 ±0.74</td><td>3.46 ±0.21</td></tr><tr><td>Omega</td><td>1.57 ±0.53</td><td>1.02 ±0.05</td><td>1.48 ±0.87</td><td>1.05 ±0.11</td><td>0.84±0.02</td><td>5.60 ±8.82</td><td>0.98 ±0.06</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 3: Accuracy on VarMisuse task. GGNN∗ result taken from appendix of Allamanis et al. (2018).
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Model</td><td>TRAIN</td><td>VALID</td><td>SEENPROJTEST</td><td>UNSEENPROJTEST</td></tr><tr><td>GGNN*</td><td>n/a</td><td>n/a</td><td>84.0 n/a</td><td>74.1 n/a</td></tr><tr><td>GGNN</td><td>87.5±1.8%</td><td>82.1±0.9%</td><td>85.7 ±0.5%</td><td>79.3 ±1.2%</td></tr><tr><td>R-GCN</td><td>88.7±3.1%</td><td>85.7±1.6%</td><td>87.2±1.5%</td><td>81.4±2.3%</td></tr><tr><td>R-GAT</td><td>90.4±3.9%</td><td>84.2±1.0%</td><td>86.9 ±0.7%</td><td>81.2 ±0.9%</td></tr><tr><td>R-GIN</td><td>93.4±1.8%</td><td>84.2±1.0%</td><td>87.1 ±0.1%</td><td>81.1 ±0.9%</td></tr><tr><td>GNN-MLP0</td><td>95.3±2.4%</td><td>83.4±0.3%</td><td>86.5 ±0.2%</td><td>80.5 ±1.4%</td></tr><tr><td>GNN-MLP1</td><td>94.7±1.2%</td><td>84.4±0.4%</td><td>86.9 ±0.3%</td><td>81.4±0.7%</td></tr><tr><td>GNN-FiLM</td><td>94.3±1.0%</td><td>84.6±0.6%</td><td>87.0 ±0.2%</td><td>81.3 ±0.9%</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Each model was trained for each of the properties separately five times using different random seeds on compute nodes with NVidia P100 cards. The average results of the five runs are reported in Tab. 2, with their respective standard deviations.5 The results indicate that the new GNN-FiLM model outperforms the standard baselines on all tasks and the usually not considered GNN-MLP variants on the majority of tasks.
|
| 178 |
+
|
| 179 |
+
# 3.3.3 VARIABLE USAGE IN PROGRAMS (VARMISUSE)
|
| 180 |
+
|
| 181 |
+
Finally, the models were evaluated on the VarMisuse task of Allamanis et al. (2018). This task requires to process a graph representing an abstraction of a program fragment and then select one of a few candidate nodes (representing program variables) based on the representation of another node (representing the location to use a variable in). The experiments are performed using the released split of the dataset, which contains $\sim 1 3 0 k$ training graphs, $\sim 2 0 k$ validation graphs and two test sets: SEENPROJTEST, which contains $\sim 5 5 k$ graphs extracted from open source projects that also contributed data to the training and validation sets, and UNSEENPROJTEST, which contains $\sim 3 0 k$ graphs extracted from completely unseen projects.
|
| 182 |
+
|
| 183 |
+
Due to the inherent cost of training models on this dataset (Balog et al. (2019) provide an in-depth performance analysis), a limited hyperparameter grid search was performed, with only $\sim 3 0$ candidate configurations for each model (see App. A for details). For each model, the configuration yielding the best results on the validation data set fold was selected. This led to six layers for GGNN and R-GIN, eight layers for R-GAT and GNN-MLP0, and ten layers for the remaining models. Graph node hidden sizes were 128 for all models but GGNN and R-GAT, which performed better with 96 dimensions.
|
| 184 |
+
|
| 185 |
+
The results, shown in Tab. 3, are somewhat surprising, as they indicate a different ranking of model architectures as the results on PPI and QM9, with R-GCN performing best. All re-implemented baselines beat the results reported by Allamanis et al. (2018), who also reported that R-GCN and GGNN show very similar performance. This is in spite of a simpler implementation of the task than in the original paper, as it only uses the string labels of nodes for the representation and does not use the additional type information provided in the dataset. However, the re-implementation of the task uses the insights from Cvitkovic et al. (2019), who use character CNNs to encode node labels and furthermore introduce extra nodes for subtokens appearing in labels of different nodes, connecting them to their sources (e.g., nodes labelled openWullfrax and closeWullfrax are both connected to a fresh Wullfrax node).
|
| 186 |
+
|
| 187 |
+
A deeper investigation results showed that the more complex models seem to suffer from significant overfitting to the training data, as can be seen in the results for training and validation accuracy reported in Tab. 3. A brief exploration of more aggressive regularisation methods (more dropout, weight decay) showed no improvement and a deeper understanding of the cause of these results remains for future work.
|
| 188 |
+
|
| 189 |
+
Furthermore, the large variance in results on the validation set (especially for R-GCN) makes it likely that the hyperparameter grid search with only one training run per configuration did not yield the best configuration for each model.
|
| 190 |
+
|
| 191 |
+
# 4 DISCUSSION & CONCLUSIONS
|
| 192 |
+
|
| 193 |
+
After a review of existing graph neural network architectures, the idea of using hypernetworkinspired models in the graph setting was explored. This led to two models, Graph Dynamic Convolutional Networks and GNNs with feature-wise linear modulation, were presented. While GDCNs seem to be impractical to train, experiments show that GNN-FiLM is competitive with or improving on baseline models on three tasks from the literature.
|
| 194 |
+
|
| 195 |
+
The extensive experiments also show that a number of results from the literature could benefit from more substantial hyperparameter search and are often missing comparisons to a number of obvious baselines:
|
| 196 |
+
|
| 197 |
+
• The results in Tab. 1 indicate that GATs have no advantage over GGNNs or R-GCNs on the PPI task, which does not match the findings by Velickovi ˇ c et al. (2018). ´ • The results in Tab. 3 indicate that R-GCNs are outperforming GGNNs substantially on the VarMisuse task, contradicting the findings of Allamanis et al. (2018). • The GNN-MLP models are obvious extensions that are often alluded to, but are not part of the usually considered set of baseline models. Nonetheless, experiments across all three tasks have shown that these methods outperform better-published techniques such as GGNNs, R-GCNs and GATs, without a substantial runtime penalty.
|
| 198 |
+
|
| 199 |
+
These results indicate that there is substantial value in independent reproducibility efforts and comparisons that include “obvious” baselines, matching the experiences from other areas of machine learning as well as earlier work by Shchur et al. (2018) on reproducing experimental results for GNNs on citation network tasks.
|
| 200 |
+
|
| 201 |
+
# REFERENCES
|
| 202 |
+
|
| 203 |
+
Miltiadis Allamanis, Marc Brockschmidt, and Mahmoud Khademi. Learning to represent programs with graphs. In International Conference on Learning Representations (ICLR), 2018.
|
| 204 |
+
|
| 205 |
+
Lei Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016.
|
| 206 |
+
|
| 207 |
+
Matej Balog, Bart van Merrienboer, Subhodeep Moitra, Yujia Li, and Daniel Tarlow. Fast training ¨ of sparse graph neural networks on dense hardware. CoRR, abs/1906.11786, 2019.
|
| 208 |
+
|
| 209 |
+
Dan Busbridge, Dane Sherburn, Pietro Cavallo, and Nils Y. Hammerla. Relational graph attention networks. CoRR, abs/1904.05811, 2019.
|
| 210 |
+
|
| 211 |
+
Milan Cvitkovic, Badal Singh, and Anima Anandkumar. Open vocabulary learning on source code with a graph-structured cache. In International Conference on Machine Learning (ICML), 2019.
|
| 212 |
+
|
| 213 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning (ICML), 2017.
|
| 214 |
+
|
| 215 |
+
David Ha, Andrew M. Dai, and Quoc V. Le. HyperNetworks. In International Conference on Learning Representations (ICLR), 2017.
|
| 216 |
+
|
| 217 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), 2017.
|
| 218 |
+
|
| 219 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR), 2016.
|
| 220 |
+
|
| 221 |
+
Aditya Paliwal, Sarah M. Loos, Markus N. Rabe, Kshitij Bansal, and Christian Szegedy. Graph representations for higher-order logic and theorem proving. CoRR, abs/1905.10006, 2019.
|
| 222 |
+
|
| 223 |
+
Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron C. Courville. FiLM: Visual reasoning with a general conditioning layer. In AAAI Conference on Artificial Intelligence, 2017.
|
| 224 |
+
|
| 225 |
+
Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1, 2014.
|
| 226 |
+
|
| 227 |
+
Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional network. In Extended Semantic Web Conference (ESWC), 2018.
|
| 228 |
+
|
| 229 |
+
Daniel Selsam, Matthew Lamm, Benedikt Bunz, Percy Liang, Leonardo de Moura, and David L. ¨ Dill. Learning a SAT solver from single-bit supervision. In International Conference on Learning Representations (ICLR), 2019.
|
| 230 |
+
|
| 231 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29, 2008.
|
| 232 |
+
|
| 233 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. CoRR, abs/1811.05868, 2018.
|
| 234 |
+
|
| 235 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. In International Conference on Learning Representations (ICLR), 2018.
|
| 236 |
+
|
| 237 |
+
Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In International Conference on Learning Representations (ICLR), 2019.
|
| 238 |
+
|
| 239 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR), 2019.
|
| 240 |
+
|
| 241 |
+
Marinka Zitnik and Jure Leskovec. Predicting multicellular function through multi-layer tissue networks. Bioinformatics, 33, 2017.
|
| 242 |
+
|
| 243 |
+
# A HYPERPARAMETER SEARCH SPACES
|
| 244 |
+
|
| 245 |
+
A.1 PPI
|
| 246 |
+
|
| 247 |
+
For all models, a full grid search considering all combinations of the following parameters was performed:
|
| 248 |
+
|
| 249 |
+
• hidden siz $\textsf { e } \in \{ 1 9 2 , 2 5 6 , 3 2 0 \}$ - size of per-node representations. • graph num layers $\in \{ 2 , 3 , 4 , 5 \}$ - number of propagation steps / layers. • graph layer input dropout keep prob $\in \ \{ 0 . 8 , 0 . 9 , 1 . 0 \}$ - dropout applied before propagation steps.
|
| 250 |
+
|
| 251 |
+
# A.2 QM9
|
| 252 |
+
|
| 253 |
+
For all models, 500 configurations were considered, sampling hyperparameter settings uniformly from the following options:
|
| 254 |
+
|
| 255 |
+
• hidden siz $\textsf { e } \in \{ 6 4 , 9 6 , 1 2 8 \}$ - size of per-node representations.
|
| 256 |
+
• graph num layers $\in \{ 4 , 6 , 8 \}$ - number of propagation steps / layers.
|
| 257 |
+
• graph layer input dropout keep prob $\in \ \{ 0 . 8 , 0 . 9 , 1 . 0 \}$ - dropout applied before propagation steps.
|
| 258 |
+
• layer norm $\in \{ T r u e , F a l s e \}$ - decided if layer norm is applied after each propagation step.
|
| 259 |
+
• dense layers $\in \{ 1 , 2 , 3 2 \}$ - insert a fully connected layer applied to node representations between every dense layers propagation steps. (32 effectively turns this off) res connection $\in \quad \{ 1 , 2 , 3 2 \}$ - insert a residual connection between every res connection propagation steps. (32 effectively turns this off)
|
| 260 |
+
• graph activation function $\in$ {relu, leaky relu, elu, gelu, tanh} - non-linearity applied after message passing.
|
| 261 |
+
• optimizer $\in \{ R M S P r o p , A d a m \}$ - optimizer used (with TF 1.13.1 default parameters).
|
| 262 |
+
• $\mathtt { l r } \in [ 0 . 0 0 0 5 , 0 . 0 0 1 ]$ - learning rate.
|
| 263 |
+
• $\mathsf { c e l 1 } \in \{ R N N , G R U , L S T M \}$ - gated cell used for GGNN (only part of search space for GGNN).
|
| 264 |
+
• num heads $\in \{ 4 , 8 , 1 6 \}$ - number of attention heads used for R-GAT (only part of search space for R-GAT).
|
| 265 |
+
|
| 266 |
+
# A.3 VARMISUSE
|
| 267 |
+
|
| 268 |
+
For all models, a full grid search considering all combinations of the following parameters was performed:
|
| 269 |
+
|
| 270 |
+
• hidden si $z \in \{ 6 4 , 9 6 , 1 2 8 \}$ - size of per-node representations.
|
| 271 |
+
• graph num layers $\in \{ 6 , 8 , 1 0 \}$ - number of propagation steps / layers. graph layer input dropout keep prob $\in \ \{ 0 . 8 , 0 . 9 , 1 . 0 \}$ - dropout applied before propagation steps.
|
| 272 |
+
$\mathsf { c e l 1 } \in \mathsf { \Omega } \{ G R U , L S T M \}$ - gated cell used for GGNN (only part of search space for GGNN).
|
| 273 |
+
• num heads $\in \ \{ 4 , 8 \}$ - number of attention heads used for R-GAT (only part of search space for R-GAT).
|
md/train/HJeO7RNKPr/HJeO7RNKPr.md
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEPV2D: VIDEO TO DEPTH WITH DIFFERENTIABLE STRUCTURE FROM MOTION
|
| 2 |
+
|
| 3 |
+
Zachary Teed
|
| 4 |
+
Princeton University
|
| 5 |
+
zteed@cs.princeton.edu
|
| 6 |
+
Jia Deng
|
| 7 |
+
Princeton University
|
| 8 |
+
jiadeng@cs.princeton.edu
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
We propose DeepV2D, an end-to-end deep learning architecture for predicting depth from video. DeepV2D combines the representation ability of neural networks with the geometric principles governing image formation. We compose a collection of classical geometric algorithms, which are converted into trainable modules and combined into an end-to-end differentiable architecture. DeepV2D interleaves two stages: motion estimation and depth estimation. During inference, motion and depth estimation are alternated and converge to accurate depth. Code is available https://github.com/princeton-vl/DeepV2D.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
In video to depth, the task is to estimate depth from a video sequence. The problem has traditionally been approached using Structure from Motion (SfM), which takes a collection of images as input, and jointly optimizes over 3D structure and camera motion (Schonberger & Frahm, 2016b). The resulting camera parameter estimates can be used as input to Multi-View Stereo in order to build a more complete 3D representation such as surface meshes and depth maps (Furukawa et al., 2015; Furukawa & Ponce, 2010).
|
| 17 |
+
|
| 18 |
+
In parallel, deep learning has been highly successful in a number of 3D reconstruction tasks. In particular, given ground truth depth, a network can learn to predict depth from a single image (Eigen et al., 2014; Eigen & Fergus, 2015; Laina et al., 2016), stereo images (Kendall et al., 2017; Mayer et al., 2016a), or collections of frames (Zhou et al., 2018; Kar et al., 2017; Tang & Tan, 2018; Yao et al., 2018). One advantage of deep networks is that they can use single-image cues such as texture gradients and shading as shown by their strong performance on depth estimation from a single image (Eigen et al., 2014; Eigen & Fergus, 2015; Laina et al., 2016). Furthermore, differentiable network modules can be composed so that entire pipelines (i.e. feature extraction, feature matching, regularization) can be learned directly from training data. On the other hand, as recent work has shown, it is often hard to train generic network layers to directly utilize multiview geometry (e.g. using interframe correspondence to recover depth), and it is often advantageous to embed knowledge of multiview geometry through specially designed layers or losses (Ummenhofer et al., 2017; Kendall & Cipolla, 2017; Zhou et al., 2017; Vijayanarasimhan et al., 2017; Zhou et al., 2018).
|
| 19 |
+
|
| 20 |
+
In this work, we continue the direction set forth by recent works (Ummenhofer et al., 2017; Kendall et al., 2017; Tang & Tan, 2018; Zhou et al., 2018; Kar et al., 2017; Wang et al., 2018) that combine the representation ability of neural networks with the geometric principles underlying image formation. We propose DeepV2D, a composition of classical geometrical algorithms which we turn into differentiable network modules and combine into an end-to-end trainable architecture. DeepV2D interleaves two stages: camera motion estimation and depth estimation (Figure 1). The motion module takes depth as input, and outputs an incremental update to camera motion. The depth module takes camera motion as input, and performs stereo reconstruction to predict depth. At test time, DeepV2D acts as block coordinate descent, alternating between updating depth and camera motion.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: DeepV2D predicts depth from video. It is the composition of classical geometric algorithms, made differentiable, and combined into an end-to-end trainable network architecture. Video to depth is broken down into the subproblems of motion estimation and depth estimation, which are solved by the Motion Module and Depth Module respectively.
|
| 24 |
+
|
| 25 |
+
To estimate camera motion we introduce Flow-SE3, a new motion estimation architecture, which outputs an incremental update to camera motion. Flow-SE3 takes depth as input, and estimates dense 2D correspondence between pairs of frames. We unroll a single iteration of Perspectiven-Point (PnP) (Lepetit et al., 2009; Li et al., 2012) performing Gauss-Newton updates over SE3 perturbations to minimize geometric reprojection error. The new estimate of camera motion can then be fed back into Flow-SE3, which re-estimates correspondence for a finer grain pose update.
|
| 26 |
+
|
| 27 |
+
Our Depth Module builds upon prior work (Kendall et al., 2017; Yao et al., 2018) and formulates multiview-stereo (MVS) reconstruction as a single feed-forward network. Like classical MVS, we leverage geometry to build a cost volume over video frames, but use trainable network for both feature extraction and matching.
|
| 28 |
+
|
| 29 |
+
Our work shares similarities with prior works (Ummenhofer et al., 2017; Kendall et al., 2017; Tang & Tan, 2018; Zhou et al., 2018; Kar et al., 2017; Wang et al., 2018) that also combine deep learning and multiview geometry, but is novel and unique in that it essentially “differentializes” a classical SfM pipeline that alternates between stereopsis, dense 2D feature matching, and $\mathrm { P n P } .$ As a comparison, DeMon (Ummenhofer et al., 2017) and DeepTAM (Zhou et al., 2018) differentialize stereopsis and feature matching, but not PnP because they use a generic network to predict camera motion.
|
| 30 |
+
|
| 31 |
+
Another comparison is with BA-Net (Tang & Tan, 2018), whose classical analogue is performing bundle adjustment from scratch to optimize feature alignment over camera motion and the coefficients of a limited set of depth maps (depth basis). In other words, BA-Net performs one joint nonlinear optimization over all variables, whereas we decompose the joint optimization into more tractable subproblems and do block coordinate descent. Our decomposition is more expressive in terms of reconstruction since we can optimize directly over per-pixel depth and are not constrained by a depth basis, which can potentially limit the accuracy of the final depth.
|
| 32 |
+
|
| 33 |
+
In our experiments, we demonstrate the effectiveness of DeepV2D across a variety of datasets and tasks, and outperform strong methods such as DeepTAM (Zhou et al., 2018), DeMoN (Ummenhofer et al., 2017), BANet (Tang & Tan, 2018), and MVSNet (Yao et al., 2018). As we show, alternating depth and motion estimation quickly converges to good solutions. On all datasets we outperform all existing single-view and multi-view approaches. We also show superior cross-dataset generalizability, and can outperform existing methods even when training on entirely different datasets.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Structure from Motion: Beginning with early systems designed for small image collections (Longuet-Higgins, 1981; Mohr et al., 1995), Structure from Motion (SfM) has improved dramatically in regards to robustness, accuracy, and scalability. Advances have come from improved features (Lowe, 2004; Han et al., 2015), optimization techniques (Snavely, 2009), and more scalable data structures and representations (Schonberger & Frahm, 2016a; Gherardi et al., 2010), culminating in a number of robust systems capable of large-scale reconstruction task (Schonberger & Frahm, 2016a; Snavely, 2011; Wu et al., 2011). Ranftl et al. (2016) showed that SfM could be extended to reconstruct scenes containing many dynamically moving objects. However, SfM is limited by the accuracy and availability of correspondence. In low texture regions, occlusions, or lighting changes SfM can produce noisy or missing reconstructions.
|
| 38 |
+
|
| 39 |
+
Simultaneous Localization and Mapping (SLAM) jointly estimates camera motion and 3D structure from a video sequence (Engel et al., 2014; Mur-Artal et al., 2015; Mur-Artal & Tardos, 2017; New- ´ combe et al., 2011; Engel et al., 2018). LSD-SLAM (Engel et al., 2014) is unique in that it relies on a featureless approach to 3D reconstruction, directly estimating depth maps and camera pose by minimizing photometric error. Our Motion Network behaves similarly to the tracking component in LSD-SLAM, but we use a network which predicts misalignment directly instead of using intensity gradients. We end up with an easier optimization problem characteristic of indirect methods (Mur
|
| 40 |
+
|
| 41 |
+
Artal et al., 2015), while retaining the flexibility of direct methods in modeling edges and smooth intensity changes (Engel et al., 2018).
|
| 42 |
+
|
| 43 |
+
Geometry and Deep Learning: Geometric principles has motivated the design of many deep learning architectures. In video to depth, we need to solve two subproblems: depth estimation and motion estimation.
|
| 44 |
+
|
| 45 |
+
Depth: End-to-end networks can be trained to predict accurate depth from a rectified pair of stereo images (Han et al., 2015; Mayer et al., 2016a; Kendall et al., 2017; Chang & Chen, 2018). Kendall et al. (2017) and Chang & Chen (2018) design network architectures specifically for stereo matching. First, they apply a 2D convolutional network to extract learned features, then build a cost volume over the learned features. They then apply 3-D convolutions to the cost volume to perform feature matching and regularization. A similar idea has been extended to estimate 3D structure from multiple views (Kar et al., 2017; Yao et al., 2018). In particular, MVSNet (Yao et al., 2018) estimates depth from multiple images. However, these works require known camera poses as input, while our method estimates depth from a video where the motion of the camera is unknown and estimated during inference.
|
| 46 |
+
|
| 47 |
+
Motion: Several works have used deep networks to predict camera pose. Kendall et al. (2015) focus on the problem of camera localization, while other work (Zhou et al., 2017; Vijayanarasimhan et al., 2017; Wang et al., 2017) propose methods which estimate camera motion between a pairs of frames in a video. Networks for motion estimation have typically relied on generic network components whereas we formulate motion estimation as a least-squares optimization problem. Whereas prior work has focused on estimating relative motion between pairs of frames, we can jointly update the pose of a variable number of frames.
|
| 48 |
+
|
| 49 |
+
Depth and Motion: Geometric information has served as a self-supervisory signal for many recent works (Vijayanarasimhan et al., 2017; Zhou et al., 2017; Wang et al., 2018; Yin & Shi, 2018; Yang et al., 2018; Godard et al., 2017; Mahjourian et al., 2018). In particular, Zhou et al. (2017) and Vijayanarasimhan et al. (2017) trained a single-image depth network and a pose network while supervising on photometric consistency. However, while these works use geometric principles for training, they do not use multiple frames to predict depth at inference.
|
| 50 |
+
|
| 51 |
+
DeMoN (Ummenhofer et al., 2017) and DeepTAM (Zhou et al., 2018) where among the first works to combine motion estimation and multi-view reconstruction into a trainable pipeline. DeMoN (Ummenhofer et al., 2017) operates on two frames and estimates depth and motion in separate network branches, while DeepTAM (Zhou et al., 2018) can be used on variable number of frames. Like our work and other classical SLAM framesworks (Engel et al., 2014; Newcombe et al., 2011), DeepTAM separates depth and motion estimation, however we maintain end-to-end differentiablity between our modules. A major innovation of DeepTAM was to formulate camera motion estimation in the form of incremental updates. In each iteration, DeepTAM renders the keyframe from a synthetic viewpoint, and predicts the residual motion from the rendered viewpoint and the target frame.
|
| 52 |
+
|
| 53 |
+
Estimating depth and camera motion can be naturally modeled as a non-linear least squares problem, which has motivated several works to include an differentiable optimization layer within network architectures (Tang & Tan, 2018; Wang et al., 2018; Clark et al., 2018; Bloesch et al., 2018). We follow this line of work, and propose the Flow-SE3 module which introduces a direct mapping from 2D correspondence to a 6-dof camera motion update. Our Flow-SE3 module is different from prior works such as DeMon (Ummenhofer et al., 2017) and DeepTAM (Zhou et al., 2018) which do not impose geometric constraints on camera motion and use generic layers. BA-Net (Tang & Tan, 2018) and LS-Net (Clark et al., 2018) include optimization layers, but instead optimize over photometric error (either pixel alignment (Clark et al., 2018) or feature alignment (Tang & Tan, 2018)). Our Flow-SE3 module still imposes geometric constraints on camera motion like BA-Net (Tang & Tan, 2018), but we show that in minimizing geometric reprojection error ( difference of pixel locations), we end up with a well-behaved optimization problem, well-suited for end-to-end training.
|
| 54 |
+
|
| 55 |
+
An important difference between our approach and BA-Net is that BA-Net performs one joint optimization problem by formulating Bundle-Adjustment as a differentiable network layer, whereas we separate motion and depth estimation. With this separation, we avoid the need for a depth basis. Our final reconstructed depth is the product of a cost volume, which can adapt the reconstruction as camera motion updates improve, while the output of BA-Net is restricted by the initial quality of the depth basis produced by a single-image network.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 2: The Depth Module performs stereo matching over multiple frames to estimate depth. First each image is fed through a network to extract a dense feature map. The 2D features are backprojected into a set of cost volumes. The cost volumes are processed by a set of 3D hourglass networks to perform feature matching. The final cost volume is processed by the differentiable arg-max operator to produce a pixelwise depth estimate.
|
| 59 |
+
|
| 60 |
+
# 3 APPROACH
|
| 61 |
+
|
| 62 |
+
DeepV2D predicts depth from a calibrated video sequence. We take a video as input and output dense depth. We consider two subproblems: depth estimation and motion estimation. Both subproblems are formulated as trainable neural network modules, which we refer to as the Depth Module and the Motion Module. Our depth module takes camera motion as input and outputs an updated depth prediction. Our motion module takes depth as input, and outputs a motion correction term. In the forward pass, we alternate between the depth and motion modules as we show in Figure 1.
|
| 63 |
+
|
| 64 |
+
Notation and Camera Geometry: As a preliminary, we define some of the operations used within the depth and motion modules. We define $\pi$ to be the camera projection operator which maps a 3D point $\mathbf { X } = ( X , Y , Z , 1 ) ^ { T }$ to image coordinates $\mathbf { x } = ( u , v )$ . Likewise, $\pi ^ { \dot { - } 1 }$ is defined to be the backprojection operator, which maps a pixel $x$ and depth $z$ to a 3D point. Using the pinhole camera model with intrinsics $( f _ { x } , f _ { y } , c _ { x } , c _ { y } )$ we have
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\pi ( { \bf X } ) = ( f _ { x } \frac { X } { Z } + c _ { x } , f _ { y } \frac { Y } { Z } + c _ { y } ) , \qquad \pi ^ { - 1 } ( { \bf x } , z ) = ( z \frac { u - c _ { x } } { f _ { x } } , z \frac { v - c _ { y } } { f _ { y } } , z , 1 ) ^ { T }
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
The camera pose is represented using rigid body transform $\mathbf { G } \in S E ( 3 )$ . To find the image coordinates of point $\mathbf { X }$ in camera $i$ , we chain the projection and transformation: $( u , v ) ^ { T } = \bar { \pi ( \mathbf { G } _ { i } \mathbf { X } ) }$ , where $\mathbf { G } _ { i }$ is the pose of camera $i$ .
|
| 71 |
+
|
| 72 |
+
Now, given two cameras $\mathbf { G } _ { i }$ and $\mathbf { G } _ { j }$ . If we know the depth of a point $\mathbf { x } ^ { i } = ( u ^ { i } , v ^ { i } )$ in camera $i$ , we can find its reprojected coordinates in camera $j$ :
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\binom { u ^ { j } } { v ^ { j } } = \pi ( \mathbf { G } _ { j } \mathbf { G } _ { i } ^ { - 1 } \pi ^ { - 1 } ( \mathbf { x } , z ) ) = \pi ( \mathbf { G } _ { i j } \pi ^ { - 1 } ( \mathbf { x } , z ) )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
using the notation $\mathbf { G } _ { i j } = \mathbf { G } _ { j } \mathbf { G } _ { i } ^ { - 1 }$ for the relative pose between cameras $i$ and $j$ .
|
| 79 |
+
|
| 80 |
+
# 3.1 DEPTH MODULE
|
| 81 |
+
|
| 82 |
+
The depth module takes a collection of frames, $\mathbf { I } = \{ I _ { 1 } , I _ { 2 } , . . . , I _ { N } \}$ , along with their respective pose estimates, $\mathbf { G } = \{ G _ { 1 } , G _ { 2 } , . . . , G _ { N } \}$ , and predicts a dense depth map $D ^ { * }$ for the keyframe (Figure 2). The depth module works by building a cost volume over learned features. Information is aggregated over multiple viewpoints by applying a global pooling layer which pools across viewpoints.
|
| 83 |
+
|
| 84 |
+
The depth module can be viewed as the composition of 3 building blocks: 2D feature extractor, cost volume backprojection, and 3D stereo matching.
|
| 85 |
+
|
| 86 |
+
2D Feature Extraction: The Depth Module begins by extracting learned features from the input images. The 2D encoder consists of 2 stacked hourglass modules (Newell et al., 2016) which maps each image to a dense feature map $I _ { i } \to F _ { i }$ . More information regarding network architectures is provided in the appendix.
|
| 87 |
+
|
| 88 |
+
Cost Volume Backprojection: Take $I _ { 1 }$ to be the keyframe, a cost volume is constructed for each of the remaining N-1 frames. The cost volume for frame $j$ , $\mathbf { C } ^ { j }$ , is constructed by backprojecting 2D features into the coordinate system defined by the keyframe image. To build the cost volume, we enumerate over a range of depths $z _ { 1 } , z _ { 2 } , . . . , z _ { D }$ which is chosen to span the ranges observed in the dataset $0 . 2 \mathrm { m } \cdot 1 0 \mathrm { m }$ for indoor scenes). For every depth $z _ { k }$ , we use Equation 2 to find the reprojected coordinates on frame $j$ , and then use differentiable bilinear sampling of the feature map $F _ { j }$ .
|
| 89 |
+
|
| 90 |
+
More formally, given a pixel $\mathbf { x } = ( u , v ) \in \mathbb { N } ^ { 2 }$ in frame $I _ { 1 }$ and depth $z _ { k }$
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
C _ { u v k } ^ { j } = F _ { j } ( \pi ( \mathbf { G } _ { j } \mathbf { G } _ { 1 } ^ { - 1 } \pi ^ { - 1 } ( \mathbf { x } , z _ { k } ) ) ) \in \mathbb { R } ^ { H \times W \times D \times C }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $F ( \cdot )$ is the differentiable bilinear sampling operator (Jaderberg et al., 2015). Since the bilinear sampling is differentiable, $\mathbf { C } ^ { j }$ is differentiable w.r.t all inputs, including the camera pose.
|
| 97 |
+
|
| 98 |
+
Applying this operation to each frame, gives us a set of N-1 cost volumes each with dimension $\mathbf { H } { \times } \mathbf { W } { \times } \mathbf { D } { \times } \mathbf { C }$ . As a final step, we concatenate each cost volume with the keyframe image features increasing the dimension to $\mathrm { H } { \times } \mathrm { W } { \times } \mathrm { D } { \times } 2 \mathrm { C }$ . By concatenating features, we give the network the necessary information to perform feature matching between the keyframe/image pairs without decimating the feature dimension.
|
| 99 |
+
|
| 100 |
+
3D Matching Network: The set of N-1 cost volumes are first processed by a series of 3D convolutional layers to perform stereo matching. We then perform view pooling by averaging over the N-1 volumes to aggregate information across frames. View pooling leaves us with a single volume of dimension $\mathbf { H } { \times } \mathbf { W } { \times } \mathbf { D } { \times } \mathbf { C }$ . The aggregated volume is then processed by a series of 3D hourglass modules, each outputs an intermediate depth.
|
| 101 |
+
|
| 102 |
+
Each 3D hourglass module predicts an intermediate depth estimate. We produce an intermediate depth representation by first applying a 1x1x1 convolution to a produce $\mathrm { H } \times \mathrm { W } \times \mathrm { D }$ volume. We then apply the softmax operator over the depth dimension, so that for each pixel, we get a probability distribution over depths. We map the probability volume into a single depth estimate using the differentiable argmax function (Kendall et al., 2017) which computes the expected depth.
|
| 103 |
+
|
| 104 |
+
# 3.2 MOTION MODULE
|
| 105 |
+
|
| 106 |
+
The objective of the motion module is to update the camera motion estimates given depth as input. Given the input poses, $\mathbf { G } = \{ G _ { 1 } , G _ { 2 } , . . . , G _ { N } \}$ , the motion module outputs a set of local perturbations $\pmb { \xi } = \{ \xi _ { 1 } , \xi _ { 2 } , . . . , \xi _ { N } \} , \xi _ { i } \in s e ( 3 )$ used to update the poses. The updates are found by setting up a least squares optimization problem which is solved using a differentiable in-network optimization layer.
|
| 107 |
+
|
| 108 |
+
Initialization: We use a generic network architecture to predict the initial pose estimates similiar to prior work Zhou et al. (2017). We choose one frame to be the keyframe. The poses are initialized by setting the keyframe pose to be the identity matrix, and then predicting the relative motion between the keyframe and each of the other frames in the video.
|
| 109 |
+
|
| 110 |
+
Feature Extraction: Our motion module operates over learned features. The feature extractor maps every frame to a dense feature map, $I _ { i } \to F _ { i }$ . The weights of the feature extractor are shared across all frames. Network architecture details are provided in the appendix.
|
| 111 |
+
|
| 112 |
+
Error Term: Take two frames, $( I _ { i } , I _ { j } )$ , with respective poses $( \mathbf { G } _ { i } , \mathbf { G } _ { j } )$ and feature maps $( F _ { i } , F _ { j } )$ . Given depth $Z _ { i }$ we can use Equation 2 we can warp $F _ { j }$ onto camera $i$ to generate the warped feature map $\tilde { F } _ { j }$ . If the relative pose $\mathbf { G } _ { i j } = \mathbf { G } _ { j } \mathbf { G } _ { i } ^ { - 1 }$ is correct, then the feature maps $F _ { i }$ and $\tilde { F } _ { j }$ should align. However, if the relative pose is noisy, then there will be misalignment between the feature images which should be corrected by the pose update.
|
| 113 |
+
|
| 114 |
+
We concatenate $F _ { i }$ and $\tilde { F } _ { j }$ , and send the concatenated feature map through an hourglass network to predict the dense residual flow between the feature maps, which we denote $\mathbf { R }$ , and corresponding confidence map W. Using the residual flow, we define the following error term:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) = \mathbf { r } _ { k } - [ \pi ( ( e ^ { \xi _ { j } } \mathbf { G } _ { j } ) ( e ^ { \xi _ { i } } \mathbf { G } _ { i } ) ^ { - 1 } \mathbf { X } _ { k } ^ { i } ) - \pi ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } ) ] , \qquad \mathbf { X } _ { k } ^ { i } = \pi ^ { - 1 } ( \mathbf { x } _ { k } , z _ { k } )
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: The Motion Module updates the input pose estimates by solving a least squares optimization problem. The motion module predicts the residual flow between pairs of frames, and uses the residual terms to define the optimization objective. Pose increments $\boldsymbol { \xi }$ are found by performing a single differentiable Gauss-Newton optimization step.
|
| 122 |
+
|
| 123 |
+
where $\mathbf { r } _ { k }$ is the residual flow at pixel $\mathbf { x } _ { k }$ predicted by the network, and $z _ { k }$ is the predicted depth. The weighting map W is mapped to $( 0 , 1 )$ using the sigmoid activation, and is used to determine how the individual error terms are weighted in the final objective.
|
| 124 |
+
|
| 125 |
+
Optimization Objective: The previous section showed how two frames $( i , j )$ can be used to define a collection of error terms $\mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } )$ for each pixel $\mathbf { x } _ { k }$ in image $I _ { i }$ . The final optimization objective is a weighted combination of error terms:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
E ( \pmb { \xi } ) = \sum _ { ( i , j ) \in \mathcal { C } } \sum _ { k } \mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) ^ { T } d i a g ( \mathbf { w } _ { k } ) \mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) , \qquad d i a g ( \mathbf { w } _ { k } ) = \left( \begin{array} { l l } { w _ { k } ^ { u } } & { 0 } \\ { 0 } & { w _ { k } ^ { v } } \end{array} \right)
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
This leaves us with the question of which frames pairs $( i , j ) \in \mathcal { C }$ to use when defining the optimization objective. In this paper, we consider two different approaches which we refer to as Global pose optimization and Keyframe pose optimization.
|
| 132 |
+
|
| 133 |
+
Global Pose Optimization: Our global pose optimization uses all pairs of frames ${ \mathcal { C } } = ( i , j ) , i \neq j$ to define the objective function (Equation 5) and the pose increment $\xi$ is solved for jointly over all poses. Therefore, given $N$ frames, dense pose optimization uses $\mathbf { N } { \times } \mathbf { N } { - } 1$ frame pairs. Since every pair of frames is compared, this means that the global pose optimization requires the predicted depth maps for all frames as input. Although each pair $( i , j )$ only gives us information about the relative pose $\mathbf { G } _ { i j }$ , considering all pairs allows us to converge to a globally consistent pose graph.
|
| 134 |
+
|
| 135 |
+
Keyframe Pose Optimization: Our keyframe pose optimization selects a given frame to be the keyframe (i.e select $I _ { 1 }$ as the keyframe), and only computes the error terms between the keyframe and each of the other frames: $\mathcal { C } \overset { \cdot } { = } \left( 1 , j \right)$ for $j = 2 , . . . , N$ .
|
| 136 |
+
|
| 137 |
+
Fixing the pose of the keyframe, we can remove $\xi _ { 1 }$ from the optimization objective. This means that each error $\mathbf { e } _ { k } ^ { i j } ( \mathbf { 0 } , \boldsymbol { \xi } _ { j } )$ term is only a function of a single pose increment $\xi _ { j }$ . Therefore, we can solve for each of the $N - 1$ pose increments independently. Additionally, since $i = 1$ for all pairs $( i , j ) \in \mathcal { C }$ , we only need the depth of the keyframe as input when using keyframe pose optimization.
|
| 138 |
+
|
| 139 |
+
LS-Optimization Layer: Using the optimization objective in Equation 5, we solve for the pose increments $\boldsymbol { \xi }$ by applying a Gauss-Newton update. We backpropogate through the Gauss-Newton update so that the weights of the motion module (both feature extractor and flow network) can be trained on the final objective function. In the appendix, we provide additional information for how the update is derived and the expression for the Jacobian of Equation 4.
|
| 140 |
+
|
| 141 |
+
# 3.3 FULL SYSTEM
|
| 142 |
+
|
| 143 |
+
During inference, we alternate the depth and motion modules for a selected number of iterations. The motion module uses depth to predict camera pose. As the depth estimates converge, the camera poses become more accurate. Likewise, as camera poses converge, the depth module can estimate more accurate depth.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 4: Visualization of predicted depth maps on NYU, ScanNet, and SUN3D. On ScanNet and SUN3D (marked with \*) we show the results of the model trained only on NYU data.
|
| 147 |
+
|
| 148 |
+
Initialization: We try two different strategies for initialization in our experiments: (1) self initialization initializes DeepV2D with a constant depth map and (2) single image initialization uses the output of a single-image depth network for initialization. Both methods give good performance.
|
| 149 |
+
|
| 150 |
+
# 3.4 SUPERVISION
|
| 151 |
+
|
| 152 |
+
Depth Supervision: We supervise on the L1 distance between the ground truth and predicted depth. We additionally apply a small L1 smoothness penalty to the predicted depth map. Given predicted depth $Z$ and ground truth depth $Z ^ { \ast }$ , the depth loss is defined as:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\mathcal { L } _ { d e p t h } ( Z ) = \sum _ { \mathbf { x } _ { i } } \left| Z ( \mathbf { x } _ { i } ) - Z ^ { * } ( \mathbf { x _ { i } } ) \right| + w _ { s } \sum _ { \mathbf { x } _ { i } } \left| \partial _ { x } Z ( \mathbf { x } _ { i } ) \right| + \left| \partial _ { y } Z ( \mathbf { x } _ { i } ) \right|
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Motion Supervision: We supervise pose using the geometric reprojection error. Given predicted pose $\mathbf { G }$ and ground truth pose $\mathbf { G } ^ { \ast }$ , the pose loss is defined
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\mathcal { L } _ { m o t i o n } ( \mathbf { G } ) = \sum _ { \mathbf { x } _ { i } } | | \pi ( \mathbf { G } \pi ^ { - 1 } ( \mathbf { x } _ { i } , Z ( \mathbf { x } _ { i } ) ) ) - \pi ( \mathbf { G } ^ { * } \pi ^ { - 1 } ( \mathbf { x } _ { i } , Z ( \mathbf { x } _ { i } ) ) ) | | _ { \delta }
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $| | \cdot | | _ { \delta }$ is the robust Huber loss; we set $\delta = 1$ .
|
| 165 |
+
|
| 166 |
+
Total Loss: The total loss is taken as a weighted combination of the depth and motion loss terms: $\mathcal { L } = \mathcal { L } _ { d e p t h } + \lambda \mathcal { L } _ { m o t i o n }$ , where we set $\lambda = 1 . 0$ in our experiments.
|
| 167 |
+
|
| 168 |
+
# 4 EXPERIMENTS
|
| 169 |
+
|
| 170 |
+
We test DeepV2D across a wide range of benchmarks to provide a thorough comparison to other methods. While the primary focus of these experiments is to compare to other works which estimate depth from multiple frames, often single-view networks still outperform multiview depth estimation. To put our results in proper context, we include both multiview and state-of-the-art single-image comparisons. Since it is not possible to recover the absolute scale of the scene through SfM, we report all results (both ours and all other approaches) using scale matched depth (Tang & Tan, 2018).
|
| 171 |
+
|
| 172 |
+
Our primary experiments are on NYU, ScanNet, SUN3D, and KITTI, and we report strong results across all datasets. We show visualization of our predicted depth maps in Figure 4. The figure shows that DeepV2D can recover accurate and sharp depth even when applied to unseen datasets. One aspect of particular interest is cross-dataset generalizability. Our results show that DeepV2D generalizes very well—we achieve the highest accuracy on ScanNet and SUN3D even without training on either dataset.
|
| 173 |
+
|
| 174 |
+
# 4.1 DEPTH EXPERIMENTS
|
| 175 |
+
|
| 176 |
+
We evaluate depth on NYU (Silberman et al., 2012), ScanNet (Dai et al., 2017), SUN3D (Xiao et al., 2013), and KITTI (Geiger et al., 2013). On all datasets, DeepV2D is given a video clip with unknown camera poses and alternates depth and pose updates and is evaluated after 8 iterations.
|
| 177 |
+
|
| 178 |
+
NYU: NYU depth (Silberman et al., 2012) is a dataset composed of videos taken in indoor settings including offices, bedrooms, and libraries. We experiment on NYU using the standard train/test split (Eigen et al., 2014) and report results in Table 1 using scaled depth (Zhou et al., 2017; Tang & Tan, 2018). We evaluate two different initialization methods of our approach. Self-init uses a constant depth map for initialization, while fcrn-init uses the output of a FCRN (Laina et al., 2016)—a singleview network for initialization. Using a single-image depth network for initialization gives a slight improvement in performance.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>NYUv2</td><td></td><td>δ<1.25↑</td><td>δ<1.25²↑</td><td>δ<1.253 个</td><td>Abs Rel↓</td><td>Sc Inv↓</td><td>RMSE↓</td><td>log10↓</td></tr><tr><td rowspan="3"></td><td>FCRN (Laina et al., 2016)</td><td>0.853</td><td>0.965</td><td>0.991</td><td>0.121</td><td>0.151</td><td>0.592</td><td>0.052</td></tr><tr><td>DORN (Fu et al., 2018)</td><td>0.875</td><td>0.966</td><td>0.989</td><td>0.109</td><td>-</td><td>0.464</td><td>0.047</td></tr><tr><td>Alhashim& Wonka (2018) COLMAP</td><td>0.895</td><td>0.980</td><td>0.996</td><td>0.103</td><td>-</td><td>0.390</td><td>0.043</td></tr><tr><td rowspan="6">mnnian DeMoN †</td><td>DfUSMC DeMoN</td><td>0.619 0.487</td><td>0.760 0.697</td><td>0.829 0.814</td><td>0.312 0.447</td><td>1.512 0.456</td><td>1.381 1.793</td><td>0.153 0.169</td></tr><tr><td>MVSNet + OpenMVG</td><td>0.766</td><td>0.913</td><td>0.965</td><td>0.181</td><td>0.212</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>0.917</td><td>0.072</td></tr><tr><td></td><td>0.776</td><td>0.933</td><td>0.979</td><td>0.160</td><td>0.196</td><td>0.775</td><td>0.067</td></tr><tr><td>0.805</td><td>0.951</td><td></td><td>0.985</td><td>0.144</td><td>0.179</td><td>0.717</td><td>0.061</td></tr><tr><td rowspan="4">Ours (self-init)-Keyframe Ours (fcrn-init) - Keyframe Ours (self-init) - Global</td><td>0.940</td><td>0.985</td><td>0.995</td><td>0.072</td><td>0.105</td><td>0.459</td><td></td><td>0.031</td></tr><tr><td></td><td>0.955 0.942</td><td>0.990</td><td>0.996</td><td>0.062</td><td>0.095</td><td>0.405</td><td>0.027</td></tr><tr><td></td><td>0.986</td><td>0.995</td><td>0.070</td><td>0.104</td><td></td><td>0.454</td><td>0.030</td></tr><tr><td>Ours (fcrn-init) -Global 0.956</td><td>0.989</td><td>0.996</td><td>0.061</td><td></td><td>0.094</td><td>0.403</td><td>0.026</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Table 1: Results on the NYU dataset. Our approach outperforms existing single-view and multiview depth estimation methods. Ours (self-init) uses a constant depth map for initialization while ours(fcrn-init) uses a single-image depth network for initialization.
|
| 183 |
+
|
| 184 |
+
We compare to state-of-the-art single-image depth networks DORN (Fu et al., 2018) and DenseDepth (Alhashim & Wonka, 2018) which are built on top of a pretrained ResNet (DORN) or DenseNet-201 (DenseDepth). The results show that we can do much better than single-view depth by using multiple views. We also include classical multiview approaches such as COLMAP (Schonberger & Frahm, 2016a) and DfUSMC (Ha et al., 2016) which estimate poses with bundle adjustment, followed by dense stereo matching. While COLMAP uses SIFT features, DfUSMC is built on local-feature tracking and is designed for small baseline videos.
|
| 185 |
+
|
| 186 |
+
Table 1 also includes results using multi-view deep learning approaches. MVSNet (Yao et al., 2018) is trained to estimate depth from multiple viewpoints. Unlike our approach which estimates camera pose during inference, MVSNet requires ground truth poses as input. We train MVSNet on NYU and use poses estimated from OpenMVG (Moulon et al.) during inference. Finally, we also evaluate DeMoN (Ummenhofer et al., 2017) on NYU. DeMoN is not originally trained on NYU, but instead trained on a combination of 5 other datasets. We also try a version of DeMoN which we retrain on NYU using the code provided by the authors (denoted †).
|
| 187 |
+
|
| 188 |
+
In Appendix C, we include additional results on NYU where we test different versions of our model, along with parameter counts, timing information, peak memory usage, and depth accuracy. A shallower version of DeepV2D (replacing the stacked hourglass networks with a single hourglass network) and lower resolution inference still outperform existing work on NYU. However, using a 3D network for stereo matching turns out to be very important for depth accuracy. When the 3D stereo network is replaced with a correlation layer (Dosovitskiy et al., 2015) and 2d encoder-decoder, depth accuracy is worse increasing Abs-Rel from 0.062 to 0.135.
|
| 189 |
+
|
| 190 |
+
Figure 5 shows the impact of the number of iterations and views on the scale-invariant (sc-inv) validation set accuracy. Figure 5 (left) shows that DeepV2D requires very few iterations to converge, suggesting that block coordinate descent is effective for estimate depth from small video clips. In Figure 5 (right) we test accuracy as a function of the number of input frames used. Although DeepV2D is trained using a fixed number (4) frames as input, accuracy continues to improve a more frames are added.
|
| 191 |
+
|
| 192 |
+
ScanNet: ScanNet is a large indoor dataset consisting of 1513 RGB-D videos in distinct scenes. We use the train/test split proposed by Tang & Tan (2018) and evaluate depth and pose accuracy in Table 2. While our primary focus is on depth, DeepV2D accurately predicts camera motion.
|
| 193 |
+
|
| 194 |
+
We use ScanNet to test cross-dataset generalization and report results from two versions of our approach: ours (nyu) is our method trained only on nyu, ours (scannet) is our method trained on ScanNet. As expected, when we train on the ScanNet training set we do better than if we train only on NYU. But the performance of our NYU model is still good and outperforms BA-Net on all metrics. The design of our approach is motivated by generalizability. Our network only needs to learn feature matching and correspondence; this experiment indicates that by learning these low level tasks, we can generalize well to new data.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 5: Impact of the number of iterations (left) and frames (right) on sc-inv validation accuracy. (left) shows that DeepV2D quickly converges within a small number of iterations. In (right) we see that accuracy consistently improves as more views are added. DeepV2D can be applied to variable numbers of views for a variable number of iterations without retraining.
|
| 198 |
+
|
| 199 |
+
Table 2: ScanNet experiments evaluating depth and pose accuracy and cross-dataset generalization. Our approach trained on NYU (ours nyu) outperforms BA-Net despite BA-Net being trained on ScanNet data; training on ScanNet (ours scannet) gives even better performance.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>ScanNet</td><td>Abs Rel↓</td><td>Sq Rel↓</td><td>RMSE、</td><td>RMSE log √</td><td>sc inv</td><td>rot.(deg)↓</td><td>tr. (deg)↓</td><td>tr.(cm)↓</td></tr><tr><td>DeMoN</td><td>0.231</td><td>0.520</td><td>0.761</td><td>0.289</td><td>0.284</td><td>3.791</td><td>31.626</td><td>15.50</td></tr><tr><td>BA-Net (orig.)</td><td>0.161</td><td>0.092</td><td>0.346</td><td>0.214</td><td>0.184</td><td>1.018</td><td>20.577</td><td>3.390</td></tr><tr><td>BA-Net (5-view)</td><td>0.091</td><td>0.058</td><td>0.223</td><td>0.147</td><td>0.137</td><td>1.009</td><td>14.626</td><td>2.365</td></tr><tr><td>DSO (Engel et al., 2018)</td><td></td><td></td><td></td><td></td><td></td><td>0.925</td><td>19.728</td><td>2.174</td></tr><tr><td>DSO (fcrn-init)</td><td></td><td></td><td></td><td></td><td></td><td>0.946</td><td>19.238</td><td>2.165</td></tr><tr><td>Ours (nyu) Ours (scannet)</td><td>0.080 0.057</td><td>0.018 0.010</td><td>0.223 0.168</td><td>0.109 0.080</td><td>0.105 0.077</td><td>0.714 0.628</td><td>12.205 10.800</td><td>1.514 1.373</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 202 |
+
|
| 203 |
+
Pose accuracy from DSO Engel et al. (2018) is also included in Table 2. We test DSO using both the default initialization and single-image depth initialization using the output of FCRN (Laina et al., 2016). DSO fails to initialize or loses tracking on some of the test sequences so we only evaluate on sequences where DSO is successful. DSO fails on 335 of the 2000 test sequences while DSO (fcrn-init) fails on only 271.
|
| 204 |
+
|
| 205 |
+
SUN3D: SUN3D (Xiao et al., 2013) is another indoor scenes dataset which we use for comparison with DeepTAM. DeepTAM only evaluates their depth module in isolation using the poses provided by dataset, while our approach is designed to estimate poses during inference. We provide results from our SUN3D experiments in Table 3.
|
| 206 |
+
|
| 207 |
+
Table 3: Results on SUN3D dataset and comparison to DeepTAM. DeepTAM only evaluates depth in isolation and uses the poses from the dataset during inference, while our approach jointly estimates camera poses during inference. We outperform DeepTAM and DeMoN on SUN3D even when we do not use SUN3D data for training.
|
| 208 |
+
|
| 209 |
+
<table><tr><td>SUN3D</td><td>Training Data</td><td>L1-Inv ↓</td><td>L1-Rel↓</td><td>Sc-Inv↓</td></tr><tr><td>SGM DTAM</td><td>=</td><td>0.197</td><td>0.412</td><td>0.340</td></tr><tr><td>DeMoN</td><td>=</td><td>0.210</td><td>0.423</td><td>0.374</td></tr><tr><td>DeepTAM</td><td>S11+RGBD+MVS+SUN3D</td><td>=</td><td>=</td><td>0.146</td></tr><tr><td>Ours</td><td>MVS+SUNCG+SUN3D</td><td>0.054 0.056</td><td>0.101</td><td>0.128</td></tr><tr><td>Ours</td><td>NYU NYU+ ScanNet</td><td>0.041</td><td>0.106</td><td>0.134</td></tr><tr><td></td><td></td><td></td><td>0.077</td><td>0.104</td></tr></table>
|
| 210 |
+
|
| 211 |
+
We cannot train using the same data as DeepTAM since DeepTAM is trained using a combination of SUN3D, SUNCG, and MVS, and, at this time, neither MVS nor SUNCG are publicly available. Instead we train on alternate data and test on SUN3D. We test two different versions of our model; one where we train only on NYU, and another where we train on a combination of NYU and ScanNet data. Our NYU model performs similiar to DeepTAM; When we combine with ScanNet data, we outperform DeepTAM even though DeepTAM is trained on SUN3D and is evaluated with ground truth pose as input.
|
| 212 |
+
|
| 213 |
+
KITTI: The KITTI dataset (Geiger et al., 2013) is captured from a moving vehicle and has been widely used to evaluate depth estimation and odometry. We follow the Eigen train/test split (Eigen et al., 2014), and report results in Table 4. We evaluate using the official ground truth depth maps. We compare to the state-of-the-art single-view methods and also multiview approaches such as BANet (Tang & Tan, 2018), and outperform previous methods on the KITTI dataset across all metrics.
|
| 214 |
+
|
| 215 |
+
<table><tr><td>KITTI</td><td>Multi</td><td>δ<1.25↑</td><td>δ<1.25²↑</td><td>δ<1.25³↑</td><td>AbsRel↓</td><td>Sq Rel↓</td><td>Sq Rel†↓</td><td>RMSE↓</td><td>RMSE log↓</td></tr><tr><td>DORN</td><td>N</td><td>0.945</td><td>0.988</td><td>0.996</td><td>0.069</td><td>0.300</td><td>=</td><td>2.857</td><td>0.112</td></tr><tr><td>DfUSMC</td><td>Y</td><td>0.617</td><td>0.796</td><td>0.874</td><td>0.346</td><td>5.984</td><td></td><td>8.879</td><td>0.454</td></tr><tr><td>BA-Net</td><td>Y</td><td>=</td><td>=</td><td>=</td><td>0.083</td><td>=</td><td>0.025</td><td>3.640</td><td>0.134</td></tr><tr><td>Ours</td><td>Y</td><td>0.977</td><td>0.993</td><td>0.997</td><td>0.037</td><td>0.174</td><td>0.013</td><td>2.005</td><td>0.074</td></tr></table>
|
| 216 |
+
|
| 217 |
+
Table 4: Results on the KITTI dataset. We compare to state-of-the-art single-image depth network DORN (Fu et al., 2018) and multiview BA-Net (Tang & Tan, 2018). BA-Net reports results using a different form of the Sq-Rel metric which we denote by $\dagger$ .
|
| 218 |
+
|
| 219 |
+
Overall, the depth experiments demonstrates that imposing geometric constraints on the model architecture leads to higher accuracy and better cross-dataset generalization. By providing a differentiable mapping from optical flow to camera motion, the motion network only needs to learn to estimate interframe correspondence. Likewise, the 3D cost volume means the the depth network only needs to learn to perform stereo matching. These tasks are easy for the network to learn, which leads to strong results on all datasets, and can generalize to new datasets.
|
| 220 |
+
|
| 221 |
+
# 4.2 TRACKING EXPERIMENTS
|
| 222 |
+
|
| 223 |
+
DeepV2D can be turned into a basic SLAM system. Using NYU and ScanNet for training, we test tracking performance on the TUM-RGBD tracking benchmark (Table 5) using sensor depth as input. We achieve a lower translational rmse $[ \mathrm { m } / \mathrm { s } ]$ than DeepTAM on most of the sequences. DeepTAM uses optical flow supervision to improve performance, but since our network directly maps optical flow to camera motion, we do not need supervision on optical flow.
|
| 224 |
+
|
| 225 |
+
We use our global pose optimization in our tracking experiments. We maintain a fixed window of 8 frames during tracking. At each timestep, the pose of the first 3 frames in the window are fixed and the remaining 5 are updated using the motion module. After the update, the start of the tracking window is incremented by 1 frame. We believe our ability to jointly update the pose of multiple frames is a key reason for our strong performance on the RGB-D benchmark.
|
| 226 |
+
|
| 227 |
+
Table 5: Tracking results in the RGB-D benchmark (translational rmse $[ \mathrm { m } / \mathrm { s } ] ,$ ).
|
| 228 |
+
|
| 229 |
+
<table><tr><td></td><td>360</td><td>desk</td><td>desk2</td><td>plant</td><td>room</td><td>rpy</td><td>xyz</td><td>mean</td></tr><tr><td>DVO (Kerl et al., 2013)</td><td>0.125</td><td>0.037</td><td>0.020</td><td>0.062</td><td>0.042</td><td>0.082</td><td>0.051</td><td>0.060</td></tr><tr><td>DeepTAM (Zhou et al., 2018)</td><td>0.054</td><td>0.027</td><td>0.017</td><td>0.057</td><td>0.039</td><td>0.065</td><td>0.019</td><td>0.040</td></tr><tr><td>DeepTAM(w/o flow) (Zhou et al.,2018)</td><td>0.069</td><td>0.042</td><td>0.025</td><td>0.063</td><td>0.051</td><td>0.070</td><td>0.030</td><td>0.050</td></tr><tr><td>Ours</td><td>0.046</td><td>0.034</td><td>0.017</td><td>0.052</td><td>0.032</td><td>0.037</td><td>0.014</td><td>0.033</td></tr></table>
|
| 230 |
+
|
| 231 |
+
# 5 CONCLUSION
|
| 232 |
+
|
| 233 |
+
We propose DeepV2D, a deep learning architecture which is built by composing classical geometric algorithms into a fully differentiable pipeline. DeepV2D is flexible and performs well across a variety of tasks and datasets.
|
| 234 |
+
|
| 235 |
+
Acknowledgements We would like to thank Zhaoheng Zheng for helping with baseline experiments. This work was partially funded by the Toyota Research Institute, the King Abdullah University of Science and Technology (KAUST) Office of Sponsored Research (OSR) under Award No. OSR2015-CRG4-2639, and the National Science Foundation under Grant No. 1617767.
|
| 236 |
+
|
| 237 |
+
# REFERENCES
|
| 238 |
+
|
| 239 |
+
Mart´ın Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for largescale machine learning. In OSDI, volume 16, pp. 265–283, 2016.
|
| 240 |
+
|
| 241 |
+
Sameer Agarwal, Keir Mierle, et al. Ceres solver. 2012.
|
| 242 |
+
|
| 243 |
+
Ibraheem Alhashim and Peter Wonka. High quality monocular depth estimation via transfer learning. arXiv preprint arXiv:1812.11941, 2018.
|
| 244 |
+
|
| 245 |
+
Michael Bloesch, Jan Czarnowski, Ronald Clark, Stefan Leutenegger, and Andrew J Davison. Codeslam—learning a compact, optimisable representation for dense visual slam. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2560–2568, 2018.
|
| 246 |
+
|
| 247 |
+
Jia-Ren Chang and Yong-Sheng Chen. Pyramid stereo matching network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5410–5418, 2018.
|
| 248 |
+
|
| 249 |
+
Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016.
|
| 250 |
+
|
| 251 |
+
Ronald Clark, Michael Bloesch, Jan Czarnowski, Stefan Leutenegger, and Andrew J Davison. Learning to solve nonlinear least squares for monocular stereo. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 284–299, 2018.
|
| 252 |
+
|
| 253 |
+
Angela Dai, Angel X Chang, Manolis Savva, Maciej Halber, Thomas Funkhouser, and Matthias Nießner. Scannet: Richly-annotated 3d reconstructions of indoor scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5828–5839, 2017.
|
| 254 |
+
|
| 255 |
+
Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2758–2766, 2015.
|
| 256 |
+
|
| 257 |
+
David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2650–2658, 2015.
|
| 258 |
+
|
| 259 |
+
David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multi-scale deep network. In Advances in neural information processing systems, pp. 2366–2374, 2014.
|
| 260 |
+
|
| 261 |
+
Jakob Engel, Thomas Schops, and Daniel Cremers. Lsd-slam: Large-scale direct monocular slam.¨ In European Conference on Computer Vision, pp. 834–849. Springer, 2014.
|
| 262 |
+
|
| 263 |
+
Jakob Engel, Vladlen Koltun, and Daniel Cremers. Direct sparse odometry. IEEE transactions on pattern analysis and machine intelligence, 40(3):611–625, 2018.
|
| 264 |
+
|
| 265 |
+
Huan Fu, Mingming Gong, Chaohui Wang, Kayhan Batmanghelich, and Dacheng Tao. Deep ordinal regression network for monocular depth estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2002–2011, 2018.
|
| 266 |
+
|
| 267 |
+
Yasutaka Furukawa and Jean Ponce. Accurate, dense, and robust multiview stereopsis. IEEE transactions on pattern analysis and machine intelligence, 32(8):1362–1376, 2010.
|
| 268 |
+
|
| 269 |
+
Yasutaka Furukawa, Carlos Hernandez, et al. Multi-view stereo: A tutorial. ´ Foundations and Trends $\textsuperscript { \textregistered }$ in Computer Graphics and Vision, 9(1-2):1–148, 2015.
|
| 270 |
+
|
| 271 |
+
Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun. Vision meets robotics: The kitti dataset. The International Journal of Robotics Research, 32(11):1231–1237, 2013.
|
| 272 |
+
|
| 273 |
+
Riccardo Gherardi, Michela Farenzena, and Andrea Fusiello. Improving the efficiency of hierarchical structure-and-motion. In Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on, pp. 1594–1600. IEEE, 2010.
|
| 274 |
+
|
| 275 |
+
Clement Godard, Oisin Mac Aodha, and Gabriel J Brostow. Unsupervised monocular depth estima- ´ tion with left-right consistency. In CVPR, volume 2, pp. 7, 2017.
|
| 276 |
+
|
| 277 |
+
Hyowon Ha, Sunghoon Im, Jaesik Park, Hae-Gon Jeon, and In So Kweon. High-quality depth from uncalibrated small motion clip. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5413–5421, 2016.
|
| 278 |
+
|
| 279 |
+
Xufeng Han, Thomas Leung, Yangqing Jia, Rahul Sukthankar, and Alexander C Berg. Matchnet: Unifying feature and metric learning for patch-based matching. In Computer Vision and Pattern Recognition (CVPR), 2015 IEEE Conference on, pp. 3279–3286. IEEE, 2015.
|
| 280 |
+
|
| 281 |
+
Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015.
|
| 282 |
+
|
| 283 |
+
Abhishek Kar, Jitendra Malik, and Christian Hane. Learning a multi-view stereo machine. In ¨ Advances in Neural Information Processing Systems, pp. 364–375, 2017.
|
| 284 |
+
|
| 285 |
+
Alex Kendall and Roberto Cipolla. Geometric loss functions for camera pose regression with deep learning. In Proc. CVPR, volume 3, pp. 8, 2017.
|
| 286 |
+
|
| 287 |
+
Alex Kendall, Matthew Grimes, and Roberto Cipolla. Posenet: A convolutional network for realtime 6-dof camera relocalization. In Computer Vision (ICCV), 2015 IEEE International Conference on, pp. 2938–2946. IEEE, 2015.
|
| 288 |
+
|
| 289 |
+
Alex Kendall, Hayk Martirosyan, Saumitro Dasgupta, Peter Henry, Ryan Kennedy, Abraham Bachrach, and Adam Bry. End-to-end learning of geometry and context for deep stereo regression. In Proceedings of the IEEE International Conference on Computer Vision, pp. 66–75, 2017.
|
| 290 |
+
|
| 291 |
+
Christian Kerl, Jurgen Sturm, and Daniel Cremers. Dense visual slam for rgb-d cameras. In Intelligent Robots and Systems (IROS), 2013 IEEE/RSJ International Conference on, pp. 2100–2106. IEEE, 2013.
|
| 292 |
+
|
| 293 |
+
Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, and Nassir Navab. Deeper depth prediction with fully convolutional residual networks. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 239–248. IEEE, 2016.
|
| 294 |
+
|
| 295 |
+
Vincent Lepetit, Francesc Moreno-Noguer, and Pascal Fua. Epnp: An accurate o (n) solution to the pnp problem. International journal of computer vision, 81(2):155, 2009.
|
| 296 |
+
|
| 297 |
+
Shiqi Li, Chi Xu, and Ming Xie. A robust o (n) solution to the perspective-n-point problem. IEEE transactions on pattern analysis and machine intelligence, 34(7):1444–1450, 2012.
|
| 298 |
+
|
| 299 |
+
H Christopher Longuet-Higgins. A computer algorithm for reconstructing a scene from two projections. Nature, 293(5828):133–135, 1981.
|
| 300 |
+
|
| 301 |
+
David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004.
|
| 302 |
+
|
| 303 |
+
Reza Mahjourian, Martin Wicke, and Anelia Angelova. Unsupervised learning of depth and egomotion from monocular video using 3d geometric constraints. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5667–5675, 2018.
|
| 304 |
+
|
| 305 |
+
Nikolaus Mayer, Eddy Ilg, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4040–4048, 2016a.
|
| 306 |
+
|
| 307 |
+
Nikolaus Mayer, Eddy Ilg, Philip Hausser, Philipp Fischer, Daniel Cremers, Alexey Dosovitskiy, and Thomas Brox. A large dataset to train convolutional networks for disparity, optical flow, and scene flow estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4040–4048, 2016b.
|
| 308 |
+
|
| 309 |
+
Roger Mohr, Long Quan, and Franc¸oise Veillon. Relative 3d reconstruction using multiple uncalibrated images. The International Journal of Robotics Research, 14(6):619–632, 1995.
|
| 310 |
+
|
| 311 |
+
Pierre Moulon, Pascal Monasse, Renaud Marlet, and Others. Openmvg. an open multiple view geometry library. https://github.com/openMVG/openMVG.
|
| 312 |
+
|
| 313 |
+
Raul Mur-Artal and Juan D Tardos. Orb-slam2: An open-source slam system for monocular, stereo, ´ and rgb-d cameras. IEEE Transactions on Robotics, 33(5):1255–1262, 2017.
|
| 314 |
+
|
| 315 |
+
Raul Mur-Artal, Jose Maria Martinez Montiel, and Juan D Tardos. Orb-slam: a versatile and accurate monocular slam system. IEEE Transactions on Robotics, 31(5):1147–1163, 2015.
|
| 316 |
+
|
| 317 |
+
Richard A Newcombe, Steven J Lovegrove, and Andrew J Davison. Dtam: Dense tracking and mapping in real-time. In 2011 international conference on computer vision, pp. 2320–2327. IEEE, 2011.
|
| 318 |
+
|
| 319 |
+
Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. In European Conference on Computer Vision, pp. 483–499. Springer, 2016.
|
| 320 |
+
|
| 321 |
+
Rene Ranftl, Vibhav Vineet, Qifeng Chen, and Vladlen Koltun. Dense monocular depth estimation ´ in complex dynamic scenes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4058–4066, 2016.
|
| 322 |
+
|
| 323 |
+
Johannes L Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4104–4113, 2016a.
|
| 324 |
+
|
| 325 |
+
Johannes L Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4104–4113, 2016b.
|
| 326 |
+
|
| 327 |
+
Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from rgbd images. Computer Vision–ECCV 2012, pp. 746–760, 2012.
|
| 328 |
+
|
| 329 |
+
Keith N Snavely. Scene reconstruction and visualization from internet photo collections. 2009.
|
| 330 |
+
|
| 331 |
+
Noah Snavely. Scene reconstruction and visualization from internet photo collections: A survey. IPSJ Transactions on Computer Vision and Applications, 3:44–66, 2011.
|
| 332 |
+
|
| 333 |
+
Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8934–8943, 2018.
|
| 334 |
+
|
| 335 |
+
Chengzhou Tang and Ping Tan. Ba-net: Dense bundle adjustment network. arXiv preprint arXiv:1806.04807, 2018.
|
| 336 |
+
|
| 337 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26– 31, 2012.
|
| 338 |
+
|
| 339 |
+
Benjamin Ummenhofer, Huizhong Zhou, Jonas Uhrig, Nikolaus Mayer, Eddy Ilg, Alexey Dosovitskiy, and Thomas Brox. Demon: Depth and motion network for learning monocular stereo. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5038– 5047, 2017.
|
| 340 |
+
|
| 341 |
+
Sudheendra Vijayanarasimhan, Susanna Ricco, Cordelia Schmid, Rahul Sukthankar, and Katerina Fragkiadaki. Sfm-net: Learning of structure and motion from video. arXiv preprint arXiv:1704.07804, 2017.
|
| 342 |
+
|
| 343 |
+
Chaoyang Wang, Jose Miguel Buenaposada, Rui Zhu, and Simon Lucey. Learning depth from ´ monocular videos using direct methods. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2022–2030, 2018.
|
| 344 |
+
|
| 345 |
+
Sen Wang, Ronald Clark, Hongkai Wen, and Niki Trigoni. Deepvo: Towards end-to-end visual odometry with deep recurrent convolutional neural networks. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 2043–2050. IEEE, 2017.
|
| 346 |
+
|
| 347 |
+
Changchang Wu et al. Visualsfm: A visual structure from motion system. 2011.
|
| 348 |
+
|
| 349 |
+
Jianxiong Xiao, Andrew Owens, and Antonio Torralba. Sun3d: A database of big spaces reconstructed using sfm and object labels. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1625–1632, 2013.
|
| 350 |
+
|
| 351 |
+
Nan Yang, Rui Wang, Jorg Stuckler, and Daniel Cremers. Deep virtual stereo odometry: Leveraging deep depth prediction for monocular direct sparse odometry. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 817–833, 2018.
|
| 352 |
+
|
| 353 |
+
Yao Yao, Zixin Luo, Shiwei Li, Tian Fang, and Long Quan. Mvsnet: Depth inference for unstructured multi-view stereo. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 767–783, 2018.
|
| 354 |
+
|
| 355 |
+
Zhichao Yin and Jianping Shi. Geonet: Unsupervised learning of dense depth, optical flow and camera pose. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1983–1992, 2018.
|
| 356 |
+
|
| 357 |
+
Huizhong Zhou, Benjamin Ummenhofer, and Thomas Brox. Deeptam: Deep tracking and mapping. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 822–838, 2018.
|
| 358 |
+
|
| 359 |
+
Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised learning of depth and ego-motion from video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1851–1858, 2017.
|
| 360 |
+
|
| 361 |
+
# A APPENDIX
|
| 362 |
+
|
| 363 |
+
# A.1 LS-OPTIMIZATION LAYER:
|
| 364 |
+
|
| 365 |
+
In Equation 4 we defined the residual error to be:
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) = \mathbf { r } _ { k } - [ \pi ( ( e ^ { \xi _ { j } } \mathbf { G } _ { j } ) ( e ^ { \xi _ { i } } \mathbf { G } _ { i } ) ^ { - 1 } \mathbf { X } _ { k } ^ { i } ) - \pi ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } ) ] , \qquad \mathbf { X } _ { k } ^ { i } = \pi ^ { - 1 } ( \mathbf { x } _ { k } , z _ { k } )
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
and the objective function as the weighted sum of error terms:
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
E ( \pmb { \xi } ) = \sum _ { ( i , j ) \in \mathcal { C } } \sum _ { k } \mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) ^ { T } d i a g ( \mathbf { w } _ { k } ) \mathbf { e } _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) , \qquad d i a g ( \mathbf { w } _ { k } ) = \left( \begin{array} { l l } { w _ { k } ^ { u } } & { 0 } \\ { 0 } & { w _ { k } ^ { v } } \end{array} \right)
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
We apply a Gauss-Newton update to Equation 9. The Gauss-Newton update is computed by solving for the minimum of the second order approximation of the objective function:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\boldsymbol { \xi } ^ { * } = - ( \mathbf { J } ^ { T } \mathbf { W } \mathbf { J } ) ^ { - 1 } \mathbf { J } ^ { T } \mathbf { W } \mathbf { r } ( \xi _ { 1 } , . . . , \xi _ { N } ) , \qquad \mathbf { J } _ { p } = \frac { \partial r _ { p } ( \epsilon ) } { \partial \epsilon } | _ { \epsilon = 0 }
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
where $\mathbf { r } ( \xi _ { 1 } , . . . , \xi _ { N } )$ is the stack of residuals and $\mathbf { J }$ is the Jacobian matrix. Each row $\mathbf { J } _ { i }$ is the Jacobian of the $\mathrm { i } ^ { t h }$ error term w.r.t to each of the parameters. Each $\xi$ is 6-dimensional, so optimizing over $N$ poses means we are updating $6 N$ variables.
|
| 384 |
+
|
| 385 |
+
Let $r _ { p } = e _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } )$ be the $\mathrm { p } ^ { t h }$ residual, then
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\begin{array} { r l r } & { } & { \displaystyle { \frac { \partial e _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) } { \partial \xi _ { j } } } \vert _ { \xi _ { i } = 0 , \xi _ { j } = 0 } = \frac { \partial } { \partial \xi _ { j } } [ { \bf r } _ { k } - [ \pi ( ( e ^ { \xi _ { j } } { \bf G } _ { j } ) ( e ^ { \xi _ { i } } { \bf G } _ { i } ) ^ { - 1 } { \bf X } _ { k } ^ { i } ) - \pi ( { \bf G } _ { i j } { \bf X } _ { k } ^ { i } ) ] ] = } \\ & { } & { \displaystyle { \frac { \partial } { \partial \xi _ { j } } \pi ( ( e ^ { \xi _ { j } } { \bf G } _ { j } ) ( e ^ { \xi _ { i } } { \bf G } _ { i } ) ^ { - 1 } { \bf X } _ { k } ^ { i } ) } = \frac { \partial } { \partial \xi _ { j } } \pi ( e ^ { \xi _ { j } } ( { \bf G } _ { i j } { \bf X } _ { k } ^ { i } ) ) } \\ & { } & { \displaystyle { \frac { \partial e _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) } { \partial \xi _ { j } } \vert _ { \xi _ { i } = 0 , \xi _ { j } = 0 } = \frac { \partial } { \partial ( { \bf G } _ { i j } { \bf X } _ { k } ^ { i } ) } \pi ( { \bf G } _ { i j } { \bf X } _ { k } ^ { i } ) \cdot \frac { \partial } { \partial \xi _ { j } } e ^ { \xi _ { i } } ( { \bf G } _ { i j } { \bf X } _ { k } ^ { i } ) } } \end{array}
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
Likewise, the Jacobian for $\xi _ { j }$ is
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
\begin{array} { r l } & { \displaystyle \frac { \partial e _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) } { \partial \xi _ { j } } \vert _ { \xi _ { i } = 0 , \xi _ { j } = 0 } = \frac { \partial } { \partial \xi _ { i } } [ \mathbf { r } _ { k } - [ \pi ( ( e ^ { \xi _ { j } } \mathbf { G } _ { j } ) ( e ^ { \xi _ { i } } \mathbf { G } _ { i } ) ^ { - 1 } \mathbf { X } _ { k } ^ { i } ) - \pi ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } ) ] ] = } \\ & { \displaystyle \frac { \partial } { \partial \xi _ { i } } \pi ( ( e ^ { \xi _ { j } } \mathbf { G } _ { j } ) ( e ^ { \xi _ { i } } \mathbf { G } _ { i } ) ^ { - 1 } \mathbf { X } _ { k } ^ { i } ) = \frac { \partial } { \partial \xi _ { i } } \pi ( \mathbf { G } _ { j } \mathbf { G } _ { i } ^ { - 1 } e ^ { - \xi _ { i } } \mathbf { X } _ { k } ^ { i } ) = \frac { \partial } { \partial \xi _ { i } } \pi ( \mathbf { G } _ { i j } e ^ { - \xi _ { i } } \mathbf { X } _ { k } ^ { i } ) } \end{array}
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
using the adjoint to move the increment to the left of the transformation
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
\begin{array} { r } { \displaystyle = \frac { \partial } { \partial \xi _ { i } } \pi ( e ^ { w } \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } ) \qquad \mathrm { w h e r e ~ } w = - A d j _ { \mathbf { G } _ { i j } } \cdot \boldsymbol { \xi } } \\ { \displaystyle \frac { \partial e _ { k } ^ { i j } ( \xi _ { i } , \xi _ { j } ) } { \partial \xi _ { j } } \vert _ { \xi _ { i } = 0 , \xi _ { j } = 0 } = - \frac { \partial } { \partial \big ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } \big ) } \pi ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } ) \cdot \frac { \partial } { \partial w } e ^ { w } \big ( \mathbf { G } _ { i j } \mathbf { X } _ { k } ^ { i } \big ) \cdot A d j _ { \mathbf { G } _ { i j } } } \end{array}
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
where the Jacobian of the action of a $\mathbf { S E } ( 3 )$ element on a 3D point is computed
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\frac { \partial e ^ { \xi } \mathbf { X } } { \partial \xi } | _ { \xi = 0 } = [ \begin{array} { c c c } { 1 } & { 0 } & { 0 } \\ { 0 } & { 1 } & { 0 } \\ { 0 } & { 0 } & { 1 } \end{array} ] \begin{array} { c c c } { 0 } & { - Z } & { Y } \\ { Z } & { 0 } & { X } \\ { - Y } & { X } & { 0 } \end{array} ]
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
During training, we propagate through the Gauss-Newton update. The update is found by solving the linear system
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\mathbf { H } \xi = - \mathbf { b } , \qquad \mathbf { H } = \mathbf { J } ^ { T } \mathbf { W } \mathbf { J } , \ \mathbf { \ b } = \mathbf { J } ^ { T } \mathbf { W } \mathbf { r } ( \xi _ { 1 } , . . . , \xi _ { N } )
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
Since $\mathbf { H }$ is positive definite, we solve Equation 15 using Cholesky decomposition. In the backward pass, the gradients can be found by solving another linear system.
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\frac { \partial \mathcal { L } } { \partial \mathbf { H } } = - ( \mathbf { H } ^ { - 1 } \frac { \partial \mathcal { L } } { \partial \xi } ) ^ { T } \boldsymbol { \xi } , \qquad \frac { \partial \mathcal { L } } { \partial \mathbf { b } } = \mathbf { H } ^ { - 1 } \frac { \partial \mathcal { L } ^ { T } } { \partial \boldsymbol { \xi } }
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
# B TRAINING DETAILS
|
| 422 |
+
|
| 423 |
+
DeepV2D is implemented in Tensorflow (Abadi et al., 2016). All components of the network are trained from scratch without using any pretrained weights. We use gradient checkpointing (Chen et al., 2016) to reduce memory usage and increase batch size.
|
| 424 |
+
|
| 425 |
+
When training on NYU and ScanNet, we train with 4 frame video clips. On KITTI, we use 5 frame video clips. The video clips are created by first selecting a keyframe. The other frames are randomly sampled from the set of frames within a specified time window of the keyframe. For example, on NYU, we create the training video by sampling from frames within 1 second of the keyframe.
|
| 426 |
+
|
| 427 |
+
Training occurs in the following two stages:
|
| 428 |
+
|
| 429 |
+
Stage I: We train the Motion Module using the $L _ { m o t i o n }$ loss with RMSProp (Tieleman & Hinton, 2012) and a learning rate of 0.0001. For the input depth, we use the ground truth depth with missing values interpolated. We train Stage I for 20k iterations on NYU, 16k iterations on KITTI, and 30k iterations on ScanNet.
|
| 430 |
+
|
| 431 |
+
Stage II: In stage II, we jointly train the motion and depth modules end-to-end on the combined loss with RMSProp. The initial learning rate is set to .001 and decayed to .0002 after 100k training steps. During the second stage we store depth predictions to be used during the next training epoch. We train Stage II for a total of $1 2 0 \mathrm { k }$ iterations with a batch size of 2. In our ScanNet experiments, we train for an additional $6 0 \mathrm { k }$ iterations.
|
| 432 |
+
|
| 433 |
+
Data Augmentation: We perform data augmentation by adjusting brightness, gamma, and performing random scaling of the image channels. We also randomly perturb the input camera pose to the Motion Module by sampling small perturbations.
|
| 434 |
+
|
| 435 |
+
# C TIMING AND MEMORY USAGE
|
| 436 |
+
|
| 437 |
+
In the below table we provide timing and peak memory usage for different versions of our method. All results are obtained using 8 frame video sequences as input with the exception of the basline single-image network FCRN Laina et al. (2016) which uses a single frame as input.
|
| 438 |
+
|
| 439 |
+
Table 6: Timing and memory details for different versions of our approach.
|
| 440 |
+
|
| 441 |
+
<table><tr><td></td><td>Abs-Rel ↓</td><td>Parameters</td><td>PeakGPUMemory</td><td>Iteration Time</td></tr><tr><td>FCRN (Laina et al., 2016)</td><td>0.121</td><td>64M</td><td>0.1G</td><td>0.05s</td></tr><tr><td>Ours (1/2 res)</td><td>0.083</td><td>32M</td><td>0.7G</td><td>0.22s</td></tr><tr><td>Ours (1-HG)</td><td>0.071</td><td>16M</td><td>2.8G</td><td>0.61s</td></tr><tr><td>Ours (corr)</td><td>0.135</td><td>25M</td><td>1.8G</td><td>0.32s</td></tr><tr><td>Ours</td><td>0.062</td><td>32M</td><td>2.8G</td><td>0.69s</td></tr></table>
|
| 442 |
+
|
| 443 |
+
In ours(1-HG) we replace the feature extractor with a single 2D-hourglass network, and replace the stereo network with a single 3D-hourglass network. The shallower network still performs well, but causes Abs-Rel to increase from 0.065 to 0.071, showing that stacking hourglass networks is beneficial for performance. In ours (1/2 res) we test the performance of DeepV2D when images are downsampled to 1/2 resolution for training and inference. Using lower resolution images decreases memory usage and inference time but slightly decreases accuracy.
|
| 444 |
+
|
| 445 |
+
We also test a version where we replace the 3d stereo network with a correlation layer and 2d encoder-decoder. In ours(corr), we take the correlation between features over the same depth range as we use to build the 3D cost volume, then concatenate the correlation response with features from the keyframe image, similar to DispNet (Mayer et al., 2016b). The correlation version performs worse, increasing Abs-Rel from 0.065 to 0.135. This is consistent with prior work which has demonstrated that 3D cost volumes give better performance than direct correlation (Kendall et al., 2017; Chang & Chen, 2018).
|
| 446 |
+
|
| 447 |
+
# D ADDITIONAL TRACKING INFORMATION
|
| 448 |
+
|
| 449 |
+
In Table 7 we report tracking results for all sequences in the Freiburg 1 dataset.
|
| 450 |
+
|
| 451 |
+
Table 7: Per-Sequence tracking results on the RGB-D benchmark evaluated using translational RMSE $[ \mathrm { m } / \mathrm { s } ]$ . We outperform DeepTAM and DVO on 12 of the 16 sequences and achieve a lower translational RMSE averaged over all sequences. While DeepTAM requires optical flow supervision to achieve good performance, we do not require supervision on optical flow since the relation between camera motion and optical flow is embedded into our network architecture.
|
| 452 |
+
|
| 453 |
+
<table><tr><td> Sequence</td><td>RGB-D SLAM</td><td>DeepTAM</td><td>Ours</td></tr><tr><td>360</td><td>0.119</td><td>0.063</td><td>0.056</td></tr><tr><td>360(v)</td><td>0.125</td><td>0.054</td><td>0.046</td></tr><tr><td>desk</td><td>0.030</td><td>0.033</td><td>0.029</td></tr><tr><td>desk(v)</td><td>0.037</td><td>0.027</td><td>0.034</td></tr><tr><td>desk2</td><td>0.055</td><td>0.046</td><td>0.041</td></tr><tr><td>desk2(v)</td><td>0.020</td><td>0.017</td><td>0.017</td></tr><tr><td>floor</td><td>0.090</td><td>0.081</td><td>0.064</td></tr><tr><td>plant</td><td>0.036</td><td>0.027</td><td>0.019</td></tr><tr><td>plant(v)</td><td>0.062</td><td>0.057</td><td>0.052</td></tr><tr><td>room</td><td>0.048</td><td>0.040</td><td>0.047</td></tr><tr><td>room(v)</td><td>0.042</td><td>0.039</td><td>0.032</td></tr><tr><td>rpy</td><td>0.043</td><td>0.046</td><td>0.039</td></tr><tr><td>rpy(v)</td><td>0.082</td><td>0.065</td><td>0.037</td></tr><tr><td>teddy</td><td>0.067</td><td>0.059</td><td>0.043</td></tr><tr><td>Xyz</td><td>0.051</td><td>0.019</td><td>0.025</td></tr><tr><td>xyz(v)</td><td>0.024</td><td>0.017</td><td>0.016</td></tr><tr><td>Average</td><td>0.058</td><td>0.043</td><td>0.037</td></tr></table>
|
| 454 |
+
|
| 455 |
+
# E CAMERA POSE ABLATIONS
|
| 456 |
+
|
| 457 |
+
The focus of this work on depth estimation, but we are interested in how different methods for estimating camera pose impact the final performance. In Table 8, we test different methods for estimating camera pose on NYU. In each experiment, we replace the motion module of our trained network with the given alternative, and test the final results. We also report results from MVSNet (trained on NYU) using each SfM implementation.
|
| 458 |
+
|
| 459 |
+
COLMAP (Schonberger & Frahm, 2016a) and OpenMVG (Moulon et al.) are publicly available SfM implementations. They do not return results on all input sequences, so we only evaluate sequences were they converge without an error. PWCNet+Ceres takes the output of an optical flow network, PWCNet (Sun et al., 2018), and performs joint optimization of depth and pose using the Ceres solver (Agarwal et al., 2012). Finally, we evaluate MVSNet (Yao et al., 2018) when the pose predicted by DeepV2D is given as input. Note that not all SfM implementations converge on all sequences (success rate is reported in parenthesis) and we only evaluate the method on the frames in which it converges.
|
| 460 |
+
|
| 461 |
+
<table><tr><td>Depth</td><td>Motion</td><td>Abs-Rel ↓ 81↑</td><td>S↑</td><td>8↑</td></tr><tr><td>MVSNet DeepV2D MVSNet</td><td>Identity Identity COLMAP (274/654)</td><td>0.419 0.382 0.362 0.460 0.244 0.724</td><td>0.681 0.756 0.857</td><td>0.859 0.901 0.925</td></tr><tr><td>DeepV2D MVSNet</td><td>COLMAP OpenMVG(422/654)</td><td>0.199 0.741 0.181 0.766</td><td>0.878 0.913</td><td>0.940 0.965</td></tr><tr><td>DeepV2D MVSNet</td><td>OpenMVG PWC+Ceres (654/654)</td><td>0.173 0.774 0.279 0.651</td><td>0.913 0.845</td><td>0.963 0.925</td></tr><tr><td>DeepV2D MVSNet</td><td>PWC+Ceres DeepV2D (654/654) DeepV2D (ours)</td><td>0.274 0.664 0.101 0.885</td><td>0.846 0.970</td><td>0.925 0.990</td></tr></table>
|
| 462 |
+
|
| 463 |
+
Table 8: Impact of pose estimation method on depth accuracy. Replacing our motion module with SfM degrades performance for both MVSNet and our approach.
|
| 464 |
+
|
| 465 |
+
We also show results of our method when the motion module is replaced with other methods for estimation motion. In all cases, using SfM results in worse performance. We observe that classical SfM is not robust enough to consistently produce accurate poses, which leads to large errors on the test set. MVSNet performs better using the poses estimated by our network, but still underperforms our full system, showing the importance of differentiable alternation between pose and stereo.
|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
Figure 6: Visualizations of depth predictions on KITTI dataset.
|
| 469 |
+
|
| 470 |
+

|
| 471 |
+
Figure 7: Additional results on the NYU depth dataset Silberman et al. (2012) using 7-frame video clips. We show results compared with Laina et al. (2016) and Ummenhofer et al. (2017).
|
| 472 |
+
|
| 473 |
+
# G NETWORK ARCHITECTURES
|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
Figure 8: Motion Module Architecture: The Encoder(left) extracts a dense 1/4 resolution feature map for each of the input images. The Residual Flow Network (right) takes in a pair of feature maps and estimates the residual flow and corresponding weights. This residual flow is estimated with an encoder-decoder network, with skip connections formed by concatenating feature maps. Numbers in parenthesis correspond to the number of output channels for each layer.
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
Figure 9: Depth Module Architecture: The 2D encoder (top) is applied to each image in the video sequence. The 2D Encoder consists of a series of residual convolutions and 2 Hourglass Networks. The hourglass networks process the incoming features maps as multiple scales. The hourglass network is defined recursively (i.e. HG(n) contains lower resolution hourglass HG(n-1)). We use 4 nested hourglass modules with feature dimension 64-128-192-256. The resulting feature maps from the 2D encoder are used to construct the cost volumes. The 3D matching network (bottom) takes a collection of cost volumes as input. After a 1x1x1 convolutional layer and a $3 \mathrm { x } 3 \mathrm { x } 3 $ residual convolution, we perform view pooling, which aggregates information over all the frames in the video. The aggregated volume is then processed by a series of 3D hourglass networks, each of which outputs an intermediate depth estimate. The widths of the 3D hourglass is 32-80-128-176.
|
md/train/HJxyZkBKDr/HJxyZkBKDr.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NAS-BENCH-201: EXTENDING THE SCOPE OF REPRODUCIBLE NEURAL ARCHITECTURE SEARCH
|
| 2 |
+
|
| 3 |
+
Xuanyi Dong†‡ ∗and Yi Yang† †ReLER, CAI, University of Technology Sydney, ‡Baidu Research
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Neural architecture search (NAS) has achieved breakthrough success in a great number of applications in the past few years. It could be time to take a step back and analyze the good and bad aspects in the field of NAS. A variety of algorithms search architectures under different search space. These searched architectures are trained using different setups, e.g., hyper-parameters, data augmentation, regularization. This raises a comparability problem when comparing the performance of various NAS algorithms. NAS-Bench-101 has shown success to alleviate this problem. In this work, we propose an extension to NAS-Bench-101: NAS-Bench201 with a different search space, results on multiple datasets, and more diagnostic information. NAS-Bench-201 has a fixed search space and provides a unified benchmark for almost any up-to-date NAS algorithms. The design of our search space is inspired from the one used in the most popular cell-based searching algorithms, where a cell is represented as a directed acyclic graph. Each edge here is associated with an operation selected from a predefined operation set. For it to be applicable for all NAS algorithms, the search space defined in NAS-Bench-201 includes all possible architectures generated by 4 nodes and 5 associated operation options, which results in 15,625 neural cell candidates in total. The training log using the same setup and the performance for each architecture candidate are provided for three datasets. This allows researchers to avoid unnecessary repetitive training for selected architecture and focus solely on the search algorithm itself. The training time saved for every architecture also largely improves the efficiency of most NAS algorithms and brings a more computational cost friendly NAS community for a broader range of researchers. We provide additional diagnostic information such as fine-grained loss and accuracy, which can give inspirations to new designs of NAS algorithms. In further support of the proposed NAS-Bench201, we have analyzed it from many aspects and benchmarked 10 recent NAS algorithms, which verify its applicability.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The deep learning community is undergoing a transition from hand-designed neural architecture (He et al., 2016; Krizhevsky et al., 2012; Szegedy et al., 2015) to automatically designed neural architecture (Zoph & Le, 2017; Pham et al., 2018; Real et al., 2019; Dong & Yang, 2019b; Liu et al., 2019). In its early era, the great success of deep learning was promoted by novel neural architectures, such as ResNet (He et al., 2016), Inception (Szegedy et al., 2015), VGGNet (Simonyan & Zisserman, 2015), and Transformer (Vaswani et al., 2017). However, manually designing one architecture requires human experts to try numerous different operation and connection choices (Zoph & Le, 2017). In contrast to architectures that are manually designed, those automatically found by neural architecture search (NAS) algorithms require much less human interaction and expert effort. These NAS-generated architectures have shown promising results in many domains, such as image recognition (Zoph & Le, 2017; Pham et al., 2018; Real et al., 2019), sequence modeling (Pham et al., 2018; Dong & Yang, 2019b; Liu et al., 2019), etc.
|
| 12 |
+
|
| 13 |
+
Recently, a variety of NAS algorithms have been increasingly proposed. While these NAS methods are methodically designed and show promising improvements, many setups in their algorithms are different. (1) Different search space is utilized, e.g., different macro skeletons of the whole architecture (Zoph et al., 2018; Tan et al., 2019) and a different operation set for the micro cell within the skeleton (Pham et al., 2018), etc. (2) After a good architecture is selected, various strategies can be employed to train this architecture and report the performance, e.g., different data augmentation (Ghiasi et al., 2018; Zhang et al., 2018), different regularization (Zoph et al., 2018), different scheduler (Loshchilov & Hutter, 2017), and different selections of hyper-parameters (Liu et al., 2018; Dong & Yang, 2019a). (3) The validation set for testing the performance of the selected architecture is not split in the same way (Liu et al., 2019; Pham et al., 2018). These discrepancies raise a comparability problem when comparing the performance of various NAS algorithms, making it difficult to conclude their contributions.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Top: the macro skeleton of each architecture candidate. Bottom-left: examples of neural cell with 4 nodes. Each cell is a directed acyclic graph, where each edge is associated with an operation selected from a predefined operation set as shown in the Bottom-right.
|
| 17 |
+
|
| 18 |
+
In response to this problem, NAS-Bench-101 (Ying et al., 2019) and NAS-HPO-Bench (Klein & Hutter, 2019) are proposed. However, some NAS algorithms can not be applied directly on NASBench-101, and NAS-HPO-Bench only has 144 candidate architectures, which maybe insufficient to evaluate NAS algorithms. To extend these two benchmarks and towards better reproducibility of NAS methods1, we propose NAS-Bench-201 with a fixed cell search space, inspired from the search space used in the most popular neural cell-based searching algorithms (Zoph et al., 2018; Liu et al., 2019). As shown in Figure 1, each architecture consists of a predefined skeleton with a stack of the searched cell. In this way, architecture search is transformed into the problem of searching a good cell. Each cell is represented as a densely-connected directed acyclic graph (DAG) as shown in the bottom section of Figure 1. Here the node represents the sum of the feature maps and each edge is associated with an operation transforming the feature maps from the source node to the target node. The size of the search space is related to the number of nodes defined for the DAG and the size of the operation set. In NAS-Bench-201, we choose 4 nodes and 5 representative operation candidates for the operation set, which generates a total search space of 15,625 cells/architectures. Each architecture is trained multiple times on three different datasets. The training log and performance of each architecture are provided for each run. The training accuracy/test accuracy/training loss/test loss after every training epoch for each architecture plus the number of parameters and floating point operations (FLOPs) are accessible.
|
| 19 |
+
|
| 20 |
+
Hopefully, NAS-Bench-201 will show its value in the field of NAS research. (1) It provides a unified benchmark for most up-to-date NAS algorithms including all cell-based NAS methods. With NASBench-201, researchers can focus on designing robust searching algorithm while avoiding tedious hyper-parameter tuning of the searched architecture. Thus, NAS-Bench-201 provides a relatively fair benchmark for the comparison of different NAS algorithms. (2) It provides the full training log of each architecture. Unnecessary repetitive training procedure of each selected architecture can be avoided (Liu et al., 2018; Zoph & Le, 2017) so that researchers can target on the essence of NAS, i.e., search algorithm. Another benefit is that the validation time for NAS largely decreases when testing in NAS-Bench-201, which provides a computational power friendly environment for more participations in NAS. (3) It provides results of each architecture on multiple datasets. The model transferability can be thoroughly evaluated for most NAS algorithms. (4) In NAS-Bench-201, we provide systematic analysis of the proposed search space. We also evaluate 10 recent advanced NAS algorithms including reinforcement learning (RL)-based methods, evolutionary strategy (ES)-based methods, differentiable-based methods, etc. We hope our empirical analysis can bring some insights to the future designs of NAS algorithms.
|
| 21 |
+
|
| 22 |
+
# 2 NAS-Bench-201
|
| 23 |
+
|
| 24 |
+
Our NAS-Bench-201 is algorithm-agnostic. Put simply, it is applicable to almost any up-to-date NAS algorithms. In this section, we will briefly introduce our NAS-Bench-201. The search space of NASBench-201 is inspired by cell-based NAS algorithms (Section 2.1). NAS-Bench-201 evaluates each architecture on three different datasets (Section 2.2). All implementation details of NAS-Bench-201 are introduced in Section 2.3. NAS-Bench-201 also provides some diagnostic information which can be used for potentially better designs of future NAS algorithms (discussed in Section 2.4).
|
| 25 |
+
|
| 26 |
+
# 2.1 ARCHITECTURES IN THE SEARCH SPACE
|
| 27 |
+
|
| 28 |
+
Macro Skeleton. Our search space follows the design of its counterpart as used in the recent neural cell-based NAS algorithms (Liu et al., 2019; Zoph et al., 2018; Pham et al., 2018). As shown in the top of Figure 1, the skeleton is initiated with one 3-by-3 convolution with 16 output channels and a batch normalization layer (Ioffe & Szegedy, 2015). The main body of the skeleton includes three stacks of cells, connected by a residual block. Each cell is stacked $N = 5$ times, with the number of output channels as 16, 32 and 64 for the first, second and third stages, respectively. The intermediate residual block is the basic residual block with a stride of 2 (He et al., 2016), which serves to downsample the spatial size and double the channels of an input feature map. The shortcut path in this residual block consists of a 2-by-2 average pooling layer with stride of 2 and a 1-by-1 convolution. The skeleton ends up with a global average pooling layer to flatten the feature map into a feature vector. Classification uses a fully connected layer with a softmax layer to transform the feature vector into the final prediction.
|
| 29 |
+
|
| 30 |
+
Searched Cell. Each cell in the search space is represented as a densely connected DAG. The densely connected DAG is obtained by assigning a direction from the $i$ -th node to the $j$ -th node $( i < j )$ for each edge in an undirected complete graph. Each edge in this DAG is associated with an operation transforming the feature map from the source node to the target node. All possible operations are selected from a predefined operation set, as shown in Figure 1(bottom-right). In our NAS-Bench-201, the predefined operation set $\mathcal { O }$ has $L = 5$ representative operations: (1) zeroize, (2) skip connection, (3) 1-by-1 convolution, (4) 3-by-3 convolution, and (5) 3-by-3 average pooling layer. The convolution in this operation set is an abbreviation of an operation sequence of ReLU, convolution, and batch normalization. The DAG has $V = 4$ nodes, where each node represents the sum of all feature maps transformed through the associated operations of the edges pointing to this node. We choose $V = 4$ to allow the search space to contain basic residual block-like cells, which requires 4 nodes. Densely connected DAG does not restrict the searched topology of the cell to be densely connected, since we include zeroize in the operation set, which is an operation of dropping the associated edge. Besides, since we do not impose the constraint on the maximum number of edges (Ying et al., 2019), our search space is applicable to most NAS algorithms, including all cell-based NAS algorithms.
|
| 31 |
+
|
| 32 |
+
# 2.2 DATASETS
|
| 33 |
+
|
| 34 |
+
We train and evaluate each architecture on CIFAR-10, CIFAR-100 (Krizhevsky et al., 2009), and ImageNet-16-120 (Chrabaszcz et al., 2017). We choose these three datasets because CIFAR and ImageNet (Russakovsky et al., 2015) are the most popular image classification datasets.
|
| 35 |
+
|
| 36 |
+
We split each dataset into training, validation and test sets to provide a consistent training and evaluation settings for previous NAS algorithms (Liu et al., 2019). Most NAS methods use the validation set to evaluate architectures after the architecture is optimized on the training set. The validation performance of the architectures serves as supervision signals to update the searching algorithm. The test set is to evaluate the performance of each searching algorithm by comparing the indicators (e.g., accuracy, model size, speed) of their selected architectures. Previous methods use different splitting strategies, which may result in various searching costs and unfair comparisons. We hope to use the proposed splits to unify the training, validation and test sets for a fairer comparison.
|
| 37 |
+
|
| 38 |
+
CIFAR-10: It is a standard image classification dataset and consists of 60K $3 2 \times 3 2$ colour images in 10 classes. The original training set contains 50K images, with 5K images per class. The original test set contains 10K images, with 1K images per class. Due to the need of validation set, we split all 50K training images in CIFAR-10 into two groups. Each group contains 25K images with 10 classes. We regard the first group as the new training set and the second group as the validation set.
|
| 39 |
+
|
| 40 |
+
CIFAR-100: This dataset is just like CIFAR-10. It has the same images as CIFAR-10 but categorizes each image into 100 fine-grained classes. The original training set on CIFAR-100 has 50K images, and the original test set has 10K images. We randomly split the original test set into two group of equal size — 5K images per group. One group is regarded as the validation set, and another one is regarded as the new test set.
|
| 41 |
+
|
| 42 |
+
ImageNet-16-120: We build ImageNet-16-120 from the down-sampled variant of ImageNet (ImageNet $1 6 \times 1 6$ ). As indicated in Chrabaszcz et al. (2017), down-sampling images in ImageNet can largely reduce the computation costs for optimal hyper-parameters of some classical models while maintaining similar searching results. Chrabaszcz et al. (2017) down-sampled the original ImageNet to $1 6 \times 1 6$ pixels to form ImageNet $. 6 \times 1 6$ , from which we select all images with label $\in [ 1 , 1 2 0 ]$ to construct ImageNet-16-120. In sum, ImageNet-16-120 contains 151.7K training images, 3K validation images, and 3K test images with 120 classes.
|
| 43 |
+
|
| 44 |
+
By default, in this paper, “the training set”, “the validation set”, “the test set” indicate the new training, validation, and test sets, respectively.
|
| 45 |
+
|
| 46 |
+
# 2.3 ARCHITECTURE PERFORMANCE
|
| 47 |
+
|
| 48 |
+
Training Architectures. In order to unify the performance of every architecture, we give the performance of every architecture in our search space. In our NAS-Bench-201, we follow previous literature to set up the hyper-parameters and training strategies (Zoph et al., 2018; Loshchilov & Hutter, 2017; He et al., 2016). We train each architecture with the same strategy, which is shown in Table 1. For simplification, we denote all hyperparameters for training a model as a set $\mathcal { H }$ , and we use $\mathcal { H } ^ { \dagger }$ to denote the values of hyper-parameter that we use. Specifically, we train each architecture via Nesterov momentum SGD, using the cross-entropy loss for 200 epochs in total. We set the weight decay as 0.0005 and decay the learning rate from 0.1 to 0 with a cosine annealing (Loshchilov & Hutter, 2017). We use the same $\mathcal { H } ^ { \dagger }$ on different datasets, except for the data augmentation which is slightly different due to the image resolution. On CIFAR, we use the random flip with probability of 0.5, the random crop $3 2 \times 3 2$ patch with 4 pixels padding on each border, and the normalization over RGB channels. On ImageNet-16-120, we use a similar strategy but random crop $1 6 \times 1 6$ patch with 2 pixels padding on each border. Apart from using $\mathcal { H } ^ { \dagger }$ for all datasets, we also use a different hyper-parameter set $\bar { \mathcal { H } } ^ { \dagger }$ for CIFAR-10. It is similar to $\mathcal { H } ^ { \dagger }$ but its total number of training epochs is 12. In this way, we could provide bandit-based algorithms (Falkner et al., 2018; Li et al., 2018) more options for the usage of short training budget (see more details in appendix).
|
| 49 |
+
|
| 50 |
+
Table 1: The training hyper-parameter set $\mathcal { H } ^ { \dagger }$ .
|
| 51 |
+
|
| 52 |
+
<table><tr><td rowspan=2 colspan=1>optimizerNesterovmomentumweight decaybatch sizeVrandom flipnormalization</td><td rowspan=1 colspan=1>SGD</td><td rowspan=2 colspan=1>initialLRending LRLR scheduleepochinitial channelNrandom crop</td><td rowspan=2 colspan=1>0.10cosine200165</td></tr><tr><td rowspan=1 colspan=1>√0.90.00052564p=0.5<</td></tr></table>
|
| 53 |
+
|
| 54 |
+
Metrics. We train each architecture with different random seeds on different datasets. We evaluate each architecture $A$ after every training epoch. NAS-Bench-201 provides the training, validation,
|
| 55 |
+
|
| 56 |
+
and test loss as well as accuracy. We show the supported metrics on different datasets in Table 2. Users can easily use our API to query the results of each trial of $A$ , which has negligible computational costs. In this way, researchers could significantly speed up their searching algorithm on these datasets and focus solely on the essence of NAS.
|
| 57 |
+
|
| 58 |
+
We list the training/test loss/accuracies over
|
| 59 |
+
|
| 60 |
+
Table 2: NAS-Bench-201 provides the following metrics with $\mathcal { H } ^ { \dagger }$ . ‘Acc.’ means accuracy.
|
| 61 |
+
|
| 62 |
+
<table><tr><td>Dataset</td><td>TrainLoss/Acc.Eval Loss/Acc.</td><td></td></tr><tr><td>CIFAR-10</td><td>train set</td><td>valid set</td></tr><tr><td>CIFAR-10</td><td>train+valid set</td><td>test set</td></tr><tr><td>CIFAR-100</td><td>train set</td><td>valid set</td></tr><tr><td>CIFAR-100</td><td>train set</td><td>test set</td></tr><tr><td>ImageNet-16-120</td><td>train set</td><td>valid set</td></tr><tr><td>ImageNet-16-120</td><td>train set</td><td>test set</td></tr></table>
|
| 63 |
+
|
| 64 |
+
different split sets on four datasets in Table 2. On CIFAR-10, we train the model on the training set and evaluate it on the validation set. We also train the model on the training and validation set and evaluate it on the test set. These two paradigm follow the typical experimental setup on CIFAR-10 in previous literature (Liu et al., 2018; Zoph et al., 2018; Liu et al., 2018; Pham et al., 2018). On CIFAR-100 and ImageNet-16-120, we train the model on the training set and evaluate it on both validation and test sets.
|
| 65 |
+
|
| 66 |
+
Table 3: We summarize some characteristics of NAS-Bench-101 and NAS-Bench-201. Our NASBench-201 can directly be applicable to almost any up-to-date NAS algorithms. In contrast, as pointed in (Ying et al., 2019), NAS algorithms based on parameter sharing or network morphisms cannot be directly evaluated on NAS-Bench-101. Besides, NAS-Bench-201 provides train/validation/test performance on three (one for NAS-Bench-101) different datasets so that the generality of NAS algorithms can be evaluated. It also provides some diagnostic information that may provide insights to design better NAS algorithms.
|
| 67 |
+
|
| 68 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">#archit -ectures</td><td rowspan="2">#data -sets</td><td rowspan="2">10</td><td rowspan="2">search space constraint</td><td colspan="4">Supported NAS algorithms</td><td rowspan="2">Diagnostic information</td></tr><tr><td>RL</td><td>ES</td><td>|Diff.]</td><td>HPO</td></tr><tr><td>NAS-Bench-101</td><td>510M</td><td>1</td><td>3</td><td>constrain #edges1</td><td>partial</td><td>partial</td><td>none</td><td>most</td><td></td></tr><tr><td>NAS-Bench-201</td><td>15.6K</td><td>3</td><td>5</td><td>no constraint</td><td>all</td><td>all</td><td>all</td><td>most</td><td>fine-grained info., param., etc</td></tr></table>
|
| 69 |
+
|
| 70 |
+
# 2.4 DIAGNOSTIC INFORMATION
|
| 71 |
+
|
| 72 |
+
Validation accuracy is a commonly used supervision signal for NAS. However, considering the expensive computational costs for evaluating the architecture, the signal is too sparse. In our NASBench-201, we also provide some diagnostic information which is some extra statistics obtained during training each architecture. Collecting these statistics almost involves no extra computation cost but may provide insights for better designs and training strategies of different NAS algorithms, such as platform-aware NAS (Tan et al., 2019), accuracy prediction (Baker et al., 2018), mutationbased NAS (Cai et al., 2018; Chen et al., 2016), etc.
|
| 73 |
+
|
| 74 |
+
Architecture Computational Costs: NAS-Bench-201 provides three computation metrics for each architecture — the number of parameters, FLOPs, and latency. Algorithms that target on searching architectures with computational constraints, such as models on edge devices, can use these metrics directly in their algorithm designs without extra calculations.
|
| 75 |
+
|
| 76 |
+
Fine-grained training and evaluation information. NAS-Bench-201 tracks the changes in loss and accuracy of every architecture after every training epochs. These fine-grained training and evaluation information shows the tendency of the architecture performance and could indicate some attributes of the model, such as the speed of convergence, the stability, the over-fitting or under-fitting levels, etc. These attributes may benefit the designs of NAS algorithms. Besides, some methods learn to predict the final accuracy of an architecture based on the results of few early training epochs (Baker et al., 2018). These algorithm can be trained faster and the performance of the accuracy prediction can be evaluated using the fine-grained evaluation information.
|
| 77 |
+
|
| 78 |
+
Parameters of optimized architecture. Our NAS-Bench-201 releases the trained parameters for each architecture. This can provide ground truth label for hypernetwork-based NAS methods (Zhang et al., 2019; Brock et al., 2018), which learn to generate parameters of an architecture. Other methods mutate an architecture to become another one (Real et al., 2019; Cai et al., 2018). With NAS-Bench-201, researchers could directly use the off-the-shelf parameters instead of training from scratch and analyze how to transfer parameters from one architecture to another.
|
| 79 |
+
|
| 80 |
+
# 3 DIFFERENCE WITH EXISTING NAS BENCHMARKS
|
| 81 |
+
|
| 82 |
+
To the best of our knowledge, NAS-Bench-101 (Ying et al., 2019) is the only existing large-scale architecture dataset. Similar to NAS-Bench-201, NAS-Bench-101 also transforms the problem of architecture search into the problem of searching neural cells, represented as a DAG. Differently, NAS-Bench-101 defines operation candidates on the node, whereas we associate operations on the edge as inspired from (Liu et al., 2019; Dong & Yang, 2019b; Zoph et al., 2018). We summarize characteristics of our NAS-Bench-201 and NAS-Bench-101 in Table 3. The main highlights of our NAS-Bench-201 are as follows. (1) NAS-Bench-201 is algorithm-agnostic while NAS-Bench
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: Training, validation, test accuracy of each architecture on CIFAR-10, CIFAR-100, and ImageNet-16-120. We also visualize the results of ResNet in the orange star marker.
|
| 86 |
+
|
| 87 |
+
101 without any modification is only applicable to selected algorithms (Yu et al., 2020; Zela et al., 2020). The original complete search space, based on the nodes in NAS-Bench-101, is extremely huge. So, it is exceedingly difficult to efficiently traverse the training of all architectures. To trade off the computational cost and the size of the search space, they constrain the maximum number of edges in the DAG. However, it is difficult to incorporate this constraint in all NAS algorithms, such as NAS algorithms based on parameter-sharing (Liu et al., 2019; Pham et al., 2018). Therefore, many NAS algorithms cannot be directly evaluated on NAS-Bench-101. Our NAS-Bench-201 solves this problem by sacrificing the number of nodes and including all possible edges so that our search space is algorithm-agnostic. (2) We provide extra diagnostic information, such as architecture computational cost, fine-grained training and evaluation time, etc., which give inspirations to better and efficient designs of NAS algorithms utilizing these diagnostic information.
|
| 88 |
+
|
| 89 |
+
NAS-HPO-Bench (Klein & Hutter, 2019) evaluated 62208 configurations in the joint NAS and hyper-parameter space for a simple 2-layer feed-forward network. Since NAS-HPO-Bench has only 144 architectures, it could be insufficient to evaluate different NAS algorithms.
|
| 90 |
+
|
| 91 |
+
# 4 ANALYSIS OF NAS-Bench-201
|
| 92 |
+
|
| 93 |
+
An overview of architecture performance. The performance of each architecture is shown in Figure 2. We show the test accuracy of every architecture in our search space in the left column of Figure 2. The training, validation and test accuracy with respect to the number of parameters are shown in the rest three columns, respectively. Results show that a different number of parameters will affect the performance of the architectures, which indicates that the choices of operations are essential in NAS. We also observe that the performance of the architecture can vary even when the number of parameters stays the same. This observation indicates the importance of how the operations/cells are connected. We compare the architectures with a classical human-designed architecture (ResNet) in all cases, which is indicated by an orange star mark. ResNet shows competitive performance in three datasets, however, it still has room to improve, i.e., about $2 \%$ compared to the best architecture in CIFAR-100 and ImageNet-16-120, about $1 \%$ compared to the best one with the same amount of parameters in CIFAR-100 and ImageNet-16-120.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 3: The ranking of each architecture on three datasets, sorted by the ranking in CIFAR-10.
|
| 97 |
+
|
| 98 |
+
Architecture ranking on three datasets. The ranking of every architecture in our search space is shown in Figure 3, where the architecture ranked in CIFAR-10 $\mathbf { \dot { X } } \mathbf { \cdot }$ -axis) is ranked as in y-axis in CIFAR-100 and ImageNet-16-120, indicated by green and red markers respectively. The performance of the architectures shows a generally consistent ranking over the three datasets with slightly different variance, which serves to test the generality of the searching algorithm.
|
| 99 |
+
|
| 100 |
+
Correlations of validation and test accuracies. We visualize the correlation between the validation and test accuracy within one dataset and across datasets in Figure 4. The correlation within one dataset is high compared to cross-dataset correlation. The correlation dramatically decreases as we
|
| 101 |
+
|
| 102 |
+
only pick the top performing architectures. When we directly transfer the best architecture in one dataset to another (a vanilla strategy), it can not $100 \%$ secure a good performance. This phenomena is a call for better transferable NAS algorithms instead of vanilla strategy.
|
| 103 |
+
|
| 104 |
+
Dynamic ranking of architectures. We show the ranking of the performance of all architectures in different time stamps in Figure 5. The ranking based on the validation set (y axis) gradually converges to the ranking ba
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4: We report the correlation coefficient between the accuracy on 6 sets, i.e., CIFAR-10 validation set (C10- V), CIFAR-10 test set (C10-T), CIFAR-100 validation set (C100-V), CIFAR-100 test set (C100-T), ImageNet-16-120 validation set (I120-V), ImageNet-16-120 test set (I120-T). ed on the final test accuracy (x axis).
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: The ranking of all architectures based on the validation accuracy at different time stamps (y axis) sorted by the final test accuracy (x axis).
|
| 111 |
+
|
| 112 |
+
# 5 BENCHMARK
|
| 113 |
+
|
| 114 |
+
In this section, we evaluate 10 recent searching methods on our NAS-Bench-201, which can serve as baselines for future NAS algorithms in our dataset. Specifically, we evaluate some typical NAS algorithms: (I) Random Search algorithms, e.g., random search (RS) (Bergstra & Bengio, 2012), random search with parameter sharing (RSPS) (Li & Talwalkar, 2019). (II) ES methods, e.g., REA (Real et al., 2019). (III) RL algorithms, e.g., REINFORCE (Williams, 1992), ENAS (Pham et al., 2018). (IV) Differentiable algorithms. e.g., first order DARTS (DARTS-V1) (Liu et al., 2019), second order DARTS (DARTS-V2), GDAS (Dong & Yang, 2019b), and SETN (Dong & Yang, 2019a). (V) HPO methods, e.g., BOHB (Falkner et al., 2018). We experimented all NAS algorithms on a single GeForce GTX 1080 Ti GPU.
|
| 115 |
+
|
| 116 |
+
Table 4: The utility of our NAS-Bench-201 for different NAS algorithms. We show whether a NAS algorithm can use our NAS-Bench-201 to accelerate the searching and evaluation procedure.
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan=1 colspan=1>accelerate</td><td rowspan=1 colspan=1>RS</td><td rowspan=1 colspan=1>RSPS</td><td rowspan=1 colspan=1>DARTS-V1</td><td rowspan=1 colspan=1>DARTS-V2</td><td rowspan=1 colspan=1>GDAS</td><td rowspan=1 colspan=1>SETN</td><td rowspan=1 colspan=1>REA</td><td rowspan=1 colspan=1>REINFORCE</td><td rowspan=1 colspan=1>ENAS</td><td rowspan=1 colspan=1>BOHB</td></tr><tr><td rowspan=1 colspan=1>searchevaluation</td><td rowspan=1 colspan=1>V</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>V</td><td rowspan=1 colspan=1>1√</td><td rowspan=1 colspan=1>V</td><td rowspan=1 colspan=1>√√</td></tr></table>
|
| 119 |
+
|
| 120 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Search (seconds)</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td><td colspan="2">ImageNet-16-120</td></tr><tr><td>validation</td><td>test</td><td>validation</td><td>test</td><td>validation</td><td>test</td></tr><tr><td>RSPS</td><td>8007.13</td><td>80.42±3.58</td><td>84.07±3.61</td><td>52.12±5.55</td><td>52.31±5.77</td><td>27.22±3.24</td><td>26.28±3.09</td></tr><tr><td>DARTS-V1</td><td>11625.77</td><td>39.77±0.00</td><td>54.30±0.00</td><td>15.03±0.00</td><td>15.61±0.00</td><td>16.43±0.00</td><td>16.32±0.00</td></tr><tr><td>DARTS-V2</td><td>35781.80</td><td>39.77±0.00</td><td>54.30±0.00</td><td>15.03±0.00</td><td>15.61±0.00</td><td>16.43±0.00</td><td>16.32±0.00</td></tr><tr><td>GDAS</td><td>31609.80</td><td>89.89±0.08</td><td>93.61±0.09</td><td>71.34±0.04</td><td>70.70±0.30</td><td>41.59±1.33</td><td>41.71±0.98</td></tr><tr><td>SETN</td><td>34139.53</td><td>84.04±0.28</td><td>87.64±0.00</td><td>58.86±0.06</td><td>59.05±0.24</td><td>33.06±0.02</td><td>32.52±0.21</td></tr><tr><td>ENAS</td><td>14058.80</td><td>37.51±3.19</td><td>53.89±0.58</td><td>13.37±2.35</td><td>13.96±2.33</td><td>15.06±1.95</td><td>14.84±2.10</td></tr><tr><td>RSPSt</td><td>7587.12</td><td>84.16±1.69</td><td>87.66±1.69</td><td>59.00±4.60</td><td>58.33±4.34</td><td>31.56±3.28</td><td>31.14±3.88</td></tr><tr><td>DARTS-V1†</td><td>10889.87</td><td>39.77±0.00</td><td>54.30±0.00</td><td>15.03±0.00</td><td>15.61±0.00</td><td>16.43±0.00</td><td>16.32±0.00</td></tr><tr><td>DARTS-V2t</td><td>29901.67</td><td>39.77±0.00</td><td>54.30±0.00</td><td>15.03±0.00</td><td>15.61±0.00</td><td>16.43±0.00</td><td>16.32±0.00</td></tr><tr><td>GDASt</td><td>28925.91</td><td>90.00±0.21</td><td>93.51±0.13</td><td>71.14±0.27</td><td>70.61±0.26</td><td>41.70±1.26</td><td>41.84±0.90</td></tr><tr><td>SETNt</td><td>31009.81</td><td>82.25±5.17</td><td>86.19±4.63</td><td>56.86±7.59</td><td>56.87±7.77</td><td>32.54±3.63</td><td>31.90±4.07</td></tr><tr><td>ENASt</td><td>13314.51</td><td>39.77±0.00</td><td>54.30±0.00</td><td>15.03±0.00</td><td>15.61±0.00</td><td>16.43±0.00</td><td>16.32±0.00</td></tr><tr><td>REA RS</td><td>0.02</td><td>91.19±0.31</td><td>93.92±0.30</td><td>71.81±1.12</td><td>71.84±0.99</td><td>45.15±0.89</td><td>45.54±1.03</td></tr><tr><td></td><td>0.01</td><td>90.93±0.36</td><td>93.70±0.36</td><td>70.93±1.09</td><td>71.04±1.07</td><td>44.45±1.10</td><td>44.57±1.25</td></tr><tr><td>REINFORCE</td><td>0.12</td><td>91.09±0.37</td><td>93.85±0.37</td><td>71.61±1.12</td><td>71.71±1.09</td><td>45.05±1.02</td><td>45.24±1.18</td></tr><tr><td>BOHB</td><td>3.59</td><td>90.82±0.53</td><td>93.61±0.52</td><td>70.74±1.29</td><td>70.85±1.28</td><td>44.26±1.36</td><td>44.42±1.49</td></tr><tr><td>ResNet</td><td rowspan="2">N/A</td><td>90.83</td><td>93.97</td><td>70.42</td><td>70.86</td><td>44.53</td><td>43.63</td></tr><tr><td>optimal</td><td>91.61</td><td>94.37</td><td>73.49</td><td>73.51</td><td>46.77</td><td>47.31</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 5: We evaluate $I O$ different searching algorithms in our NAS-Bench-201. The first block shows results of parameter sharing based NAS methods. The second block is similar to the first one, however, BN layers in the searching cells do not keep running estimates but always use batch statistics. The third block shows results of NAS methods without parameter sharing. Each algorithm uses the training and validation set of CIFAR-10 for searching. We show results of their searched architectures for (1) training on the CIFAR-10 train set and evaluating on its validation set; (2) training on the CIFAR-10 train+validation sets and evaluating on its test set; (3) training on the CIFAR-10 or ImageNet-16-120 train set and evaluating on their validation or test sets. “optimal” indicates the highest mean accuracy for each set. We report the mean and std of 500 runs for RS, REA, REINFORCE, and BOHB and of 3 runs for RSPS, DARTS, GDAS, SETN, and ENAS.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 6: We show results of 500 runs for RS, REA, REINFORCE, and BOHB on CIFAR-10. The architecture is searched on CIFAR-10 and we report its validation accuracy (solid line) and test accuracy (dashed line) on three datasets. Each individual run is sorted by the validation accuracy of the searched architecture.
|
| 126 |
+
|
| 127 |
+
We show the benefits for speed using our NAS-Bench-201 for different NAS algorithms in Table 4. For each NAS algorithm, once the searching procedure finished and the final architecture is found, our NAS-Bench-201 can directly return the performance of this architecture. With NAS-Bench-201, NAS algorithms without parameter sharing can significantly reduce the searching time into seconds. Notably, it still requires several GPU hours for NAS algorithms with parameter sharing to complete the searching.
|
| 128 |
+
|
| 129 |
+
All algorithms use the training and validation set of CIFAR-10 to search architectures. In Table 5, Figure 6, Figure 7, and Figure 8, we report the performance of the searched architectures plus the optimal architecture on three datasets. We make the following observations: (1) NAS methods without parameter sharing (REA, RS, REINFORCE, and BOHB) outperform others. This be because training a model for a few epochs with the converged LR scheduler $( { \mathcal { H } } ^ { \ddagger } )$ can provide a good relative ranking of each architecture. (2) DARTS-V1 and DARTS-V2 quickly converge to find the architecture whose edges are all skip connection. A possible reason is that the original hyper-parameters of DARTS are chosen for their search space instead of ours. (3) The strategy of BN layers can significantly effect the NAS methods with parameter sharing. Using batch statistics are better than keep running estimates of the mean and variance. (4) Using our fine-grained information, REA, REINFORCE and RS can be finished in seconds which could significantly reduce the search costs and let researchers focus solely on the search algorithm itself.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 7: Results keeping keep running estimates for BN layers in each searching cell. We use parameter sharing based NAS methods to search the architecture on CIFAR-10. After each searching epoch, we derive the architecture and show its validation accuracy (VALID) and test accuracy (TEST) on CIFAR-10. The 0-th epoch indicates the architecture is derived from the randomly initialized architecture encoding.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 8: Results using batch statistics without keeping keep running estimates for BN layers in each searching cell. We use parameter sharing based NAS methods to search the architecture on CIFAR-10. After each searching epoch, we derive the architecture and show its validation accuracy (VALID) and test accuracy (TEST) on CIFAR-10. The 0-th epoch indicates the architecture is derived from the randomly initialized architecture encoding.
|
| 136 |
+
|
| 137 |
+
In Figure 7 and Figure 8, we show the performance of the architecture derived from each algorithm per searching epoch. DARTS-V1 will gradually over-fit to an architecture with all skip-connection operations. DARTS-V2 can alleviate this problem to some extent but will still over-fit after more epochs. It can further alleviate this problem by using batch statistics for BN layers. We train RSPS, GDAS, SETN, and ENAS five times longer than DARTS (250 epochs vs. 50 epochs). This is because at every iteration, RSPS, GDAS, SETN, and ENAS only optimize 1|O|=5 parameters of the shared parameters, whereas DARTS optimize all shared parameters. The searched architecture performs similar for GDAS after 50 searching epochs. RSPS and SETN show a higher variance of the searched architecture compared to GDAS.
|
| 138 |
+
|
| 139 |
+
Clarification. We have tried our best to implement each method. However, still, some algorithms might obtain non-optimal results since their hyper-parameters might not fit our NAS-Bench-201. We empirically found that some NAS algorithms are sensitive to some hyper-parameters, whereas we try to compare them in a fair way as we can (Please see more explanation in Appendix). If researchers can provide better results with different hyper-parameters, we are happy to update results according to the new experimental results. We also welcome more NAS algorithms to test on our dataset and would include them accordingly.
|
| 140 |
+
|
| 141 |
+
# 6 DISCUSSION
|
| 142 |
+
|
| 143 |
+
How to avoid over-fitting on NAS-Bench-201? Our NAS-Bench-201 provides a benchmark for NAS algorithms, aiming to provide a fair and computational cost-friendly environment to the NAS community. The trained architecture and the easy-to-access performance of each architecture might provide some insidious ways for designing algorithms to over-fit the best architecture in our NASBench-201. Thus, we propose some rules which we wish the users will follow to achieve the original intention of NAS-Bench-201, a fair and efficient benchmark.
|
| 144 |
+
|
| 145 |
+
1. No regularization for a specific operation. Since the best architecture is known in our benchmark, specific designs to fit the structural attributes of the best performed architecture are insidious ways to fit our NAS-Bench-201. For example, as mentioned in Section 5, we found that the best architecture with the same amount of parameters for CIFAR10 on NAS-Bench-201 is ResNet. Restrictions on the number of residual connections is a way to over-fit the CIFAR10 benchmark. While this can give a good result on this benchmark, the searching algorithm might not generalize to other benchmarks.
|
| 146 |
+
|
| 147 |
+
2. Use the provided performance. The training strategy affects the performance of the architecture. We suggest the users stick to the performance provided in our benchmark even if it is feasible to use other $\mathcal { H }$ to get a better performance. This provides a fair comparison with other algorithms.
|
| 148 |
+
|
| 149 |
+
3. Report results of multiple searching runs. Since our benchmark can help to largely decrease the computational cost for a number of algorithms. Multiple searching runs give stable results of the searching algorithm with acceptable time cost.
|
| 150 |
+
|
| 151 |
+
Limitation regarding to hyper-parameter optimization (HPO). The performance of an architecture depends on the hyper-parameters $\mathcal { H }$ for its training and the optimal configuration of $\mathcal { H }$ may vary for different architectures. In NAS-Bench-201, we use the same configuration for all architectures, which may bring biases to the performance of some architectures. One related solution is HPO, which aims to search the optimal hyper-parameter configuration. However, searching the optimal hyper-parameter configurations and the architecture in one shot is too computationally expensive and still is an open problem.
|
| 152 |
+
|
| 153 |
+
Potential designs using diagnostic information in NAS-Bench-201. As pointed in Section 2.4, different kinds of diagnostic information are provided. We hope that more insights about NAS could be found by analyzing these diagnostic information and further motivate potential solutions for NAS. For example, parameter sharing (Pham et al., 2018) is the crucial technique to improve the searching efficiency, but the shared parameter would sacrifice the accuracy of each architecture. Could we find a better way to share parameters of each architecture from the learned 15,625 models’ parameters?
|
| 154 |
+
|
| 155 |
+
Generalization ability of the search space. It is important to test the generalization of observations on this dataset. An idea strategy is to do all benchmark experiments on a much larger search space. Unfortunately, it is prohibitive regarding the expensive computational cost. We bring some results from (Ying et al., 2019) and (Zela et al., 2020) to provide some preliminary evidence of generalization. In Figure 2, we show the rankings of RS, REA, and REINFORCE is ( REA $>$ REINFORCE $> \mathrm { R } S$ ). This is consistent with results in NAS-Bench-101, which contains more architecture candidates. For NAS methods with parameter sharing, we find that $\mathrm { G D A S } \geq \mathrm { D A R T S } \geq \mathrm { E N A S }$ , which is also consistent with results in NAS-Bench-1SHOT1. Therefore, observations from our NAS-Bench201 may generalize to other search spaces.
|
| 156 |
+
|
| 157 |
+
# 7 CONCLUSION & FUTURE WORK
|
| 158 |
+
|
| 159 |
+
In this paper, we introduce NAS-Bench-201 that extends the scope of reproducible NAS. In NASBench-201, almost any NAS algorithms can be directly evaluated. We train and evaluate 15,625 architecture on three different datasets, and we provide results regarding different metrics. We comprehensively analyze our dataset and test some recent NAS algorithms on NAS-Bench-201 to serve as baselines for future works. In future, we will (1) consider HPO and NAS together and (2) much larger search space. We welcome researchers to try their NAS algorithms on our NAS-Bench201 and would update the paper to include their results.
|
| 160 |
+
|
| 161 |
+
Acknowledgements. We thank the ICLR area chair, ICLR reviewers, and authors of NAS-Bench101 for the constructive suggestions during the rebuttal and revision period.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Bowen Baker, Otkrist Gupta, Ramesh Raskar, and Nikhil Naik. Accelerating neural architecture search using performance prediction. In International Conference on Learning Representations Workshop (ICLR-W), 2018.
|
| 166 |
+
|
| 167 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. The Journal of Machine Learning Research (JMLR), 13(Feb):281–305, 2012.
|
| 168 |
+
|
| 169 |
+
Andrew Brock, Theodore Lim, James M Ritchie, and Nick Weston. SMASH: one-shot model architecture search through hypernetworks. In International Conference on Learning Representations (ICLR), 2018.
|
| 170 |
+
|
| 171 |
+
Han Cai, Tianyao Chen, Weinan Zhang, Yong Yu, and Jun Wang. Efficient architecture search by network transformation. In AAAI Conference on Artificial Intelligence (AAAI), pp. 2787–2794, 2018.
|
| 172 |
+
|
| 173 |
+
Tianqi Chen, Ian Goodfellow, and Jonathon Shlens. Net2net: Accelerating learning via knowledge transfer. In International Conference on Learning Representations (ICLR), 2016.
|
| 174 |
+
|
| 175 |
+
Patryk Chrabaszcz, Ilya Loshchilov, and Frank Hutter. A downsampled variant of imagenet as an alternative to the cifar datasets. arXiv preprint arXiv:1707.08819, 2017.
|
| 176 |
+
|
| 177 |
+
Xuanyi Dong and Yi Yang. One-shot neural architecture search via self-evaluated template network. In Proc. of the IEEE International Conference on Computer Vision (ICCV), pp. 3681–3690, 2019a.
|
| 178 |
+
|
| 179 |
+
Xuanyi Dong and Yi Yang. Searching for a robust neural architecture in four gpu hours. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1761–1770, 2019b.
|
| 180 |
+
|
| 181 |
+
Stefan Falkner, Aaron Klein, and Frank Hutter. BOHB: Robust and efficient hyperparameter optimization at scale. In The International Conference on Machine Learning (ICML), pp. 1436–1445, 2018.
|
| 182 |
+
|
| 183 |
+
Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V Le. Dropblock: A regularization method for convolutional networks. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 10727–10737, 2018.
|
| 184 |
+
|
| 185 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 186 |
+
|
| 187 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 188 |
+
|
| 189 |
+
Aaron Klein and Frank Hutter. Tabular benchmarks for joint architecture and hyperparameter optimization. arXiv preprint arXiv:1905.04970, 2019.
|
| 190 |
+
|
| 191 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 192 |
+
|
| 193 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 1097–1105, 2012.
|
| 194 |
+
|
| 195 |
+
Liam Li and Ameet Talwalkar. Random search and reproducibility for neural architecture search. In The Conference on Uncertainty in Artificial Intelligence (UAI), 2019.
|
| 196 |
+
|
| 197 |
+
Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research (JMLR), 18(1):6765–6816, 2018.
|
| 198 |
+
|
| 199 |
+
Chenxi Liu, Barret Zoph, Maxim Neumann, Jonathon Shlens, Wei Hua, Li-Jia Li, Li Fei-Fei, Alan Yuille, Jonathan Huang, and Kevin Murphy. Progressive neural architecture search. In Proc. of the European Conference on Computer Vision (ECCV), pp. 19–34, 2018.
|
| 200 |
+
|
| 201 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In International Conference on Learning Representations (ICLR), 2019.
|
| 202 |
+
|
| 203 |
+
Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. In International Conference on Learning Representations (ICLR), 2017.
|
| 204 |
+
|
| 205 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In The Conference on Neural Information Processing Systems Workshop (NeurIPS-W), 2017.
|
| 206 |
+
|
| 207 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In The International Conference on Machine Learning (ICML), pp. 4095–4104, 2018.
|
| 208 |
+
|
| 209 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In AAAI Conference on Artificial Intelligence (AAAI), pp. 4780– 4789, 2019.
|
| 210 |
+
|
| 211 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015.
|
| 212 |
+
|
| 213 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 214 |
+
|
| 215 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1–9, 2015.
|
| 216 |
+
|
| 217 |
+
Mingxing Tan, Bo Chen, Ruoming Pang, Vijay Vasudevan, Mark Sandler, Andrew Howard, and Quoc V Le. Mnasnet: Platform-aware neural architecture search for mobile. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2820–2828, 2019.
|
| 218 |
+
|
| 219 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In The Conference on Neural Information Processing Systems (NeurIPS), pp. 5998–6008, 2017.
|
| 220 |
+
|
| 221 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229–256, 1992.
|
| 222 |
+
|
| 223 |
+
Chris Ying, Aaron Klein, Esteban Real, Eric Christiansen, Kevin Murphy, and Frank Hutter. Nasbench-101: Towards reproducible neural architecture search. In The International Conference on Machine Learning (ICML), pp. 7105–7114, 2019.
|
| 224 |
+
|
| 225 |
+
Kaicheng Yu, Christian Sciuto, Martin Jaggi, Claudiu Musat, and Mathieu Salzmann. Evaluating the search phase of neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
|
| 226 |
+
|
| 227 |
+
Arber Zela, Julien Siems, and Frank Hutter. Nas-bench-1shot1: Benchmarking and dissecting one shot neural architecture search. In International Conference on Learning Representations (ICLR), 2020.
|
| 228 |
+
|
| 229 |
+
Chris Zhang, Mengye Ren, and Raquel Urtasun. Graph hypernetworks for neural architecture search. In International Conference on Learning Representations (ICLR), 2019.
|
| 230 |
+
|
| 231 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations (ICLR), 2018.
|
| 232 |
+
|
| 233 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations (ICLR), 2017.
|
| 234 |
+
|
| 235 |
+
Barret Zoph, Vijay Vasudevan, Jonathon Shlens, and Quoc V Le. Learning transferable architectures for scalable image recognition. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 8697–8710, 2018.
|
| 236 |
+
|
| 237 |
+
<table><tr><td rowspan="2">EPOCHS</td><td rowspan="2">TOTAL</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td><td colspan="2">ImageNet-16-120</td></tr><tr><td>validation</td><td>test</td><td>validation</td><td>test</td><td>validation</td><td>test</td></tr><tr><td>6</td><td>12 (H)</td><td>0.7767</td><td>0.7627</td><td>0.8086</td><td>0.8095</td><td>0.8052</td><td>0.7941</td></tr><tr><td>12</td><td>12 (H+)</td><td>0.9110</td><td>0.8983</td><td>0.9361</td><td>0.9368</td><td>0.9062</td><td>0.8952</td></tr><tr><td>12</td><td>200 (H+)</td><td>0.7520</td><td>0.7396</td><td>0.8071</td><td>0.8080</td><td>0.8167</td><td>0.8092</td></tr><tr><td>24</td><td>200 (H+)</td><td>0.7705</td><td>0.7594</td><td>0.8280</td><td>0.8290</td><td>0.8286</td><td>0.8217</td></tr><tr><td>100</td><td>200 (H+)</td><td>0.7938</td><td>0.7900</td><td>0.8529</td><td>0.8540</td><td>0.8262</td><td>0.8211</td></tr><tr><td>150</td><td>200 (H+)</td><td>0.8955</td><td>0.8926</td><td>0.9239</td><td>0.9246</td><td>0.8506</td><td>0.8425</td></tr><tr><td>175</td><td>200 (H+)</td><td>0.9834</td><td>0.9782</td><td>0.9743</td><td>0.9744</td><td>0.8539</td><td>0.8423</td></tr><tr><td>200</td><td>200 (Ht+)</td><td>0.9993</td><td>0.9937</td><td>0.9672</td><td>0.9671</td><td>0.8259</td><td>0.8124</td></tr></table>
|
| 238 |
+
|
| 239 |
+
Table 6: We compare the correlation of different training strategies. The correlation coefficient between the validation accuracy after several training epochs on CIFAR-10 and (1) the validation accuracy of full trained models on the CIFAR-10 training set, (2) the test accuracy on CIFAR-10 trained with the training and validation sets, (3) the validation/test accuracy on CIFAR-100 trained with the CIFAR-100 training set, (4) the validation/test accuracy on ImageNet-16-120 trained with the ImageNet-16-120 training set. We use the validation accuracy after “EPOCHS“ training epochs, where the the cosine annealing converged after “TOTAL” epochs.
|
| 240 |
+
|
| 241 |
+
# A MORE DETAILS OF NAS-Bench-201
|
| 242 |
+
|
| 243 |
+
Number of unique architectures. In our NAS-Bench-201, we encode each architecture by a 6- dimensional vector. The $i$ -th value in this vector indicates the operation in the $i \cdot$ -th edge in a cell. Since we have 5 possible operations, there are $5 ^ { 6 } = 1 5 6 2 5$ total unique models in this encoding. If we identify the isomorphic cell caused by the “skip-connect” operation, there are 12751 unique topology structures. If we identify the isomorphic cell caused by both “skip-connect” and “zeroize” operations, there are only 6466 unique topology structures. Note that, due to the numerical error, when given the same inputs, two architectures with the isomorphic cell might have different outputs.
|
| 244 |
+
|
| 245 |
+
Note that, when we build our NAS-Bench-201, we train and evaluate every architecture without considering isomorphism.
|
| 246 |
+
|
| 247 |
+
NAS-Bench-201 with bandit-based algorithms. Bandit-based algorithms, such as Hyperband (Li et al., 2018) and BOHB (Falkner et al., 2018), usually train models with a short time budget. In our NAS-Bench-201, on CIFAR-10, we provide two options if you want to obtain the performance of a model trained with a short time budget: (1) Results from $\mathcal { H } ^ { \ddag }$ , where the cosine annealing converged at the 12-th epoch. (2) Results from $\mathcal { H } ^ { \dagger }$ , where the cosine annealing converged at the 200-th epoch. As shown in Table 6, the performance of these converged networks is much more likely to correlate highly with the performance after a larger number of iterations than just taking an earlier point of a single cosine annealing trajectory. Therefore, we choose the first option for all NAS algorithms that do not use parameter sharing.
|
| 248 |
+
|
| 249 |
+
# B IMPLEMENTATION DETAILS
|
| 250 |
+
|
| 251 |
+
Based on the publicly available codes, we re-implement 10 NAS algorithms by ourselves to search architectures on our NAS-Bench-201. We provide the implementation details of each searching algorithm below.
|
| 252 |
+
|
| 253 |
+
We consider the searching time of the first order DARTS as a baseline (about 12000 seconds on CIFAR-10). When evaluating RS, REINFORCE, ENAS, and BOHB, we set the total time budget as 12000 seconds for them. By default, for NAS algorithms with parameter sharing, we follow most hyper-parameters from DARTS and do not learn the scale and shift parameters for BN layers in each searching cell. We setup the searching procedure of RSPS, GDAS, SETN, ENAS five times longer than DARTS, because they optimize $\textcircled { \frac { 1 } { 5 } }$ of parameters but DARTS optimize all parameters per iteration. Most configurations can be found at https://github.com/D-X-Y/ AutoDL-Projects/tree/master/configs/nas-benchmark/algos.
|
| 254 |
+
|
| 255 |
+
Random search (RS) (Bergstra & Bengio, 2012). We randomly select architectures until the total training time plus the time of one evaluation procedure reaches the total budget. We use the validation accuracy after 12 training epochs $( { \mathcal { H } } ^ { \ddagger } )$ , which can be obtained directly in our NAS-Bench-201 as discussed in Section 2.4. The architecture with the highest validation accuracy is selected as the final searched architecture.
|
| 256 |
+
|
| 257 |
+
Regularized evolution for image classifier architecture search (REA) (Real et al., 2019). We set the initial population size as 10, the number of cycles as infinity. The sample size is chosen as 10 from [3, 5, 10], according to Figure 9. We finish the algorithm once the simulated training time of the traversed architecture reaches the time budgets (12000 seconds). We use the validation accuracy after 12 training epochs $( { \mathcal { H } } ^ { \ddagger } )$ as the fitness.
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 9: The effect of different sample sizes for REA on the CIFAR-10 validation set.
|
| 261 |
+
|
| 262 |
+
REINFORCE (Williams, 1992). We follow (Ying et al., 2019) to use the REINFORCE algorithm as a baseline RL method. We use an architecture encoding to parameterize each candidate in our search space as (Liu et al., 2019; Dong & Yang, 2019b). We use the validation accuracy after 12 training epochs $\mathcal { H } ^ { \ddag }$ as the reward in REINFORCE. The architecture encoding is optimized via Adam. We evaluate the learning rate from [0.01, 0.02, 0.05, 0.1, 0.2, 0.5] following (Ying et al., 2019). According to Figure 10, the learning date is set as . The momentum for exponential moving average of 0.9. We finish the training once the simulated training time reaches the time budgets (12000 seconds).
|
| 263 |
+
|
| 264 |
+
The first order and second order DARTS (DARTS-V1 and DARTS-V2) (Liu et al., 2019). We train the shared parameters via Nesterov momentum SGD, using the cross-entropy loss for 50 epochs in total. We set weight decay as 0.0005 and momentum of 0.9. We decay the learning rate from 0.025 to 0.001 via cosine learning rate scheduler and clip the gradient by 5. We train the architecture encoding via Adam with the learning rate of 0.0003 and the weight decay of 0.001. We use the batch size of 64. The random horizontal flipping, random cropping with padding, and normalization are used for data augmentation. We choose these hyper-parameters following (Liu et al., 2019).
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 10: We evaluate the effect of different learning rates for REINFORCE, and report the CIFAR-10 validation accuracy of the searched architecture.
|
| 268 |
+
|
| 269 |
+
Random search with parameter sharing (RSPS) (Li & Talwalkar, 2019). We train RSPS with the similar hyper-parameters as that of DARTS. Differently, we train the algorithm in 250 epochs in total. During each searching iteration, we randomly sample one architecture in each batch training. Each architecture uses the training mode for BN during training and the evaluation mode during evaluation (Paszke et al., 2017). After training the shared parameters, we evaluate 100 randomly selected architectures with the shared parameters. For each architecture, we randomly choose one mini-batch with 256 validation samples to estimate the validation accuracy instead of using the whole validation set to calculate the precise validation accuracy. The one with the highest estimated validation accuracy will be selected. With the size of this mini-batch increasing, the more precise validation accuracy would be obtained and the better architecture would be selected. However, the searching costs will also be increased. We use the size of 256 to trade-off the accuracy and cost.
|
| 270 |
+
|
| 271 |
+
Gradient-based search using differentiable architecture sampler (GDAS) (Dong & Yang, 2019b). We use the most hyper-parameters as that of DARTS but train it for 250 epochs in total. The Gumbel-Softmax temperature is linearly decayed from 10 to 0.1.
|
| 272 |
+
|
| 273 |
+
Self-Evaluated Template Network (SETN) (Dong & Yang, 2019a). We use the most hyperparameters as that of DARTS but train it for 250 epochs in total. After training the shared parameters, we select 100 architectures with the highest probabilities (encoded by the learned architecture encoding). We evaluate these 100 selected architectures with the shared parameters. The evaluation procedure for these 100 architectures are the same as RSPS.
|
| 274 |
+
|
| 275 |
+
Table 7: The correlation between the probability or the one-shot validation accuracy (OSVA) and the ground truth accuracy on the CIFAR-10 validation set. “BN with Train” indicates that, during evaluation, the mean and variance of BN layers are calculated within each mini-batch. “BN with Eval” indicates that we accumulate mean and variance of BN layers in the training set and use these accumulated mean and variance for evaluation. We report the correlation as the average of 3 runs.
|
| 276 |
+
|
| 277 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="3">CIFAR-1OValidation Set</td></tr><tr><td>Probability</td><td>OSVA (BN with Train)</td><td>OSVA (BN with Eval)</td></tr><tr><td>DARTS-V1</td><td>0.0779</td><td>0.0039</td><td>-0.0071</td></tr><tr><td>DARTS-V2</td><td>0.0862</td><td>0.0355</td><td>0.0109</td></tr><tr><td>SETN</td><td>0.0682</td><td>0.9049</td><td>0.0862</td></tr><tr><td>GDAS</td><td>0.2714</td><td>0.8141</td><td>0.2466</td></tr></table>
|
| 278 |
+
|
| 279 |
+
ENAS (Pham et al., 2018). We use a two layer LSTM as the controller with the hidden size of 32. We use the temperature of 5 and the tanh constant of 2.5 for the sampling logits Following (Pham et al., 2018), we also add the the controller’s sample entropy to the reward, weighted by 0.0001. We optimize the controller with Adam using the constant learning rate of 0.001. We optimize the network weights with SGD following the learning rate scheduler as the original paper and the batch size of 128. We did not impose any penalty to a specific operation.
|
| 280 |
+
|
| 281 |
+
BOHB (Falkner et al., 2018). We choose to use BOHB as an HPO algorithm on our NAS-Bench201. We follow (Ying et al., 2019) to set up the hyper-parameters for BOHB. We set the number of samples for the acquisition function to 4, the random fraction to $0 \%$ , the minimum-bandwidth to 0.3, the bandwidth factor to 3. We finish the algorithm once the simulated training time reaches the time budgets (12000 seconds).
|
| 282 |
+
|
| 283 |
+
# C DISCUSSION FOR NAS WITH PARAMETER SHARING
|
| 284 |
+
|
| 285 |
+
Parameter sharing (Pham et al., 2018) becomes a common technique to improve the efficiency of differentiable neural architecture search methods (Liu et al., 2019; Dong & Yang, 2019b;a). The shared parameters are shared over millions of architecture candidates. It is almost impossible for the shared parameters to be optimal for all candidates. We hope to evaluate the trained shared parameters quantitatively. Specially, we use DARTS, GDAS, and SETN to optimize the shared parameters and the architecture encoding on CIFAR-10. For each architecture candidate, we can calculate its probability of being a good architecture from the architecture encoding following SETN (Dong & Yang, 2019a). In addition, we can also evaluate a candidate using the shared parameters on the validation set to obtain “the one-shot validation accuracy”. It is computationally expensive to evaluate all candidates on the whole validation set. To accelerate this procedure, we evaluate each architecture on a mini-batch with the size of 2048, and use the accuracy on this mini-batch to approximate “the one-shot validation accuracy”. Ideally, the architecture ranking sorted by the probability or the one-shot validation accuracy should be similar to the ground truth ranking. We show the correlation between the proxy metric and the ground truth validation accuracy in Table 7. There are several observations: (1) The correlation between the probability (encoded by the architecture encoding) and the ground truth accuracy is low. It suggests that the argmax-based deriving strategy (Liu et al., 2019) can not secure a good architecture. It remains open on how to derive a good architecture after optimizing the shared parameters. (2) The behavior of BN layers is important to one-shot validation accuracy. The accumulated mean and variance from the training set are harmful to one-shot accuracy. Instead, each architecture candidate should re-calculate the mean and variance of the BN layers. (3) GDAS introduced Gumbel-softmax sampling when optimizing the architecture encoding. This strategy leads to a high correlation for the learned probability than that of DARTS. (4) The uniform sampling strategy for training the shared parameters (Dong & Yang, 2019a) can increase the correlation for one-shot accuracy compared to the strategy of the joint optimizing strategy (Dong & Yang, 2019b; Liu et al., 2019).
|
| 286 |
+
|
| 287 |
+
# D DETAILED INFORMATION OF NAS-Bench-201
|
| 288 |
+
|
| 289 |
+
In NAS-Bench-201 (version 1.0), every architecture is trained at least once. To be specific, 6219 architectures are trained once, 1621 architectures are trained twice, 7785 architectures are trained three times with different random seeds. Moreover, we are actively training all architectures with more seeds and will continue updating our NAS-Bench-201.
|
| 290 |
+
|
| 291 |
+
The latency in our NAS-Bench-201 (version 1.0) is computed by running each model on a single GPU (GeForce GTX 1080 Ti) with a batch size of 256. We report the latency on CIFAR-100 and ImageNet-16-120, and the latency on CIFAR-10 should be similar to CIFAR-10.
|
| 292 |
+
|
| 293 |
+
The usage of API. We provide convenient APIs to access our NAS-Bench-201, which can be easily installed via “pip install nas-bench-201”. Some examples are shown as follows:
|
| 294 |
+
|
| 295 |
+
from nas_201_api import NASBench201API as API
|
| 296 |
+
2 api $=$ API(’NAS-Bench-201-v1_0-e61699.pth’) for i, arch_str in enumerate(api): # show every architecturre print (’{:5d}/{:5d} : {:}’.format(i, len(api), arch_str)) 5 info $=$ api.query_meta_info_by_index(1) # get metrics of the 1-th arch res_dict $=$ info.get_metrics(’cifar10’, ’train’) # a dict saving loss/acc print (’The accuracy is {:.2f}’.format(res_dict[’accuracy’]))
|
| 297 |
+
8 print (’The loss is {:.2f}’.format(res_dict[’loss’])) 9 cos_dict $=$ info.get_comput_costs(’cifar100’) # a dict saving costs
|
| 298 |
+
10 print (’The flops is {:.2f} M’.format(cos_dict[’flops’]))
|
| 299 |
+
11 print (’The #parameters is {:.2f} MB’.format(cos_dict[’params’]))
|
| 300 |
+
12 print (’The latency is {:.3f} s’.format(cos_dict[’latency’]))
|
| 301 |
+
13 # query the index of a specific architecture from API
|
| 302 |
+
14 arch_index $=$ api.query_index_by_arch(’|nor_conv_3x3\~0|+|nor_conv_3x3\~0| avg_pool_3x3\~1|+|skip_connect\~0|nor_conv_3x3\~1|skip_connect\~2|’)
|
| 303 |
+
15 # get results of each trial for a specific architecture
|
| 304 |
+
16 results $=$ api.query_by_index(arch_index, ’cifar100’)
|
| 305 |
+
17 print (’There are {:} trials for this architecture [{:}] on cifar100’. format(len(results), api[arch_index]))
|
| 306 |
+
|
| 307 |
+
Please see https://github.com/D-X-Y/NAS-Bench-201 for more kinds of usages. The benchmark data file for API can be downloaded online from https://drive.google.com/ file/d/1SKW0Cu0u8-gb18zDpaAGi0f74UdXeGKs/view.
|
md/train/HWX5j6Bv_ih/HWX5j6Bv_ih.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CROSS-NODE FEDERATED GRAPH NEURAL NETWORK FOR SPATIO-TEMPORAL DATA MODELING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Vast amount of data generated from networks of sensors, wearables, and the Internet of Things (IoT) devices underscores the need for advanced modeling techniques that leverage the spatio-temporal structure of decentralized data due to the need for edge computation and licensing (data access) issues. While federated learning (FL) has emerged as a framework for model training without requiring direct data sharing and exchange, effectively modeling the complex spatiotemporal dependencies to improve forecasting capabilities still remains an open problem. On the other hand, state-of-the-art spatio-temporal forecasting models assume unfettered access to the data, neglecting constraints on data sharing. To bridge this gap, we propose a federated spatio-temporal model – Cross-Node Federated Graph Neural Network (CNFGNN) – which explicitly encodes the underlying graph structure using graph neural network (GNN)-based architecture under the constraint of cross-node federated learning, which requires that data in a network of nodes is generated locally on each node and remains decentralized. CNFGNN operates by disentangling the temporal dynamics modeling on devices and spatial dynamics on the server, utilizing alternating optimization to reduce the communication cost, facilitating computations on the edge devices. Experiments on the traffic flow forecasting task show that CNFGNN achieves the best forecasting performance in both transductive and inductive learning settings with no extra computation cost on edge devices, while incurring modest communication cost.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Modeling the dynamics of spatio-temporal data generated from networks of edge devices or nodes (e.g. sensors, wearable devices and the Internet of Things (IoT) devices) is critical for various applications including traffic flow prediction (Li et al., 2018; Yu et al., 2018), forecasting (Seo et al., 2019; Azencot et al., 2020), and user activity detection (Yan et al., 2018; Liu et al., 2020). While existing works on spatio-temporal dynamics modeling (Battaglia et al., 2016; Kipf et al., 2018; Battaglia et al., 2018) assume that the model is trained with centralized data gathered from all devices, the volume of data generated at these edge devices precludes the use of such centralized data processing, and calls for decentralized processing where computations on the edge can lead to significant gains in improving the latency. In addition, in case of spatio-temporal forecasting, the edge devices need to leverage the complex inter-dependencies to improve the prediction performance. Moreover, with increasing concerns about data privacy and its access restrictions due to existing licensing agreements, it is critical for spatio-temporal modeling to utilize decentralized data, yet leveraging the underlying relationships for improved performance.
|
| 12 |
+
|
| 13 |
+
Although recent works in federated learning (FL) (Kairouz et al., 2019) provides a solution for training a model with decentralized data on multiple devices, these works either do not consider the inherent spatio-temporal dependencies (McMahan et al., 2017; Li et al., 2020b; Karimireddy et al., 2020) or only model it implicitly by imposing the graph structure in the regularization on model weights (Smith et al., 2017), the latter of which suffers from the limitation of regularization based methods due to the assumption that graphs only encode similarity of nodes (Kipf & Welling, 2017), and cannot operate in settings where only a fraction of devices are observed during training (inductive learning setting). As a result, there is a need for an architecture for spatio-temporal data modeling which enables reliable computation on the edge, while maintaining the data decentralized.
|
| 14 |
+
|
| 15 |
+
To this end, leveraging recent works on federated learning (Kairouz et al., 2019), we introduce the cross-node federated learning requirement to ensure that data generated locally at a node remains decentralized. Specifically, our architecture – Cross-Node Federated Graph Neural Network (CNFGNN), aims to effectively model the complex spatio-temporal dependencies under the cross-node federated learning constraint. For this, CNFGNN decomposes the modeling of temporal and spatial dependencies using an encoder-decoder model on each device to extract the temporal features with local data, and a Graph Neural Network (GNN) based model on the server to capture spatial dependencies among devices.
|
| 16 |
+
|
| 17 |
+
As compared to existing federated learning techniques that rely on regularization to incorporate spatial relationships, CNFGNN leverages an explicit graph structure using a graph neural networkbased (GNNs) architecture, which leads to performance gains. However, the federated learning (data sharing) constraint means that the GNN cannot be trained in a centralized manner, since each node can only access the data stored on itself. To address this, CNFGNN employs Split Learning (Singh et al., 2019) to train the spatial and temporal modules. Further, to alleviate the associated high communication cost incurred by Split Learning, we propose an alternating optimization-based training procedure of these modules, which incurs only half the communication overhead as compared to a comparable Split Learning architecture. Here, we also use Federated Averaging (FedAvg) (McMahan et al., 2017) to train a shared temporal feature extractor for all nodes, which leads to improved empirical performance.
|
| 18 |
+
|
| 19 |
+
Our main contributions are as follows :
|
| 20 |
+
|
| 21 |
+
1. We propose Cross-Node Federated Graph Neural Network (CNFGNN), a GNN-based federated learning architecture that captures complex spatio-temporal relationships among multiple nodes while ensuring that the data generated locally remains decentralized at no extra computation cost at the edge devices.
|
| 22 |
+
2. Our modeling and training procedure enables GNN-based architectures to be used in federated learning settings. We achieve this by disentangling the modeling of local temporal dynamics on edge devices and spatial dynamics on the central server, and leverage an alternating optimization-based procedure for updating the spatial and temporal modules using Split Learning and Federated Averaging to enable effective GNN-based federated learning.
|
| 23 |
+
3. We demonstrate that CNFGNN achieves the best prediction performance (both in transductive and inductive settings) at no extra computation cost on edge devices with modest communication cost, as compared to the related techniques on a traffic flow prediction task.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Our method derives elements from graph neural networks, federated learning and privacy-preserving graph learning, we now discuss related works in these areas in relation to our work.
|
| 28 |
+
|
| 29 |
+
Graph Neural Networks (GNNs). GNNs have shown their superior performance on various learning tasks with graph-structured data, including graph embedding (Hamilton et al., 2017), node classification (Kipf & Welling, 2017), spatio-temporal data modeling (Yan et al., 2018; Li et al., 2018; Yu et al., 2018) and multi-agent trajectory prediction (Battaglia et al., 2016; Kipf et al., 2018; Li et al., 2020a). Recent GNN models (Hamilton et al., 2017; Ying et al., 2018; You et al., 2019; Huang et al., 2018) also have sampling strategies and are able to scale on large graphs. While GNNs enjoy the benefit from strong inductive bias (Battaglia et al., 2018; Xu et al., 2019), most works require centralized data during the training and the inference processes.
|
| 30 |
+
|
| 31 |
+
Federated Learning (FL). Federated learning is a machine learning setting where multiple clients train a model in collaboration with decentralized training data (Kairouz et al., 2019). It requires that the raw data of each client is stored locally without any exchange or transfer. However, the decentralized training data comes at the cost of less utilization due to the heterogeneous distributions of data on clients and the lack of information exchange among clients. Various optimization algorithms have been developed for federated learning on non-IID and unbalanced data (McMahan et al., 2017; Li et al., 2020b; Karimireddy et al., 2020). Smith et al. (2017) propose a multi-task learning framework that captures relationships amongst data. While the above works mitigate the caveat of missing neighbors’ information to some extent, they are not as effective as GNN models and still suffer from the absence of feature exchange and aggregation.
|
| 32 |
+
|
| 33 |
+
Alternating Optimization. Alternating optimization is a popular choice in non-convex optimization (Agarwal et al., 2014; Arora et al., 2014; 2015; Jain & Kar, 2017). In the context of Federated Learning, Liang et al. (2020) uses alternating optimization for learning a simple global model and reduces the number of communicated parameters, and He et al. (2020) uses alternating optimization for knowledge distillation from server models to edge models. In our work, we utilize alternating optimization to effectively train on-device modules and the server module jointly, which captures temporal and spatial relationships respectively.
|
| 34 |
+
|
| 35 |
+
Privacy-Preserving Graph Learning. Suzumura et al. (2019) and Mei et al. (2019) use statistics of graph structures instead of node information exchange and aggregation to avoid the leakage of node information. Recent works have also incorporated graph learning models with privacypreserving techniques such as Differential Privacy (DP), Secure Multi-Party Computation (MPC) and Homomorphic Encryption (HE). Zhou et al. (2020) utilize MPC and HE when learning a GNN model for node classification with vertically split data to preserve silo-level privacy instead of nodelevel privacy. Sajadmanesh & Gatica-Perez (2020) preprocesses the input raw data with DP before feeding it into a GNN model. Composing privacy-preserving techniques for graph learning can help build federated learning systems following the privacy-in-depth principle, wherein the privacy properties degrade as gracefully as possible if one technique fails (Kairouz et al., 2019).
|
| 36 |
+
|
| 37 |
+
# 3 CROSS-NODE FEDERATED GRAPH NEURAL NETWORK
|
| 38 |
+
|
| 39 |
+
# 3.1 PROBLEM FORMULATION
|
| 40 |
+
|
| 41 |
+
Given a dataset with a graph $\mathcal { G } = ( \nu , \mathcal { E } )$ , a feature tensor $\pmb { \mathsf { X } } \in \mathbb { R } ^ { | \mathcal { V } | \times \hdots }$ and a label tensor ${ \pmb { \mathsf { Y } } } \in { }$ $\mathbb { R } ^ { | \nu | \times \dots }$ , we consider learning a model under the cross-node federated learning constraint: node feature $\pmb { x } _ { i } = \pmb { \mathrm { X } } _ { i , \dots }$ , node label $\begin{array} { r } { \mathbf { { y } } _ { i } = \mathbf { { Y } } _ { i , \dots } } \end{array}$ , and model output $\hat { y } _ { i }$ are only visible to the node $i$ .
|
| 42 |
+
|
| 43 |
+
One typical task that requires the cross-node federated learning constraint is the prediction of spatiotemporal data generated by a network of sensors. In such a scenario, $\nu$ is the set of sensors and $\mathcal { E }$ describes relations among sensors (e.g. $e _ { i j } \in \mathcal { E }$ if and only if the distance between $v _ { i }$ and $v _ { j }$ is below some threshold). The feature tensor $\pmb { x } _ { i } \in \mathbb { R } ^ { m \times D }$ represents the $i$ -th sensor’s records in the $D$ -dim space during the past $m$ time steps, and the label $\dot { \boldsymbol { y } } _ { i } \in \mathbb { R } ^ { n \times D }$ represents the $i$ -th sensor’s records in the future $n$ time steps. Since records collected on different sensors owned by different users/organizations may not be allowed to be shared due to the need for edge computation or licensing issues on data access, it is necessary to design an algorithm modeling the spatio-temporal relation without any direct exchange of node-level data.
|
| 44 |
+
|
| 45 |
+
# 3.2 PROPOSED METHOD
|
| 46 |
+
|
| 47 |
+
We now introduce our proposed Cross-Node Federated Graph Neural Network (CNFGNN) model. Here, we begin by disentangling the modeling of node-level temporal dynamics and server-level spatial dynamics as follows: (i) (Figure 1c) on each node, an encoder-decoder model extracts temporal features from data on the node and makes predictions; (ii) (Figure 1b) on the central server, a Graph Network (GN) (Battaglia et al., 2018) propagates extracted node temporal features and outputs node embeddings, which incorporate the relationship information amongst nodes. (i) has access to the not shareable node data and is executed on each node locally. (ii) only involves the upload and download of smashed features and gradients instead of the raw data on nodes. This decomposition enables the exchange and aggregation of node information under the cross-node federated learning constraint.
|
| 48 |
+
|
| 49 |
+
# 3.2.1 MODELING OF NODE-LEVEL TEMPORAL DYNAMICS
|
| 50 |
+
|
| 51 |
+
We modify the Gated Recurrent Unit (GRU) based encoder-decoder architecture in (Cho et al., 2014) for the modeling of node-level temporal dynamics on each node. Given an input sequence $\pmb { x } _ { i } \in \mathbb { R } ^ { m \times D }$ on the $i$ -th node, an encoder sequentially reads the whole sequence and outputs the
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+
(a) Overview of the training procedure.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
|
| 59 |
+
(b) Server-side Graph Network (GN).
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
(c) Encoder-decoder on the $_ { i }$ -th node.
|
| 63 |
+
Figure 1: Cross-Node Federated Graph Neural Network. (a) In each round of training, we alternately train models on nodes and the model on the server. More specifically, we sequentially execute: (1) Federated learning of on-node models. (2) Temporal encoding update. (3) Split Learning of GN. (4) On-node graph embedding update. (b) Detailed view of the server-side GN model for modeling spatial dependencies in data. (c) Detailed view of the encoder-decoder model on the $i$ -th node.
|
| 64 |
+
|
| 65 |
+
hidden state $h _ { c , i }$ as the summary of the input sequence according to Equation 1.
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { \pmb { h } _ { c , i } = E n c o d e r _ { i } ( \pmb { x } _ { i } , \pmb { h } _ { c , i } ^ { ( 0 ) } ) , } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where ${ h } _ { c , i } ^ { ( 0 ) }$ is a zero-valued initial hidden state vector.
|
| 72 |
+
|
| 73 |
+
To incorporate the spatial dynamics into the prediction model of each node, we concatenate $h _ { c , i }$ with the node embedding $h _ { G , c , i }$ generated from the procedure described in 3.2.2, which contains spatial information, as the initial state vector of the decoder. The decoder generates the prediction $\hat { y } _ { i }$ in an auto-regressive way starting from the last frame of the input sequence $x _ { i , m }$ with the concatenated hidden state vector.
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\hat { \pmb { y } } _ { i } = D e c o d e r _ { i } ( x _ { i , m } , [ \pmb { h } _ { c , i } ; \pmb { h } _ { G , c , i } ] ) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
We choose the mean squared error (MSE) between the prediction and the ground truth values as the loss function, which is evaluated on each node locally.
|
| 80 |
+
|
| 81 |
+
# 3.2.2 MODELING OF SPATIAL DYNAMICS
|
| 82 |
+
|
| 83 |
+
To capture the complex spatial dynamics, we adopt Graph Networks (GNs) proposed in (Battaglia et al., 2018) to generate node embeddings containing the relational information of all nodes. The central server collects the hidden state from all nodes $\{ h _ { c , i } \mid i \in \mathcal { V } \}$ as the input to the GN. Each layer of GN updates the input features as follows:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\begin{array} { r l r } & { { \mathbf e } _ { k } ^ { \prime } = \phi ^ { e } \left( { \mathbf e } _ { k } , { \mathbf v } _ { r _ { k } } , { \mathbf v } _ { s _ { k } } , { \mathbf u } \right) } & { \overline { { { \mathbf e } } } _ { i } ^ { \prime } = \rho ^ { e \to v } \left( E _ { i } ^ { \prime } \right) } \\ & { { \mathbf v } _ { i } ^ { \prime } = \phi ^ { v } \left( \overline { { { \mathbf e } } } _ { i } ^ { \prime } , { \mathbf v } _ { i } , { \mathbf u } \right) } & { \overline { { { \mathbf e } } } ^ { \prime } = \rho ^ { e \to u } \left( E ^ { \prime } \right) } \\ & { { \mathbf u } ^ { \prime } = \phi ^ { u } \left( \overline { { { \mathbf e } } } ^ { \prime } , \overline { { { \mathbf v } } } ^ { \prime } , { \mathbf u } \right) } & { \overline { { { \mathbf v } } } ^ { \prime } = \rho ^ { v \to u } \left( V ^ { \prime } \right) } \end{array} ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
# Algorithm 1 Training algorithm of CNFGNN on the server side.
|
| 90 |
+
|
| 91 |
+
# Server executes:
|
| 92 |
+
|
| 93 |
+
1: Initialize server-side GN weights θ GN , client model weigh ts θ¯(0)c {θ¯(0),encc , $\{ \bar { \bar { \theta } } _ { c } ^ { ( 0 ) , e n c } , \bar { \theta } _ { c } ^ { ( 0 ) , d e c } \} _ { . }$ .
|
| 94 |
+
2: for each node $i \in \mathcal V$ in parallel do
|
| 95 |
+
3: Initialize client model θ(0)c,i ${ \pmb \theta } _ { c , i } ^ { ( 0 ) } = \bar { \pmb \theta } _ { c } ^ { ( 0 ) }$ = θ¯(0)c .
|
| 96 |
+
4: raph encoding. on node $h _ { G , c , i } = h _ { G , c , i } ^ { ( 0 ) }$ end for
|
| 97 |
+
6: for global round $r _ { g } = 1 , 2 , \ldots , R _ { g }$ do
|
| 98 |
+
7: // (1) Federated learning of on-node models.
|
| 99 |
+
8: for each client $i \in \nu$ in parallel do
|
| 100 |
+
9: $\theta _ { c , i } \gets$ ClientUpdate $( i )$ .
|
| 101 |
+
11: 10: end for $\begin{array} { r } { \bar { \pmb { \theta } } _ { c } \sum _ { i \in \mathcal { V } } \frac { N _ { i } } { N } \pmb { \theta } _ { c , i } } \end{array}$ .
|
| 102 |
+
12: for each client $i \in \nu$ in parallel do
|
| 103 |
+
13: Initialize client model: $\theta _ { c , i } ^ { ( 0 ) } = \bar { \theta } _ { c }$
|
| 104 |
+
14: end for
|
| 105 |
+
15: // (2) Temporal encoding update.
|
| 106 |
+
16: for each client $i \in \nu$ in parallel do
|
| 107 |
+
17: $h _ { c , i } \gets$ ClientEncode $( i )$ .
|
| 108 |
+
18: end for
|
| 109 |
+
19: // (3) Split Learning of GN.
|
| 110 |
+
20: Initialize $\pmb { \theta } _ { G N } ^ { ( r _ { g } , 0 ) } = \pmb { \theta } _ { G N } ^ { ( r _ { g } - 1 ) }$
|
| 111 |
+
21: for server round $r _ { s } = 1 , 2 , \ldots , R _ { s }$ do
|
| 112 |
+
22: $\{ h _ { G , c , i } | i ~ \in ~ \mathcal { V } \} ~ ~ G N ( \{ h _ { c , i } | i ~ \in ~$
|
| 113 |
+
23 $\mathcal { V } \rbrace ; \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } - 1 ) } )$ . in prale o $i \in \nu$
|
| 114 |
+
24: $\nabla _ { h _ { G , c , i } } \ell _ { i } \gets$ ClientBackward( $_ { i , h _ { G , c , i } ) }$ .backward(
|
| 115 |
+
25: $\nabla _ { \pmb { \theta } ^ { ( r _ { g } , r _ { s } - 1 ) } } \ell _ { i } \gets \pmb { h } _ { G , c , i }$ $\overset { \scriptscriptstyle \mathrm { G } } { \nabla } _ { h _ { G , c , i } } \ell _ { i } )$ .
|
| 116 |
+
26: end for
|
| 117 |
+
27: $\begin{array} { r l } & { \nabla _ { \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } - 1 ) } } \ell \sum _ { i \in \mathcal { V } } \nabla _ { \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } - 1 ) } } \ell _ { i } . } \\ & { \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } ) } \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } - 1 ) } } \\ & { \qquad - \eta _ { s } \nabla _ { \pmb { \theta } _ { G N } ^ { ( r _ { g } , r _ { s } - 1 ) } } \ell . } \end{array}$
|
| 118 |
+
28:
|
| 119 |
+
29: end for
|
| 120 |
+
30: ${ \pmb \theta } _ { G N } ^ { ( r _ { g } ) } { \pmb \theta } _ { G N } ^ { ( r _ { g } , R _ { s } ) }$
|
| 121 |
+
31: // (4) On-node graph embedding update.
|
| 122 |
+
32: $\begin{array} { r l } & { \{ h _ { G , c , i } | i \in \mathcal { V } \} } \\ & { \quad G N ( \{ h _ { c , i } | i \in \mathcal { V } \} ; \theta _ { G N } ^ { ( r _ { g } ) } ) . } \end{array}$
|
| 123 |
+
33: for each client $i \in \mathcal V$ in parallel do
|
| 124 |
+
34: Set graph encoding on client as hG,c,i.
|
| 125 |
+
35: end for
|
| 126 |
+
36: end for
|
| 127 |
+
|
| 128 |
+
# Algorithm 2 Training algorithm of CNFGNN on the client side.
|
| 129 |
+
|
| 130 |
+
# ClientUpdate(i):
|
| 131 |
+
|
| 132 |
+
1: for client round $r _ { c } = 1 , 2 , \ldots , R _ { c } \ : _ { }$ do
|
| 133 |
+
2: $\pmb { h } _ { c , i } ^ { ( r _ { c } ) } \gets E n c o d e r _ { i } ( \pmb { x } _ { i } ; \pmb { \theta } _ { c , i } ^ { ( r _ { c } - 1 ) , e n c } )$
|
| 134 |
+
3: $\hat { \pmb { y } } _ { i } D e c o d e r _ { i }$ (
|
| 135 |
+
$x _ { i , m } , [ { h _ { c , i } ^ { ( r _ { c } ) } } ; { h _ { G , c , i } } ] ; \theta _ { c , i } ^ { ( r _ { c } - 1 ) , d e c } ) .$
|
| 136 |
+
4: 5: θ(rc)c,i ← θ(rc−1)c,i − ηc∇θ(rc−1)c,i \`i. $\ell _ { i } \gets \ell ( \hat { \pmb y } _ { i } , \pmb y )$ .
|
| 137 |
+
|
| 138 |
+
6: end for
|
| 139 |
+
|
| 140 |
+
7: θc,i = θ(Rc).
|
| 141 |
+
8: return $\theta _ { c , i }$ to server.
|
| 142 |
+
ClientEncode $\mathbf { \rho } ( i )$ :
|
| 143 |
+
1: return $\begin{array} { r c l } { { { h } } _ { { c } , i } } & { = } & { { E n c o d e r } _ { i } ( { \bf { x } } _ { i } ; { \bf { \bf { \theta } } } _ { c , i } ^ { e n c } ) } \end{array}$ to server.
|
| 144 |
+
ClientBackward $( i , h _ { G , c , i } )$ :
|
| 145 |
+
1: $\hat { \pmb { y } } _ { i } D e c o d e r _ { i } ( x _ { i , m } , [ h _ { c , i } ; h _ { G , c , i } ] ; \pmb { \theta } _ { c , i } ^ { d e c } )$ . 2: $\ell _ { i } \gets \ell ( \hat { \pmb y } _ { i } , \pmb y )$ .
|
| 146 |
+
3: return $\nabla _ { \boldsymbol { h } _ { G , c , i } } \ell _ { i }$ to server.
|
| 147 |
+
|
| 148 |
+
where $\mathbf { e } _ { k } , \mathbf { v } _ { i } , \mathbf { u }$ are edge features, node features and global features respectively. $\phi ^ { e } , \phi ^ { v } , \phi ^ { u }$ are neural networks. $\rho ^ { e v } , \rho ^ { e u } , \rho ^ { v u }$ are aggregation functions such as summation. As shown in Figure 1b, we choose a 2-layer GN with residual connections for all experiments. We set $\mathbf { v } _ { i } = h _ { c , i }$ , $\mathbf { e } _ { k } = W _ { r _ { k } , s _ { k } }$ $\cdot$ is the adjacency matrix) , and assign the empty vector to u as the input of the first GN layer. The server-side GN outputs embeddings $\{ h _ { G , c , i } \mid i \in \mathcal { V } \}$ for all nodes, and sends the embedding of each node correspondingly.
|
| 149 |
+
|
| 150 |
+
# 3.2.3 ALTERNATING TRAINING OF NODE-LEVEL AND SPATIAL MODELS
|
| 151 |
+
|
| 152 |
+
One challenge brought about by the cross-node federated learning requirement and the server-side GN model is the high communication cost in the training stage. Since we distribute different parts of the model on different devices, Split Learning proposed by (Singh et al., 2019) is a potential solution for training, where hidden vectors and gradients are communicated among devices. However, when we simply train the model end-to-end via Split Learning, the central server needs to receive hidden states from all nodes and to send node embeddings to all nodes in the forward propagation, then it must receive gradients of node embeddings from all nodes and send back gradients of hidden states to all nodes in the backward propagation. Assume all hidden states and node embeddings have the same size $S$ , the total amount of data transmitted in each training round of the GN model is $4 | \nu | S$ .
|
| 153 |
+
|
| 154 |
+
Table 1: Statistics of datasets PEMS-BAY and METR-LA.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Dataset</td><td>#Nodes</td><td># Directed Edges</td><td># Train Seq</td><td># Val Seq</td><td># Test Seq</td></tr><tr><td>PEMS-BAY</td><td>325</td><td>2369</td><td>36465</td><td>5209</td><td>10419</td></tr><tr><td>METR-LA</td><td>207</td><td>1515</td><td>23974</td><td>3425</td><td>6850</td></tr></table>
|
| 157 |
+
|
| 158 |
+
To alleviate the high communication cost in the training stage, we instead alternately train models on nodes and the GN model on the server. More specifically, in each round of training, we (1) fix the node embedding $h _ { G , c , i }$ and optimize the encoder-decoder model for $R _ { c }$ rounds, then (2) we optimize the GN model while fixing all models on nodes. Since models on nodes are fixed, $h _ { c , i }$ stays constant during the training of the GN model, and the server only needs to fetch $h _ { c , i }$ from nodes before the training of GN starts and only to communicate node embeddings and gradients. Therefore, the average amount of data transmitted in each round for $R s$ rounds of training of the GN model reduces to $\frac { 2 + \overline { { 2 } } R _ { s } } { R _ { s } } | \mathcal { V } | S$ . We provide more details of the training procedure in Algorithm 1 and Algorithm 2.
|
| 159 |
+
|
| 160 |
+
To more effectively extract temporal features from each node, we also train the encoder-decoder models on nodes with the FedAvg algorithm proposed in (McMahan et al., 2017). This enables all nodes to share the same feature extractor and thus share a joint hidden space of temporal features, which avoids the potential overfitting of models on nodes and demonstrates faster convergence and better prediction performance empirically.
|
| 161 |
+
|
| 162 |
+
# 4 EXPERIMENTS
|
| 163 |
+
|
| 164 |
+
We evaluate the performance of CNFGNN and all baseline methods on the traffic forecasting task, which is an important application for spatio-temporal data modeling. We reuse the following two real-world large-scale datasets in (Li et al., 2018) and follow the same preprocessing procedures: (1) PEMS-BAY: This dataset contains the traffic speed readings from 325 sensors in the Bay Area over 6 months from Jan 1st, 2017 to May 31st, 2017. (2) METR-LA: This dataset contains the traffic speed readings from 207 loop detectors installed on the highway of Los Angeles County over 4 months from Mar 1st, 2012 to Jun 30th, 2012.
|
| 165 |
+
|
| 166 |
+
For both datasets, we construct the adjacency matrix of sensors using the Gaussian kernel with a threshold: $W _ { i , j } = d _ { i , j }$ if $d _ { i , j } > = \kappa$ else 0, where $\begin{array} { r } { d _ { i , j } = \exp { ( - \frac { \mathrm { d i s t } ( v _ { i } , v _ { j } ) ^ { 2 } } { \sigma ^ { 2 } . } ) } , } \end{array}$ $\mathrm { d i s t } ( v _ { i } , v _ { j } )$ is the road network distance from sensor $v _ { i }$ to sensor $v _ { j }$ , $\sigma$ is the standard deviation of distances and $\kappa$ is the threshold. We set $\kappa = 0 . 1$ for both datasets.
|
| 167 |
+
|
| 168 |
+
We aggregate traffic speed readings in both datasets into 5-minute windows and truncate the whole sequence to multiple sequences with length 24. The forecasting task is to predict the traffic speed in the following 12 steps of each sequence given the first 12 steps. We show the statistics of both datasets in Table 1.
|
| 169 |
+
|
| 170 |
+
# 4.1 SPATIO-TEMPORAL DATA MODELING: TRAFFIC FLOW FORECASTING
|
| 171 |
+
|
| 172 |
+
Baselines We compare CNFGNN with the following baselines. (1) GRU (centralized): a Gated Recurrent Unit (GRU) model trained with centralized sensor data. (2) $\_$ (centralized): a model directly combining GRU and GN trained with centralized data, whose architecture is similar to CNFGNN but all GRU modules on nodes always share the same weights. We see its performance as the upper bound of the performance of CNFGNN. (3) GRU (local): for each node we train a GRU model with only the local data on it. (4) GRU $^ +$ FedAvg: a GRU model trained with the Federated Averaging algorithm (McMahan et al., 2017). (5) $\mathbf { G R U + F M T L }$ : for each node we train a GRU model using the federated multi-task learning (FMTL) with cluster regularization (Smith et al., 2017) given by the adjacency matrix. For each baseline, we have 2 variants of the GRU model to show the effect of on-device model complexity: one with 63K parameters and the other with 727K parameters. For CNFGNN, the encoder-decoder model on each node has 64K parameters and the GN model has 1M parameters.
|
| 173 |
+
|
| 174 |
+
Table 3: Comparison of the computation cost on edge devices and the communication cost. We use the amount of floating point operations (FLOPS) to measure the computational cost of models on edge devices. We also show the total size of data/parameters transmitted in the training stage (Train Comm Cost) until the model reaches its lowest validation error.
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Comp Cost On Device (GFLOPS)</td><td colspan="2">PEMS-BAY</td><td colspan="2">METR-LA</td></tr><tr><td>RMSE</td><td>Train Comm Cost (GB)</td><td>RMSE</td><td>Train Comm Cost (GB)</td></tr><tr><td>GRU (63K)+FMTL</td><td>0.159</td><td>3.961</td><td>57.823</td><td>11.548</td><td>99.201</td></tr><tr><td>GRU (727K) + FMTL</td><td>1.821</td><td>3.955</td><td>359.292</td><td>11.570</td><td>722.137</td></tr><tr><td>CNFGNN (64K + 1M)</td><td>0.162</td><td>3.822</td><td>237.654</td><td>11.487</td><td>222.246</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Discussion Table 2 shows the comparison of forecasting performance and Table 3 shows the comparison of computation cost on device and communication cost of CNFGNN and baselines. We make the following observations. Firstly, when we compare the best forecasting performance of each baseline over the 2 GRU variants, GRU trained with FedAvg performs the worst in terms of forecasting performance compared to GRU trained with centralized data and GRU trained with local data (4.432 vs 4.010/4.124 on PEMS-BAY and 12.058 vs 11.730/11.801 on METRLA), showing that the data distributions on different nodes are highly heterogeneous, and training one single model ignoring the heterogeneity is suboptimal.
|
| 179 |
+
|
| 180 |
+
Table 2: Comparison of performance on the traffic flow forecasting task. We use the Rooted Mean Squared Error (RMSE) to evaluate the forecasting performance.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Method</td><td>PEMS-BAY</td><td>METR-LA</td></tr><tr><td>GRU (centralized, 63K)</td><td>4.124</td><td>11.730</td></tr><tr><td>GRU (centralized, 727K) GRU + GN</td><td>4.128</td><td>11.787</td></tr><tr><td>(centralized, 64K + 1M)</td><td>3.816</td><td>11.471</td></tr><tr><td>GRU (local, 63K)</td><td>4.010</td><td>11.801</td></tr><tr><td>GRU (local, 727K)</td><td>4.152</td><td>12.224</td></tr><tr><td>GRU (63K) + FedAvg</td><td>4.512</td><td>12.132</td></tr><tr><td>GRU (727K) + FedAvg</td><td>4.432</td><td>12.058</td></tr><tr><td>GRU (63K)+FMTL</td><td>3.961</td><td>11.548</td></tr><tr><td>GRU (727K) + FMTL</td><td>3.955</td><td>11.570</td></tr><tr><td>CNFGNN (64K + 1M)</td><td>3.822</td><td>11.487</td></tr></table>
|
| 183 |
+
|
| 184 |
+
Secondly, both the $\mathrm { G R U + F M T L }$ baseline and CNFGNN consider the spatial relations among nodes and show better forecasting performance than baselines without relation information. This shows that the modeling of spatial dependencies is critical for the forecasting task.
|
| 185 |
+
|
| 186 |
+
Lastly, CNFGNN achieves the lowest forecasting error on both datasets. The baselines that increases the complexity of on-device models (GRU $( 7 2 7 \mathrm { K } ) + \mathrm { F M T L }$ ) gains slight or even no improvement at the cost of higher computation cost on edge devices and larger communication cost. However, due to its effective modeling of spatial dependencies in data, CNFGNN not only has the largest improvement of forecasting performance, but also keeps the computation cost on devices almost unchanged and maintains modest communication cost compared to baselines increasing the model complexity on devices.
|
| 187 |
+
|
| 188 |
+
# 4.2 INDUCTIVE LEARNING ON UNSEEN NODES
|
| 189 |
+
|
| 190 |
+
Set-up Another advantage of CNFGNN is that it can conduct inductive learning and generalize to larger graphs with nodes unobserved during the training stage. We evaluate the performance of CNFGNN under the following inductive learning setting: for each dataset, we first sort all sensors based on longitudes, then use the subgraph on the first $\eta \%$ of sensors to train the model and evaluate the trained model on the entire graph. For each dataset we select $\eta \% = 2 5 \%$ , $5 0 \%$ , $7 5 \%$ . Over all baselines following the cross-node federated learning constraint, GRU (local) and $\mathrm { G R U + F M T L }$ requires training new models on unseen nodes and only GRU $^ +$ FedAvg is applicable to the inductive learning setting.
|
| 191 |
+
|
| 192 |
+
Table 4: Inductive learning performance measured with rooted mean squared error (RMSE).
|
| 193 |
+
|
| 194 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">PEMS-BAY</td><td colspan="3">METR-LA</td></tr><tr><td>25%</td><td>50%</td><td>75%</td><td>25%</td><td>50%</td><td>75%</td></tr><tr><td>GRU (63K) + FedAvg</td><td>4.863</td><td>4.847</td><td>4.859</td><td>11.993</td><td>12.104</td><td>12.014</td></tr><tr><td>CNFGNN (64K + 1M)</td><td>4.541</td><td>4.598</td><td>4.197</td><td>12.013</td><td>11.815</td><td>11.676</td></tr></table>
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 2: Validation loss during the training stage of different training strategies.
|
| 198 |
+
|
| 199 |
+
Discussion Table 4 shows the performance of inductive learning of CNFGNN and GRU $^ +$ FedAvg baseline on both datasets. We observe that under most settings, CNFGNN outperforms the $\mathrm { G R U + }$ FedAvg baseline (except on the METR-LA dataset with $2 5 \%$ nodes observed in training, where both models perform similarly), showing that CNFGNN has the stronger ability of generalization.
|
| 200 |
+
|
| 201 |
+
4.3 ABLATION STUDY: EFFECT OF ALTERNATING TRAINING AND FEDAVG ON NODE-LEVEL AND SPATIAL MODELS
|
| 202 |
+
|
| 203 |
+
Baselines We compare the effect of different training strategies of CNFGNN: (1) Centralized: CNFGNN trained with centralized data where all nodes share one single encoder-decoder. (2)
|
| 204 |
+
|
| 205 |
+
Table 5: Comparison of test error (RMSE) and the communication cost during training of different training strategies of CNFGNN.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">PEMS-BAY</td><td colspan="2">METR-LA</td></tr><tr><td>RMSE</td><td>Train Comm Cost (GB)</td><td>RMSE</td><td>Train Comm Cost (GB)</td></tr><tr><td>Centralized</td><td>3.816</td><td></td><td>11.471</td><td></td></tr><tr><td>SL</td><td>3.914</td><td>350.366</td><td>12.186</td><td>307.627</td></tr><tr><td>SL + FedAvg</td><td>4.383</td><td>80.200</td><td>11.631</td><td>343.031</td></tr><tr><td>AT, w/o FedAvg</td><td>4.003</td><td>5221.576</td><td>11.912</td><td>2434.985</td></tr><tr><td>AT +FedAvg</td><td>3.822</td><td>237.654</td><td>11.487</td><td>222.246</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Split Learning (SL): CNFGNN trained with split learning (Singh et al., 2019), where models on nodes and the model on the server are jointly trained by exchanging hidden vectors and gradients. (3) Split
|
| 210 |
+
|
| 211 |
+
Learning $^ +$ FedAvg $\mathrm { \bf S L + }$ FedAvg): A variant of SL that synchronizes the weights of encoderdecoder modules periodically with FedAvg. (4) Alternating training without Federated Averaging of models on nodes (AT, w/o FedAvg). (5) Alternating training with Federated Averaging on nodes described in Section 3.2.3 $\mathbf { \Delta A T } + \mathbf { F e d A v g }$ ).
|
| 212 |
+
|
| 213 |
+
Discussion Figure 2 shows the validation loss during training of different training strategies on PEMS-BAY and METR-LA datasets, and Table 5 shows their prediction performance and the communication cost in training. We notice that (1) SL suffers from suboptimal prediction performance and high communication costs on both datasets; SL $^ +$ FedAvg does not have consistent results on both datasets and its performance is always inferior to AT $\cdot$ FedAvg. AT $\cdot$ FedAvg consistently outperforms other baselines on both datasets, including its variant without FedAvg. (2) AT $^ +$ FedAvg has the lowest communication cost on METR-LA and the 2nd lowest communication cost on PEMS-BAY, on which the baseline with the lowest communication cost ( $\mathrm { S L } +$ FedAvg) has a much higher prediction error (4.383 vs 3.822). Both illustrate that our proposed training strategy, $\mathrm { S L } +$ FedAvg, achieves the best prediction performance as well as low communication cost compared to other baseline strategies.
|
| 214 |
+
|
| 215 |
+
# 4.4 ABLATION STUDY: EFFECT OF CLIENT ROUNDS AND SERVER ROUNDS
|
| 216 |
+
|
| 217 |
+
Set-up We further investigate the effect of different compositions of the number of client rounds $( R _ { s } )$ in Algorithm 2 and the number of server rounds $( R _ { c } )$ in Algorithm 1. To this end, we vary both $R _ { c }$ and $R _ { s }$ over [1,10,20].
|
| 218 |
+
|
| 219 |
+
Discussion Figure 3 shows the forecasting performance (measured with RMSE) and the total communication cost in the training of CNFGNN under all compositions of $( R _ { c }$ , $R _ { s }$ ) on the METR-LA dataset. We observe that: (1) Models with lower ${ \cal R } _ { c } / { \cal R } _ { s }$ ratios $( R _ { c } / R _ { s } ~ < ~ 0 . 5 )$ tend to have lower forecasting errors while models with higher ${ \cal R } _ { c } / { \cal R } _ { s }$ ratios $( R _ { c } / R _ { s } > 2 )$ have lower communication cost in training. This is because the lower ratio of ${ \cal R } _ { c } / { \cal R } _ { s }$ encourages more frequent exchange of node information at the expense of higher communication cost, while the higher ratio of ${ \cal R } _ { c } / { \cal R } _ { s }$ acts in the opposite way. (2) Models with similar ${ \cal R } _ { c } / { \cal R } _ { s }$ ratios have similar communication costs, while those with lower
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 3: Effect of client rounds and server rounds $( R _ { c } , R _ { s } )$ on forecasting performance and communication cost.
|
| 223 |
+
|
| 224 |
+
$R _ { c }$ values perform better, corroborating our observation in (1) that frequent node information exchange improves the forecasting performance.
|
| 225 |
+
|
| 226 |
+
# 5 CONCLUSION
|
| 227 |
+
|
| 228 |
+
We propose Cross-Node Federated Graph Neural Network (CNFGNN), which bridges the gap between modeling complex spatio-temporal data and decentralized data processing by enabling the use of graph neural networks (GNNs) in the federated learning setting. We accomplish this by decoupling the learning of local temporal models and the server-side spatial model using alternating optimization of spatial and temporal modules based on split learning and federated averaging. Our experimental results on traffic flow prediction on two real-world datasets show superior performance as compared to competing techniques. Our future work includes applying existing GNN models with sampling strategies and integrating them into CNFGNN for large-scale graphs, extending CNFGNN to a fully decentralized framework, and incorporating existing privacy-preserving methods for graph learning to CNFGNN, to enhance federated learning of spatio-temporal dynamics.
|
| 229 |
+
|
| 230 |
+
# REFERENCES
|
| 231 |
+
|
| 232 |
+
Alekh Agarwal, Animashree Anandkumar, Prateek Jain, Praneeth Netrapalli, and Rashish Tandon. Learning sparsely used overcomplete dictionaries. In Conference on Learning Theory, pp. 123– 137, 2014.
|
| 233 |
+
|
| 234 |
+
Sanjeev Arora, Rong Ge, and Ankur Moitra. New algorithms for learning incoherent and overcomplete dictionaries. In Conference on Learning Theory, pp. 779–806, 2014.
|
| 235 |
+
|
| 236 |
+
Sanjeev Arora, Rong Ge, Tengyu Ma, and Ankur Moitra. Simple, efficient, and neural algorithms for sparse coding. 2015.
|
| 237 |
+
|
| 238 |
+
Omri Azencot, N Benjamin Erichson, Vanessa Lin, and Michael W Mahoney. Forecasting sequential data using consistent koopman autoencoders. In ICML, 2020.
|
| 239 |
+
|
| 240 |
+
Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In Advances in neural information processing systems, pp. 4502–4510, 2016.
|
| 241 |
+
|
| 242 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 243 |
+
|
| 244 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734, 2014.
|
| 245 |
+
|
| 246 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017.
|
| 247 |
+
|
| 248 |
+
Chaoyang He, Salman Avestimehr, and Murali Annavaram. Group knowledge transfer: Collaborative training of large cnns on the edge. arXiv preprint arXiv:2007.14513, 2020.
|
| 249 |
+
|
| 250 |
+
Wenbing Huang, Tong Zhang, Yu Rong, and Junzhou Huang. Adaptive sampling towards fast graph representation learning. In Advances in neural information processing systems, pp. 4558–4567, 2018.
|
| 251 |
+
|
| 252 |
+
Prateek Jain and Purushottam Kar. Non-convex optimization for machine learning. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 10(3-4):142–363, 2017. ISSN 1935-8237. doi: 10.1561/ 2200000058. URL http://dx.doi.org/10.1561/2200000058.
|
| 253 |
+
|
| 254 |
+
Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurelien Bellet, Mehdi Bennis, Arjun Nitin ´ Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 255 |
+
|
| 256 |
+
Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank J Reddi, Sebastian U Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In Proceedings of the 37th International Conference on Machine Learning, 2020.
|
| 257 |
+
|
| 258 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 259 |
+
|
| 260 |
+
Thomas N Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard S Zemel. Neural relational inference for interacting systems. In ICML, 2018.
|
| 261 |
+
|
| 262 |
+
Max Guangyu Li, Bo Jiang, Hao Zhu, Zhengping Che, and Yan Liu. Generative attention networks for multi-agent behavioral modeling. In AAAI, 2020a.
|
| 263 |
+
|
| 264 |
+
Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. In Proceedings of the 3rd MLSys Conference, 2020b.
|
| 265 |
+
|
| 266 |
+
Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In International Conference on Learning Representations (ICLR ’18), 2018.
|
| 267 |
+
|
| 268 |
+
Paul Pu Liang, Terrance Liu, Liu Ziyin, Ruslan Salakhutdinov, and Louis-Philippe Morency. Think locally, act globally: Federated learning with local and global representations. arXiv preprint arXiv:2001.01523, 2020.
|
| 269 |
+
|
| 270 |
+
Ziyu Liu, Hongwen Zhang, Zhenghao Chen, Zhiyong Wang, and Wanli Ouyang. Disentangling and unifying graph convolutions for skeleton-based action recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 143–152, 2020.
|
| 271 |
+
|
| 272 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pp. 1273–1282. PMLR, 2017.
|
| 273 |
+
|
| 274 |
+
Guangxu Mei, Ziyu Guo, Shijun Liu, and Li Pan. Sgnn: A graph neural network based federated learning approach by hiding structure. In 2019 IEEE International Conference on Big Data (Big Data), pp. 2560–2568. IEEE, 2019.
|
| 275 |
+
|
| 276 |
+
Sina Sajadmanesh and Daniel Gatica-Perez. When differential privacy meets graph neural networks. arXiv preprint arXiv:2006.05535, 2020.
|
| 277 |
+
|
| 278 |
+
Sungyong Seo, Chuizheng Meng, and Yan Liu. Physics-aware difference graph networks for sparsely-observed dynamics. In International Conference on Learning Representations, 2019.
|
| 279 |
+
|
| 280 |
+
Abhishek Singh, Praneeth Vepakomma, Otkrist Gupta, and Ramesh Raskar. Detailed comparison of communication efficiency of split learning and federated learning. arXiv preprint arXiv:1909.09145, 2019.
|
| 281 |
+
|
| 282 |
+
Virginia Smith, Chao-Kai Chiang, Maziar Sanjabi, and Ameet S Talwalkar. Federated multi-task learning. In Advances in Neural Information Processing Systems, pp. 4424–4434, 2017.
|
| 283 |
+
|
| 284 |
+
Toyotaro Suzumura, Yi Zhou, Natahalie Barcardo, Guangnan Ye, Keith Houck, Ryo Kawahara, Ali Anwar, Lucia Larise Stavarache, Daniel Klyashtorny, Heiko Ludwig, et al. Towards federated graph learning for collaborative financial crimes detection. arXiv preprint arXiv:1909.12946, 2019.
|
| 285 |
+
|
| 286 |
+
Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In International Conference on Learning Representations (ICLR), 2019.
|
| 287 |
+
|
| 288 |
+
Sijie Yan, Yuanjun Xiong, and Dahua Lin. Spatial temporal graph convolutional networks for skeleton-based action recognition. In AAAI, 2018.
|
| 289 |
+
|
| 290 |
+
Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 974– 983, 2018.
|
| 291 |
+
|
| 292 |
+
Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In Proceedings of the 36th International Conference on Machine Learning, 2019.
|
| 293 |
+
|
| 294 |
+
Bing Yu, Haoteng Yin, and Zhanxing Zhu. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. In Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI), 2018.
|
| 295 |
+
|
| 296 |
+
Jun Zhou, Chaochao Chen, Longfei Zheng, Xiaolin Zheng, Bingzhe Wu, Ziqi Liu, and Li Wang. Privacy-preserving graph neural network for node classification. arXiv preprint arXiv:2005.11903, 2020.
|
| 297 |
+
|
| 298 |
+
# A APPENDIX
|
| 299 |
+
|
| 300 |
+
A.1 DETAILED EXPERIMENT SETTINGS
|
| 301 |
+
|
| 302 |
+
Unless noted otherwise, all models are optimized using the Adam optimizer with the learning rate 1e-3.
|
| 303 |
+
|
| 304 |
+
GRU (centralized) : Gated Recurrent Unit (GRU) model trained with centralized sensor data. The GRU model with 63K parameters is a 1-layer GRU with hidden dimension 100, and the GRU model with 727K parameters is a 2-layer GRU with hidden dimension 200.
|
| 305 |
+
|
| 306 |
+
GRU (local) We train one GRU model for each node with the local data only.
|
| 307 |
+
|
| 308 |
+
GRU $^ +$ FedAvg We train a single GRU model with Federated Averaging (McMahan et al., 2017).
|
| 309 |
+
We select 1 as the number of local epochs.
|
| 310 |
+
|
| 311 |
+
$\mathbf { G R U } + \mathbf { F M T L }$ We train one GRU model for each node using the federated multi-task learning (FMTL) with cluster regularization (Smith et al., 2017) given by the adjacency matrix. More specifically, the cluster regularization (without the L2-norm regularization term) takes the following form:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\mathcal { R } ( W , \mathfrak { L } ) = \lambda \mathrm { t r } ( W \Omega W ^ { T } ) .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Given the constructed adjacency matrix $\pmb { A }$ , $\begin{array} { r } { \pmb { \Omega } = \frac { 1 } { | \mathcal { V } | } ( \pmb { D } - \pmb { A } ) = \frac { 1 } { | \mathcal { V } | } \pmb { L } } \end{array}$ , where $_ { D }$ is the degree matrix and $\pmb { L }$ is the Laplacian matrix. Equation A1 can be reformulated as:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l } { { \mathcal { R } ( W , \pmb { \Omega } ) = \lambda \mathrm { t r } ( W \pmb { \Omega } W ^ { T } ) = \frac { \lambda } { | \mathcal { V } | } \mathrm { t r } ( W \pmb { L } W ^ { T } ) } } \\ & { = \frac { \lambda } { | \mathcal { V } | } \mathrm { t r } ( \displaystyle \sum _ { i \in \mathcal { V } } \pmb { w } _ { i } \displaystyle \sum _ { j \not = i } a _ { i j } \pmb { w } _ { i } ^ { T } - \displaystyle \sum _ { j \not = i } \pmb { w } _ { i } a _ { i j } \pmb { w } _ { j } ^ { T } ) } \\ & { = \lambda _ { 1 } ( \displaystyle \sum _ { i \in \mathcal { V } } \displaystyle \sum _ { j \not = i } \alpha _ { i , j } \langle \pmb { w } _ { i } , \pmb { w } _ { i } - \pmb { w } _ { j } \rangle ) . } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
We implement the cluster regularization via sharing model weights between each pair of nodes connected by an edge and select $\lambda _ { 1 } = 0 . 1$ .
|
| 324 |
+
|
| 325 |
+
CNFGNN We use a GRU-based encoder-decoder model as the model on nodes, which has 1 GRU layer and hidden dimension 64. We use a 2-layer Graph Network (GN) with residual connections as the Graph Neural Network model on the server side. We use the same network architecture for the edge/node/global update function in each GN layer: a multi-layer perceptron (MLP) with 3 hidden layers, whose sizes are [256, 256, 128] respectively. We choose $R _ { c } = 1 , R _ { s } = 2 0$ for experiments on PEMS-BAY, and $R _ { c } = 1 , R _ { s } = 1$ for METR-LA.
|
| 326 |
+
|
| 327 |
+
# A.2 CALCULATION OF COMMUNICATION COST
|
| 328 |
+
|
| 329 |
+
We denote $R$ as the number of communication rounds for one model to reach the lowest validation error in the training stage.
|
| 330 |
+
|
| 331 |
+
$\mathbf { G R U + F M T L }$ Using Equation A2, in each communication round, each pair of nodes exchange their model weights, thus the total communicated data amount is calculated as:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
R \times \# \mathrm { n o n s e l f ~ d i r e c t e d ~ e d g e s } \times \mathrm { s i z e ~ o f ~ n o d e ~ m o d e l ~ w e i g h t s } .
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
CNFGNN (AT $^ +$ FedAvg) In each communication round, the central server fetches and sends back model weights to each node for Federated Averaging, and transmits hidden vectors and gradients for Split Learning. The total communicated data amount is calculated as:
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { r l } & { R \times ( \mathrm { \# n o d e s } \times \mathrm { s i z e ~ o f ~ n o d e ~ m o d e l ~ w e i g h t s } \times 2 } \\ & { \quad + ( 1 + 2 * \mathrm { s e r v e r ~ r o u n d } + 1 ) \times \mathrm { \# n o d e s } \times \mathrm { h i d d e n ~ s t a t e ~ s i z e } ) . } \end{array}
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
CNFGNN (SL) In each communication round, each node sends and fetches hidden vectors and graidents twice (one for encoder, the other for decoder) and the total communicated data amount is:
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
-
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
CNFGNN $\mathrm { \bf { S L + } }$ FedAvg) Compared to CNFGNN (SL), the method has extra communcation cost for FedAvg in each round, thus the total communicated data amount is:
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
-
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
CNFGNN (AT, w/o FedAvg) Compared to CNFGNN (AT $^ +$ FedAvg), there is no communcation cost for the FedAvg part, thus the total communcated data amount is:
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
-
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Table A1: Parameters used for calculating the communication cost of $\mathrm { G R U + F M T L }$ .
|
| 362 |
+
|
| 363 |
+
<table><tr><td colspan="2">Method</td><td colspan="2">GRU (63K) + FMTL GRU (727K) + FMTL</td></tr><tr><td colspan="2">Node Model Weights Size (GB)</td><td>2.347E-4</td><td>2.708E-3</td></tr><tr><td rowspan="3">PEMS-BAY</td><td>#Nonself Directed Edges</td><td>2369</td><td></td></tr><tr><td>R</td><td>104</td><td>56</td></tr><tr><td>Train Comm Cost (GB)</td><td>57.823</td><td>359.292</td></tr><tr><td rowspan="3">METR-LA</td><td>#Nonself Directed Edges</td><td></td><td>1515</td></tr><tr><td>R</td><td>279</td><td>176</td></tr><tr><td>Train Comm ( Cost (GB)</td><td>99.201</td><td>722.137</td></tr></table>
|
| 364 |
+
|
| 365 |
+
Table A2: Parameters used for calculating the communication cost of CNFGNN (AT $\cdot$ FedAvg).
|
| 366 |
+
|
| 367 |
+
<table><tr><td>Node Model Weights Size (GB)</td><td colspan="2">2.384E-4</td></tr><tr><td rowspan="3">PEMS-BAY</td><td>#Nodes</td><td>325</td></tr><tr><td>Hidden State Size (GB) Server Round</td><td>2.173E-3 20</td></tr><tr><td>R</td><td>2</td></tr><tr><td rowspan="3">METR-LA</td><td>Train Comm Cost (GB) #Nodes</td><td>237.654 207</td></tr><tr><td>Hidden State Size (GB)</td><td>1.429E-3</td></tr><tr><td>Server Round R</td><td>1 46</td></tr></table>
|
| 368 |
+
|
| 369 |
+
# A.3 INDUCTIVE LEARNING
|
| 370 |
+
|
| 371 |
+
We have added results using $\cdot$ and $5 \%$ data on both datasets and we show the table of inductive learning results as Table A6. We observe that: (1) With the portion of visible nodes in the training stage increasing, the prediction error of CNFGNN decreases drastically. However, the increase of the portion of visible nodes has negligible contribution to the performance of GRU $\cdot$ FedAvg after the portion surpasses $\cdot$ . Since increasing the ratio of seen nodes in training introduces more complex relationships among nodes to the training data, the difference of performance illustrates that CNFGNN has a stronger capability of capturing complex spatial relationships. (2) When the ratio of visible nodes in training is extremely low $\cdot$ , there is not enough spatial relationship information in the training data to train the GN module in CNFGNN, and the performance of CNFGNN may not be ideal. We visualize the subgraphs visible in training under different ratios in Figure A1. However, as long as the training data covers a moderate portion of the spatial information of the whole graph, CNFGNN can still leverage the learned spatial connections among nodes effectively and outperforms GRU $+$ FedAvg. We empirically show that the necessary ratio can vary for different datasets ( $2 5 \%$ for PEMS-BAY and $\cdot$ for METR-LA).
|
| 372 |
+
|
| 373 |
+
Table A3: Parameters used for calculating the communication cost of CNFGNN (SL).
|
| 374 |
+
|
| 375 |
+
<table><tr><td rowspan="2">PEMS-BAY</td><td>#Nodes Hidden State Size (GB) R</td><td>325 2.173E-3 31</td></tr><tr><td>Train Comm Cost (GB)</td><td>350.366</td></tr><tr><td rowspan="3">METR-LA</td><td>#Nodes Hidden State Size (GB)</td><td>207 1.429E-3</td></tr><tr><td>R</td><td>65</td></tr><tr><td>Train Comm Cost (GB)</td><td>307.627</td></tr></table>
|
| 376 |
+
|
| 377 |
+
Table A4: Parameters used for calculating the communication cost of CNFGNN (SL $^ +$ FedAvg).
|
| 378 |
+
Table A5: Parameters used for calculating the communication cost of CNFGNN (AT, w/o FedAvg).
|
| 379 |
+
|
| 380 |
+
<table><tr><td>Node Model Weights Size (GB)</td><td colspan="2">2.384E-4</td></tr><tr><td>PEMS-BAY</td><td>#Nodes Hidden State Size (GB) R Train Comm Cost (GB)</td><td>325 2.173E-3 7 80.200</td></tr><tr><td>METR-LA</td><td>#Nodes Hidden State Size (GB) R Train Comm Cost (GB)</td><td>207 1.429E-3 71 343.031</td></tr></table>
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure A1: Visualization of subgraphs visible in training under different ratios.
|
| 384 |
+
|
| 385 |
+
Table A6: Inductive learning performance measured with rooted mean squared error (RMSE).
|
| 386 |
+
|
| 387 |
+
<table><tr><td rowspan="2">Method</td><td colspan="5">PEMS-BAY</td><td colspan="5">METR-LA</td></tr><tr><td>5%</td><td>25%</td><td>50%</td><td>75%</td><td>90%</td><td>5%</td><td>25%</td><td>50%</td><td>75%</td><td>90%</td></tr><tr><td>GRU (63K)+ FedAvg</td><td>5.087</td><td>4.863</td><td>4.847</td><td>4.859</td><td>4.866</td><td>12.128</td><td>11.993</td><td>12.104</td><td>12.014</td><td>12.016</td></tr><tr><td>CNFGNN (64K + 1M)</td><td>5.869</td><td>4.541</td><td>4.598</td><td>4.197</td><td>3.942</td><td>13.931</td><td>12.013</td><td>11.815</td><td>11.676</td><td>11.629</td></tr></table>
|
| 388 |
+
|
| 389 |
+
# A.4 THE HISTOGRAMS OF DATA ON DIFFERENT NODES
|
| 390 |
+
|
| 391 |
+
We show the histograms of traffic speed on different nodes of PEMS-BAY and METR-LA in Figure A2. For each dataset, we only show the first 100 nodes ranked by their IDs for simplicity. The histograms show that the data distribution varies with nodes, thus data on different nodes are not independent and identically distributed.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure A2: The histograms of data on the first 100 nodes ranked by ID.
|
md/train/HkezXnA9YX/HkezXnA9YX.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SYSTEMATIC GENERALIZATION: WHAT IS REQUIRED AND CAN IT BE LEARNED?
|
| 2 |
+
|
| 3 |
+
Dzmitry Bahdanau∗ Mila, Universite de Montr´ eal´ AdeptMind Scholar Element AI
|
| 4 |
+
|
| 5 |
+
Shikhar Murty∗ Mila, Universite de Montr ´ eal ´
|
| 6 |
+
|
| 7 |
+
Michael Noukhovitch Mila, Universite de Montr ´ eal ´
|
| 8 |
+
|
| 9 |
+
Thien Huu Nguyen University of Oregon
|
| 10 |
+
|
| 11 |
+
Harm de Vries Mila, Universite de Montr´ eal´
|
| 12 |
+
|
| 13 |
+
Aaron Courville
|
| 14 |
+
Mila, Universite de Montr´ eal´
|
| 15 |
+
CIFAR Fellow
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
Numerous models for grounded language understanding have been recently proposed, including (i) generic models that can be easily adapted to any given task and (ii) intuitively appealing modular models that require background knowledge to be instantiated. We compare both types of models in how much they lend themselves to a particular form of systematic generalization. Using a synthetic VQA test, we evaluate which models are capable of reasoning about all possible object pairs after training on only a small subset of them. Our findings show that the generalization of modular models is much more systematic and that it is highly sensitive to the module layout, i.e. to how exactly the modules are connected. We furthermore investigate if modular models that generalize well could be made more end-to-end by learning their layout and parametrization. We find that endto-end methods from prior work often learn inappropriate layouts or parametrizations that do not facilitate systematic generalization. Our results suggest that, in addition to modularity, systematic generalization in language understanding may require explicit regularizers or priors.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION
|
| 22 |
+
|
| 23 |
+
In recent years, neural network based models have become the workhorse of natural language understanding and generation. They empower industrial machine translation (Wu et al., 2016) and text generation (Kannan et al., 2016) systems and show state-of-the-art performance on numerous benchmarks including Recognizing Textual Entailment (Gong et al., 2017), Visual Question Answering (Jiang et al., 2018), and Reading Comprehension (Wang et al., 2018). Despite these successes, a growing body of literature suggests that these approaches do not generalize outside of the specific distributions on which they are trained, something that is necessary for a language understanding system to be widely deployed in the real world. Investigations on the three aforementioned tasks have shown that neural models easily latch onto statistical regularities which are omnipresent in existing datasets (Agrawal et al., 2016; Gururangan et al., 2018; Jia & Liang, 2017) and extremely hard to avoid in large scale data collection. Having learned such dataset-specific solutions, neural networks fail to make correct predictions for examples that are even slightly out of domain, yet are trivial for humans. These findings have been corroborated by a recent investigation on a synthetic instruction-following task (Lake & Baroni, 2018), in which seq2seq models (Sutskever et al., 2014; Bahdanau et al., 2015) have shown little systematicity (Fodor & Pylyshyn, 1988) in how they generalize, that is they do not learn general rules on how to compose words and fail spectacularly when for example asked to interpret “jump twice” after training on “jump”, “run twice” and “walk twice”.
|
| 24 |
+
|
| 25 |
+
An appealing direction to improve the generalization capabilities of neural models is to add modularity and structure to their design to make them structurally resemble the kind of rules they are supposed to learn (Andreas et al., 2016; Gaunt et al., 2016). For example, in the Neural Module Network paradigm (NMN, Andreas et al. (2016)), a neural network is assembled from several neural modules, where each module is meant to perform a particular subtask of the input processing, much like a computer program composed of functions. The NMN approach is intuitively appealing but its widespread adoption has been hindered by the large amount of domain knowledge that is required to decide (Andreas et al., 2016) or predict (Johnson et al., 2017; Hu et al., 2017) how the modules should be created (parametrization) and how they should be connected (layout) based on a natural language utterance. Besides, their performance has often been matched by more traditional neural models, such as FiLM (Perez et al., 2017), Relations Networks (Santoro et al., 2017), and MAC networks (Hudson & Manning, 2018). Lastly, generalization properties of NMNs, to the best of our knowledge, have not been rigorously studied prior to this work.
|
| 26 |
+
|
| 27 |
+
Here, we investigate the impact of explicit modularity and structure on systematic generalization of NMNs and contrast their generalization abilities to those of generic models. For this case study, we focus on the task of visual question answering (VQA), in particular its simplest binary form, when the answer is either “yes” or “no”. Such a binary VQA task can be seen as a fundamental task of language understanding, as it requires one to evaluate the truth value of the utterance with respect to the state of the world. Among many systematic generalization requirements that are desirable for a VQA model, we choose the following basic one: a good model should be able to reason about all possible object combinations despite being trained on a very small subset of them. We believe that this is a key prerequisite to using VQA models in the real world, because they should be robust at handling unlikely combinations of objects. We implement our generalization demands in the form of a new synthetic dataset, called Spatial Queries On Object Pairs (SQOOP), in which a model has to perform spatial relational reasoning about pairs of randomly scattered letters and digits in the image (e.g. answering the question “Is there a letter A left of a letter B?”). The main challenge in SQOOP is that models are evaluated on all possible object pairs, but trained on only a subset of them.
|
| 28 |
+
|
| 29 |
+
Our first finding is that NMNs do generalize better than other neural models when layout and parametrization are chosen appropriately. We then investigate which factors contribute to improved generalization performance and find that using a layout that matches the task (i.e. a tree layout, as opposed to a chain layout), is crucial for solving the hardest version of our dataset. Lastly, and perhaps most importantly, we experiment with existing methods for making NMNs more end-to-end by inducing the module layout (Johnson et al., 2017) or learning module parametrization through soft-attention over the question (Hu et al., 2017). Our experiments show that such end-to-end approaches often fail by not converging to tree layouts or by learning a blurred parameterization for modules, which results in poor generalization on the hardest version of our dataset. We believe that our findings challenge the intuition of researchers in the field and provide a foundation for improving systematic generalization of neural approaches to language understanding.
|
| 30 |
+
|
| 31 |
+
# 2 THE SQOOP DATASET FOR TESTING SYSTEMATIC GENERALIZATION
|
| 32 |
+
|
| 33 |
+
We perform all experiments of this study on the SQOOP dataset. SQOOP is a minimalistic VQA task that is designed to test the model’s ability to interpret unseen combinations of known relation and object words. Clearly, given known objects X, Y and a known relation R, a human can easily verify whether or not the objects X and $\mathrm { Y }$ are in relation R. Some instances of such queries are common in daily life (is there a cup on the table), some are extremely rare (is there a violin under the car), and some are unlikely but have similar, more likely counter-parts (is there grass on the frisbee vs is there a frisbee on the grass). Still, a person can easily answer these questions by understanding them as just the composition of the three separate concepts. Such compositional reasoning skills are clearly required for language understanding models, and SQOOP is explicitly designed to test for them.
|
| 34 |
+
|
| 35 |
+
Concretely speaking, SQOOP requires observing a $6 4 \times 6 4$ RGB image x and answering a yes-no question $q = \mathrm { X R Y }$ about whether objects $\mathrm { X }$ and $\mathrm { Y }$ are in a spatial relation R. The questions are represented in a redundancy-free X R Y form; we did not aim to make the questions look like natural language. Each image contains 5 randomly chosen and randomly positioned objects. There are 36 objects: the latin letters A-Z and digits 0-9, and there are 4 relations: LEFT OF, RIGHT OF, ABOVE, and BELOW. This results in $3 6 \cdot 3 5 \cdot 4 = 5 0 4 0$ possible unique questions (we do not allow questions about identical objects). To make negative examples challenging, we ensure that both X and Y of a question are always present in the associated image and that there are distractor objects $\mathrm { Y } ^ { \prime } \ne \mathrm { Y }$ and $\mathrm { X } ^ { \prime } \ne \mathrm { X }$ such that $\mathrm { X R Y ^ { \prime } }$ and $\mathrm { X } ^ { \prime } \mathrm { R Y }$ are both true for the image. These extra precautions guarantee that answering a question requires the model to locate all possible X and Y then check if any pair of them are in the relation R. Two SQOOP examples are shown in Figure 2.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Different NMN layouts: NMN-Chain-Shortcut (left), NMN-Chain (center), NMN-Tree (right). See Section 3.2 for details.
|
| 39 |
+
Figure 2: A positive (top) and negative (bottom) example from the SQOOP dataset.
|
| 40 |
+
|
| 41 |
+
Our goal is to discover which models can correctly answer questions about all $3 6 \cdot 3 5$ possible object pairs in SQOOP after having been trained on only a subset. For this purpose we build training sets containing $3 6 \cdot 4 \cdot k$ unique questions by sampling $k$ different right-hand-side (RHS) objects $\mathrm { Y } _ { 1 }$ , $\mathrm { Y } _ { 2 }$ , ..., $\mathrm { Y } _ { \mathrm { k } }$ for each left-hand-side (LHS) object X. We use this procedure instead of just uniformly sampling object pairs in order to ensure that each object appears in at least one training question, thereby keeping the all versions of the dataset solvable. We will refer to $k$ as the #rhs/lhs parameter of the dataset. Our test set is composed from the remaining $3 6 \cdot 4 \cdot ( 3 5 - k )$ questions. We generate training and test sets for rhs/lhs values of 1,2,4,8 and 18, as well as a control version of the dataset, #rhs/lhs ${ } = 3 5$ , in which both the training and the test set contain all the questions (with different images). Note that lower #rhs/lhs versions are harder for generalization due to the presence of spurious dependencies between the words $\mathrm { X }$ and $\mathrm { Y }$ to which the models may adapt. In order to exclude a possible compounding factor of overfitting on the training images, all our training sets contain 1 million examples, so for a dataset with #rhs/lhs $= k$ we generate approximately $1 0 ^ { 6 } { \bar { / } } ( 3 6 \cdot$ $4 { \cdot } k$ ) different images per unique question. Appendix D contains pseudocode for SQOOP generation.
|
| 42 |
+
|
| 43 |
+
# 3 MODELS
|
| 44 |
+
|
| 45 |
+
A great variety of VQA models have been recently proposed in the literature, among which we can distinguish two trends. Some of the recently proposed models, such as FiLM (Perez et al., 2017) and Relation Networks (RelNet, Santoro et al. (2017)) are highly generic and do not require any taskspecific knowledge to be applied on a new dataset. On the opposite end of the spectrum are modular and structured models, typically flavours of Neural Module Networks (Andreas et al., 2016), that do require some knowledge about the task at hand to be instantiated. Here, we evaluate systematic generalization of several state-of-the-art models in both families. In all models, the image x is first fed through a CNN based network, that we refer to as the stem, to produce a feature-level 3D tensor $h _ { \mathrm { x } }$ . This is passed through a model-specific computation conditioned on the question $q$ , to produce a joint representation $h _ { q \bf { x } }$ . Lastly, this representation is fed into a fully-connected classifier network to produce logits for prediction. Therefore, the main difference between the models we consider is how the computation $h _ { q \mathbf { x } } = m o d e l ( h _ { \mathbf { x } } , q )$ is performed.
|
| 46 |
+
|
| 47 |
+
# 3.1 GENERIC MODELS
|
| 48 |
+
|
| 49 |
+
We consider four generic models in this paper: CNN+LSTM, FiLM, Relation Network (RelNet), and Memory-Attention-Control (MAC) network. For CNN+LSTM, FiLM, and RelNet models, the question $q$ is first encoded into a fixed-size representation $h _ { q }$ using a unidirectional LSTM network. CNN+LSTM flattens the 3D tensor $h _ { \mathrm { x } }$ to a vector and concatenates it with $h _ { q }$ to produce $h _ { q \mathrm { \tiny ~ x } }$ :
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
h _ { q \mathrm { x } } = [ f l a t t e n ( h _ { \mathrm { x } } ) ; h _ { q } ] .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
RelNet (Santoro et al., 2017) uses a network $g$ which is applied to all pairs of feature columns of $h _ { \mathrm { x } }$ concatenated with the question representation $h _ { q }$ , all of which is then pooled to obtain $h _ { q \bf { x } }$ :
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
h _ { q \mathrm { x } } = \sum _ { i , j } g ( h _ { \mathrm { x } } ( i ) , h _ { \mathrm { x } } ( j ) , h _ { q } )
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $h _ { x } ( i )$ is the $i$ -th feature column of $h _ { x }$ . FiLM networks (Perez et al., 2017) use $N$ convolutional FiLM blocks applied to $h _ { \mathrm { x } }$ . A FiLM block is a residual block (He et al., 2016) in which a feature-wise affine transformation (FiLM layer) is inserted after the $2 ^ { \mathrm { n d } }$ convolutional layer. The FiLM layer is conditioned on the question at hand via prediction of the scaling and shifting parameters $\gamma _ { n }$ and $\beta _ { n }$ :
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\begin{array} { r } { [ \gamma _ { n } ; \beta _ { n } ] = W _ { q } ^ { n } h _ { q } + b _ { q } ^ { n } } \\ { \tilde { h } _ { q \mathbf { x } } ^ { n } = B N ( W _ { 2 } ^ { n } * R e L U ( W _ { 1 } ^ { n } * h _ { q \mathbf { x } } ^ { n - 1 } + b _ { n } ) ) } \\ { h _ { q \mathbf { x } } ^ { n } = h _ { q \mathbf { x } } ^ { n - 1 } + R e L U ( \gamma _ { n } \odot \tilde { h } _ { q \mathbf { x } } ^ { n } \oplus \beta _ { n } ) } \end{array}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $B N$ stands for batch normalization (Ioffe & Szegedy, 2015), $^ *$ stands for convolution and $\odot$ stands for element-wise multiplications. $h _ { q \mathrm { ~ x ~ } } ^ { n }$ is the output of the $n$ -th FiLM block and $h _ { q \mathrm { x } } ^ { 0 } = h _ { \mathrm { x } }$ . The output of the last FiLM block $h _ { q \mathrm { ~ x ~ } } ^ { N }$ undergoes an extra $1 \times 1$ convolution and max-pooling to produce $h _ { q \bf { x } }$ . MAC network of Hudson & Manning (2018) produces $h _ { q \bf { x } }$ by repeatedly applying a Memory-Attention-Composition (MAC) cell that is conditioned on the question through an attention mechanism. The MAC model is too complex to be fully described here and we refer the reader to the original paper for details.
|
| 68 |
+
|
| 69 |
+
# 3.2 NEURAL MODULE NETWORKS
|
| 70 |
+
|
| 71 |
+
Neural Module Networks (NMN) (Andreas et al., 2016) are an elegant approach to question answering that constructs a question-specific network by composing together trainable neural modules, drawing inspiration from symbolic approaches to question answering (Malinowski & Fritz, 2014). To answer a question with an NMN, one first constructs the computation graph by making the following decisions: (a) how many modules and of which types will be used, (b) how will the modules be connected to each other, and (c) how are these modules parametrized based on the question. We refer to the aspects (a) and (b) of the computation graph as the layout and the aspect (c) as the parametrization. In the original NMN and in many follow-up works, different module types are used to perform very different computations, e.g. the Find module from Hu et al. (2017) performs trainable convolutions on the input attention map, whereas the And module from the same paper computes an element-wise maximum for two input attention maps. In this work, we follow the trend of using more homogeneous modules started by Johnson et al. (2017), who use only two types of modules: unary and binary, both performing similar computations. We restrict our study to NMNs with homogeneous modules because they require less prior knowledge to be instantiated and because they performed well in our preliminary experiments despite their relative simplicity. We go one step further than Johnson et al. (2017) and retain a single binary module type, using a zero tensor for the second input when only one input is available. Additionally, we choose to use exactly three modules, which simplifies the layout decision to just determining how the modules are connected. Our preliminary experiments have shown that, even after these simplifications, NMNs are far ahead of other models in terms of generalization.
|
| 72 |
+
|
| 73 |
+
In the original NMN, the layout and parametrization were set in an ad-hoc manner for each question by analyzing a dependency parse. In the follow-up works (Johnson et al., 2017; Hu et al., 2017), these aspects of the computation are predicted by learnable mechanisms with the goal of reducing the amount of background knowledge required to apply the NMN approach to a new task. We experiment with the End-to-End NMN (N2NMN) (Hu et al., 2017) paradigm from this family, which predicts the layout with a seq2seq model (Sutskever et al., 2014) and computes the parametrization of the modules using a soft attention mechanism. Since all the questions in SQOOP have the same structure, we do not employ a seq2seq model but instead have a trainable layout variable and trainable attention variables for each module.
|
| 74 |
+
|
| 75 |
+
Formally, our NMN is constructed by repeatedly applying a generic neural module $f ( \theta , \gamma , s ^ { 0 } , s ^ { 1 } )$ , which takes as inputs the shared parameters $\theta$ , the question-specific parametrization $\gamma$ and the lefthand side and right-hand side inputs $s ^ { 0 }$ and $s ^ { 1 }$ . Three such modules are connected and conditioned
|
| 76 |
+
|
| 77 |
+
on a question $q = ( q _ { 1 } , q _ { 2 } , q _ { 3 } )$ as follows:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { c } { { \displaystyle \gamma _ { k } = \sum _ { i = 1 } ^ { 3 } \alpha ^ { k , i } e ( q _ { i } ) } } \\ { { \displaystyle s _ { k } ^ { m } = \sum _ { j = - 1 } ^ { k - 1 } \tau _ { m } ^ { k , j } s _ { j } } } \\ { { \displaystyle s _ { k } = f ( \theta , \gamma _ { k } , s _ { k } ^ { 0 } , s _ { k } ^ { 1 } ) } } \\ { { \displaystyle h _ { q x } = s _ { 3 } } } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
In the equations above, $s _ { - 1 } = 0$ is the zero tensor input, $s _ { 0 } = h _ { x }$ are the image features outputted by the stem, $e$ is the embedding table for question words. $k \in \{ 1 , 2 , 3 \}$ is the module number, $s _ { k }$ is the output of the $k$ -th module and $s _ { k } ^ { m }$ are its left $\mathbf { \bar { \rho } } _ { m } = 0 ,$ ) and right $\mathbf { \Phi } _ { m } = 1 \mathbf { \Phi } _ { \rho }$ ) inputs. We refer to $A = ( \alpha ^ { k , i } )$ and $T = ( \tau _ { m } ^ { k , j } )$ as the parametrization attention matrix and the layout tensor respectively.
|
| 84 |
+
|
| 85 |
+
We experiment with two choices for the NMN’s generic neural module: the Find module from Hu et al. (2017) and the Residual module from Johnson et al. (2017). The equations for the Residual module are as follows:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l r } & { } & { [ W _ { 1 } ^ { k } ; b _ { 1 } ^ { k } ; W _ { 2 } ^ { k } ; b _ { 2 } ^ { k } ; W _ { 3 } ^ { k } ; b _ { 3 } ^ { k } ] = \gamma _ { k } } \\ & { } & { \tilde { s _ { k } } = R e L U ( W _ { 3 } ^ { k } * [ s _ { k } ^ { 0 } ; s _ { k } ^ { 1 } ] + b _ { 3 } ^ { k } ) , } \\ & { } & { f _ { R e s i d u a l } ( \gamma _ { k } , s _ { k } ^ { 0 } , s _ { k } ^ { 1 } ) = R e L U ( \tilde { s _ { k } } + W _ { 1 } ^ { k } * R e L U ( W _ { 2 } ^ { k } * \tilde { s _ { k } } + b _ { 2 } ^ { k } ) ) + b _ { 1 } ^ { k } ) , } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
and for Find module as follows:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l r } & { } & { [ W _ { 1 } ; b _ { 1 } ; W _ { 2 } ; b _ { 2 } ] = \theta , } \\ & { } & { f _ { F i n d } ( \theta , \gamma _ { k } , s _ { k } ^ { 0 } , s _ { k } ^ { 1 } ) = R e L U ( W _ { 1 } * \gamma _ { k } \odot R e L U ( W _ { 2 } * [ s _ { k } ^ { 0 } ; s _ { k } ^ { 1 } ] + b _ { 2 } ) + b _ { 1 } ) . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
In the formulas above all $W$ ’s stand for convolution weights, and all $b$ ’s are biases. Equations 10 and 13 should be understood as taking vectors $\gamma _ { k }$ and $\theta$ respectively and chunking them into weights and biases. The main difference between Residual and Find is that in Residual all parameters depend on the questions words (hence $\theta$ is omitted from the signature of $f _ { R e s i d u a l } )$ , where as in Find convolutional weights are the same for all questions, and only the element-wise multipliers $\gamma _ { k }$ vary based on the question. We note that the specific Find module we use in this work is slightly different from the one used in (Hu et al., 2017) in that it outputs a feature tensor, not just an attention map. This change was required in order to connect multiple Find modules in the same way as we connect multiple residual ones.
|
| 98 |
+
|
| 99 |
+
Based on the generic NMN model described above, we experiment with several specific architectures that differ in the way the modules are connected and parametrized (see Figure 1). In NMN-Chain the modules form a sequential chain. Modules 1, 2 and 3 are parametrized based on the first object word, second object word and the relation word respectively, which is achieved by setting the attention maps $\alpha _ { 1 }$ , $\alpha _ { 2 }$ , $\alpha _ { 3 }$ to the corresponding one-hot vectors. We also experiment with giving the image features $h _ { x }$ as the right-hand side input to all 3 modules and call the resulting model NMN-ChainShortcut. NMN-Tree is similar to NMN-Chain in that the attention vectors are similarly hardcoded, but we change the connectivity between the modules to be tree-like. Stochastic N2NMN follows the N2NMN approach by Hu et al. (2017) for inducing layout. We treat the layout $T$ as a stochastic latent variable. $T$ is allowed to take two values: $T _ { t r e e }$ as in NMN-Tree, and $T _ { c h a i n }$ as in NMN-Chain. We calculate the output probabilities by marginalizing out the layout i.e. probability of answer being “yes” is computed as $\begin{array} { r } { \bar { p } ( \mathrm { y e s } | x , q ) = \sum _ { T \in \{ T _ { t r e e } , T _ { c h a i n } \} } p ( \mathrm { y e s } | \bar { T } , x , q ) p ( \bar { T } ) } \end{array}$ . Lastly, Attention N2NMN uses the N2NMN method for learning parametrization (Hu et al., 2017). It is structured just like NMN-Tree but has $\alpha ^ { k }$ computed as $\operatorname { s o f t m a x } ( \tilde { \alpha } ^ { k } )$ , where $\tilde { \alpha } ^ { k }$ is a trainable vector. We use Attention N2NMN only with the Find module because using it with the Residual module would involve a highly non-standard interpolation between convolutional weights.
|
| 100 |
+
|
| 101 |
+
# 4 EXPERIMENTS
|
| 102 |
+
|
| 103 |
+
In our experiments we aimed to: (a) understand which models are capable of exhibiting systematic generalization as required by SQOOP, and (b) understand whether it is possible to induce, in an end-to-end way, the successful architectural decisions that lead to systematic generalization.
|
| 104 |
+
|
| 105 |
+
All models share the same stem architecture which consists of 6 layers of convolution (8 for Relation Networks), batch normalization and max pooling. The input to the stem is a $6 4 \times 6 4 \times 3$ image, and the feature dimension used throughout the stem is 64. Further details can be found in Appendix A. The code for all experiments is available online1.
|
| 106 |
+
|
| 107 |
+
# 4.1 WHICH MODELS GENERALIZE BETTER?
|
| 108 |
+
|
| 109 |
+
We report the performance for all models on datasets of varying difficulty in Figure 3. Our first observation is that the modular and tree-structured NMN-Tree model exhibits strong systematic generalization. Both versions of this model, with Residual and Find modules, robustly solve all versions of our dataset, including the most challenging #rhs/lh $^ { = 1 }$ split.
|
| 110 |
+
|
| 111 |
+
The results of NMN-Tree should be contrasted with those of generic models. 2 out of 4 models (Conv+LSTM and RelNet) are not able to learn to answer all SQOOP questions, no matter how easy the split was (for high #rhs/lhs Conv+LSTM overfitted and RelNet did not train). The results of other two models, MAC and FiLM, are similar. Both models are clearly able to solve the SQOOP task, as suggested by their almost perfect $< 1 \%$ error rate on the control #rhs/lhs $= 3 5$ split, yet they struggle to generalize on splits with lower #rhs/lhs. In particular, we observe $1 3 . 6 7 \pm 9 . 9 7 \%$ errors for MAC and a $3 4 . 7 3 \pm 4 . 6 1 \%$ errors for FiLM on the hardest #rhs/lhs $^ { = 1 }$ split. For the splits of intermediate difficulty we saw the error rates of both models decreasing as we increased the #rhs/lhs ratio from 2 to 18. Interestingly, even with 18 #rhs/lhs some MAC and FiLM runs result in a test error rate of $\sim 2 \%$ . Given the simplicity and minimalism of SQOOP questions, we believe that these results should be considered a failure to pass the SQOOP test for both MAC and FiLM. That said, we note a difference in how exactly FiLM and MAC fail on #rhs/lhs $^ { = 1 }$ : in several runs (3 out of 15) MAC exhibits a strong generalization performance $( \sim 0 . 5 \%$ error rate), whereas in all runs of FiLM the error rate is about $3 0 \%$ . We examine the successful MAC models and find that they converge to a successful setting of the control attention weights, where specific MAC units consistently attend to the right questions words. In particular, MAC models that generalize strongly for each question seem to have a unit focusing strongly on $X$ and a unit focusing strongly on $Y$ (see Appendix B for more details). As MAC was the strongest competitor of NMN-Tree across generic models, we perform an ablation study for this model, in which we vary the number of modules and hidden units, as well as experiment with weight decay. These modifications do not result in any significant reduction of the gap between MAC and NMN-Tree. Interestingly, we find that using the default high number of MAC units, namely 12, is helpful, possibly because it increases the likelihood that at least one unit converges to focus on X and $\mathrm { Y }$ words (see Appendix B for details).
|
| 112 |
+
|
| 113 |
+
# 4.2 WHAT IS ESSENTIAL TO STRONG GENERALIZATION OF NMN?
|
| 114 |
+
|
| 115 |
+
The superior generalization of NMN-Tree raises the following question: what is the key architectural difference between NMN-Tree and generic models that explains the performance gap between them? We consider two candidate explanations. First, the NMN-Tree model differs from the generic models in that it does not use a language encoder and is instead built from modules that are parametrized by question words directly. Second, NMN-Tree is structured in a particular way, with the idea that modules 1 and 2 may learn to locate objects and module 3 can learn to reason about object locations independently of their identities. To understand which of the two differences is responsible for the superior generalization, we compare the performance of the NMN-Tree, NMN-Chain and NMNChain-Shortcut models (see Figure 1). These 3 versions of NMN are similar in that none of them are using a language encoder, but they differ in how the modules are connected. The results in Figure 3 show that for both Find and Residual module architectures, using a tree layout is absolutely crucial (and sufficient) for generalization, meaning that the generalization gap between NMN-Tree and generic models can not be explained merely by the language encoding step in the latter. In particular, NMN-Chain models perform barely above random chance, doing even worse than generic models on the #rhs/lhs $^ { = 1 }$ version of the dataset and dramatically failing even on the easiest #rhs/lhs ${ } _ { = 1 8 }$ split. This is in stark contrast with NMN-Tree models that exhibits nearly perfect performance on the hardest #rhs/lh $^ { = 1 }$ split. As a sanity check we train NMN-Chain models on the vanilla #rhs/lhs ${ } = 3 5$ split. We find that NMN-Chain has little difficulty learning to answer SQOOP questions when it sees all of them at training time, even though it previously shows poor generalization when testing on unseen examples. Interestingly, NMN-Chain-Shortcut performs much better than NMN-Chain and quite similarly to generic models. We find it remarkable that such a slight change in the model layout as adding shortcut connections from image features $h _ { x }$ to the modules results in a drastic change in generalization performance. In an attempt to understand why NMN-Chain generalizes so poorly we compare the test set responses of the 5 NMN-Chain models trained on #rhs/lhs $^ { = 1 }$ split. Notably, there was very little agreement between predictions of these 5 runs (Fleiss $\kappa = 0 . 0 5$ ), suggesting that NMN-Chain performs rather randomly outside of the training set.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Top: Comparing the performance of generic models on datasets of varying difficulty (lower #rhs/lhs is more difficult). Note that NMN-Tree generalizes perfectly on the hardest #rhs/lhs $^ { \dag = 1 }$ version of SQOOP, whereas MAC and FiLM fail to solve completely even the easiest #rhs/lhs ${ \it \Omega } = 1 8$ version. Bottom: Comparing NMNs with different layouts and modules. We can clearly observe the superior generalization of NMN-Tree, poor generalization of NMN-Chain and mediocre generalization of NMN-Chain-Shortcut. Means and standard deviations after at least 5 runs are reported.
|
| 119 |
+
|
| 120 |
+
# 4.3 CAN THE RIGHT KIND OF NMN BE INDUCED?
|
| 121 |
+
|
| 122 |
+
The strong generalization of the NMN-Tree is impressive, but a significant amount of prior knowledge about the task was required to come up with the successful layout and parametrization used in this model. We therefore investigate whether the amount of such prior knowledge can be reduced by fixing one of these structural aspects and inducing the other.
|
| 123 |
+
|
| 124 |
+
# 4.3.1 LAYOUT INDUCTION
|
| 125 |
+
|
| 126 |
+
In our layout induction experiments, we use the Stochastic N2NMN model which treats the layout as a stochastic latent variable with two values ( $T _ { t r e e }$ and $T _ { c h a i n }$ , see Section 3.2 for details). We experiment with N2NMNs using both Find and Residual modules and report results with different initial conditions, $p _ { 0 } ( t r e e ) \in 0 . 1 , 0 . 5 , 0 . 9$ . We believe that the initial probability $p _ { 0 } ( t r e e ) = 0 . 1$ should not be considered small, since in more challenging datasets the space of layouts would be exponentially large, and sampling the right layout in $10 \%$ of all cases should be considered a very lucky initialization. We repeat all experiments on #rhs/lhs $^ { = 1 }$ and on #rhs/lhs ${ \it \Omega } = 1 8$ splits, the former to study generalization, and the latter to control whether the failures on #rhs/lhs $^ { - 1 }$ are caused specifically by the difficulty of this split. The results (see Table 1) show that the success of layout induction (i.e. converging to a $p ( t r e e )$ close to 0.9) depends in a complex way on all the factors that we considered in our experiments. The initialization has the most influence: models initialized with $p _ { 0 } ( t r e e ) = 0 . 1$ typically do not converge to a tree (exception being experiments with Residual module on #rhs/lhs ${ } = 1 8$ , in which 3 out of 5 runs converged to a solution with a high $p ( t r e e ) )$ ). Likewise, models initialized with $p _ { 0 } ( t r e e ) = 0 . 9$ always stay in a regime with a high $p ( t r e e )$ . In the intermediate setting of $p _ { 0 } ( t r e e ) = 0 . 5$ we observe differences in behaviors for Residual and Find modules. In particular, N2NMN based on Residual modules stays spurious with $p ( t r e e ) = 0 . 5 \pm 0 . 0 8$ when #rhs/lhs $^ { \dag = 1 }$ , whereas N2NMN based on Find modules always converges to a tree.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 4: Learning dynamics of layout induction on 1 rhs/lhs and 18 rhs/lhs datasets using the Residual module with $p _ { 0 } ( t r e e ) =$ 0.5. All 5 runs do not learn to use the tree layout for 1 rhs/lhs, the very setting where the tree layout is necessary for generalization.
|
| 134 |
+
Figure 5: Attention quality $\kappa$ vs accuracy for Attention N2NMN models trained on different #rhs/lhs splits. We can observe that generalization is strongly associated with high $\kappa$ for #rhs/lhs $^ { = 1 }$ , while for splits with 2 and 18 rhs/lhs blurry attention may be sufficient.
|
| 135 |
+
Figure 6: An example of how attention weights of modules 1 (left), 2 (middle), and 3 (right) evolve during training of an Attention N2NMN model on the 18 rhs/lhs version of SQOOP. Modules 1 and 2 learn to focus on different objects words, X and $\mathrm { Y }$ respectively in this example, but they also assign high weight to the relation word R. Module 3 learns to focus exclusively on R.
|
| 136 |
+
|
| 137 |
+
One counterintuitive result in Table 1 is that for the Stochastic N2NMNs with Residual modules, trained with $p _ { 0 } ( t r e e ) = 0 . 5$ and #rhs/lhs $^ { = 1 }$ , make just $1 . 6 4 { \pm } 1 . 7 9 \%$ test error despite never resolving the layout uncertainty through training $( p _ { 2 0 0 K } ( t r e e ) = 0 . 5 6 \pm 0 . 0 6 )$ . We offer an investigation of this result in Appendix C.
|
| 138 |
+
|
| 139 |
+
# 4.3.2 PARAMETRIZATION INDUCTION
|
| 140 |
+
|
| 141 |
+
Next, we experiment with the Attention N2NMN model (see Section 3.2) in which the parametrization is learned for each module as an attention-weighted average of word embeddings. In these experiments, we fix the layout to be tree-like and sample the pre-softmax attention weights $\tilde { \alpha }$ from a uniform distribution $U [ 0 ; 1 ]$ . As in the layout induction investigations, we experiment with several SQOOP splits, namely we try #rhs/lhs $\ r \in \{ 1 , 2 , 1 8 \}$ . The results (reported in Table 2) show that Attention N2NMN fails dramatically on #rhs/lhs=1 but quickly catches up as soon as #rhs/lhs is increased to 2. Notably, 9 out of 10 runs on #rhs/lhs $^ { = 2 }$ result in almost perfect performance, and 1 run completely fails to generalize ( $2 6 \%$ error rate), resulting in a high $8 . 1 8 \%$ variance of the mean error rate. All 10 runs on the split with 18 rhs/lhs generalize flawlessly. Furthermore, we inspect the learned attention weights and find that for typical successful runs, module 3 focuses on the relation word, whereas modules 1 and 2 focus on different object words (see Figure 6) while still focusing on the relation word. To better understand the relationship between successful layout induction and generalization, we define an attention quality metric $\begin{array} { r } { \kappa = \operatorname* { m i n } _ { w \in \{ X , Y \} } \operatorname* { m a x } _ { k \in 1 , 2 } \alpha _ { k , w } / ( 1 - \alpha _ { k , R } ) } \end{array}$ . Intuitively, $\kappa$ is large when for each word $w \in X , Y$ there is a module $i$ that focuses mostly on this word. The renormalization by $1 / ( 1 - \alpha _ { k , R } )$ is necessary to factor out the amount of attention that modules 1 and 2 assign to the relation word. For the ground-truth parametrization that we use for NMN-Tree $\kappa$ takes a value of 1, and if both modules 1 and 2 focus on X, completely ignoring Y, $\kappa$ equals 0. The scatterplot of the test error rate versus $\kappa$ (Figure 5) shows that for #rhs/lhs $^ { = 1 }$ high generalization is strongly associated with higher $\kappa$ , meaning that it is indeed necessary to have different modules strongly focusing on different object words in order to generalize in this most challenging setting. Interestingly, for #rhs/lhs $^ { = 2 }$ we see a lot of cases where N2NMN generalizes well despite attention being rather spurious $( \kappa \approx 0 . 6 $ ).
|
| 142 |
+
|
| 143 |
+
Table 1: Tree layout induction results for Stochastic N2NMNs using Residual and Find modules on 1 rhs/lhs and 18 rhs/lhs datasets. For each setting of $p _ { 0 } ( t r e e )$ we report results after 5 runs. $p _ { 2 0 0 K } ( t r e e )$ is the probability of using a tree layout after 200K training iterations.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>module</td><td>#rhs/lhs</td><td>po(tree)</td><td>Test error rate (%)</td><td>Test loss</td><td>p200k(tree)</td></tr><tr><td rowspan="5">Residual</td><td rowspan="3">1</td><td>0.1</td><td>31.89 ± 0.75</td><td>0.64±0.03</td><td>0.08±0.01</td></tr><tr><td>0.5</td><td>1.64 ± 1.79</td><td>0.27 ± 0.04</td><td>0.56 ±0.06</td></tr><tr><td>0.9</td><td>0.16 ± 0.11</td><td>0.03 ±0.01</td><td>0.96 ±0.00</td></tr><tr><td rowspan="3">18</td><td>0.1</td><td>3.99 ± 5.33</td><td>0.15 ±0.06</td><td>0.59±0.34</td></tr><tr><td>0.5</td><td>0.19 ±0.11</td><td>0.06±0.02</td><td>0.99 ±0.01</td></tr><tr><td>0.9</td><td>0.12 ±0.12</td><td>0.01 ±0.00</td><td>1.00 ± 0.00</td></tr><tr><td rowspan="5">Find</td><td rowspan="3">1</td><td>0.1</td><td>47.54± 0.95</td><td>1.78 ± 0.47</td><td>0.00±0.00</td></tr><tr><td>0.5</td><td>0.78 ±0.52</td><td>0.05 ± 0.04</td><td>0.94±0.07</td></tr><tr><td>0.9</td><td>0.41 ± 0.07</td><td>0.02±0.00</td><td>1.00 ±0.00</td></tr><tr><td rowspan="3">18</td><td>0.1</td><td>5.11 ± 1.19</td><td>0.14±0.03</td><td>0.02±0.04</td></tr><tr><td>0.5</td><td>0.17 ± 0.16</td><td>0.01±0.01</td><td>1.00 ±0.00</td></tr><tr><td>0.9</td><td>0.11 ± 0.03</td><td>0.00±0.00</td><td>1.00 ± 0.00</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 2: Parameterization induction results for 1,2,18 rhs/lhs datasets for Attention N2NMN. The model does not generalize well in the difficult 1 rhs/lhs setting. Results for MAC are presented for comparison. Means and standard deviations were estimated based on at least 10 runs.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Model</td><td>#rhs/lhs</td><td>Test error rate (%)</td><td>Test loss (%)</td></tr><tr><td>AttentionN2NMN</td><td>1</td><td>27.19±16.02</td><td>1.22 ± 0.71</td></tr><tr><td>Attention N2NMN</td><td>2</td><td>2.82 ±8.18</td><td>0.14 ± 0.41</td></tr><tr><td>Attention N2NMN</td><td>18</td><td>0.16 ± 0.12</td><td>0.00±0.00</td></tr><tr><td>MAC</td><td>1</td><td>13.67± 9.97</td><td>0.41 ± 0.32</td></tr><tr><td>MAC</td><td>2</td><td>9.21 ± 4.31</td><td>0.28 ± 0.15</td></tr><tr><td>MAC</td><td>18</td><td>0.53 ± 0.74</td><td>0.01 ±0.02</td></tr></table>
|
| 150 |
+
|
| 151 |
+
In order to put Attention N2NMN results in context we compare them to those of MAC (see Table 2). Such a comparison can be of interest because both models perform attention over the question. For 1 rhs/lhs MAC seems to be better on average, but as we increase #rhs/lhs to 2 we note that Attention N2NMN succeeds in 9 out of 10 cases on the #rhs/lh $^ { \circ 2 }$ split, much more often than 1 success out of 10 observed for $\mathbf { M A C }$ . This result suggests that Attention N2NMNs retains some of the strong generalization potential of NMNs with hard-coded parametrization.
|
| 152 |
+
|
| 153 |
+
# 5 RELATED WORK
|
| 154 |
+
|
| 155 |
+
The notion of systematicity was originally introduced by (Fodor & Pylyshyn, 1988) as the property of human cognition whereby “the ability to entertain a given thought implies the ability to entertain thoughts with semantically related contents”. They illustrate this with an example that no English speaker can understand the phrase “John loves the girl” without being also able to understand the phrase “the girl loves John”. The question of whether or not connectionist models of cognition can account for the systematicity phenomenon has been a subject of a long debate in cognitive science (Fodor & Pylyshyn, 1988; Smolensky, 1987; Marcus, 1998; 2003; Calvo & Colunga, 2003). Recent research has shown that lack of systematicity in the generalization is still a concern for the modern seq2seq models (Lake & Baroni, 2018; Bastings et al., 2018; Loula et al., 2018). Our findings about the weak systematic generalization of generic VQA models corroborate the aforementioned seq2seq results. We also go beyond merely stating negative generalization results and showcase the high systematicity potential of adding explicit modularity and structure to modern deep learning models.
|
| 156 |
+
|
| 157 |
+
Besides the theoretical appeal of systematicity, our study is inspired by highly related prior evidence that when trained on downstream language understanding tasks, neural networks often generalize poorly and latch on to dataset-specific regularities. Agrawal et al. (2016) report how neural models exploit biases in a VQA dataset, e.g. responding “snow” to the question “what covers the ground” regardless of the image because “snow” is the most common answer to this question. Gururangan et al. (2018) report that many successes in natural language entailment are actually due to exploiting statistical biases as opposed to solving entailment, and that state-of-the-art systems are much less performant when tested on unbiased data. Jia & Liang (2017) demonstrate that seemingly state-ofthe-art reading comprehension system can be misled by simply appending an unrelated sentence that resembles the question to the document.
|
| 158 |
+
|
| 159 |
+
Using synthetic VQA datasets to study grounded language understanding is a recent trend started by the CLEVR dataset (Johnson et al., 2016). CLEVR images are 3D-rendered and CLEVR questions are longer and more complex than ours, but in the associated generalization split CLEVR-CoGenT the training and test distributions of images are different. In our design of SQOOP we aimed instead to minimize the difference between training and test images to make sure that we test a model’s ability to interpret unknown combinations of known words. The ShapeWorld family of datasets by Kuhnle & Copestake (2017) is another synthetic VQA platform with a number of generalization tests, but none of them tests SQOOP-style generalization of relational reasoning to unseen object pairs. Most closely related to our work is the recent study of generalization to long-tail questions about rare objects done by Bingham et al. (2017). They do not, however, consider as many models as we do and do not study the question of whether the best-performing models can be made end-to-end.
|
| 160 |
+
|
| 161 |
+
The key paradigm that we test in our experiments is Neural Module Networks (NMN). Andreas et al. (2016) introduced NMNs as a modular, structured VQA model where a fixed number of handcrafted neural modules (such as Find, or Compare) are chosen and composed together in a layout determined by the dependency parse of the question. Andreas et al. (2016) show that the modular structure allows answering questions that are longer than the training ones, a kind of generalization that is complementary to the one we study here. Hu et al. (2017) and Johnson et al. (2017) followed up by making NMNs end-to-end, removing the non-differentiable parser. Both Hu et al. (2017) and Johnson et al. (2017) reported that several thousands of ground-truth layouts are required to pretrain the layout predictor in order for their approaches to work. In a recent work, Hu et al. (2018) attempt to soften the layout decisions, but training their models end-to-end from scratch performed substantially lower than best models on the CLEVR task. Gupta & Lewis (2018) report successful layout induction on CLEVR for a carefully engineered heterogeneous NMN that takes a scene graph as opposed to a raw image as the input.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION AND DISCUSSION
|
| 164 |
+
|
| 165 |
+
We have conducted a rigorous investigation of an important form of systematic generalization required for grounded language understanding: the ability to reason about all possible pairs of objects despite being trained on a small subset of such pairs. Our results allow one to draw two important conclusions. For one, the intuitive appeal of modularity and structure in designing neural architectures for language understanding is now supported by our results, which show how a modular model consisting of general purpose residual blocks generalizes much better than a number of baselines, including architectures such as MAC, FiLM and RelNet that were designed specifically for visual reasoning. While this may seem unsurprising, to the best of our knowledge, the literature has lacked such a clear empirical evidence in favor of modular and structured networks before this work. Importantly, we have also shown how sensitive the high performance of the modular models is to the layout of modules, and how a tree-like structure generalizes much stronger than a typical chain of layers.
|
| 166 |
+
|
| 167 |
+
Our second key conclusion is that coming up with an end-to-end and/or soft version of modular models may be not sufficient for strong generalization. In the very setting where strong generalization is required, end-to-end methods often converge to a different, less compositional solution (e.g. a chain layout or blurred attention). This can be observed especially clearly in our NMN layout and parametrization induction experiments on the #rhs/lhs $^ { = 1 }$ version of SQOOP, but notably, strong initialization sensitivity of layout induction remains an issue even on the #rhs/lhs ${ } _ { = 1 8 }$ split. This conclusion is relevant in the view of recent work in the direction of making NMNs more end-toend (Suarez et al., 2018; Hu et al., 2018; Hudson & Manning, 2018; Gupta & Lewis, 2018). Our findings suggest that merely replacing hard-coded components with learnable counterparts can be insufficient, and that research on regularizers or priors that steer the learning towards more systematic solutions can be required. That said, our parametrization induction results on the #rhs/lhs $^ { = 2 }$ split are encouraging, as they show that compared to generic models, a weaker nudge (in the form of a richer training signal or a prior) towards systematicity may suffice for end-to-end NMNs.
|
| 168 |
+
|
| 169 |
+
While our investigation has been performed on a synthetic dataset, we believe that it is the realworld language understanding where our findings may be most relevant. It is possible to construct a synthetic dataset that is bias-free and that can only be solved if the model has understood the entirety of the dataset’s language. It is, on the contrary, much harder to collect real-world datasets that do not permit highly dataset-specific solutions, as numerous dataset analysis papers of recent years have shown (see Section 5 for a review). We believe that approaches that can generalize strongly from imperfect and biased data will likely be required, and our experiments can be seen as a simulation of such a scenario. We hope, therefore, that our findings will inform researchers working on language understanding and provide them with a useful intuition about what facilitates strong generalization and what is likely to inhibit it.
|
| 170 |
+
|
| 171 |
+
# ACKNOWLEDGEMENTS
|
| 172 |
+
|
| 173 |
+
We thank Maxime Chevalier-Boisvert, Yoshua Bengio and Jacob Andreas for useful discussions. This research was enabled in part by support provided by Compute Canada (www.computecanada.ca), NSERC, Canada Research Chairs and Microsoft Research. We also thank Nvidia for donating NVIDIA DGX-1 used for this research.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Aishwarya Agrawal, Dhruv Batra, and Devi Parikh. Analyzing the Behavior of Visual Question Answering Models. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, January 2016.
|
| 178 |
+
Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural Module Networks. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. URL http://arxiv.org/abs/1511.02799.
|
| 179 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. In Proceedings of the 2015 International Conference on Learning Representations, 2015.
|
| 180 |
+
Joost Bastings, Marco Baroni, Jason Weston, Kyunghyun Cho, and Douwe Kiela. Jump to better conclusions: SCAN both left and right. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 47–55, Brussels, Belgium, November 2018. Association for Computational Linguistics. URL https://www.aclweb. org/anthology/W18-5407.
|
| 181 |
+
Eli Bingham, Piero Molino, Paul Szerlip, Obermeyer Fritz, and Goodman Noah. Characterizing how Visual Question Answering scales with the world. In NIPS 2017 Visually-Grounded Interaction and Language Workshop, 2017.
|
| 182 |
+
Francisco Calvo and Eliana Colunga. The statistical brain: Reply to Marcus The algebraic mind. In Proceedings of the Annual Meeting of the Cognitive Science Society, volume 25, 2003.
|
| 183 |
+
|
| 184 |
+
Jerry A. Fodor and Zenon W. Pylyshyn. Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1):3–71, 1988.
|
| 185 |
+
|
| 186 |
+
Alexander L. Gaunt, Marc Brockschmidt, Nate Kushman, and Daniel Tarlow. Differentiable Programs with Neural Libraries. In Proceedings of the 34th International Conference on Machine Learning, November 2016. URL http://arxiv.org/abs/1611.02109. arXiv: 1611.02109.
|
| 187 |
+
|
| 188 |
+
Yichen Gong, Heng Luo, and Jian Zhang. Natural Language Inference over Interaction Space. In Proceedings of the 2018 International Conference on Learning Representations, 2017. URL http://arxiv.org/abs/1709.04348. arXiv: 1709.04348.
|
| 189 |
+
|
| 190 |
+
Nitish Gupta and Mike Lewis. Neural Compositional Denotational Semantics for Question Answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 2018. URL http://aclweb.org/ anthology/D18-1239.
|
| 191 |
+
|
| 192 |
+
Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R. Bowman, and Noah A. Smith. Annotation Artifacts in Natural Language Inference Data. In Proceedings of NAACL-HLT 2018, March 2018. URL http://arxiv.org/abs/1803.02324. arXiv: 1803.02324.
|
| 193 |
+
|
| 194 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 195 |
+
|
| 196 |
+
Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to Reason: End-to-End Module Networks for Visual Question Answering. In Proceedings of 2017 IEEE International Conference on Computer Vision, April 2017. URL http://arxiv.org/ abs/1704.05526. arXiv: 1704.05526.
|
| 197 |
+
|
| 198 |
+
Ronghang Hu, Jacob Andreas, Trevor Darrell, and Kate Saenko. Explainable Neural Computation via Stack Neural Module Networks. In Proceedings of 2018 European Conference on Computer Vision, July 2018. URL http://arxiv.org/abs/1807.08556. arXiv: 1807.08556.
|
| 199 |
+
|
| 200 |
+
Drew A. Hudson and Christopher D. Manning. Compositional Attention Networks for Machine Reasoning. In Proceedings of the 2018 International Conference on Learning Representations, February 2018. URL https://openreview.net/forum?id=S1Euwz-Rb.
|
| 201 |
+
|
| 202 |
+
Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 448–456, 2015. URL http: //jmlr.org/proceedings/papers/v37/ioffe15.html.
|
| 203 |
+
|
| 204 |
+
Robin Jia and Percy Liang. Adversarial Examples for Evaluating Reading Comprehension Systems. Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2021–2031, 2017. doi: 10.18653/v1/D17-1215. URL https://aclanthology.coli. uni-saarland.de/papers/D17-1215/d17-1215.
|
| 205 |
+
|
| 206 |
+
Yu Jiang, Vivek Natarajan, Xinlei Chen, Marcus Rohrbach, Dhruv Batra, and Devi Parikh. Pythia v0.1: The winning entry to the vqa challenge 2018. https://github.com/ facebookresearch/pythia, 2018.
|
| 207 |
+
|
| 208 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C. Lawrence Zitnick, and Ross Girshick. CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning. In Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), December 2016. URL http://arxiv.org/abs/1612.06890. arXiv: 1612.06890.
|
| 209 |
+
|
| 210 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C. Lawrence Zitnick, and Ross Girshick. Inferring and Executing Programs for Visual Reasoning. In Proceedings of 2017 IEEE International Conference on Computer Vision, 2017. URL http: //arxiv.org/abs/1705.03633.
|
| 211 |
+
|
| 212 |
+
Anjuli Kannan, Karol Kurach, Sujith Ravi, Tobias Kaufmann, Andrew Tomkins, Balint Miklos, Greg Corrado, Laszlo Lukacs, Marina Ganea, Peter Young, and Vivek Ramavajjala. Smart Reply: Automated Response Suggestion for Email. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 955–964, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4232-2. doi: 10.1145/2939672.2939801. URL http://doi.acm.org/10.1145/2939672.2939801.
|
| 213 |
+
|
| 214 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In Proceedings of the 2015 International Conference on Learning Representations, 2015. URL http://arxiv. org/abs/1412.6980. arXiv: 1412.6980.
|
| 215 |
+
|
| 216 |
+
Alexander Kuhnle and Ann Copestake. ShapeWorld - A new test methodology for multimodal language understanding. arXiv:1704.04517 [cs], April 2017. URL http://arxiv.org/ abs/1704.04517. arXiv: 1704.04517.
|
| 217 |
+
|
| 218 |
+
Brenden M. Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In Proceedings of the 36th International Conference on Machine Learning, 2018. URL http://arxiv.org/abs/1711.00350. arXiv: 1711.00350.
|
| 219 |
+
|
| 220 |
+
Joao Loula, Marco Baroni, and Brenden M. Lake. Rearranging the Familiar: Testing Compositional Generalization in Recurrent Networks. In Proceedings of the 2018 BlackboxNLP EMNLP Workshop, July 2018. URL https://arxiv.org/abs/1807.07545.
|
| 221 |
+
|
| 222 |
+
Mateusz Malinowski and Mario Fritz. A Multi-world Approach to Question Answering About Realworld Scenes Based on Uncertain Input. In Proceedings of the 27th International Conference on Neural Information Processing Systems, NIPS’14, pp. 1682–1690, Cambridge, MA, USA, 2014. MIT Press. URL http://dl.acm.org/citation.cfm?id=2968826.2969014.
|
| 223 |
+
|
| 224 |
+
Gary F. Marcus. Rethinking Eliminative Connectionism. Cognitive Psychology, 37(3):243–282, December 1998. ISSN 0010-0285. doi: 10.1006/cogp.1998.0694. URL http://www. sciencedirect.com/science/article/pii/S0010028598906946.
|
| 225 |
+
|
| 226 |
+
Gary F. Marcus. The algebraic mind: Integrating connectionism and cognitive science. MIT press, 2003.
|
| 227 |
+
|
| 228 |
+
Ethan Perez, Florian Strub, Harm de Vries, Vincent Dumoulin, and Aaron Courville. FiLM: Visual Reasoning with a General Conditioning Layer. In In Proceedings of the 2017 AAAI Conference on Artificial Intelligence, 2017. URL http://arxiv.org/abs/1709.07871.
|
| 229 |
+
|
| 230 |
+
Adam Santoro, David Raposo, David G. T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In Advances in Neural Information Processing Systems 31, June 2017. URL http://arxiv. org/abs/1706.01427. arXiv: 1706.01427.
|
| 231 |
+
|
| 232 |
+
Paul Smolensky. The constituent structure of connectionist mental states: A reply to Fodor and Pylyshyn. Southern Journal of Philosophy, 26(Supplement):137–161, 1987.
|
| 233 |
+
|
| 234 |
+
Joseph Suarez, Justin Johnson, and Fei-Fei Li. DDRprog: A CLEVR Differentiable Dynamic Reasoning Programmer. arXiv:1803.11361 [cs], March 2018. URL http://arxiv.org/abs/ 1803.11361. arXiv: 1803.11361.
|
| 235 |
+
|
| 236 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to Sequence Learning with Neural Networks. In Advances in Neural Information Processing Systems 27, pp. 3104–3112, 2014.
|
| 237 |
+
|
| 238 |
+
Wei Wang, Ming Yan, and Chen Wu. Multi-Granularity Hierarchical Attention Fusion Networks for Reading Comprehension and Question Answering. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1705–1714, Melbourne, Australia, 2018. Association for Computational Linguistics. URL http://aclweb.org/anthology/P18-1158.
|
| 239 |
+
|
| 240 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, and others. Google’s Neural Machine Translation System: Bridging the Gap between Human and Machine Translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 241 |
+
|
| 242 |
+
# A EXPERIMENT DETAILS
|
| 243 |
+
|
| 244 |
+
We trained all models by minimizing the cross entropy loss $\log p ( y | x , q )$ on the training set, where $y ~ \in ~ \{ \mathrm { y e s } , \mathrm { n o } \}$ is the correct answer, $x$ is the image, $q$ is the question. In all our experiments we used the Adam optimizer (Kingma & Ba, 2015) with hyperparameters $\alpha = 0 . 0 0 0 1$ , $\bar { \beta } _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ , $\epsilon = 1 0 ^ { - \mathrm { { 1 0 } } }$ . We continuously monitored validation set performance of all models during training, selected the best one and reported its performance on the test set. The number of training iterations for each model was selected in preliminary investigations based on our observations of how long it takes for different models to converge. This information, as well as other training details, can be found in Table 3.
|
| 245 |
+
|
| 246 |
+
Table 3: Training details for all models. The subsampling factor is the ratio between the original spatial dimensions of the input image and those of the representation produced by the stem. It is effectively equal to $2 ^ { k }$ , where $k$ is the number of $2 \mathrm { x 2 }$ max-pooling operations in the stem.
|
| 247 |
+
|
| 248 |
+
<table><tr><td>model</td><td>stem layers</td><td>subsampling factor</td><td>iterations</td><td>batch size</td></tr><tr><td>FiLM</td><td>6</td><td>4</td><td>200000</td><td>64</td></tr><tr><td>MAC</td><td>6</td><td>4</td><td>100000</td><td>128</td></tr><tr><td>Conv+LSTM</td><td>6</td><td>4</td><td>200000</td><td>128</td></tr><tr><td>RelNet</td><td>8</td><td>8</td><td>500000</td><td>64</td></tr><tr><td>NMN (Residual)</td><td>6</td><td>4</td><td>50000</td><td>64</td></tr><tr><td>NMN (Find)</td><td>6</td><td>4</td><td>200000</td><td>64</td></tr><tr><td>Stochastic NMN (Residual)</td><td>6</td><td>4</td><td>200000</td><td>64</td></tr><tr><td>Stochastic NMN (Find)</td><td>6</td><td>4</td><td>200000</td><td>64</td></tr><tr><td>Attention NMN (Find)</td><td>6</td><td>4</td><td>50000</td><td>64</td></tr></table>
|
| 249 |
+
|
| 250 |
+
# B ADDITIONAL RESULTS FOR MAC MODEL
|
| 251 |
+
|
| 252 |
+
We performed an ablation study in which we varied the number of MAC units, the model dimensionality and the level of weight decay for the MAC model. The results can be found in Table 4.
|
| 253 |
+
|
| 254 |
+
Table 4: Results of an ablation study for MAC. The default model has 12 MAC units of dimensionality 128 and uses no weight decay. For each experiment we report means and standard deviations based on 5 repetitions.
|
| 255 |
+
|
| 256 |
+
<table><tr><td>model</td><td>#rhs/lhs</td><td>train error rate(%)</td><td>test error rate (%)</td></tr><tr><td>default</td><td>1</td><td>0.17± 0.21</td><td>13.67 ± 9.97</td></tr><tr><td>1 unit</td><td>1</td><td>0.27 ± 0.35</td><td>28.67 ± 1.91</td></tr><tr><td>2 units</td><td>1</td><td>0.23 ± 0.13</td><td>24.28 ± 2.05</td></tr><tr><td>3units</td><td>1</td><td>0.16 ±0.15</td><td>26.47 ± 1.12</td></tr><tr><td>6units</td><td>1</td><td>0.18 ±0.17</td><td>20.84± 5.56</td></tr><tr><td>24 units</td><td>1</td><td>0.04± 0.05</td><td>9.11 ± 7.67</td></tr><tr><td>dim. 64</td><td>1</td><td>0.27 ± 0.33</td><td>23.61 ± 6.27</td></tr><tr><td>dim. 256</td><td>1</td><td>0.00 ±0.00</td><td>4.62 ± 5.07</td></tr><tr><td>dim. 512</td><td>1</td><td>0.02 ±0.04</td><td>8.37 ± 7.45</td></tr><tr><td>weight decay 0.00001</td><td>1</td><td>0.20 ±0.23</td><td>19.21 ± 9.27</td></tr><tr><td>weight decay 0.0001</td><td></td><td>1.00 ± 0.54</td><td>31.19 ± 0.87</td></tr><tr><td>weight decay 0.001</td><td></td><td>40.55 ± 1.35</td><td>45.11 ± 0.74</td></tr></table>
|
| 257 |
+
|
| 258 |
+
We also perform qualitative investigations to understand the high variance in MAC’s performance. In particular, we focus on control attention weights $( c )$ for each run and aim to understand if runs that generalize have clear differences when compared to runs that failed. Interestingly, we observe that in successful runs each word $w \in \mathrm { X }$ , Y has a unit that is strongly focused on it. To present our observations in quantitative terms, we plot attention quality $\begin{array} { r } { \kappa = \operatorname* { m i n } _ { w \in \{ X , Y \} } \operatorname* { m a x } _ { k \in [ 1 ; 1 2 ] } } \end{array}$ $\alpha _ { k , w } / ( 1 - \alpha _ { k , R } )$ , where $\alpha$ are control scores vs accuracy in Figure 7 for each run (see Section 4.3.2 for an explanation of $\kappa$ ). We can clearly see a positive correlation between $\kappa$ and error rate, especially for low #rhs/lhs.
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 7: Model test accuracy vs $\kappa$ for the MAC model on different versions of SQOOP. All experiments are run 10 times with different random seeds. We can observe a clear correlation between $\kappa$ and error rate for 1, 2 and 4 rhs/lhs. Also note that perfect generalization is always associated with $\kappa$ close to 1.
|
| 262 |
+
|
| 263 |
+
Next, we experiment with a hard-coded variation of MAC. In this model, we use hard-coded control scores such that given a SQOOP question X R Y, the first half of all modules focuses on X while the second half focuses on Y. The relationship between MAC and hardcoded MAC is similar to that between NMN-Tree and end-to-end NMN with parameterization induction. However, this model has not performed as well as the successful runs of MAC. We hypothesize that this could be due to the interactions between the control scores and the visual attention part of the model.
|
| 264 |
+
|
| 265 |
+
# C INVESTIGATION OF CORRECT PREDICTIONS WITH SPURIOUS LAYOUTS
|
| 266 |
+
|
| 267 |
+
In Section 4.3.1 we observed that an NMN with the Residual module can answer test questions with a relative low error rate of $1 . 6 4 \pm 1 . 7 9 \%$ , despite being a mixture of a tree and a chain (see results in Table 1, $p _ { 0 } ( t r e e ) = 0 . 5 )$ . Our explanation for this phenomenon is as follows: when connected in a tree, modules of such spurious models generalize well, and when connected as a chain they generalize poorly. The output distribution of the whole model is thus a mixture of the mostly correct $p ( y | T \stackrel { } { = } T _ { t r e e } , x , q )$ and mostly random $p ( y | T = T _ { c h a i n } , x , q )$ . We verify our reasoning by explicitly evaluating test accuracies for $p ( y | T = T _ { t r e e } , x , q )$ and $p ( y | T = T _ { c h a i n } , x , q )$ , and find them to be around $9 9 \%$ and $6 0 \%$ respectively, confirming our hypothesis. As a result the predictions of the spurious models with $p ( t r e e ) \approx 0 . 5$ have lower confidence than those of sharp tree models, as indicated by the high log loss of $0 . 2 7 \pm 0 . 0 4$ . We visualize the progress of structure induction for the Residual module with $p _ { 0 } ( t r e e ) = 0 . 5$ in Figure 4 which shows how $p ( t r e e )$ saturates to 1.0 for #rhs/lhs ${ } = 1 8$ and remains around 0.5 when #rhs/lhs $^ { = 1 }$ .
|
| 268 |
+
|
| 269 |
+
# D SQOOP PSEUDOCODE
|
| 270 |
+
|
| 271 |
+
# Algorithm 1 Pseudocode for creating SQOOP
|
| 272 |
+
|
| 273 |
+
1: $S \gets \{ \mathrm { A , B , C , \dots , Z , 0 , 1 , 2 , 3 , \dots , 9 } \}$
|
| 274 |
+
2: Rel ← {LEFT-OF, RIGHT-OF, ABOVE, BELOW} . relations
|
| 275 |
+
3: function CREATESQOOP(k)
|
| 276 |
+
4: T rainQuestions ← []
|
| 277 |
+
5: AllQuestions ← []
|
| 278 |
+
6: for all $X$ in $S$ do
|
| 279 |
+
7: AllRhs ← RandomSample $( S \setminus \{ X \} , \mathbf { k } )$ $\triangleright$ sample without replacement from $S \setminus \{ X \}$
|
| 280 |
+
8: $A l l Q u e s t i o n s \gets \{ X \} \times R e l \times ( S \setminus \{ X \} ) \cup A l l Q u e s t i o n$ s
|
| 281 |
+
9: for all $R , Y$ in $A l l R h s \times R e l$ do
|
| 282 |
+
10: T rainQuestions $ ( X , R , Y ) \cup T$ rainQuestions
|
| 283 |
+
11: end for
|
| 284 |
+
12: end for
|
| 285 |
+
13: T estQuestions ← AllQuestions \ T rainQuestions
|
| 286 |
+
14: function GENERATEEXAMPLE $( X , R , Y )$
|
| 287 |
+
15: $a \sim \{ \mathrm { Y e s } , \mathrm { N o } \}$
|
| 288 |
+
16: if $a = \mathrm { Y e s }$ then
|
| 289 |
+
17: $I $ place $X$ and $Y$ objects so that $R$ holds $\triangleright$ create the image
|
| 290 |
+
18: $I $ sample 3 objects from $S$ and add to $I$
|
| 291 |
+
19: else
|
| 292 |
+
20: repeat
|
| 293 |
+
21: $X ^ { \prime } \gets$ Sample $X ^ { \prime }$ from $S \setminus \{ X \}$
|
| 294 |
+
22: $Y ^ { \prime } \gets \boldsymbol { \mathsf { S } }$ ample $Y ^ { \prime }$ from $S \backslash \{ Y \}$
|
| 295 |
+
23: $I $ place $X ^ { \prime }$ and $Y$ objects so that $R$ holds . create the image
|
| 296 |
+
24: $I $ add $X$ and $Y ^ { \prime }$ objects to $I$ so that $R$ holds
|
| 297 |
+
25: $I $ sample 1 more object from $S$ and add to $I$
|
| 298 |
+
26: until $X$ and $Y$ are not in relation $R$ in I
|
| 299 |
+
27: end if
|
| 300 |
+
28: return $I , X , R , Y , a$
|
| 301 |
+
29: end function
|
| 302 |
+
30: T rain $\gets$ sample $ | \underset { -- } { \underbrace { 1 0 ^ { 6 } } } | \underset { -- } { \underbrace { T r a i n Q u e s t i o n s } } |$ examples for each (X,R,Y) T rainQuestions from
|
| 303 |
+
GENERATEEXAMPLE $( X , R , Y )$
|
| 304 |
+
31: $T e s t \gets$ sample 10 examples for each (X,R,Y) T estQuestions from GENERATEEXAM
|
| 305 |
+
$\mathrm { P L E } ( X , R , Y )$
|
| 306 |
+
32: end function
|
md/train/HkgHk3RctX/HkgHk3RctX.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SEQ2SLATE: RE-RANKING AND SLATE OPTIMIZATION WITH RNNS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Ranking is a central task in machine learning and information retrieval. In this task, it is especially important to present the user with a slate of items that is appealing as a whole. This in turn requires taking into account interactions between items, since intuitively, placing an item on the slate affects the decision of which other items should be placed alongside it. In this work, we propose a sequence-to-sequence model for ranking called seq2slate. At each step, the model predicts the next item to place on the slate given the items already selected. The recurrent nature of the model allows complex dependencies between items to be captured directly in a flexible and scalable way. We show how to learn the model end-to-end from weak supervision in the form of easily obtained click-through data. We further demonstrate the usefulness of our approach in experiments on standard ranking benchmarks as well as in a real-world recommendation system.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Ranking a set of candidate items is a central task in machine learning and information retrieval. Many existing ranking systems are based on pointwise estimators, where the model assigns a score to each item in a candidate set and the resulting slate is obtained by sorting the list according to item scores (Liu et al., 2009). Such models are usually trained from click-through data to optimize an appropriate loss function (Joachims, 2002). This simple approach is computationally attractive as it only requires a sort operation over the candidate set at test (or serving) time, and can therefore scale to large problems. On the other hand, in terms of modeling, pointwise rankers cannot easily express dependencies between ranked items. In particular, the score of an item (e.g., its probability of being clicked) often depends on the other items in the slate and their joint placement. Such interactions between items can be especially dominant in the common case where display area is limited or when strong position bias is present, so that only a few highly ranked items get the user’s attention. In this case it may be preferable, for example, to present a diverse set of items at the top positions of the slate in order to cover a wider range of user interests.
|
| 12 |
+
|
| 13 |
+
A significant amount of work on learning-to-rank does consider interactions between ranked items when training the model. In pairwise approaches a classifier is trained to determine which item should be ranked first within a pair of items (e.g., Herbrich et al., 1999; Joachims, 2002; Burges et al., 2005). Similarly, in listwise approaches the loss depends on the full permutation of items (e.g., Cao et al., 2007; Yue et al., 2007). Although these losses consider inter-item dependencies, the ranking function itself is pointwise, so at inference time the model still assigns a score to each item which does not depend on scores of other items.
|
| 14 |
+
|
| 15 |
+
There has been some work on trying to capture interactions between items in the ranking scores themselves (e.g., Qin et al., 2008; 2009; Zhu et al., 2014; Rosenfeld et al., 2014; Dokania et al., 2014). Such approaches can, for example, encourage a pair of items to appear next to (or far from) each other in the resulting ranking. Approaches of this type often assume that the relationship between items takes a simple form (e.g., submodular) in order to obtain tractable inference and learning algorithms. Unfortunately, this comes at the expense of the model’s expressive power.
|
| 16 |
+
|
| 17 |
+
In this paper, we present a general, scalable approach to ranking, which naturally accounts for high-order interactions. In particular, we apply a sequence-to-sequence (seq2seq) model (Sutskever et al., 2014) to the ranking task, where the input is the list of candidate items and the output is the resulting ordering. Since the output sequence corresponds to ranked items on the slate, we call this model sequence-to-slate (seq2slate). The order in which the input is processed can significantly affect the performance of such models (Vinyals et al., 2016). For this reason, we often assume the availability of a base (or “production”) ranker with which the input sequence is ordered (e.g., a simple pointwise method that ignores the interactions we seek to model), and view the output of our model as a re-ranking of the items.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: The seq2slate pointer network architecture for ranking.
|
| 21 |
+
|
| 22 |
+
To address the seq2seq problem, we build on the recent success of recurrent neural networks (RNNs) in a wide range of applications (e.g., Sutskever et al., 2014). This allows us to use a deep model to capture rich dependencies between ranked items, while keeping the computational cost of inference manageable. More specifically, we use pointer networks, which are seq2seq models with an attention mechanism for pointing at positions in the input (Vinyals et al., 2015b). We show how to train the network end-to-end to directly optimize several commonly used ranking measures. To this end, we adapt RNN training to use weak supervision in the form of click-through data obtained from logs, instead of relying on ground-truth rankings, which are much more expensive to obtain. Finally, we demonstrate the usefulness of the proposed approach in a number of learning-to-rank benchmarks and in a large-scale, real-world recommendeation system.
|
| 23 |
+
|
| 24 |
+
# 2 RANKING AND SLATE OPTIMIZATION AS SEQUENCE PREDICTION
|
| 25 |
+
|
| 26 |
+
The ranking problem is that of computing a ranking of a set of items (or ordered list or slate) given some query or context. We formalize the problem as follows. Assume a set of $n$ items, each represented by a feature vector $x _ { i } \in \mathbb { R } ^ { m }$ (which may depend on a query or context). Let $\pi \in \Pi$ denote a permutation of the items, where each $\pi _ { j } \in \{ 1 , \ldots , n \}$ denotes the index of the item in position $j$ . Our goal is to predict the output ranking $\pi$ given the input items $x$ . For instance, given a specific user query, we might want to return an ordered set of music recommendations from a set of candidates that maximizes some measure of user engagement (e.g., number of tracks played).
|
| 27 |
+
|
| 28 |
+
In the seq2seq framework, the probability of an output permutation, or slate, given the inputs is expressed as a product of conditional probabilities according to the chain rule:
|
| 29 |
+
|
| 30 |
+
$$
|
| 31 |
+
p ( \pi | x ) = \prod _ { j = 1 } ^ { n } p ( \pi _ { j } | \pi _ { 1 } , \dots , \pi _ { j - 1 } , x ) \ ,
|
| 32 |
+
$$
|
| 33 |
+
|
| 34 |
+
This expression is completely general and does not make any conditional independence assumptions. In our case, the conditional $p ( \pi _ { j } | \pi _ { < j } , x ) \in \Delta ^ { n }$ (a point in the $n$ -dimensional simplex) models the probability of any item being placed at the $j$ ’th position in the ranking given the items already placed at previous positions. Therefore, this conditional exactly captures all high-order dependencies between items in the ranked list, including those due to diversity, similarity or other interactions.
|
| 35 |
+
|
| 36 |
+
Our setting is somewhat different than a standard seq2seq setting in that the output vocabulary is not fixed. In particular, the same index (position) is populated by different items in different instances (queries). Indeed, the vocabulary size $n$ itself may vary per instance in the common case where the number of items to rank can change. This is precisely the problem addressed by pointer networks, which we review next.
|
| 37 |
+
|
| 38 |
+
# POINTER-NETWORK ARCHITECTURE FOR RANKING
|
| 39 |
+
|
| 40 |
+
We employ the pointer-network architecture of Vinyals et al. (2015b) to model the conditional $p ( \pi _ { j } | \pi _ { < j } ^ { - } , \stackrel { . } { x } )$ . A pointer network uses non-parametric softmax modules, akin to the attention mechanism of Bahdanau et al. (2015), and learns to point to items in its input sequence rather than predicting an index from a fixed-sized vocabulary.
|
| 41 |
+
|
| 42 |
+
Our seq2slate model, illustrated in Fig. 1, consists of two recurrent neural networks (RNNs): an encoder and a decoder, both of which use Long Short-term Memory (LSTM) cells (Hochreiter and Schmidhuber, 1997). At each encoding step $i \leq n$ , the encoder RNN reads the input vector $x _ { i }$ and outputs a $d$ -dimensional vector $e _ { i }$ , thus transforming the input sequence $\{ x _ { i } \} _ { i = 1 } ^ { n }$ into a sequence of latent memory states $\{ e _ { i } \} _ { i = 1 } ^ { n }$ . At each decoding step $j$ , the decoder RNN outputs a $d$ -dimensional vector $d _ { j }$ which is used as a query in our attention function. The attention function takes as input the query $d _ { j } \in \mathbb { R } ^ { d }$ and the set of latent memory states computed by the encoder $\{ e _ { i } \} _ { i = 1 } ^ { n }$ and produces a probability distribution over the next item to include in the output sequence as follows:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r l r } & { s _ { i } ^ { j } = v ^ { \top } \operatorname { t a n h } \left( W _ { e n c } \cdot e _ { i } + W _ { d e c } \cdot d _ { j } \right) } \\ & { p _ { \theta } ( \pi _ { j } = i | \pi _ { < j } , x ) \equiv p _ { i } ^ { j } = \left\{ \begin{array} { l l } { e ^ { s _ { i } ^ { j } } / \sum _ { k \notin \pi _ { < j } } e ^ { s _ { k } ^ { j } } } & { \mathrm { i f ~ } i \notin \pi _ { < j } } \\ { 0 } & { \mathrm { i f ~ } i \in \pi _ { < j } } \end{array} \right. } & { , } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $W _ { e n c } , W _ { d e c } \in \mathbb { R } ^ { d \times d }$ and $v \in \mathbb { R } ^ { d }$ are learned parameters in our network, denoted collectively by parameter vector $\theta$ . The probability $p _ { i } ^ { j } = p _ { \theta } ( \pi _ { j } = i | \pi _ { < j } , x )$ , is obtained via a softmax over the remaining items and represents the degree to which the model points to input $i$ at decoding step $j$ . To output a permutation, the $p _ { i } ^ { j }$ are set to 0 for items $i$ that already appear in the slate. Once the next item $\pi _ { j }$ is selected, typically greedily or by sampling (see below), its embedding $x _ { \pi _ { j } }$ is fed as input to the next decoder step. The input of the first decoder step is a learned $d$ -dimensional vector, denoted as $g o$ in Fig. 1. Importantly, $p _ { \theta } ( \pi | x )$ is differentiable for ant fixed permutation $\pi$ which allows gradient-based learning (see Section 3).
|
| 49 |
+
|
| 50 |
+
We note the following. (i) The model makes no explicit assumptions about the type of interactions between items. If the learned conditional in Eq. (2) is close to the true conditional in Eq. (1), then the model can capture rich interactions—including diversity, similarity or others. We demonstrate this flexibility in our experiments (Section 4). (ii) $x$ can represent either raw inputs or embeddings thereof, which can be learned together with the sequence model. (iii) The computational cost of inference, dominated by the sequential decoding procedure, is $O ( n ^ { 2 } )$ , which is standard in seq2seq models with attention. We also consider a computationally cheaper single-step decoder with linear cost $O ( n )$ , which outputs a single vector $p ^ { 1 }$ , from which we obtain $\pi$ by sorting the values (similarly to pointwise ranking).
|
| 51 |
+
|
| 52 |
+
# 3 TRAINING WITH CLICK-THROUGH DATA
|
| 53 |
+
|
| 54 |
+
We now turn to the task of training the seq2slate model from data. A typical approach to learning in ranking systems is to run an existing ranker “in the wild” and log click-through data, which are then used to train an improved ranking model. This type of training data is relatively inexpensive to obtain, in contrast to human-curated labels such as relevance scores, ratings, or rankings (Joachims, 2002).
|
| 55 |
+
|
| 56 |
+
Formally, each training example consists of a sequence of items $\{ x _ { 1 } , \ldots , x _ { n } \}$ and binary labels $\left( y _ { 1 } , \ldots , y _ { n } \right)$ , with $y _ { i } \in \{ 0 , 1 \}$ , representing user feedback (e.g., click/no-click). Our approach easily extends to more informative feedback, such as the level of user engagement with the chosen item (e.g., time spent), but to simplify the presentation we focus on the binary case. Our goal is to learn the parameters $\theta$ of $p _ { \theta } ( \pi _ { j } | \pi _ { < j } , x )$ (Eq. (2)) such that permutations $\pi$ corresponding to “good” rankings are assigned high probabilities. Various performance measures $\mathcal { R } ( \pi , y )$ can be used to evaluate the quality of a permutation $\pi$ given the labels $y$ , for example, mean average precision (MAP), precision at $k$ , or normalized discounted cumulative gain at $k$ $( \mathrm { N D C G } @ \mathrm { k } )$ . Generally speaking, permutations where the positive labels rank higher are considered better.
|
| 57 |
+
|
| 58 |
+
In the standard seq2seq setting, models are trained to maximize the likelihood of a target sequence of tokens given the input, which can be done by maximizing the likelihood of each target token given the previous target tokens using Eq. (1). During training, the model is typically fed the ground-truth tokens as inputs to the next prediction step, an approach known as teacher forcing (Williams and Zipser, 1989). Unfortunately, this approach cannot be applied in our setting since we only have access to weak supervision in the form of labels $y$ (e.g clicks), rather than ground-truth permutations. Instead, we show how the seq2slate model can be trained directly from the labels $y$ .
|
| 59 |
+
|
| 60 |
+
# 3.1 TRAINING USING REINFORCE
|
| 61 |
+
|
| 62 |
+
One potential approach, which has been applied successfully in related tasks (Bello et al., 2017; Zhong et al., 2017), is to use reinforcement learning $( R L )$ to directly optimize for the ranking measure $\mathcal { R } ( \pi , \overset { \mathbf { \tilde { \alpha } } } { \boldsymbol { y } } )$ . In this setup, the objective is to maximize the expected ranking metric obtained by sequences sampled from our model: $\mathbb { E } _ { \pi \sim p _ { \theta } ( . | x ) } [ \mathcal { R } ( \pi , y ) ]$ . One can use policy gradients and stochastic gradient ascent to optimize $\theta$ . The gradient is formulated using the popular REINFORCE update (Williams, 1992) and can be approximated via Monte-Carlo sampling as follows:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { l } { \displaystyle \nabla _ { \theta } \mathbb { E } _ { \pi \sim p _ { \theta } ( . | x ) } \big [ \mathcal { R } ( \pi , y ) \big ] = \mathbb { E } _ { \pi \sim p _ { \theta } ( . | x ) } \Big [ \mathcal { R } ( \pi , y ) \nabla _ { \theta } \log p _ { \theta } ( \pi \mid x ) \Big ] } \\ { \displaystyle \approx \frac { 1 } { B } \sum _ { k = 1 } ^ { B } \Big ( \mathcal { R } ( \pi _ { k } , y _ { k } ) - b ( x _ { k } ) \Big ) \nabla _ { \theta } \log p _ { \theta } ( \pi _ { k } \mid x _ { k } ) , } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
where $k$ indexes ranking instances in a batch of size $B , \pi _ { k }$ are permutations drawn from the model $p _ { \theta }$ and $b ( x )$ denotes a baseline function that estimates the expected rewards to reduce the variance of the gradients.
|
| 69 |
+
|
| 70 |
+
# 3.2 SUPERVISED TRAINING
|
| 71 |
+
|
| 72 |
+
RL, however, is known to be a challenging optimization problem and can suffer from sample inefficiency and difficult credit assignment. As an alternative, we propose supervised learning using the labels $y$ . In particular, rather than waiting until the end of the output sequence (as in RL), we wish to give feedback to the model at each decoder step.
|
| 73 |
+
|
| 74 |
+
Consider the first step, and recall that the model assigns a score $s _ { i }$ to each item in the input. We define a per-step loss $\ell ( s , y )$ which essentially acts as a multi-label classification loss with labels $y$ as ground truth. Two natural, simple choices for $\ell$ are cross-entropy loss and hinge loss:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { l } { { \ell _ { x e n t } ( s , y ) = - \sum _ { i } { \hat { y } } _ { i } \log { p _ { i } } } } \\ { { \ell _ { h i n g e } ( s , y ) = \operatorname* { m a x } \{ 0 , 1 - \underset { i : y _ { i } = 1 } { \operatorname* { m i n } } s _ { i } + \underset { j : y _ { j } = 0 } { \operatorname* { m a x } } s _ { j } \} , } } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\hat { y } _ { i } = y _ { i } / \sum _ { j } y _ { j }$ , and $p _ { i }$ is a softmax of $s$ , similar to Eq. (2). Intuitively, with cross-entropy loss we try to assign high probabilities to positive labels (see also Kurata et al., 2016), while hinge loss is minimized when scores of items with positive labels are higher than scores of those with negative labels. Notice that both losses are convex functions of the scores $s$ . To improve convergence, we consider a smooth version of the hinge-loss where the maximum and minimum are replaced by their smooth counterparts: smoot $\begin{array} { r } { { \mathrm { ~ \ h - m a x } } ( s ; \gamma ) = \frac { 1 } { \gamma } \log \sum _ { i } e ^ { \gamma s _ { i } } } \end{array}$ (and smooth minimum is defined similarly, using $\mathrm { m i n } _ { i } ( s _ { i } ) = - \mathrm { m a x } _ { i } ( - s _ { i } ) )$ .
|
| 81 |
+
|
| 82 |
+
If we simply apply a per-step loss from Eq. (4) to all steps of the output sequence while reusing the labels $y$ at each step, then the loss is invariant to the actual output permutations (e.g., predicting a positive item at the beginning of the sequence has the same cost as predicting it at the end). Instead, we let the loss $\ell$ at each decoding step $j$ depend on the items already chosen, so no further loss is incurred after a label is predicted correctly. In particular, for a fixed permutation $\pi$ , define the sequence loss:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathcal { L } _ { \pi } ( S , y ) = \sum _ { j = 1 } ^ { n } w _ { j } \ell _ { \pi _ { < j } } ( s ^ { j } , y ) ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $\boldsymbol { S } = \{ s ^ { j } \} _ { j = 1 } ^ { n }$ , and $\ell _ { \pi < j } \left( s ^ { j } , y \right)$ depends only on the indices in $s ^ { j }$ and $y$ which are not in the prefix permutation $\pi _ { < j } = ( \pi _ { 1 } , \ldots , \pi _ { j - 1 } )$ (see Eq. (4)). Including a per-step weight $w _ { j }$ can encourage better performance earlier in the sequence (e.g., $w _ { j } = 1 / \log ( j + 1 ) )$ . Furthermore, if optimizing for a particular slate size $k$ is desired, one can restrict this loss to just the first $k$ output steps.
|
| 89 |
+
|
| 90 |
+
# DECODING POLICIES DURING TRAINING
|
| 91 |
+
|
| 92 |
+
Since teacher-forcing is not an option, we resort to feeding the model its own previous predictions, as in Bengio et al. (2015); Ranzato et al. (2016). In this case, the permutation $\pi$ is not fixed, but rather depends on the scores $S$ . Specifically, we consider two policies for producing a permutation during training, sampling and greedy decoding, and introduce their corresponding losses.
|
| 93 |
+
|
| 94 |
+
Greedy policy The greedy policy consists of selecting the item that maximizes $p _ { \theta } ( \cdot | \pi _ { < j } , x )$ at every time step $j$ . The resulting permutation $\pi ^ { * }$ then satisfies $\pi _ { j } ^ { * } = \mathrm { a r g m a x } _ { i } p _ { \theta } ( \pi _ { j } = i | \pi _ { < j } ^ { * } )$ and our loss becomes ${ \mathcal { L } } _ { \pi ^ { * } }$ . The greedy policy loss is not continuous everywhere since a small change in the scores $s$ may result in a jump between permutations, and therefore ${ \mathcal { L } } _ { \pi }$ . Specifically, the loss is non-differentiable when any $s ^ { j }$ has multiple maximizing arguments. Outside this measure-zero subspace, the loss is continuous (almost everywhere), and the gradient is well-defined.
|
| 95 |
+
|
| 96 |
+
Sampling policy The sampling policy consists of drawing each $\pi _ { j }$ from $p _ { \theta } ( \cdot | \pi _ { < j } , x )$ . The corresponding loss $\begin{array} { r } { \mathbb { E } [ \mathcal { L } ] = \sum _ { \pi } p _ { \theta } ^ { \mathrm { ~ ~ } } ( \pi ) \bar { \mathcal { L } } _ { \pi } ( \theta ) } \end{array}$ is differentiable everywhere since both $p _ { \theta } ( \pi )$ and ${ \mathcal { L } } _ { \pi } ( \theta )$ are differentiable for any permutation $\pi$ (See appendix for a direct derivation of $\mathbb { E } [ \mathcal { L } ]$ as a function of $S$ ). In this case, the gradient is formulated as:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \nabla _ { \theta } \mathbb { E } [ \mathcal { L } ( \theta ) ] = \nabla _ { \theta } \displaystyle \sum _ { \pi } p _ { \theta } ( \pi ) \mathcal { L } _ { \pi } ( \theta ) } \\ & { \quad \quad \quad \quad = \displaystyle \sum _ { \pi } \left[ ( \nabla _ { \theta } p _ { \theta } ( \pi ) ) \mathcal { L } _ { \pi } ( \theta ) + p _ { \theta } ( \pi ) ( \nabla _ { \theta } \mathcal { L } _ { \pi } ( \theta ) ) \right] } \\ & { \quad \quad \quad = \mathbb { E } _ { \pi \sim p _ { \theta } } \left[ \mathcal { L } _ { \pi } ( \theta ) \cdot \nabla _ { \theta } \log p _ { \theta } ( \pi ) + \nabla _ { \theta } \mathcal { L } _ { \pi } ( \theta ) \right] , } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
which can be approximated by:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\frac { 1 } { B } \sum _ { k = 1 } ^ { B } \left[ \left( \mathcal { L } _ { \pi _ { k } } ( \theta ) - b ( x _ { k } ) \right) \nabla _ { \theta } \log p _ { \theta } ( \pi _ { k } \mid x _ { k } ) + \nabla _ { \theta } \mathcal { L } _ { \pi _ { k } } ( \theta ) \right] ,
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $b ( \boldsymbol { x } _ { k } )$ is a baseline that approximates ${ \mathcal { L } } _ { \pi _ { k } } ( \theta )$ . Applying stochastic gradient descent intuitively decreases both the loss of any sample (right term) but also the probability of drawing samples with high losses (left term). Notice that our gradient calculation differs from scheduled sampling (Bengio et al., 2015) which instead computes the loss of the sampled sequences (right term) but ignores the probability of sampling high loss sequences (left term). We found it helpful to include both terms, which may apply more generally to training of sequence-to-sequence models (Bengio et al., 2015; Goyal et al., 2016).
|
| 109 |
+
|
| 110 |
+
For both training policies, we minimize the loss via stochastic gradient descent over mini-batches in an end-to-end fashion.
|
| 111 |
+
|
| 112 |
+
# 4 EXPERIMENTAL RESULTS
|
| 113 |
+
|
| 114 |
+
We evaluate the performance of our seq2slate model on a collection of ranking tasks. In Section 4.1 we use learning-to-rank benchmark data to study the behavior of the model. We then apply our approach to a large-scale commercial recommendation system and report the results in Section 4.2.
|
| 115 |
+
|
| 116 |
+
Implementation Details We set hyperparameters of our model to values inspired by the literature. All experiments use mini-batches of 128 training examples and LSTM cells with 128 hidden units. We train our models with the Adam optimizer (Kingma and Ba, 2014) and an initial learning rate of 0.0003 decayed every 1000 steps by a factor of 0.96. Network parameters are initialized uniformly at random in $[ - 0 . 1 , 0 . 1 ]$ . To improve generalization, we regularize the model by using dropout with probability of dropping $p _ { d r o p o u t } = 0 . 1$ and L2 regularization with a penalty coefficient $\lambda = 0 . 0 0 0 3$ . Unless specified otherwise, all results use supervised training with cross-entropy loss $\ell _ { x e n t }$ and the sampling policy. At inference time, we report metrics for the greedy policy. We use an exponential moving average with a decay rate of 0.99 as the baseline $b ( x )$ in Eq. (3) and Eq. (6). When training the seq2slate model with REINFORCE, we use $\mathcal { R } = \mathop { \mathrm { N D G C @ 1 0 } }$ as the reward function and do not regularize the model. We also considered a bidirectional encoder RNN (Schuster and Paliwal, 1997) but found that it did not lead to significant improvements in our experiments.
|
| 117 |
+
|
| 118 |
+
# 4.1 LEARNING-TO-RANK BENCHMARKS
|
| 119 |
+
|
| 120 |
+
To understand the behavior of the proposed model, we conduct experiments using two learning-torank datasets. We use two of the largest publicly available benchmarks: the Yahoo Learning to Rank Challenge data (set 1),1 and the Web30k dataset.2 All context (query) features are embedded within the item feature vectors themselves.
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan="2">Ranker</td><td colspan="3">Yahoo</td><td colspan="3">Web30k</td></tr><tr><td>MAP</td><td>NDCG@5</td><td>NDCG10</td><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td></tr><tr><td>seq2slate</td><td>0.67</td><td>0.69</td><td>0.75</td><td>0.51</td><td>0.53</td><td>0.59</td></tr><tr><td>AdaRank</td><td>0.58</td><td>0.61</td><td>0.69</td><td>0.37</td><td>0.38</td><td>0.46</td></tr><tr><td>Coordinate Ascent</td><td>0.49</td><td>0.51</td><td>0.59</td><td>0.31</td><td>0.33</td><td>0.39</td></tr><tr><td>LambdaMART</td><td>0.58</td><td>0.61</td><td>0.69</td><td>0.42</td><td>0.46</td><td>0.52</td></tr><tr><td>ListNet</td><td>0.49</td><td>0.51</td><td>0.59</td><td>0.43</td><td>0.47</td><td>0.53</td></tr><tr><td>MART</td><td>0.58</td><td>0.60</td><td>0.68</td><td>0.39</td><td>0.42</td><td>0.48</td></tr><tr><td>Random Forests</td><td>0.54</td><td>0.57</td><td>0.65</td><td>0.36</td><td>0.39</td><td>0.45</td></tr><tr><td>RankBoost</td><td>0.50</td><td>0.52</td><td>0.60</td><td>0.24</td><td>0.25</td><td>0.30</td></tr><tr><td>RankNet</td><td>0.54</td><td>0.57</td><td>0.64</td><td>0.43</td><td>0.47</td><td>0.53</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Table 1: Performance of seq2slate and other baselines on data generated with diverse-clicks.
|
| 125 |
+
|
| 126 |
+
We adapt the procedure proposed by Joachims et al. (2017) to generate click data. The original procedure is as follows: first, a base ranker is trained from the raw data. We select this base ranker by training all models in the RankLib package,3 and selecting the one with the best performance on each data set (MART for Yahoo and LambdaMART for Web30k). We generate an item ranking using the base model, which is then used to generate training data by simulating a user “cascade” model: a user observes each item with decaying probability $1 / i ^ { \eta }$ , where $i$ is the base rank of the item and $\eta$ is a parameter of the generative model. This simulates a noisy sequential scan. An observed item is clicked if its ground-truth relevance score is above a threshold (relevant: $\{ 2 , 3 , 4 \}$ , irrelevant: $\{ 0 , 1 \} ,$ ), otherwise no click is generated.
|
| 127 |
+
|
| 128 |
+
To introduce high-order interactions, we augment the above procedure as follows, creating a generative process dubbed diverse-clicks. When observing a relevant item, the user will only click if it is not too similar to previously clicked items (i.e, diverse enough), thus reducing the total number of clicks. Similarity is defined as being in the smallest $q$ percentile (i.e., $q = 0 . 5$ is the median) of Euclidean distances between pairs of feature vectors within the same ranking instance: $d _ { i j } = \| x _ { i } - x _ { j } \|$ . We use $\eta = 0$ (no decay, since clicks are sparse anyway due to the diversity term) and $q = 0 . 5$ . This modification to the generative model is essential for our purpose as the original data does not contain explicit inter-item dependencies. We also discuss variations of this model below.
|
| 129 |
+
|
| 130 |
+
Using the generated training data, we train both our seq2slate model and baseline rankers from the RankLib package: AdaRank (Xu and Li, 2007), Coordinate Ascent (Metzler and Croft, 2007), LambdaMART (Wu et al., 2010), ListNet (Cao et al., 2007), MART (Friedman, 2001), Random Forests (Breiman, 2001), RankBoost (Freund et al., 2003), RankNet (Burges et al., 2005). Some of these baselines use deep neural networks (e.g., RankNet, ListNet), so they are strong state-ofthe-art models with comparable complexity to seq2slate. The results in Table 1 show that seq2slate significantly outperforms all the baselines, suggesting that it can better capture and exploit the dependencies between items in the data.
|
| 131 |
+
|
| 132 |
+
To better understand the behavior of the model, we visualize the probabilities of the attention from Eq. (2) for one of the test instances in Fig. 2. Interestingly, the model produces slates that are close to the input ranking, but with some items demoted to lower positions, presumably due to the interactions with previous items.
|
| 133 |
+
|
| 134 |
+
We next consider several variations of the generative model and of the seq2slate model itself. Results are reported in Table 2. The rank-gain metric per example is computed by summing the positions change of all positive labels in the re-ranking, and this is averaged over all examples (queries).
|
| 135 |
+
|
| 136 |
+
Comparison of training variants In Table 2, we compare the different training variants outlined in Section 3, namely cross entropy with the greedy or sampling policy, a smooth hinge loss with $\gamma = 1 . 0$ , and REINFORCE. We find that supervised learning with cross entropy generally performs best, with the smooth hinge loss doing slightly worse. Our weakly supervised training methods have positive rank gain on all datasets, meaning they improve over the base ranker. Results from Table 2 (see also Table 5 in the appendix) suggest that training with REINFORCE yields comparable results on Yahoo but significantly worse results on the more challenging Web30k dataset. We find no significant difference in performance between relying on the greedy and sampling policies during training.
|
| 137 |
+
|
| 138 |
+
Table 2: Comparison of model and data variants for seq2slate on data generated with diverse-clicks.
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="2">Ranker</td><td colspan="4">Yahoo</td><td colspan="4">Web30k</td></tr><tr><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td><td>rank-gain</td><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td><td>rank-gain</td></tr><tr><td>seq2slate</td><td>0.67</td><td>0.69</td><td>0.75</td><td>7.4</td><td>0.51</td><td>0.53</td><td>0.59</td><td>18.3</td></tr><tr><td>Greedy policy</td><td>0.66</td><td>0.69</td><td>0.75</td><td>7.2</td><td>0.50</td><td>0.52</td><td>0.59</td><td>18.3</td></tr><tr><td>smooth-hinge</td><td>0.66</td><td>0.69</td><td>0.75</td><td>7.1</td><td>0.49</td><td>0.51</td><td>0.58</td><td>17.9</td></tr><tr><td>RL</td><td>0.66</td><td>0.68</td><td>0.75</td><td>5.7</td><td>0.44</td><td>0.47</td><td>0.53</td><td>-0.5</td></tr><tr><td>one-step decoder</td><td>0.66</td><td>0.69</td><td>0.75</td><td>6.4</td><td>0.49</td><td>0.51</td><td>0.58</td><td>16.5</td></tr><tr><td>shuffled data</td><td>0.61</td><td>0.64</td><td>0.71</td><td>1</td><td>0.36</td><td>0.36</td><td>0.44</td><td>二</td></tr><tr><td>base ranker (no-op)</td><td>0.58</td><td>0.61</td><td>0.69</td><td>0</td><td>0.45</td><td>0.48</td><td>0.54</td><td>0</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 3: Performance compared to a competitive base production ranker on real data.
|
| 143 |
+
|
| 144 |
+
<table><tr><td>Ranker</td><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td><td>rank-gain</td></tr><tr><td>one-step decoder</td><td>+26.79%</td><td>+10.69%</td><td>+40.67%</td><td>0.83</td></tr><tr><td>seq2slate</td><td>+31.32%</td><td>+14.47%</td><td>+45.77%</td><td>1.087</td></tr></table>
|
| 145 |
+
|
| 146 |
+
One-step decoding We compare seq2slate to the model which uses a single decoding step, referred to as one-step decoder (see Section 2). In Table 2 we see that this model has comparable performance to the sequential decoder. This suggests that when inference time is crucial, as in many real-world systems, one might prefer the faster single-shot option. One possible explanation for the comparable performance of the one-step decoder is that the interactions in our generated data are rather simple and can be effectively learned by the encoder. By contrast, in Section 4.2 we show that on more complex real-world data, sequential decoding can perform significantly better.
|
| 147 |
+
|
| 148 |
+
Sensitivity to input order Previous work suggests that the performance of seq2seq models are often sensitive to the order in which the input is processed (Vinyals et al., 2016; Nam et al., 2017). To test this we consider the use of seq2slate without relying on the base ranker to order the input, but instead items are fed to the model in random order. The results in Table 2 (see shuffled data) show that the performance is indeed significantly worse in this case, which is consistent with previous studies. It suggests that reranking is an easier task than ranking from scratch.
|
| 149 |
+
|
| 150 |
+
Adaptivity to the type of interaction To demonstrate the flexibility of seq2slate, we generate data using a variant of the diverse-clicks model above. In the similar-clicks model, the user also clicks on observed irrelevant items if they are similar to previously clicked items (increasing the number of total clicks). As above, we use the pairwise distances in feature space $d _ { i j }$ to determine similarity. For this model we use $q = 0 . 5$ , and $\eta = 0 . 3$ for Web30k, $\eta = 0 . 1$ for Yahoo, to keep the proportion of positive labels similar. The results in the appendix (see Table 4) show that seq2slate has comparable performance to the baseline rankers, with slightly better performance on the harder Web30k data. This demonstrates that our model can adapt to various types of interactions in the data.
|
| 151 |
+
|
| 152 |
+
# 4.2 REAL-WORLD DATA
|
| 153 |
+
|
| 154 |
+
We also apply seq2slate to a ranking problem from a large-scale commercial recommendation system. We train the model using massive click-through logs (comprising roughly $O ( 1 0 ^ { 7 } )$ instances) with cross-entropy loss, the greedy policy, L2-regularization and dropout. The data has item sets of varying size, with an average $n$ of 10.24 items per example. We learn embeddings of the raw inputs as part of training. Table 3 shows the performance of seq2slate and the one-step decoder compared to the production base ranker on test data (of roughly the same size as the training data). Significant gains are observed in all performance metrics, with sequential decoding outperforming the one-step decoder. This suggests that sequential decoding may more faithfully capture complex dependencies between the items.
|
| 155 |
+
|
| 156 |
+
Finally, we let the learned seq2slate model run in a live experiment (A/B testing). We compute the click-through rate (CTR) in each position (#clicks/#examples) for seq2slate. The production base ranker serves traffic outside the experiment, and we compute CTR per position for this traffic as well. Fig. 3 shows the difference in CTR per position, indicating that seq2slate has significantly higher CTR in the top positions. This suggests that seq2slate indeed places items that are likely to be chosen higher in the ranking.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 2: Visualization of attention probabilities on benchmark data. Intensities correspond to $p _ { i } ^ { j }$ for each item $i$ in step $j$ .
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 3: Difference in CTR per position between a seq2slate model and a base production ranker in a live experiment.
|
| 163 |
+
|
| 164 |
+
# 5 RELATED WORK
|
| 165 |
+
|
| 166 |
+
In this section we discuss additional related work. Our work builds on the recent impressive success of seq2seq models in complex prediction tasks, including machine translation (Sutskever et al., 2014; Bahdanau et al., 2015), parsing (Vinyals et al., 2015a), combinatorial optimization (Vinyals et al., 2015b; Bello et al., 2017), multi-label classification (Wang et al., 2016; Nam et al., 2017), and others. Our work differs in that we explicitly target the ranking task, which requires a novel approach to training seq2seq models from weak feedback (click-through data).
|
| 167 |
+
|
| 168 |
+
Most of the work on ranking mentioned above uses shallow representations. However, in recent years deep models have been used for information retrieval, focusing on embedding queries, documents and query-document pairs (Huang et al., 2013; Guo et al., 2016; Palangi et al., 2016; Wang and Klabjan, 2017; Pang et al., 2017) (see also recent survey by Mitra and Craswell (2017)). Rather than embedding individual items, in seq2slate a representation of the entire slate of items is learned and encoded in the RNN state. Moreover, learning the embeddings $( x )$ can be easily incorporated into the training of the sequence model to optimize both simultaneously end-to-end.
|
| 169 |
+
|
| 170 |
+
Closest to ours is the recent work of Ai et al. (2018), where an RNN is used to encode a set of items for re-ranking. Their approach uses a single decoding step with attention, similar to our one-step decoder. In contrast, we use sequential decoding, which we find crucial in certain applications (see Section 4.2). Another important difference is that their training formulation assumes availability of full rankings or relevance scores, while we focus on learning from cheap click-through data.
|
| 171 |
+
|
| 172 |
+
Finally, Santa Cruz et al. (2017) recently proposed an elegant framework for learning permutations based on the so called Sinkhorn operator. Their approach uses a continuous relaxation of permutation matrices (i.e., the set of doubly-stochastic matrices). Later, Mena et al. (2018) combined this with a Gumbel softmax distribution to enable efficient learning. However, this approach is focused on reconstruction of scrambled objects, and it is not obvious how to extend it to our ranking setting, where no ground-truth permutation is available.
|
| 173 |
+
|
| 174 |
+
# 6 CONCLUSION
|
| 175 |
+
|
| 176 |
+
We presented a novel seq2slate approach to ranking sets of items. We found the formalism of pointer-networks particularly suitable for this setting. We addressed the challenge of training the model from weak user feedback to improve the ranking quality. Our experiments show that the proposed approach is highly scalable and can deliver significant improvements in ranking results.
|
| 177 |
+
|
| 178 |
+
Our work can be extended in several directions. In terms of architecture, we aim to explore the Transformer network (Vaswani et al., 2017) in place of the RNN. Several variants can potentially improve the performance of our model, including beam-search inference (Wiseman and Rush, 2016), and training with Actor-Critic (Bahdanau et al., 2017) or SeaRNN (Leblond et al., 2018) and it will be interesting to study their performance in the ranking setting. Finally, an interesting future work direction will be to study off-policy correction (Joachims et al., 2018) for seq2slate.
|
| 179 |
+
|
| 180 |
+
# REFERENCES
|
| 181 |
+
|
| 182 |
+
Qingyao Ai, Keping Bi, Jiafeng Guo, and W. Bruce Croft. Learning a deep listwise context model for ranking refinement. In SIGIR, pages 135–144, 2018.
|
| 183 |
+
|
| 184 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of ICLR, 2015.
|
| 185 |
+
|
| 186 |
+
Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. In ICLR, 2017.
|
| 187 |
+
|
| 188 |
+
Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. In ICLR 2017 – Workshop Track, 2017.
|
| 189 |
+
|
| 190 |
+
Samy Bengio, Oriol Vinyals, Navdeep Jaitly, and Noam Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In NIPS, 2015.
|
| 191 |
+
|
| 192 |
+
Leo Breiman. Random forests. Machine learning, 45(1):5–32, 2001.
|
| 193 |
+
|
| 194 |
+
Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learning to rank using gradient descent. In Proceedings of the 22nd international conference on Machine learning, pages 89–96, 2005.
|
| 195 |
+
|
| 196 |
+
Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. Learning to rank: from pairwise approach to listwise approach. In Proceedings of the 24th international conference on Machine learning, pages 129–136. ACM, 2007.
|
| 197 |
+
|
| 198 |
+
Puneet Kumar Dokania, Aseem Behl, CV Jawahar, and M Pawan Kumar. Learning to rank using high-order information. In European Conference on Computer Vision, pages 609–623. Springer, 2014.
|
| 199 |
+
|
| 200 |
+
Yoav Freund, Raj Iyer, Robert E Schapire, and Yoram Singer. An efficient boosting algorithm for combining preferences. Journal of machine learning research, 4(Nov):933–969, 2003.
|
| 201 |
+
|
| 202 |
+
Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pages 1189–1232, 2001.
|
| 203 |
+
|
| 204 |
+
Anirudh Goyal, Alex Lamb, Ying Zhang, Saizheng Zhang, Aaron C. Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, 2016.
|
| 205 |
+
|
| 206 |
+
Jiafeng Guo, Yixing Fan, Qingyao Ai, and W. Bruce Croft. A deep relevance matching model for ad-hoc retrieval. In International Conference on Information and Knowledge Management (CIKM), pages 55–64, 2016.
|
| 207 |
+
|
| 208 |
+
Ralf Herbrich, Thore Graepel, and Klaus Obermayer. Support vector learning for ordinal regression. In ICANN, pages 97–102, 1999.
|
| 209 |
+
|
| 210 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural Computations, 1997.
|
| 211 |
+
|
| 212 |
+
Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero, and Larry Heck. Learning deep structured semantic models for web search using clickthrough data. In Proceedings of the 22nd ACM international conference on Conference on information & knowledge management, pages 2333–2338. ACM, 2013.
|
| 213 |
+
|
| 214 |
+
T. Joachims, A. Swaminathan, and M. de Rijke. Deep learning with logged bandit feedback. In International Conference on Learning Representations (ICLR), 2018.
|
| 215 |
+
|
| 216 |
+
Thorsten Joachims. Optimizing search engines using clickthrough data. In Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 133–142. ACM, 2002.
|
| 217 |
+
|
| 218 |
+
Thorsten Joachims, Adith Swaminathan, and Tobias Schnabel. Unbiased learning-to-rank with biased feedback. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pages 781–789. ACM, 2017.
|
| 219 |
+
|
| 220 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014.
|
| 221 |
+
|
| 222 |
+
Gakuto Kurata, Bing Xiang, and Bowen Zhou. Improved neural network-based multi-label classification with better initialization leveraging label co-occurrence. In ACL, 2016.
|
| 223 |
+
|
| 224 |
+
Remi Leblond, Jean-Baptiste Alayrac, Anton Osokin, and Simon Lacoste-Julien. ´ SEARNN: Training rnns with global-local losses. In ICLR, 2018.
|
| 225 |
+
|
| 226 |
+
Tie-Yan Liu et al. Learning to rank for information retrieval. Foundations and Trends $\textsuperscript { \textregistered }$ in Information Retrieval, 3(3):225–331, 2009.
|
| 227 |
+
|
| 228 |
+
Gonzalo Mena, David Belanger, Scott Linderman, and Jasper Snoek. Learning latent permutations with gumbel-sinkhorn networks. In International Conference on Learning Representations (ICLR), 2018.
|
| 229 |
+
|
| 230 |
+
Donald Metzler and W Bruce Croft. Linear feature-based models for information retrieval. Information Retrieval, 10(3):257–274, 2007.
|
| 231 |
+
|
| 232 |
+
Bhaskar Mitra and Nick Craswell. Neural models for information retrieval. arXiv:1705.01509, 2017.
|
| 233 |
+
|
| 234 |
+
Jinseok Nam, Eneldo Loza Menc´ıa, Hyunwoo J Kim, and Johannes Furnkranz. Maximizing subset ¨ accuracy with recurrent neural networks in multi-label classification. In Advances in Neural Information Processing Systems 30, pages 5413–5423, 2017.
|
| 235 |
+
|
| 236 |
+
H. Palangi, L. Deng, Y. Shen, J. Gao, X. He, J. Chen, X. Song, and R. Ward. Deep sentence embedding using long short-term memory networks: Analysis and application to information retrieval. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 24(4):694–707, 2016.
|
| 237 |
+
|
| 238 |
+
Liang Pang, Yanyan Lan, Jiafeng Guo, Jun Xu, Jingfang Xu, and Xueqi Cheng. Deeprank: A new deep architecture for relevance ranking in information retrieval. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, CIKM ’17, 2017.
|
| 239 |
+
|
| 240 |
+
Tao Qin, Tie-Yan Liu, Xu-Dong Zhang, De-Sheng Wang, Wen-Ying Xiong, and Hang Li. Learning to rank relational objects and its application to web search. In Proceedings of WWW, pages 407–416. ACM, 2008.
|
| 241 |
+
|
| 242 |
+
Tao Qin, Tie-Yan Liu, Xu-Dong Zhang, De-Sheng Wang, and Hang Li. Global ranking using continuous conditional random fields. In Advances in neural information processing systems, pages 1281–1288, 2009.
|
| 243 |
+
|
| 244 |
+
MarcAurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. Sequence level training with recurrent neural networks. In Proceedings of ICLR, 2016.
|
| 245 |
+
|
| 246 |
+
Nir Rosenfeld, Ofer Meshi, Danny Tarlow, and Amir Globerson. Learning structured models with the auc loss and its generalizations. In Artificial Intelligence and Statistics, pages 841–849, 2014.
|
| 247 |
+
|
| 248 |
+
Rodrigo Santa Cruz, Basura Fernando, Anoop Cherian, and Stephen Gould. Visual permutation learning. In CVPR, 2017.
|
| 249 |
+
|
| 250 |
+
M. Schuster and K.K. Paliwal. Bidirectional recurrent neural networks. Trans. Sig. Proc., 45(11): 2673–2681, 1997. ISSN 1053-587X. doi: 10.1109/78.650093.
|
| 251 |
+
|
| 252 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, pages 3104–3112, 2014.
|
| 253 |
+
|
| 254 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30. Curran Associates, Inc., 2017.
|
| 255 |
+
|
| 256 |
+
O. Vinyals, L. Kaiser, T. Koo, S. Petrov, I. Sutskever, and G. Hinton. Grammar as a foreign language. In NIPS, 2015a.
|
| 257 |
+
Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, pages 2692–2700, 2015b.
|
| 258 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In International Conference on Learning Representations (ICLR), 2016. URL http: //arxiv.org/abs/1511.06391.
|
| 259 |
+
Baiyang Wang and Diego Klabjan. An attention-based deep net for learning to rank. arXiv preprint arXiv:1702.06106, 2017.
|
| 260 |
+
Jiang Wang, Yi Yang, Junhua Mao, Zhiheng Huang, Chang Huang, and Wei Xu. CNN-RNN: A unified framework for multi-label image classification. In Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, pages 2285–2294. IEEE, 2016.
|
| 261 |
+
Ronald Williams. Simple statistical gradient following algorithms for connectionnist reinforcement learning. In Machine Learning, 1992.
|
| 262 |
+
Ronald J. Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural Comput., 1(2):270–280, June 1989. ISSN 0899-7667. doi: 10.1162/neco. 1989.1.2.270. URL http://dx.doi.org/10.1162/neco.1989.1.2.270.
|
| 263 |
+
Sam Wiseman and Alexander M. Rush. Sequence-to-sequence learning as beam-search optimization. In ACL, 2016.
|
| 264 |
+
Qiang Wu, Christopher JC Burges, Krysta M Svore, and Jianfeng Gao. Adapting boosting for information retrieval measures. Information Retrieval, 13(3):254–270, 2010.
|
| 265 |
+
Jun Xu and Hang Li. Adarank: a boosting algorithm for information retrieval. In Proceedings of the 30th annual international ACM SIGIR conference on Research and development in information retrieval, pages 391–398. ACM, 2007.
|
| 266 |
+
Yisong Yue, Thomas Finley, Filip Radlinski, and Thorsten Joachims. A support vector method for optimizing average precision. In Proceedings of SIGIR, pages 271–278. ACM, 2007.
|
| 267 |
+
Victor Zhong, Caiming Xiong, and Richard Socher. Seq2sql: Generating structured queries from natural language using reinforcement learning. arXiv preprint arXiv:1709.00103, 2017.
|
| 268 |
+
Yadong Zhu, Yanyan Lan, Jiafeng Guo, Xueqi Cheng, and Shuzi Niu. Learning for search result diversification. In Proceedings of SIGIR, pages 293–302. ACM, 2014.
|
| 269 |
+
|
| 270 |
+
A DERIVATION OF THE EXPECTED LOSS
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\begin{array} { r l } & { \mathbb { E } [ \mathcal { L } ] = \displaystyle \sum _ { \tau } p ( \boldsymbol { \pi } ) \mathcal { L } _ { \tau } } \\ & { \mathrm { ~ \ ~ \ } = \displaystyle \sum _ { \tau } p ( \boldsymbol { \pi } ) \sum _ { j } \ell _ { \tau < j } } \\ & { \mathrm { \ ~ \ ~ \ } = \displaystyle \sum _ { j } \sum _ { \tau } p ( \boldsymbol { \pi } _ { z < j } ) p ( \boldsymbol { \pi } _ { z < j } ) \ell _ { \tau < j } \ell _ { \tau < j } } \\ & { \mathrm { \ ~ \ ~ \ } = \displaystyle \sum _ { j } \sum _ { \tau } p ( \boldsymbol { \pi } _ { z < j } ) p ( \boldsymbol { \pi } _ { z \le j } ) \ell _ { \tau < j } \ell _ { \tau < j } } \\ & { \mathrm { \ ~ \ ~ \ } = \displaystyle \sum _ { j } \sum _ { \tau < j } p ( \boldsymbol { \pi } _ { z < j } ) \ell _ { \tau < j } \sum _ { \tau \ge j } p ( \boldsymbol { \pi } _ { z < j } | \boldsymbol { \pi } _ { z < j } ) } \\ & { \mathrm { \ ~ \ ~ \ } = \displaystyle \sum _ { j } \sum _ { \tau < j } \left( \sum _ { k = 1 } ^ { j - 1 } e ^ { \lambda _ { k } } / \sum _ { \tau \in S _ { k } } c \right) \ell _ { \tau < j } e ^ { \lambda _ { k } } \Big ) \ell _ { \tau < j } \langle \boldsymbol { s } ^ { j } , \boldsymbol { y } \rangle \ . } \end{array}
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
Since the terms are continuous (and smooth) in $S$ for all $j$ and $\pi _ { < j }$ , so is the entire function.
|
| 277 |
+
|
| 278 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 279 |
+
|
| 280 |
+
<table><tr><td rowspan="2">Ranker</td><td colspan="3">Yahoo</td><td colspan="3">Web30k</td></tr><tr><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td></tr><tr><td>seq2slate</td><td>0.82</td><td>0.82</td><td>0.84</td><td>0.44</td><td>0.54</td><td>0.50</td></tr><tr><td>AdaRank</td><td>0.83</td><td>0.81</td><td>0.84</td><td>0.41</td><td>0.52</td><td>0.48</td></tr><tr><td>Coordinate Ascent</td><td>0.83</td><td>0.82</td><td>0.85</td><td>0.39</td><td>0.47</td><td>0.44</td></tr><tr><td>LambdaMART</td><td>0.84</td><td>0.83</td><td>0.85</td><td>0.41</td><td>0.52</td><td>0.48</td></tr><tr><td>ListNet</td><td>0.83</td><td>0.83</td><td>0.85</td><td>0.41</td><td>0.53</td><td>0.49</td></tr><tr><td>MART</td><td>0.83</td><td>0.82</td><td>0.85</td><td>0.41</td><td>0.52</td><td>0.48</td></tr><tr><td>Random Forests</td><td>0.83</td><td>0.82</td><td>0.84</td><td>0.40</td><td>0.48</td><td>0.45</td></tr><tr><td>RankBoost</td><td>0.83</td><td>0.83</td><td>0.85</td><td>0.38</td><td>0.43</td><td>0.41</td></tr><tr><td>RankNet</td><td>0.83</td><td>0.82</td><td>0.84</td><td>0.35</td><td>0.36</td><td>0.35</td></tr></table>
|
| 281 |
+
|
| 282 |
+
Table 4: Performance of seq2slate and other baselines on data generated with similar-clicks.
|
| 283 |
+
|
| 284 |
+
<table><tr><td rowspan="2">Ranker</td><td colspan="4">Yahoo</td><td colspan="4">Web30k</td></tr><tr><td>MAP</td><td>NDCG@5</td><td>NDCG@10</td><td>rank-gain</td><td>MAP</td><td>NDCG@5</td><td>NDCG10</td><td>rank-gain</td></tr><tr><td>seq2slate</td><td>0.82</td><td>0.82</td><td>0.84</td><td>8.5</td><td>0.44</td><td>0.54</td><td>0.50</td><td>16.0</td></tr><tr><td>Greedy policy</td><td>0.82</td><td>0.82</td><td>0.84</td><td>8.5</td><td>0.44</td><td>0.54</td><td>0.50</td><td>15.9</td></tr><tr><td>smooth-hinge</td><td>0.80</td><td>0.80</td><td>0.82</td><td>7.7</td><td>0.44</td><td>0.54</td><td>0.50</td><td>15.9</td></tr><tr><td>RL</td><td>0.82</td><td>0.82</td><td>0.84</td><td>8.5</td><td>0.42</td><td>0.53</td><td>0.49</td><td>-14.8</td></tr><tr><td>one-step decoder</td><td>0.81</td><td>0.81</td><td>0.82</td><td>7.7</td><td>0.44</td><td>0.53</td><td>0.49</td><td>15.5</td></tr><tr><td>shuffled data</td><td>0.80</td><td>0.80</td><td>0.81</td><td>二</td><td>0.40</td><td>0.44</td><td>0.42</td><td>1</td></tr><tr><td>base ranker (no-op)</td><td>0.78</td><td>0.76</td><td>0.79</td><td>0</td><td>0.43</td><td>0.53</td><td>0.49</td><td>0</td></tr></table>
|
| 285 |
+
|
| 286 |
+
Table 5: Comparison of model and data variants for seq2slate on data generated with similar-clicks.
|
md/train/HkzRQhR9YX/HkzRQhR9YX.md
ADDED
|
@@ -0,0 +1,497 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TREE-STRUCTURED RECURRENT SWITCHING LINEARDYNAMICAL SYSTEMS FOR MULTI-SCALE MODELING
|
| 2 |
+
|
| 3 |
+
Josue Nassar
|
| 4 |
+
Department of Electrical & Computer Engineering
|
| 5 |
+
Stony Brook University
|
| 6 |
+
Stony Brook, NY 11794
|
| 7 |
+
josue.nassar@stonybrook.edu
|
| 8 |
+
Scott W. Linderman
|
| 9 |
+
Department of Statistics
|
| 10 |
+
Columbia University
|
| 11 |
+
New York, NY 10027
|
| 12 |
+
scott.linderman@columbia.edu
|
| 13 |
+
|
| 14 |
+
# Il Memming Park
|
| 15 |
+
|
| 16 |
+
Mónica F. Bugallo
|
| 17 |
+
Department of Electrical & Computer Engineering
|
| 18 |
+
Stony Brook University
|
| 19 |
+
Stony Brook, NY, 11794
|
| 20 |
+
monica.bugallo@stonybrook.edu Department of Neurobiology and Behavior Stony Brook University
|
| 21 |
+
Stony Brook, NY, 11794
|
| 22 |
+
memming.park@stonybrook.edu
|
| 23 |
+
|
| 24 |
+
# ABSTRACT
|
| 25 |
+
|
| 26 |
+
Many real-world systems studied are governed by complex, nonlinear dynamics. By modeling these dynamics, we can gain insight into how these systems work, make predictions about how they will behave, and develop strategies for controlling them. While there are many methods for modeling nonlinear dynamical systems, existing techniques face a trade off between offering interpretable descriptions and making accurate predictions. Here, we develop a class of models that aims to achieve both simultaneously, smoothly interpolating between simple descriptions and more complex, yet also more accurate models1. Our probabilistic model achieves this multi-scale property through a hierarchy of locally linear dynamics that jointly approximate global nonlinear dynamics. We call it the tree-structured recurrent switching linear dynamical system. To fit this model, we present a fully-Bayesian sampling procedure using Pólya-Gamma data augmentation to allow for fast and conjugate Gibbs sampling. Through a variety of synthetic and real examples, we show how these models outperform existing methods in both interpretability and predictive capability.
|
| 27 |
+
|
| 28 |
+
# 1 INTRODUCTION
|
| 29 |
+
|
| 30 |
+
Complex systems can often be described at multiple levels of abstraction. A computer program can be characterized by the list of functions it calls, the sequence of statements it executes, or the assembly instructions it sends to the microprocessor. As we zoom in, we gain an increasingly nuanced view of the system and its dynamics. The same is true of many natural systems. For example, brain activity can be described in terms of high-level psychological states or via detailed ion channel activations; different tasks demand different levels of granularity. One of our principal aims as scientists is to identify appropriate levels of abstraction for complex natural phenomena and to discover the dynamics that govern how these systems behave at each level of resolution.
|
| 31 |
+
|
| 32 |
+
Modern machine learning offers a powerful toolkit to aid in modeling the dynamics of complex systems. Bayesian state space models and inference algorithms enable posterior inference of the latent states of a system and the parameters that govern their dynamics (Särkkä, 2013; Barber et al., 2011; Doucet et al., 2001). In recent years, this toolkit has been expanded to incorporate increasingly flexible components like Gaussian processes (Frigola et al., 2014) and neural networks (Chung et al., 2015; Johnson et al., 2016; Gao et al., 2016; Krishnan et al., 2017) into probabilistic time series models. In neuroscience, sequential autoencoders offer highly accurate models of brain activity (Pandarinath et al., 2018). However, while these methods offer state of the art predictive models, their dynamics are specified at only the most granular resolution, leaving the practitioner to tease out higher level structure post hoc.
|
| 33 |
+
|
| 34 |
+
Here we propose a probabilistic generative model that provides a multi-scale view of the dynamics through a hierarchical architecture. We call it the tree-structured recurrent switching linear dynamical system, or TrSLDS. The model builds on the recurrent SLDS (Linderman et al., 2017) to approximate latent nonlinear dynamics through a hierarchy of locally linear dynamics. Once fit, the TrSLDS can be queried at different levels of the hierarchy to obtain dynamical descriptions at multiple levels of resolution. As we proceed down the tree, we obtain higher fidelity, yet increasingly complex, descriptions. Thus, depth offers a simple knob for trading off interpretability and flexibility. The key contributions are two-fold2: first, we introduce a new form of tree-structured stick breaking for multinomial models that strictly generalizes the sequential stick breaking of the original rSLDS, while still permitting Pólya-gamma data augmentation (Polson et al., 2013) for efficient posterior inference; second, we develop a hierarchical prior that links dynamics parameters across levels of the tree, thereby providing descriptions that vary smoothly with depth. The paper is organized as follows. Section 2 provides background material on switching linear dynamical systems and their recurrent variants. Section 3 presents our tree-structured model and Section 4 derives an efficient fullyBayesian inference algorithm for the latent states and dynamics parameters. Finally, in Section 5 we show how our model yields multi-scale dynamics descriptions for synthetic data from two standard nonlinear dynamical systems—the Lorenz attractor and the FitzHugh-Nagumo model of nonlinear oscillation—as well as for a real dataset of neural responses to visual stimuli in a macaque monkey.
|
| 35 |
+
|
| 36 |
+
# 2 BACKGROUND
|
| 37 |
+
|
| 38 |
+
Let $x _ { t } \ \in \mathbb { R } ^ { d _ { x } }$ and $y _ { t } \in \mathbb { R } ^ { d _ { y } }$ denote the latent state and the observation of the system at time $t$ respectively. The system can be described using a state-space model:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r } { \begin{array} { l c r } { x _ { t } = f ( x _ { t - 1 } , w _ { t } ; \Theta ) , } & { w _ { t } \sim \mathrm { F } _ { w } } & { ( s t a t e d y n a m i c s ) } \\ { y _ { t } = g ( x _ { t } , v _ { t } ; \Psi ) , } & { v _ { t } \sim \mathrm { F } _ { v } } & { ( o b s e r \nu a t i o n ) } \end{array} } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\Theta$ denotes the dynamics parameters, $\Psi$ denotes the emission (observation) parameters, and $w _ { t }$ and $v _ { t }$ are the state and observation noises respectively. For simplicity, we restrict ourselves to systems of the form:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { x _ { t } = f ( x _ { t - 1 } ; \Theta ) + w _ { t } , \quad w _ { t } \sim \mathcal { N } ( 0 , Q ) , } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
If the state space model is completely specified then recursive Bayesian inference can be applied to obtain an estimate of the latent states using the posterior $p \left( { x _ { 0 : T } | y _ { 1 : T } } \right)$ (Doucet et al., 2001). However in many applications, the parametric form of the state space model is unknown. While there exist methods that perform smoothing to obtain an estimate of $x _ { 0 : T }$ (Barber, 2006; Fox et al., 2009; Djuric & Bugallo, 2006), we are often interested in not only obtaining an estimate of the continuous latent states but also in learning the dynamics $f ( \cdot ; \Theta )$ that govern the dynamics of the system.
|
| 51 |
+
|
| 52 |
+
In the simplest case, we can take a parametric approach to solving this joint state-parameter estimation problem. When $f ( \cdot ; \Theta )$ and $g ( \cdot ; \Psi )$ are assumed to be linear functions, the posterior distribution over latent states is available in closed-form and the parameters can be learned via expectationmaximization. On the other hand, we have nonparametric methods that use Gaussian processes and neural networks to learn highly nonlinear dynamics and observations where the joint estimation is untractable and approximations are necessarily imployed (Zhao & Park, 2016; 2018; Frigola et al., 2014; Sussillo et al., 2016). Switching linear dynamical systems (SLDS) (Ackerson & Fu, 1970; Chang & Athans, 1978; Hamilton, 1990; Ghahramani & Hinton, 1996; Murphy, 1998) balance between these two extremes, approximating the dynamics by stochastically transitioning between a small number of linear regimes.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 1: State probability allocation through stick-breaking in standard rSLDS and the TrSLDS.
|
| 56 |
+
|
| 57 |
+
# 2.1 SWITCHING LINEAR DYNAMICAL SYSTEMS
|
| 58 |
+
|
| 59 |
+
SLDS approximate nonlinear dynamics by switching between a discrete set of linear regimes. An additional discrete latent state $z _ { t } \in \{ 1 , \ldots , K \}$ determines the linear dynamics at time $t$ ,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
x _ { t } = x _ { t - 1 } + A _ { z _ { t } } x _ { t - 1 } + b _ { z _ { t } } + w _ { t } , \quad w _ { t } \sim \mathcal { N } ( 0 , Q _ { z _ { t } } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $A _ { k } , Q _ { k } \in \mathbb { R } ^ { d _ { x } \times d _ { x } }$ and $b _ { k } \in \mathbb { R } ^ { d _ { x } }$ for $k = 1 , \ldots , K$ . Typically, $z _ { t }$ is endowed with Markovian dynamics, $\operatorname* { P r } ( z _ { t } | z _ { t - 1 } = k ) = \pi _ { k }$ . The conditionally linear dynamics allow for fast and efficient learning of the model and can utilize the learning tools developed for linear systems (Haykin, 2001). While SLDS can estimate the continuous latent states $x _ { 0 : T }$ , the assumption of Markovian dynamics for the discrete latent states severely limits their generative capacity.
|
| 66 |
+
|
| 67 |
+
# 2.2 RECURRENT SWITCHING LINEAR DYNAMICAL SYSTEMS
|
| 68 |
+
|
| 69 |
+
Recurrent switching linear dynamical systems (rSLDS) (Linderman et al., 2017), also known as augmented SLDS (Barber, 2006), are an extension of SLDS where the transition density of the discrete latent state depends on the previous location in the continuous latent space
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r } { z _ { t } | x _ { t - 1 } , \{ R , r \} \sim \pi _ { S B } \left( \nu _ { t } \right) , } \\ { \nu _ { t } = R x _ { t - 1 } + r , } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $R \in \mathbb { R } ^ { K - 1 \times d _ { x } }$ and $r \in \mathbb { R } ^ { K - 1 }$ represents hyperplanes. $\pi _ { S B } : \mathbb { R } ^ { K - 1 } \to [ 0 , 1 ] ^ { K }$ maps from the reals to the probability simplex via stick-breaking:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\pi _ { S B } ( \nu ) = \left( \pi _ { S B } ^ { ( 1 ) } ( \nu ) , \cdots , \pi _ { S B } ^ { ( K ) } ( \nu ) \right) , \quad \pi _ { S B } ^ { ( k ) } = \sigma ( \nu _ { k } ) \prod _ { j < k } \sigma \left( - \nu _ { j } \right) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
for k = 1, . . . , K − 1 and π(K)SB $\begin{array} { r } { \pi _ { S B } ^ { ( K ) } = \prod _ { k = 1 } ^ { K - 1 } \sigma \left( - \nu _ { k } \right) } \end{array}$ where $\nu _ { k }$ is the $k$ th component of of $\nu$ and $\sigma ( \nu ) = ( 1 + e ^ { - \nu } ) ^ { - 1 }$ is the logistic function (Fig. 1). By including this recurrence in the transition density of $z _ { t }$ , the rSLDS partitions the latent space into $K$ sections, where each section follows its own linear dynamics. It is through this combination of locally linear dynamical systems that the rSLDS approximates eq. (3); the partitioning of the space allows for a more interpretable visualization of the underlying dynamics.
|
| 82 |
+
|
| 83 |
+
Recurrent SLDS can be learned efficiently and in a fully Bayesian manner, and experiments empirically show that they are adept in modeling the underlying generative process in many cases. However, the stick breaking process used to partition the space poses problems for inference due to its dependence on the permutation of the discrete states $\{ 1 , \cdots , K \}$ (Linderman et al., 2017).
|
| 84 |
+
|
| 85 |
+
# 3 TREE-STRUCUTRED RECURRENT SWITCHING LINEAR DYNAMICAL SYSTEMS
|
| 86 |
+
|
| 87 |
+
Building upon the rSLDS, we propose the tree-structured recurrent switching linear dynamical system (TrSLDS). Rather than sequentially partitioning the latent space using stick breaking, we use a treestructured stick breaking procedure (Adams et al., 2010) to partition the space.
|
| 88 |
+
|
| 89 |
+
Let $\tau$ denote a tree structure with a finite set of nodes $\{ \epsilon , 1 , \cdots , N \}$ . Each node $n$ has a parent node denoted by $\operatorname { p a r } ( n )$ with the exception of the root node, $\epsilon$ , which has no parent. For simplicity, we initially restrict our scope to balanced binary trees where every internal node $n$ is the parent of two children, $\operatorname { l e f t } ( n )$ and right $( n )$ . Let $\mathrm { c h i l d } ( \bar { n } ) = \{ \mathrm { l e f t } ( n ) , \mathrm { r i g h t } ( n ) \}$ denote the set of children for internal node $n$ . Let $\mathcal { Z } \subseteq \mathcal { T }$ denote the set of leaf nodes, which have no children. Let depth $( n )$ denote the depth of a node $n$ in the tree, with $\mathrm { d e p t h } ( \epsilon ) = 0$ .
|
| 90 |
+
|
| 91 |
+
At time instant $t$ , the discrete latent state $z _ { t }$ is chosen by starting at the root node and traversing down the tree until one of the $K$ leaf nodes are reached. The traversal is done through a sequence of left/right choices by the internal nodes. Unlike in standard regression trees where the choices are deterministic (Lakshminarayanan, 2016), we model the choices as random variables. The traversal through the tree can be described as a stick breaking process. We start at the root node with a unit-length stick $\pi _ { \epsilon } = 1$ , which we divide between its two children. The left child receives a fraction $\pi _ { \mathrm { l e f t } ( \epsilon ) } = \sigma ( \nu _ { \epsilon } )$ and the right child receives the remainder $\pi _ { \mathrm { r i g h t } ( \epsilon ) } = 1 - \sigma ( \nu _ { \epsilon } )$ such that $\nu _ { \epsilon } \in \mathbb { R }$ specifies the left/right balance. This process is repeated recursively, subdividing $\pi _ { n }$ into two pieces at each internal node until we reach the leaves of the tree (Fig. 1). The stick assigned to each node is thus,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\pi _ { n } = \left\{ \begin{array} { l l } { \sigma ( \nu _ { \mathrm { p a r } ( n ) } ) ^ { \mathrm { I } [ n = \mathrm { l e f t } ( \mathrm { p a r } ( n ) ) ] } \left( 1 - \sigma ( \nu _ { \mathrm { p a r } ( n ) } ) \right) ^ { \mathrm { I } [ n = \mathrm { r i g h t } ( \mathrm { p a r } ( n ) ) ] } \pi _ { \mathrm { p a r } ( n ) } } & { n \neq \epsilon , } \\ { 1 } & { n = \epsilon . } \end{array} \right.
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
We incorporate this into the TrSLDS by allowing $\nu _ { n }$ to be a function of the continuous latent state
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\nu _ { n } ( x _ { t - 1 } , R _ { n } , r _ { n } ) = R _ { n } ^ { T } x _ { t - 1 } + r _ { n } ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where the parameters $R _ { n }$ and $r _ { n }$ specify a linear hyperplane in the continuous latent state space. As the continuous latent state $x _ { t - 1 }$ evolves, the left/right choices become more or less probable. This in turn changes the probability distribution $\pi _ { k } ( x _ { t - 1 } , \Gamma , \mathcal { T } )$ over the $K$ leaf nodes, where $\Gamma = \{ R _ { n } , r _ { n } \} _ { n \in \mathcal { T } }$ In the TrSLDS, these leaf nodes correspond to the discrete latent states of the model, such that for each leaf node $k$ ,
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
p \left( z _ { t } = k \mid x _ { t - 1 } , \Gamma , \mathcal { T } \right) = \pi _ { k } ( x _ { t - 1 } , \Gamma , \mathcal { T } ) .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
In general, the tree-structured stick-breaking is not restricted to balanced binary trees. We can allow more than two children through an ordered sequential stick-breaking at each level. In this sense, tree-structured stick-breaking is a strict generalization of stick-breaking. We also note that similar to rSLDS, the model can be made more flexible by introducing a dependence on the previous discrete latent in eq. (9) but for the rest of the paper, we stick to eq. (8).
|
| 110 |
+
|
| 111 |
+
# 3.1 A HIERARCHICAL DYNAMICS PRIOR THAT RESPECTS THE TREE STRUCTURE
|
| 112 |
+
|
| 113 |
+
Similar to standard rSLDS, the dynamics are conditionally linear given a leaf node $z _ { t }$ . A priori, it is natural to expect that locally linear dynamics of nearby regions in the latent space are similar. Thus, in the context of tree-structured stick breaking, we impose that partitions that share a common parent should have similar dynamics. We explicitly model this by enforcing a hierarchical prior on the dynamics that respects the tree structure.
|
| 114 |
+
|
| 115 |
+
Let $\left\{ A _ { n } , b _ { n } \right\}$ be the dynamics parameters associated with node $n$ . Although the locally linear dynamics of a discrete state are specified by the leaf nodes, we introduce dynamics at the internal nodes as well. These internal dynamics serve as a link between the leaf node dynamics via a hierarchical prior,
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\operatorname { v e c } ( [ A _ { n } , b _ { n } ] ) | \operatorname { v e c } ( [ A _ { \mathrm { p a r } ( n ) } , b _ { \mathrm { p a r } ( n ) } ] ) \sim { \mathcal { N } } ( \operatorname { v e c } ( [ A _ { \mathrm { p a r } ( n ) } , b _ { \mathrm { p a r } ( n ) } ] ) , \Sigma _ { n } ) ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\mathrm { v e c } ( \cdot )$ is the vectorization operator. The prior on the root node is
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\mathrm { v e c } \left( \left[ A _ { \epsilon } , b _ { \epsilon } \right] \right) \sim { \mathcal N } \left( 0 , \Sigma _ { \epsilon } \right) .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
We impose the following constraint on the covariance matrix of the prior
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\begin{array} { r } { \Sigma _ { n } = \lambda ^ { \mathrm { d e p t h } ( n ) } \Sigma _ { \epsilon } , } \end{array}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\lambda \in ( 0 , 1 )$ is a hyper parameter that dictates how "close" a parent and child are to one another. The prior over the parameters can be written as, where the affine term and the $\mathrm { v e c } ( \cdot )$ operator are dropped for compactness,
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
p ( \{ A _ { n } \} _ { n \in \mathcal { T } } ) = p ( A _ { \epsilon } ) \prod _ { i \in \operatorname { c h i l d } ( \epsilon ) } p ( A _ { i } | A _ { \epsilon } ) \prod _ { j \in \operatorname { c h i l d } ( i ) } p ( A _ { j } | A _ { i } ) \ . . . \prod _ { z \in \mathcal { Z } } p ( A _ { z } | A _ { \operatorname { p a r } ( z ) } ) .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
It is through this hierarchical tree-structured prior that TrSLDS obtains a multi-scale view of the system. Parents are given the task of learning a higher level description of the dynamics over a larger region while children are tasked with learning the nuances of the dynamics. The use of hierarchical priors also allows for neighboring sections of latent space to share common underlying dynamics inherited from their parent. TrSLDS can be queried at different levels, where levels deeper in the tree provide more resolution.
|
| 140 |
+
|
| 141 |
+
TrSLDS shares some features with regression trees (Lakshminarayanan, 2016), even though regression trees are primarily used for standard, static regression problems. The biggest differences are that our tree-structured model has stochastic choices and the internal nodes contribute to smoothing across partitions through the corresponding hierarchical prior.
|
| 142 |
+
|
| 143 |
+
There are other hierarchical extensions of SLDS that have been proposed in the literature. In Stanculescu et al. (2014), they propose adding a layer to factorized SLDS where the top-level discrete latent variables determine the conditional distribution of $z _ { t }$ , with no dependence on $x _ { t - 1 }$ . While the tree-structured stick-breaking used in TrSLDS is also a hierarchy of discrete latent variables, the model proposed in Stanculescu et al. (2014) has no hierarchy of dynamics, preventing it from obtaining a multi-scale view of the dynamics. In Zoeter & Heskes (2003), the authors construct a tree of SLDSs where an SLDS with $K$ possible discrete states is first fit. An SLDS with $M$ discrete states is then fit to each of the $K$ clusters of points. This process continues iteratively, building a hierarchical collection of SLDSs that allow for a multi-scale, low-dimensional representation of the observed data. While similar in spirit to TrSLDS, there are key differences between the two models. First, it is through the tree-structured prior that TrSLDS obtains a multi-scale view of the dynamics, thus we only need to fit one instantiation of TrSLDS; in contrast, they fit a separate SLDS for each node in the tree, which is computationally expensive. There is also no explicit probabilistic connection between the dynamics of a parent and child in Zoeter & Heskes (2003). We also note that TrSLDS aims to learn a multiscale view of the dynamics while Zoeter & Heskes (2003) focuses on smoothing, that is, they aim to learn a multi-scale view of the latent states corresponding to data but not suitable for forecasting.
|
| 144 |
+
|
| 145 |
+
In the next section we show an alternate view of TrSLDS which we will refer to as the residual model in which internal nodes do contribute to the dynamics. Nevertheless, this residual model will turn out to be equivalent to the TrSLDS.
|
| 146 |
+
|
| 147 |
+
# 3.2 RESIDUAL MODEL
|
| 148 |
+
|
| 149 |
+
Let $\{ \tilde { A } _ { n } , \tilde { b } _ { n } \}$ be the linear dynamics of node $n$ and let $\operatorname { p a t h } ( n ) = ( \epsilon , \dots , n )$ be the sequence of nodes visited to arrive at node $n$ . In contrast to TrSLDS, the dynamics for a leaf node are now determined by all the nodes in the tree:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r l } & { p ( x _ { t } | x _ { t - 1 } , \tilde { \Theta } , z _ { t } ) = \mathcal { N } ( x _ { t } | x _ { t - 1 } + \bar { A } _ { z _ { t } } x _ { t - 1 } + \bar { b } _ { z _ { t } } , \tilde { Q } _ { z _ { t } } ) , } \\ & { \bar { A } _ { z _ { t } } = \displaystyle \sum _ { j \in \mathrm { p a t h } ( z _ { t } ) } \tilde { A } _ { j } , \quad \bar { b } _ { z _ { t } } = \displaystyle \sum _ { j \in \mathrm { p a t h } ( z _ { t } ) } \tilde { b } _ { j } , } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
We model the dynamics to be independent a priori, where once again the $\mathrm { v e c } ( \cdot )$ operator and the affine term aren’t shown for compactness,
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
p ( \{ \tilde { A } _ { n } \} _ { n \in \mathcal { T } } ) = \prod _ { n \in \mathcal { T } } p ( \tilde { A } _ { n } ) , \quad p ( \tilde { A } _ { n } ) = \mathcal { N } ( 0 , \tilde { \Sigma } _ { n } ) ,
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
where $\tilde { \Sigma } _ { n } = \tilde { \lambda } ^ { \mathrm { d e p t h } ( n ) } \tilde { \Sigma } _ { \epsilon }$ and $\tilde { \lambda } \in ( 0 , 1 )$ .
|
| 162 |
+
|
| 163 |
+
The residual model offers a different perspective of TrSLDS. The covariance matrix can be seen as representing how much of the dynamics a node is tasked with learning. The root node is given the broadest prior because it is present in eq. (16) for all leaf nodes; thus it is given the task of learning the global dynamics. The children then have to learn to explain the residuals of the root node. Nodes deeper in the tree become more associated with certain regions of the space, so they are tasked with learning more localized dynamics which is represented by the prior being more sharply centered on 0. The model ultimately learns a multi-scale view of the dynamics where the root node captures a coarse estimate of the system while lower nodes learn a much finer grained picture. We show that TrSLDS and residual model yield the same joint distribution (See A for the proof).
|
| 164 |
+
|
| 165 |
+
Theorem 1. TrSLDS and the residual model are equivalent if the following conditions are true: $A _ { \epsilon } = \tilde { A } _ { \epsilon } ,$ , $\begin{array} { r } { A _ { n } = \sum _ { j \in \mathrm { p a t h } ( n ) } \tilde { A } _ { j } } \end{array}$ , $Q _ { z } = \tilde { Q } _ { z } \forall z \in \mathrm { l e a v e s } ( \mathcal { T } )$ , $\Sigma _ { \epsilon } = \tilde { \Sigma } _ { \epsilon }$ and $\lambda = \tilde { \lambda }$
|
| 166 |
+
|
| 167 |
+
# 4 BAYESIAN INFERENCE
|
| 168 |
+
|
| 169 |
+
The linear dynamic matrices $\Theta$ , the hyperplanes $\Gamma = \{ R _ { n } , r _ { n } \} _ { n \in \mathcal { T } \backslash \mathcal { Z } }$ , the emission parameters $\Psi$ , the continuous latent states $x _ { 0 : T }$ and the discrete latent states $z _ { 1 : T }$ must be inferred from the data. Under the Bayesian framework, this implies computing the posterior,
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
p \left( { { x } _ { 0 : T } } , { { z } _ { 0 : T } } , \Theta , \Psi , \Gamma \vert { { y } _ { 1 : T } } \right) = \frac { p \left( { { x } _ { 0 : T } } , { { z } _ { 1 : T } } , \Theta , \Psi , \Gamma , y _ { 1 : T } \right) } { p \left( { { y } _ { 1 : T } } \right) } .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
We perform fully Bayesian inference via Gibbs sampling (Brooks et al., 2011) to obtain samples from the posterior distribution described in eq. (18). To allow for fast and closed form conditional posteriors, we augment the model with Pólya-gamma auxiliary variables Polson et al. (2013).
|
| 176 |
+
|
| 177 |
+
# 4.1 PÓLYA-GAMMA AUGMENTATION
|
| 178 |
+
|
| 179 |
+
Consider a logistic regression from regressor $x _ { n } \in \mathbb { R } ^ { d _ { x } }$ to categorical distribution $z _ { n } \in \{ 0 , 1 \}$ ; the likelihood is
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
p ( z _ { 1 : N } ) = \prod _ { n = 1 } ^ { N } \frac { \Big ( e ^ { x _ { n } ^ { T } \beta } \Big ) ^ { z _ { n } } } { 1 + e ^ { x _ { n } ^ { T } \beta } } .
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
If a Gaussian prior is placed on $\beta$ then the model is non-conjugate and the posterior can’t be obtained in closed form. To circumvent this problem Polson et al. (2013) introduced a Pólya-Gamma (PG) augmentation scheme. This augmentation scheme is based on the following integral identity
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\frac { \left( e ^ { \psi } \right) ^ { a } } { \left( 1 + e ^ { \psi } \right) ^ { b } } = 2 ^ { - b } e ^ { \kappa \psi } \int _ { 0 } ^ { \infty } e ^ { - \frac { 1 } { 2 } \omega \psi ^ { 2 } } p ( \omega ) \mathrm { d } \omega
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
where $\kappa = a - b / 2$ and $\omega \sim \mathrm { P G } ( b , 0 )$ . Setting $\psi = x ^ { T } \beta$ , it is evident that the integrand is a kernel for a Gaussian. Augmenting the model with PG axillary r.v.s $\{ \omega _ { n } \} _ { n = 1 } ^ { N }$ , eq. (19) can be expressed as
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
p ( z _ { 1 : N } ) = \prod _ { n = 1 } ^ { N } \frac { \Big ( e ^ { x _ { n } ^ { T } \beta } \Big ) ^ { z _ { n } } } { 1 + e ^ { x _ { n } ^ { T } \beta } } \propto \prod _ { n = 1 } ^ { N } e ^ { \kappa _ { n } \psi _ { n } } \int _ { 0 } ^ { \infty } e ^ { - \frac { 1 } { 2 } \omega _ { n } \psi _ { n } ^ { 2 } } p ( \omega _ { n } ) \mathrm { d } \omega _ { n } = \prod _ { n = 1 } ^ { N } \mathbb { E } _ { \omega _ { n } } \big [ e ^ { - \frac { 1 } { 2 } ( \omega _ { n } \psi _ { n } ^ { 2 } - 2 \kappa _ { n } \psi _ { n } ) } \big ] .
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
Conditioning on $\omega _ { n }$ , the posterior of $\beta$ is
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
p ( \beta | \omega _ { 1 : N } , z _ { 1 : N } , x _ { 1 : N } ) \propto p ( \beta ) \prod _ { n = 1 } ^ { N } e ^ { - \frac { 1 } { 2 } \left( \omega _ { n } \psi _ { n } ^ { 2 } - 2 \kappa _ { n } \psi _ { n } \right) }
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $\psi _ { n } = x _ { n } ^ { T } \beta$ and $\begin{array} { r } { \kappa _ { n } = z _ { n } - \frac { 1 } { 2 } } \end{array}$ . It can be shown that the conditional posterior of $\omega _ { n }$ is also PG where $\omega _ { n } | \beta , x _ { n } , z _ { n } \sim \mathrm { P G } ( 1 , \psi _ { n } )$ (Polson et al., 2013).
|
| 204 |
+
|
| 205 |
+
# 4.2 CONDITIONAL POSTERIORS
|
| 206 |
+
|
| 207 |
+
The structure of the model allows for closed form conditional posterior distributions that are easy to sample from. For clarity, the conditional posterior distributions for the TrSLDS are given below:
|
| 208 |
+
|
| 209 |
+
1. The linear dynamic parameters $( A _ { k } , b _ { k } )$ and state variance $Q _ { k }$ of a leaf node $k$ are conjugate with a Matrix Normal Inverse Wishart (MNIW) prior
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
p ( ( A _ { k } , b _ { k } ) , Q _ { k } | x _ { 0 : T } , z _ { 1 : T } ) \propto p ( ( A _ { k } , b _ { k } ) , Q _ { k } ) \prod _ { t = 1 } ^ { T } N ( x _ { t } | x _ { t - 1 } + A _ { z _ { t } } x _ { t - 1 } + b _ { z _ { t } } , Q _ { z _ { t } } ) ^ { \mathbb { 1 } [ z _ { t } = k ] } .
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
2. The linear dynamic parameters of an internal node $n$ are conditionally Gaussian given a Gaussian prior on $\left( A _ { n } , b _ { n } \right)$
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
p ( ( A _ { n } , b _ { n } ) | \Theta _ { - n } ) \propto p ( ( A _ { n } , b _ { n } ) | ( A _ { \mathrm { p a r } ( n ) } , b _ { \mathrm { p a r } ( n ) } ) ) \prod _ { j \in \coth \mathbb { 1 } \mathbb { d } ( n ) } p ( ( A _ { j } , b _ { j } ) | ( A _ { n } , b _ { n } ) ) .
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
3. If we assume the observation model is linear and with additive white Gaussian noise then the emission parameters $\Psi = \{ ( C , d ) , S \}$ are also conjugate with a MNIW prior
|
| 222 |
+
|
| 223 |
+
$$
|
| 224 |
+
p ( ( C , d ) , S | x _ { 1 : T } , y _ { 1 : T } ) \propto p ( ( C , d ) , S ) \prod _ { t = 1 } ^ { T } \mathcal { N } ( y _ { t } | C x _ { t } + d , S ) .
|
| 225 |
+
$$
|
| 226 |
+
|
| 227 |
+
We can also handle Bernoulli observations through the use of Pólya-gamma augmentation.
|
| 228 |
+
In the interest of space, the details are explained in Section B.1 in the Appendix.
|
| 229 |
+
|
| 230 |
+
4. The choice parameters are logistic regressions which follow from the conditional posterior
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
p \left( \Gamma \middle | x _ { 0 : T } , z _ { 1 : T } \right) \propto p \left( \Gamma \right) \prod _ { t = 1 } ^ { T } p \left( z _ { t } \middle | x _ { t - 1 } , \Gamma \right) = p \left( \Gamma \right) \prod _ { t = 1 } ^ { T } \prod _ { n \in \mathrm { p a t h } \left( z _ { t } \right) \backslash z } \frac { \left( e ^ { \nu _ { n , t } } \right) ^ { \mathrm { 1 } \left( \mathrm { l e f t } \left( n \right) \in \mathrm { p a t h } \left( z _ { t } \right) \right) } } { 1 + e ^ { \nu _ { n , t } } } ,
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
where $\nu _ { n , t } = R _ { n } ^ { T } x _ { t - 1 } + r _ { n }$ . The likelihood is of the same form as the left hand side of eq. (20), thus it is amenable to the PG augmentation. Let $\omega _ { n , t }$ be the auxiliary Pólya-gamma random variable introduced at time $t$ for an internal node $n$ . We can express the posterior over the hyperplane of an internal node $n$ as:
|
| 237 |
+
|
| 238 |
+
$$
|
| 239 |
+
p ( ( R _ { n } , r _ { n } ) | x _ { 0 : T } , z _ { 1 : T } , \omega _ { n , 1 : T } ) \propto p ( ( R _ { n } , r _ { n } ) ) \prod _ { t = 1 } ^ { T } \mathcal { N } ( \nu _ { n , t } | \kappa _ { n , t } / \omega _ { n , t } , 1 / \omega _ { n , t } ) ^ { 1 ( n \in \mathrm { p a t h } ( z _ { t } ) ) } ,
|
| 240 |
+
$$
|
| 241 |
+
|
| 242 |
+
where $\begin{array} { r } { \kappa _ { n , t } = \frac 1 2 \mathbb { 1 } [ j = \mathrm { l e f t } ( n ) ] - \frac 1 2 \mathbb { 1 } [ j = \mathrm { r i g h t } ( n ) ] } \end{array}$ , $j \in \mathrm { c h i l d } ( n )$ . Augmenting the model with Pólya-gamma random variables allows for the posterior to be conditionally Gaussian under a Gaussian prior.
|
| 243 |
+
|
| 244 |
+
5. Conditioned on the discrete latent states, the continuous latent states are Gaussian. However, the presence of the tree-structured recurrence potentials $\psi ( x _ { t - 1 } , z _ { t } )$ introduced by eq. (10) destroys the Gaussinity of the conditional. When the model is augmented with PG random variables $\omega _ { n , t }$ , the augmented recurrence potential, $\psi ( x _ { t - 1 } , \boldsymbol { z } _ { t } , \omega _ { n , t } )$ , becomes effectively Gaussian, allowing for the use of message passing for efficient sampling. Linderman et al. (2017) shows how to perform message-passing using the Pólya-gamma augmented recurrence potentials $\psi ( x _ { t } , z _ { t } , w _ { n , t } )$ . In the interest of space, the details are explained in Section B.2 in the Appendix.
|
| 245 |
+
|
| 246 |
+
6. The discrete latent variables $z _ { 1 : T }$ are conditionally independent given $x _ { 1 : T }$ thus
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
p \left( \boldsymbol { z } _ { t } = k | \boldsymbol { x } _ { 1 : T } , \Theta , \Gamma \right) = \frac { p \left( x _ { t } | \boldsymbol { x } _ { t - 1 } , \theta _ { k } \right) p \left( \boldsymbol { z } _ { t } = k | \boldsymbol { x } _ { t - 1 } , \Gamma \right) } { \sum _ { l \in \mathrm { l e a v e s } ( T ) } p \left( \boldsymbol { x } _ { t } | \boldsymbol { x } _ { t - 1 } , \theta _ { l } \right) p \left( \boldsymbol { z } _ { t } = l | \boldsymbol { x } _ { t - 1 } , \Gamma \right) } , k \in \mathrm { l e a v e s } ( T ) .
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
7. The conditional posterior of the Pólya-Gamma random variables are also Pólya-Gamma: $\omega _ { n , t } | z _ { t } , ( R _ { n } , r _ { n } ) , x _ { t - 1 } \sim \mathrm { P G } ( 1 , \nu _ { n , t } )$ .
|
| 253 |
+
|
| 254 |
+
Due to the complexity of the model, good initialization is critical for the Gibbs sampler to converge to a mode in a reasonable number of iterations. Details of the initialization procedure are contained in Section C in the Appendix.
|
| 255 |
+
|
| 256 |
+
# 5 EXPERIMENTS
|
| 257 |
+
|
| 258 |
+
We demonstrate the potential of the proposed model by testing it on a number of non-linear dynamical systems. The first, FitzHugh-Nagumo, is a common nonlinear system utilized throughout neuroscience to describe an action potential. We show that the proposed method can offer different angles of the system. We also compare our model with other approaches and show that we can achieve state of the art performance. We then move on to the Lorenz attractor, a chaotic nonlinear dynamical system, and show that the proposed model can once again break down the dynamics and offer an interesting perspective. Finally, we apply the proposed method on the data from Graf et al. (2011).
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
Figure 2: TrSLDS applied to model the FitzHugh-Nagumo nonlinear oscillator. (a) The model was trained on 100 trajectories with random starting points. (b) The model can infer the latent trajectories. (c) The true vector field of FHN is shown where color of the arrow represents log-speed. The two nullclines are plotted in yellow and green. (d-f) The vector fields display the multi-scale view learned from the model where color of the arrows dictate log-speed The background color showcases the hierarchical partitioning learned by the model where the darker the color is, the higher the probability of ending up in that discrete state. As we go deeper in the tree, the resolution increases which is evident from the vector fields. (g) A deterministic trajectory from the leaf nodes (colored by most likely leaf node) with affine transformation onto a trajectory FHN (gray). (h) Plotting $w$ and $v$ over time, we see that the second level captures some of the oscillations but ultimately converges to a fixed point. The model learned by the leaf nodes captures the limit cycle accurately. (i) Performances compared for multi-step prediction. We see that TrSLDS outperforms rSLDS.
|
| 262 |
+
|
| 263 |
+
# 5.1 FITZHUGH-NAGUMO
|
| 264 |
+
|
| 265 |
+
The FitzHugh-Nagumo (FHN) model is a 2-dimensional reduction of the Hodgkin-Huxley model which is completely described by the following system of differential equations (Izhikevich, 2007):
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\dot { v } = v - \frac { v ^ { 3 } } { 3 } - w + I _ { e x t } , \qquad \tau \dot { w } = v + a - b w .
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
We set the parameters to $a = 0 . 7$ , $b = 0 . 8$ , $\tau = 1 2 . 5$ , and $I _ { e x t } \sim \mathcal { N } ( 0 . 7 , 0 . 0 4 )$ . We trained our model with 100 trajectories where the starting points were sampled uniformly from $[ - 3 , 3 ] ^ { 2 }$ . Each of the trajectories consisted of 430 time points, where the last 30 time points of the trajectories were used for testing. The observation model is linear and Gaussian where $C = { \binom { 2 } { 0 } } \quad { \overset { 0 } { - } } { \overset { - } { 2 } } { \overset { - } { ) } } , d = [ 0 . 5 , 0 . 5$ ] and $S = 0 . 0 1 \mathbb { I } _ { 2 }$ where $\mathbb { I } _ { n }$ is an identity matrix of dimension n. We set the number of leaf nodes to be 4 and ran Gibbs for 1,000 samples; the last 50 samples were kept and we choose the sample that produced the highest log likelihood to produce Fig. 2 where the vector fields were produced using the mode of the conditional posteriors of the dynamics.
|
| 272 |
+
|
| 273 |
+
To quantitatively measure the predictive power of TrSLDS, we compute the $k$ -step predictive mean squared error, $\mathbf { M S E } _ { k }$ , and its normalized version, $R _ { k } ^ { 2 }$ , on a test set where $\mathrm { M S E } _ { k }$ and $\bar { R } _ { k } ^ { 2 }$ are defined as
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\mathbf { M S E } _ { k } = \frac { 1 } { T - k } \sum _ { t = 0 } ^ { T - k } \left\| y _ { t + k } - \hat { y } _ { t + k } \right\| _ { 2 } ^ { 2 } , \qquad R _ { k } ^ { 2 } = 1 - \frac { ( T - k ) \mathbf { M S E } _ { k } } { \sum _ { t = 0 } ^ { T - k } \left\| y _ { t + k } - \bar { y } \right\| _ { 2 } ^ { 2 } } ,
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
where $\bar { y }$ is the average of a trial and $\hat { y } _ { t + k }$ is the prediction at time $t + k$ which is obtained by (i) using the the samples produced by the sampler to obtain an estimate of $\hat { x } _ { T }$ given $y _ { 1 : T }$ , (ii) propagate $\hat { x } _ { T }$ for $k$ time steps forward to obtain $\hat { x } _ { t + k }$ and then (iii) obtain $\hat { y } _ { t + k }$ . We compare the model to LDS, SLDS and rSLDS for $k = 1 , \ldots , 3 0$ over the last 30 time steps for all 100 trajectories (Fig. 2I).
|
| 280 |
+
|
| 281 |
+
# 5.2 LORENZ ATTRACTOR
|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
Figure 3: (a) The 50 trajectories used to train the model are plotted where the red "x" displays the starting point of the trajectory. (b) The inferred latent states are shown, colored by their discrete latent state. (c) We see that the second layer approximates the Lorenz attractor with 2 ellipsoids. A trajectory from the Lorenz attractor starting at the same initial point is shown for comparison. (d) Going one level lower in the tree, we see that in order to capture the nuances of the dynamics, each of the ellipsoids must be split in half. A trajectory from the Lorenz attractor is shown for comparison. (e) Plotting the dynamics, it is evident that the leaf nodes improve on it’s parent’s approximation. (f) The $R _ { k } ^ { 2 }$ demonstrates the predictive power of TrSLDS.
|
| 285 |
+
|
| 286 |
+
Lorenz attractors are chaotic systems whose nonlinear dynamics are defined by,
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\begin{array} { r } { \dot { x _ { 1 } } = \sigma \left( x _ { 2 } - x _ { 1 } \right) , \quad \dot { x _ { 2 } } = x _ { 1 } ( \rho - x _ { 3 } ) - x _ { 2 } , \quad \dot { x _ { 3 } } = x _ { 1 } x _ { 2 } - \beta x _ { 3 } . } \end{array}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
The parameters were set to $\sigma = 1 0$ , $\rho = 2 8$ and $\beta = 8 / 3$ . The data consisted of 50 trajectories, each of length of 230 where the first 200 time points are used for training and the last 30 are used for testing. The observation model was a projection onto 10 dimensional space with Gaussian noise.We set the number of leaf nodes to be 4 and ran Gibbs for 1,000 samples; the last 50 samples were kept and we choose the sample that produced the highest log-likelihood to produce Fig. 3.
|
| 293 |
+
|
| 294 |
+
The butterfly shape of the Lorenz attractor lends itself to being roughly approximated by two 2- dimensional ellipsoids; this is exactly what TrSLDS learns in the second level of the tree. As is evident from Fig. 5B, the two ellipsoids don’t capture the nuances of the dynamics. Thus, the model partitions each of the ellipsoids to obtain a finer description. We can see that embedding the system with a hierarchical tree-structured prior allows for the children to build off its parent’s approximations.
|
| 295 |
+
|
| 296 |
+
# 5.3 NEURAL DATA
|
| 297 |
+
|
| 298 |
+
To validate the model and inference procedure, we used the neural spike train data recorded from the primary visual cortex of an anesthetized macaque monkey collected by Graf et al. (2011). The dataset is composed of short trials where the monkey viewed periodic temporal pattern of motions of 72 orientations, each repeated 50 times. Dimensionality reduction of the dataset showed that for each orientation of the drifting grating stimulus, the neural response oscillates over time, but in a stimulus dependent geometry captured in 3-dimensions (Zhao & Park, 2017). We used 50 trials each from a subset of 4 stimulus orientations grouped in two (140 and 150 degrees vs. 230 and 240 degrees) where each trial contained 140 neurons. Out of the 140 neurons, we selected 63 well-tuned neurons. The spike trains were binarized with a $1 0 \mathrm { m s }$ window for Bernoulli observation model and we truncated the onset and offset neural responses, resulting in 111 time bins per trial.
|
| 299 |
+
|
| 300 |
+
We fit TrSLDS with $K = 4$ leaf nodes and 3-dimensional continuous latent space; the sampler was run for 500 samples where the last sample was used to produce the results shown in Fig. 4. To obtain an initial estimate for $x _ { 0 : T }$ , we smoothed the spike trains using a Gaussian kernel and performed probabilistic PCA on the smoothed spike trains.
|
| 301 |
+
|
| 302 |
+
From Fig. 4, it is evident that TrSLDS has learned a multi-scale view as expected. It is able to correctly distinguish between the two groups of orientations by assigning them to two different subtrees (green-yellow vs. red-orange). The leaf nodes of each subtree refines the periodic orbit further. From Fig. 4, we can see that TrSLDS also learns two limit cycles that are separated.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 4: Modeling primary visual cortex spike trains. (top) Example spike raster plots in response to a drifting grating of orientations 150 and 240 degrees. Our data consisted of 200 such trials. (bottom) The average inferred latent trajectories over time for orientations 140 and 150 degrees colored by the most likely discrete latent state. (right top) Same plotted in space. The model is able to separate the limit cycles for each orientation group (green-yellow vs. red-orange) and refine them further with the leaf nodes. (right bottom) Two model generated predictive trajectories showing two stable limit cycles that resemble the two periodic orbits.
|
| 306 |
+
|
| 307 |
+
# 6 CONCLUSION
|
| 308 |
+
|
| 309 |
+
In this paper, we propose tree-structured recurrent switching linear dynamical systems (TrSLDS) which is an extension of rSLDS (Linderman et al., 2017). The system relies on the use of treestructured stick-breaking to partition the space. The tree-structured stick-breaking paradigm naturally lends itself to imposing a hierarchical prior on the dynamics that respects the tree structure. This tree-structured prior allows for a multi-scale view of the system where one can query at different levels of the tree to see different scales of the resolution. We also developed a fully Bayesian sampler, which leverages the Pólya-Gamma augmentation, to learn the parameters of the model and infer latent states. The two synthetic experiments show that TrSLDS can recover a multi-scale view of the system, where the resolution of the system increase as we delve deeper into the tree. The analysis on the real neural data verifies that TrSLDS can find a multi-scale structure.
|
| 310 |
+
|
| 311 |
+
# REFERENCES
|
| 312 |
+
|
| 313 |
+
Guy A Ackerson and King-Sun Fu. On state estimation in switching environments. IEEE Transactions on Automatic Control, 15(1):10–17, 1970.
|
| 314 |
+
|
| 315 |
+
Ryan P Adams, Zoubin Ghahramani, and Michael I Jordan. Tree-Structured Stick Breaking for Hierarchical Data. In J D Lafferty, C K I Williams, J Shawe-Taylor, R S Zemel, and A Culotta (eds.), Advances in Neural Information Processing Systems 23, pp. 19–27. Curran Associates, Inc., 2010.
|
| 316 |
+
|
| 317 |
+
David Barber. Expectation Correction for Smoothed Inference in Switching Linear Dynamical Systems. Technical report, 2006.
|
| 318 |
+
|
| 319 |
+
David Barber, A Taylan Cemgil, and Silvia Chiappa. Bayesian time series models. Cambridge University Press, 2011.
|
| 320 |
+
|
| 321 |
+
Steve Brooks, Andrew Gelman, Galin Jones, and Xiao-Li Meng. Handbook of Markov Chain Monte Carlo. CRC press, 2011.
|
| 322 |
+
|
| 323 |
+
Chaw-Bing Chang and Michael Athans. State estimation for discrete systems with switching parameters. IEEE Transactions on Aerospace and Electronic Systems, (3):418–425, 1978.
|
| 324 |
+
|
| 325 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In Advances in neural information processing systems, pp. 2980–2988, 2015.
|
| 326 |
+
|
| 327 |
+
Petar Djuric and Mónica Bugallo. Cost-Reference Particle Filtering for Dynamic Systems with Nonlinear and Conditionally Linear States, 9 2006.
|
| 328 |
+
|
| 329 |
+
Arnaud Doucet, Nando Freitas, and Neil Gordon. An Introduction to Sequential Monte Carlo Methods. In Sequential Monte Carlo Methods in Practice, pp. 3–14. Springer New York, New York, NY, 2001. doi: 10.1007/978-1-4757-3437-9{\_}1.
|
| 330 |
+
|
| 331 |
+
Elena A. Erosheva and S. McKay Curtis. Dealing with Reflection Invariance in Bayesian Factor Analysis. Psychometrika, 82(2):295–307, 6 2017. ISSN 0033-3123. doi: 10.1007/s11336-017-9564-y.
|
| 332 |
+
|
| 333 |
+
Emily Fox, Erik B Sudderth, Michael I Jordan, and Alan S Willsky. Nonparametric Bayesian Learning of Switching Linear Dynamical Systems. In D Koller, D Schuurmans, Y Bengio, and L Bottou (eds.), Advances in Neural Information Processing Systems 21, pp. 457–464. Curran Associates, Inc., 2009.
|
| 334 |
+
|
| 335 |
+
Roger Frigola, Yutian Chen, and Carl Edward Rasmussen. Variational Gaussian Process State-Space Models. In Z Ghahramani, M Welling, C Cortes, N D Lawrence, and K Q Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 3680–3688. Curran Associates, Inc., 2014.
|
| 336 |
+
|
| 337 |
+
Yuanjun Gao, Evan W Archer, Liam Paninski, and John P Cunningham. Linear dynamical neural population models through nonlinear embeddings. In Advances in neural information processing systems, pp. 163–171, 2016.
|
| 338 |
+
|
| 339 |
+
John Geweke and Guofu Zhou. Measuring the Pricing Error of the Arbitrage Pricing Theory. Review of Financial Studies, 9(2):557–587, 4 1996. ISSN 0893-9454. doi: 10.1093/rfs/9.2.557.
|
| 340 |
+
|
| 341 |
+
Zoubin Ghahramani and Geoffrey E Hinton. Switching state-space models. Technical report, University of Toronto, 1996.
|
| 342 |
+
|
| 343 |
+
Arnulf B. Graf, Adam Kohn, Mehrdad Jazayeri, and J. Anthony Movshon. Decoding the activity of neuronal populations in macaque primary visual cortex. Nature neuroscience, 14(2):239–245, February 2011. ISSN 1546-1726. doi: 10.1038/nn.2733.
|
| 344 |
+
|
| 345 |
+
James D Hamilton. Analysis of time series subject to changes in regime. Journal of econometrics, 45 (1):39–70, 1990.
|
| 346 |
+
|
| 347 |
+
Simon S Haykin. Kalman Filtering and Neural Networks. John Wiley & Sons, Inc., New York, NY, USA, 2001. ISBN 0471369985.
|
| 348 |
+
|
| 349 |
+
Eugene M Izhikevich. Dynamical systems in neuroscience. MIT press, 2007.
|
| 350 |
+
|
| 351 |
+
Matthew Johnson, David K Duvenaud, Alex Wiltschko, Ryan P Adams, and Sandeep R Datta. Composing graphical models with neural networks for structured representations and fast inference. In Advances in neural information processing systems, pp. 2946–2954, 2016.
|
| 352 |
+
|
| 353 |
+
Rahul G Krishnan, Uri Shalit, and David Sontag. Structured inference networks for nonlinear state space models. 2017.
|
| 354 |
+
|
| 355 |
+
Balaji Lakshminarayanan. Decision Trees and Forests: A Probabilistic Perspective. Technical report, UCL (University College London), 2016.
|
| 356 |
+
|
| 357 |
+
Scott Linderman, Matthew Johnson, and Ryan P Adams. Dependent Multinomial Models Made Easy: Stick-Breaking with the Polya-gamma Augmentation. In C Cortes, N D Lawrence, D D Lee, M Sugiyama, and R Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 3456–3464. Curran Associates, Inc., 2015.
|
| 358 |
+
|
| 359 |
+
Scott Linderman, Matthew Johnson, Andrew Miller, Ryan Adams, David Blei, and Liam Paninski. Bayesian Learning and Inference in Recurrent Switching Linear Dynamical Systems. In Aarti Singh and Jerry Zhu (eds.), Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pp. 914–922, Fort Lauderdale, FL, USA, 9 2017. PMLR.
|
| 360 |
+
|
| 361 |
+
Kevin P Murphy. Switching Kalman filters. Technical report, Compaq Cambridge Research, 1998.
|
| 362 |
+
|
| 363 |
+
Chethan Pandarinath, Daniel J O’Shea, Jasmine Collins, Rafal Jozefowicz, Sergey D Stavisky, Jonathan C Kao, Eric M Trautmann, Matthew T Kaufman, Stephen I Ryu, Leigh R Hochberg, et al. Inferring single-trial neural population dynamics using sequential auto-encoders. Nature methods, pp. 1, 2018.
|
| 364 |
+
|
| 365 |
+
Nicholas G Polson, James G Scott, and Jesse Windle. Bayesian Inference for Logistic Models Using Pólya–Gamma Latent Variables. Journal of the American Statistical Association, 108(504):1339– 1349, 2013. doi: 10.1080/01621459.2013.829001.
|
| 366 |
+
|
| 367 |
+
Simo Särkkä. Bayesian filtering and smoothing, volume 3. Cambridge University Press, 2013.
|
| 368 |
+
|
| 369 |
+
Ioan Stanculescu, Christopher KI Williams, and Yvonne Freer. A hierarchical switching linear dynamical system applied to the detection of sepsis in neonatal condition monitoring. In UAI, pp. 752–761, 2014.
|
| 370 |
+
|
| 371 |
+
David Sussillo, Rafal Józefowicz, L. F Abbott, and Chethan Pandarinath. LFADS - Latent Factor Analysis via Dynamical Systems. CoRR, abs/1608.06315, 2016.
|
| 372 |
+
|
| 373 |
+
Yuan Zhao and Il Memming Park. Interpretable nonlinear dynamic modeling of neural trajectories. In Advances in Neural Information Processing Systems (NIPS), 2016.
|
| 374 |
+
|
| 375 |
+
Yuan Zhao and Il Memming Park. Variational Latent Gaussian Process for Recovering SingleTrial Dynamics from Population Spike Trains. Neural Computation, 29(5), May 2017. doi: 10.1162/NECO_a_00953.
|
| 376 |
+
|
| 377 |
+
Yuan Zhao and Il Memming Park. Variational joint filtering. arXiv, abs/1707.09049, 2018.
|
| 378 |
+
|
| 379 |
+
Onno Zoeter and Tom Heskes. Hierarchical visualization of time-series data using switching linear dynamical systems. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(10): 1202–1214, 2003.
|
| 380 |
+
|
| 381 |
+
# A PROOF OF THEOREM 1
|
| 382 |
+
|
| 383 |
+
Proof. Let $\tau$ be a balanced binary tree with $K$ leaf nodes. To show that the models are equal, it suffices to show the equivalence of the likelihood and the prior between models. For compactness, we drop the affine term and the $\mathrm { v e c } ( \cdot )$ operator. The likelihood of TrSLDS is
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
p ( x _ { 1 : T } | \boldsymbol { z } _ { 1 : T } , \Theta ) = \prod _ { t = 1 } ^ { T } \mathcal { N } ( x _ { t } | x _ { t - 1 } + A _ { z _ { t } } x _ { t - 1 } , Q _ { z _ { t } } ) ,
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
and the likelihood of the residual model is
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
p ( x _ { 1 : T } | z _ { 1 : T } , \tilde { \Theta } ) = \prod _ { t = 1 } ^ { T } \mathcal { N } \left( x _ { t } | x _ { t - 1 } + \bar { A } _ { z _ { t } } x _ { t - 1 } , \tilde { Q } _ { z _ { t } } \right) .
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
where $\bar { A } _ { z _ { t } }$ is defined in eq. (16). Substituting $\begin{array} { r } { A _ { z _ { t } } = \sum _ { j \in \mathrm { p a t h } ( z _ { t } ) } \tilde { A } _ { j } } \end{array}$ into eq. (27) equates the likelihoods. All that is left to do is to show the equality of the priors.
|
| 396 |
+
|
| 397 |
+
We can express $\begin{array} { r } { A _ { n } = \sum _ { j \in \mathrm { p a t h } ( n ) } \tilde { A } _ { j } } \end{array}$ recursively
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
A _ { n } = \tilde { A } _ { n } + A _ { \mathrm { p a r } ( n ) } .
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
Plugging eq. (28) into $\ln p ( A _ { n } | A _ { \mathrm { p a r } ( n ) } )$
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\begin{array} { l } { \displaystyle \ln p \big ( A _ { n } \big | A _ { \mathrm { p a r } ( n ) } \big ) = - \frac { 1 } { 2 } \left( A _ { n } - A _ { \mathrm { p a r } ( n ) } \right) ^ { T } \Sigma _ { n } ^ { - 1 } \left( A _ { n } - A _ { \mathrm { p a r } ( n ) } \right) + \mathrm { C } } \\ { = - \frac { 1 } { 2 } \left( \tilde { A } _ { n } + A _ { \mathrm { p a r } ( n ) } - A _ { \mathrm { p a r } ( n ) } \right) ^ { T } \Sigma _ { n } ^ { - 1 } \left( \tilde { A } _ { n } + A _ { \mathrm { p a r } ( n ) } - A _ { \mathrm { p a r } ( n ) } \right) + \mathrm { C } } \\ { = - \frac { 1 } { 2 } \tilde { A } _ { n } ^ { T } \Sigma _ { n } ^ { - 1 } \tilde { A } _ { n } + \mathrm { C } } \\ { = - \frac { 1 } { 2 } \tilde { A } _ { n } ^ { T } \left( \lambda ^ { \mathrm { d e p t h } ( n ) } \Sigma _ { \epsilon } \right) ^ { - 1 } \tilde { A } _ { n } + \mathrm { C } } \end{array}
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
where $\textrm { C }$ is a constant. Because $\Sigma _ { \epsilon } = \tilde { \Sigma } _ { \epsilon }$ and $\lambda = \widetilde { \lambda }$ , eq. (32) is equivalent to the kernel of $p ( { \tilde { A } } _ { n } )$ implying that the priors are equal. Since this is true $\forall n \in \mathcal { T }$ , the joint distributions of the two models are the same. □
|
| 410 |
+
|
| 411 |
+
# B DETAILS ON BAYESIAN INFERENCE
|
| 412 |
+
|
| 413 |
+
# B.1 HANDLING BERNOULLI OBSERVATIONS
|
| 414 |
+
|
| 415 |
+
Suppose the observation of the system at time $t$ follows
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { c l c r } { { \displaystyle p ( \boldsymbol { y } _ { t } | \boldsymbol { x } _ { t } , \boldsymbol { \Psi } ) = \prod _ { n = 1 } ^ { N } \mathrm { B e r n } ( \boldsymbol { \sigma } ( \boldsymbol { v } _ { n , t } ) ) = \prod _ { n = 1 } ^ { N } \frac { ( e ^ { \boldsymbol { v } _ { n , t } } ) ^ { \boldsymbol { y } _ { n , t } } } { 1 + e ^ { \boldsymbol { v } _ { n , t } } } , } } \\ { { \boldsymbol { v } _ { n , t } = c _ { n } ^ { T } \boldsymbol { x } _ { t } + d _ { n } , } } \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where $c _ { n } \in \mathbb { R } ^ { d _ { x } }$ , $d _ { n } \in \mathbb { R }$ . Equation 33 is of the same form as the left hand side of eq. (20), thus it is amenable to PG augmentation. We introduce PG axillary variables $\eta _ { n , t }$ . Conditioning on $\eta _ { 1 : N }$ eq. (33) becomes
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\begin{array} { l } { \displaystyle p ( y _ { t } | x _ { t } , \eta _ { 1 : N } ) = \prod _ { n = 1 } ^ { N } e ^ { - \frac { 1 } { 2 } ( \eta _ { n , t } v _ { n , t } - 2 \kappa _ { n , t } v _ { n , t } ) } } \\ { \displaystyle \propto \prod _ { n = 1 } ^ { N } \mathcal { N } ( c _ { n } ^ { T } x _ { t } + d _ { n } | \kappa _ { n , t } / \eta _ { n , t } , 1 / \eta _ { n , t } ) } \\ { \displaystyle = \mathcal { N } ( C x _ { t } + D | H _ { t } ^ { - 1 } \kappa _ { t } , H _ { t } ^ { - 1 } ) } \end{array}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
where $H _ { t } = \operatorname { d i a g } ( [ \eta _ { 1 , t } , \dotsc , \eta _ { N , t } ] )$ , $\kappa _ { t } = [ \kappa _ { 1 , t } , \ldots , \kappa _ { N , t } ]$ and $\begin{array} { r } { \kappa _ { n , t } = y _ { n , t } - \frac { 1 } { 2 } } \end{array}$
|
| 428 |
+
|
| 429 |
+
The observation is now effectively Gaussian and can be incorporated into the message passing for $x _ { 1 : T }$ . The emission parameters are also conjugate with the augmented observation potential given a Matrix Normal prior. The conditional posterior on the axillary PG variables $\eta _ { n , t }$ also follows a PG distribution i.e. $\eta _ { n , t } \big | ( c _ { n } , d _ { n } ) , x _ { t } \sim \mathrm { P G } ( 1 , \overline { { \upsilon } } _ { n , t } )$ . Note that this augmentation scheme can also work for negative binomial, binomial, and multinomial observations (Polson et al., 2013; Linderman et al., 2015).
|
| 430 |
+
|
| 431 |
+
# B.2 MESSAGE PASSING FOR $x _ { 1 : T }$
|
| 432 |
+
|
| 433 |
+
Assuming that the observations, $y _ { 1 : T }$ , are linear and Gaussian, the posterior of the continuous latent states, $x _ { 0 : T }$ , conditioned on all the other variables is proportional to
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\prod _ { t = 1 } ^ { T } \psi ( x _ { t } , x _ { t - 1 } , z _ { t } ) \psi ( z _ { t } , x _ { t - 1 } ) \psi ( x _ { t } , y _ { t } )
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
where $\psi ( x _ { t } , x _ { t - 1 } , z _ { t } )$ is the potential of the conditionally linear dynamics, $\psi ( x _ { t } , y _ { t } )$ is the potential of the observation and $\psi ( x _ { t - 1 } , z _ { t } )$ is the recurrence potential. $\psi ( x _ { t - 1 } , z _ { t } )$ is a product of all the internal nodes traversed at time $t$
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\psi ( x _ { t - 1 } , z _ { t } ) = \prod _ { n \in \mathrm { p a t h } ( z _ { t } ) \backslash \mathcal { Z } } \psi _ { n } ( x _ { t - 1 } , z _ { t } ) .
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
If the potentials in eq. (38) were all linear and Gaussian, then we could efficiently sample from the posetrior of $x _ { 0 : T }$ by passing messsages forward through Kalman Filtering and then sampling backwards; the prescence of the recurrence potentials prevent this because they aren’t Gaussian. By augmenting the model with the PG r.v.’s, the recurrence potential at internal node $n$ becomes
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\psi _ { n } ( x _ { t - 1 } , z _ { t } , w _ { n , t - 1 } ) = \mathcal { N } ( R _ { n } ^ { T } x _ { t - 1 } + r _ { n } | \kappa _ { n , t - 1 } / \omega _ { n , t - 1 } , 1 / \omega _ { n , t - 1 } )
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
which is effectively Gaussian , allowing for the use of the Kalman filter for message passing.
|
| 452 |
+
|
| 453 |
+
# C INITIALIZATION
|
| 454 |
+
|
| 455 |
+
We initialized the Gibbs sampler using the following initialization procedure: (i) probabilistic PCA was performed on the data, $y _ { 1 : T }$ to initialize the emission parameters, $\{ C , d \}$ and the continuous latent states, $x _ { 1 : T }$ . (ii) To initialize the dynamics of the nodes , $\Theta$ , and the hyperplanes, $\Gamma$ , we propose greedily fitting the proposed model using MSE as the loss function. We first optimize over the root node
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\underset { A _ { \epsilon } , b _ { \epsilon } } { \arg \operatorname* { m i n } } \frac { 1 } { T } \sum _ { t = 0 } ^ { T } \left\| x _ { t + 1 } - x _ { t } - A _ { \epsilon } x _ { t } - b _ { \epsilon } \right\| _ { 2 } ^ { 2 } ,
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
and obtain $A _ { \epsilon } ^ { * } , b _ { \epsilon } ^ { * }$ (Note that $A _ { \epsilon } ^ { * } , b _ { \epsilon } ^ { * }$ can obtained in closed form by computing their corresponding OLS estimates). Fixing $A _ { \epsilon } ^ { * }$ and $b _ { \epsilon } ^ { * }$ , we then optimize over the second level in the tree
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { c } { \displaystyle \operatorname * { a r g m i n } _ { A _ { 1 } , b _ { 1 } , A _ { 2 } , b _ { 2 } , R _ { \epsilon } , r _ { \epsilon } } \frac { 1 } { T } \sum _ { t = 0 } ^ { T } \| x _ { t + 1 } - \sigma ( v _ { \epsilon } ) \hat { x } _ { 1 } - \sigma ( - v _ { \epsilon } ) \hat { x } _ { 2 } \| , } \\ { \hat { x } _ { i } = x _ { t } + \left( A _ { \epsilon } ^ { * } + A _ { i } \right) x _ { t } + ( b _ { \epsilon } ^ { * } + b _ { i } ) , } \\ { v _ { \epsilon } = R _ { \epsilon } ^ { T } x _ { t } + r _ { \epsilon } . } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
This procedure would continue until we reach the leaf nodes of the tree. $\Theta ^ { * }$ and $\Gamma ^ { * }$ are then used to initialize the dynamics and the hyperplanes, respectively. In our simulations, we used stochastic gradient descent with momentum to perform the optimization. (iii) The discrete latent states, $z _ { 1 : T }$ , were initialized by performing hard classification using $\Gamma ^ { * }$ and the initial estimate of $x _ { 0 : T }$ .
|
| 468 |
+
|
| 469 |
+
# D DEALING WITH ROTATIONAL INVARIANCE
|
| 470 |
+
|
| 471 |
+
A well known problem with these types of model is it’s susceptibility to rotational and scaling transformation, thus we can only learn the dynamics up to an affine transformation Erosheva & Curtis (2017). During Gibbs sampling the parameters will continuously rotate and scale, which can slow down the mixing of the chains. One possible solution to the issue is if we constrained $C$ to have some special structure which would make the model identifiable; this would require sampling from manifolds which is usually inefficient. Similar to Geweke & Zhou (1996), we use the following procedure to prevent the samples from continuously rotating and scaling:
|
| 472 |
+
|
| 473 |
+
• Once we obtain a sample from the conditional posterior of the emission parameters $\{ C , D \}$ , we normalize the columns of $C$ .
|
| 474 |
+
• RQ decomposition is performed on $C$ to obtain $U , O$ where $U \in \mathcal { R } ^ { d _ { y } \times d _ { x } }$ is an upper triangular matrix and $\mathcal { \dot { O } } \in \mathcal { R } ^ { d _ { x } \times d _ { x } }$ is an orthogonal matrix.
|
| 475 |
+
• We set $C = U$ and rotate all the parameters of the model using $O$ .
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
E SCALABILITY AND COMPUTATIONAL COMPLEXITY OF THE INFERENCE
|
| 479 |
+
Figure 5: The logarithm of the joint density was computed for all the samples generated from the 3 TrSLDS and smoothed using a trailing moving average filter. The sampler seems to converge to a mode rather quickly for all the three instantiations of the TrSLDS.
|
| 480 |
+
|
| 481 |
+
The rSLDS and the TrSLDS share the same linear time complexity for sampling the discrete and continuous states, and both models learn K-1 hyperplanes to weakly partition the space. Specifically, both models incur: an $\mathcal { O } ( T K )$ cost for sampling the discrete states, which increases to $\scriptstyle { \dot { \mathcal { O } } } ( T K ^ { 2 } )$ if we allow Markovian dependencies between discrete states; an $\mathcal { O } ( T D ^ { 3 } )$ cost ( $\mathrm { D }$ is the continuous state dimension) for sampling the continuous states, just like in a linear dynamical system; and $\Im { \mathcal { O } ( K D ^ { 3 } ) }$ cost for sampling the hyperplanes. The only additional cost of the TrSLDS stems from the hierarchical prior on state dynamics. Unlike the rSLDS, we impose a tree-structured prior on the dynamics to encourage similar dynamics between nearby nodes in the tree. Rather than sampling K dynamics parameters, we need to sample 2K-1. Since they are all related via a tree-structured Gaussian graphical model, the cost of an exact sample is $\mathcal { O } ( K \bar { D } ^ { 3 } )$ just as in the rSLDS, with the only difference being a constant factor of about 2. Thus, we obtain a multi-scale view of the underlying system with a negligible effect on the computational complexity.
|
| 482 |
+
|
| 483 |
+
To see how the number of discrete latent states effects the convergence speed of the Gibbs sampler, we fit 3 TrSLDS, with $K = 2 , 4 , 8$ respectively, to a Lorenz Attractor described in Sec. but used 250 trajectories to train the model as opposed to 50. To assess convergence, we plotted the logarithm of the joint density as a function of Gibbs samples. The results are shown Fig. 5.
|
| 484 |
+
|
| 485 |
+
# F SYNTHETIC NASCAR
|
| 486 |
+
|
| 487 |
+
We ran the TrSLDS on the synthetic NASCAR
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 6: TrSLDS applied to the synthetic NASCAR
|
| 491 |
+
|
| 492 |
+
# G TREE SYNTHETIC NASCAR
|
| 493 |
+
|
| 494 |
+
To check whether the sampler is mixing adequately, we test TrSLDS on a twist on the synthetic NASCAR
|
| 495 |
+
|
| 496 |
+

|
| 497 |
+
Figure 7: TrSLDS and rSLDS applied to the tree version of to the synthetic NASCAR
|
md/train/HkzSQhCcK7/HkzSQhCcK7.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STCN: STOCHASTIC TEMPORAL CONVOLUTIONAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Emre Aksan & Otmar Hilliges
|
| 4 |
+
Department of Computer Science
|
| 5 |
+
ETH Zurich, Switzerland
|
| 6 |
+
{emre.aksan, otmar.hilliges}@inf.ethz.ch
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Convolutional architectures have recently been shown to be competitive on many sequence modelling tasks when compared to the de-facto standard of recurrent neural networks (RNNs), while providing computational and modeling advantages due to inherent parallelism. However, currently there remains a performance gap to more expressive stochastic RNN variants, especially those with several layers of dependent random variables. In this work, we propose stochastic temporal convolutional networks (STCNs), a novel architecture that combines the computational advantages of temporal convolutional networks (TCN) with the representational power and robustness of stochastic latent spaces. In particular, we propose a hierarchy of stochastic latent variables that captures temporal dependencies at different time-scales. The architecture is modular and flexible due to decoupling of deterministic and stochastic layers. We show that the proposed architecture achieves state of the art log-likelihoods across several tasks. Finally, the model is capable of predicting high-quality synthetic samples over a long-range temporal horizon in modeling of handwritten text.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Generative modeling of sequence data requires capturing long-term dependencies and learning of correlations between output variables at the same time-step. Recurrent neural networks (RNNs) and its variants have been very successful in a vast number of problem domains which rely on sequential data. Recent work in audio synthesis, language modeling and machine translation tasks (Dauphin et al., 2016; Van Den Oord et al., 2016; Dieleman et al., 2018; Gehring et al., 2017) has demonstrated that temporal convolutional networks (TCNs) can also achieve at least competitive performance without relying on recurrence, and hence reducing the computational cost for training.
|
| 15 |
+
|
| 16 |
+
Both RNNs and TCNs model the joint probability distribution over sequences by decomposing the distribution over discrete time-steps. In other words, such models are trained to predict the next step, given all previous time-steps. RNNs are able to model long-term dependencies by propagating information through their deterministic hidden state, acting as an internal memory. In contrast, TCNs leverage large receptive fields by stacking many dilated convolutions, allowing them to model even longer time scales up to the entire sequence length. It is noteworthy that there is no explicit temporal dependency between the model outputs and hence the computations can be performed in parallel. The TCN architecture also introduces a temporal hierarchy: the upper layers have access to longer input sub-sequences and learn representations at a larger time scale. The local information from the lower layers is propagated through the hierarchy by means of residual and skip connections (Van Den Oord et al., 2016; Bai et al., 2018).
|
| 17 |
+
|
| 18 |
+
However, while TCN architectures have been shown to perform similar or better than standard recurrent architectures on particular tasks (Van Den Oord et al., 2016; Bai et al., 2018), there currently remains a performance gap to more recent stochastic RNN variants (Bayer & Osendorfer, 2014; Chung et al., 2015; Fabius & van Amersfoort, 2014; Fraccaro et al., 2016; Goyal et al., 2017; Shabanian et al., 2017). Following a similar approach to stochastic RNNs, Lai et al. (2018) present a significant improvement in the log-likelihood when a TCN model is coupled with latent variables, albeit at the cost of limited receptive field size.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: The computational graph of generative (left) and inference (right) models of STCN. The approximate posterior $q$ is conditioned on $\mathbf { d } _ { t }$ and is updated by the prior $p$ which is conditioned on the TCN representations of the previous time-step $\mathbf { d } _ { t - 1 }$ . The random latent variables at the upper layers have access to a long history while lower layers receive inputs from more recent time steps.
|
| 22 |
+
|
| 23 |
+
In this work we propose a new approach for augmenting TCNs with random latent variables, that decouples deterministic and stochastic structures yet leverages the increased modeling capacity efficiently. Motivated by the simplicity and computational advantages of TCNs and the robustness and performance of stochastic RNNs, we introduce stochastic temporal convolutional networks (STCN) by incorporating a hierarchy of stochastic latent variables into TCNs which enables learning of representations at many timescales. However, due to the absence of an internal state in TCNs, introducing latent random variables analogously to stochastic RNNs is not feasible. Furthermore, defining conditional random variables across time-steps would result in breaking the parallelism of TCNs and is hence undesirable.
|
| 24 |
+
|
| 25 |
+
In STCN the latent random variables are arranged in correspondence to the temporal hierarchy of the TCN blocks, effectively distributing them over the various timescales (see figure 1). Crucially, our hierarchical latent structure is designed to be a modular add-on for any temporal convolutional network architecture. Separating the deterministic and stochastic layers allows us to build STCNs without requiring modifications to the base TCN architecture, and hence retains the scalability of TCNs with respect to the receptive field. This conditioning of the latent random variables via different timescales is especially effective in the case of TCNs. We show this experimentally by replacing the TCN layers with stacked LSTM cells, leading to reduced performance compared to STCN.
|
| 26 |
+
|
| 27 |
+
We propose two different inference networks. In the canonical configuration, samples from each latent variable are passed down from layer to layer and only one sample from the lowest layer is used to condition the prediction of the output. In the second configuration, called STCN-dense, we take inspiration from recent CNN architectures (Huang et al., 2017) and utilize samples from all latent random variables via concatenation before computing the final prediction.
|
| 28 |
+
|
| 29 |
+
Our contributions can thus be summarized as: 1) We present a modular and scalable approach to augment temporal convolutional network models with effective stochastic latent variables. 2) We empirically show that the STCN-dense design prevents the model from ignoring latent variables in the upper layers (Zhao et al., 2017). 3) We achieve state-of-the-art log-likelihood performance, measured by ELBO, on the IAM-OnDB, Deepwriting, TIMIT and the Blizzard datasets. 4) Finally we show that the quality of the synthetic samples matches the significant quantitative improvements.
|
| 30 |
+
|
| 31 |
+
# 2 BACKGROUND
|
| 32 |
+
|
| 33 |
+
Auto-regressive models such as RNNs and TCNs factorize the joint probability of a variable-length sequence $\mathbf { x } = \{ x _ { 1 } , \dots , x _ { T } \}$ as a product of conditionals as follows:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
p _ { \theta } ( { \bf x } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( x _ { t } | x _ { 1 : t - 1 } ) \quad ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where the joint distribution is parametrized by $\theta$ . The prediction at each time-step is conditioned on all previous observations. The observation model is frequently chosen to be a Gaussian or Gaussian mixture model (GMM) for real-valued data, and a categorical distribution for discrete-valued data.
|
| 40 |
+
|
| 41 |
+
# 2.1 TEMPORAL CONVOLUTIONAL NETWORKS
|
| 42 |
+
|
| 43 |
+
In TCNs the joint probabilities in Eq. (1) are parametrized by a stack of convolutional layers. Causal convolutions are the central building block of such models and are designed to be asymmetric such that the model has no access to future information. In order to produce outputs of the same size as the input, zero-padding is applied at every layer.
|
| 44 |
+
|
| 45 |
+
In the absence of a state transition function, a large receptive field is crucial in capturing long-range dependencies. To avoid the need for vast numbers of causal convolution layers, typically dilated convolutions are used. Exponentially increasing the dilation factor results in an exponential growth of the receptive field size with depth (Yu & Koltun, 2015; Van Den Oord et al., 2016; Bai et al., 2018). In this work, without loss of generality, we use the building blocks of Wavenet (Van Den Oord et al., 2016) as gated activation units (van den Oord et al., 2016) have been reported to perform better.
|
| 46 |
+
|
| 47 |
+
A deterministic TCN representation $d _ { t } ^ { l }$ at time-step $t$ and layer $l$ summarizes the input sequence $x _ { 1 : t }$
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
d _ { t } ^ { l } = \mathbf { C o n v } ^ { ( l ) } ( d _ { t } ^ { l - 1 } , d _ { t - j } ^ { l - 1 } ) \quad \mathrm { a n d } \quad d _ { t } ^ { 1 } = \mathbf { C o n v } ^ { ( 1 ) } ( x _ { t } , x _ { t - j } ) \quad ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where the filter width is 2 and $j$ denotes the dilation step. In our work, the stochastic variables $z ^ { l } , l \ = \ 1 \ldots L$ are conditioned on TCN representations $d ^ { l }$ that are constructed by stacking $K$ Wavenet blocks over the previous $d ^ { l - 1 }$ (for details see Figure 4 in Appendix).
|
| 54 |
+
|
| 55 |
+
# 2.2 NON-SEQUENTIAL LATENT VARIABLE MODELS
|
| 56 |
+
|
| 57 |
+
VAEs (Kingma & Welling, 2013; Rezende et al., 2014) introduce a latent random variable $\mathbf { z }$ to learn the variations in the observed non-sequential data where the generation of the sample $\mathbf { X }$ is conditioned on the latent variable $\mathbf { z }$ . The joint probability distribution is defined as:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r } { p _ { \theta } ( \mathbf { x } , \mathbf { z } ) = p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p _ { \theta } ( \mathbf { z } ) \quad , } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
and parametrized by $\theta$ . Optimizing the marginal likelihood is intractable due to the non-linear mappings between $\mathbf { z }$ and $\mathbf { X }$ and the integration over $\mathbf { z }$ . Instead the VAE framework introduces an approximate posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ and optimizes a lower-bound on the marginal likelihood:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \log p _ { \theta } ( \mathbf { x } ) \geq - K L ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } ) ) + \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) ] \quad , } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $K L$ denotes the Kullback-Leibler divergence. Typically the prior $p _ { \boldsymbol { \theta } } ( \mathbf { z } )$ and the approximate $q _ { \phi } ( { \bf z } | { \bf x } )$ are chosen to be in simple parametric form, such as a Gaussian distribution with diagonal covariance, which allows for an analytical calculation of the $K L$ -term in Eq. (4).
|
| 70 |
+
|
| 71 |
+
# 2.3 STOCHASTIC RNNS
|
| 72 |
+
|
| 73 |
+
An RNN captures temporal dependencies by recursively processing each input, while updating an internal state $h _ { t }$ at each time-step via its state-transition function:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
h _ { t } = f ^ { ( h ) } ( x _ { t } , h _ { t - 1 } ) \quad ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $f ^ { ( h ) }$ is a deterministic transition function such as LSTM (Hochreiter & Schmidhuber, 1997) or GRU (Cho et al., 2014) cells. The computation has to be sequential because $h _ { t }$ depends on $h _ { t - 1 }$ .
|
| 80 |
+
|
| 81 |
+
The VAE framework has been extended for sequential data, where a latent variable $z _ { t }$ augments the RNN state $h _ { t }$ at each sequence step. The joint distribution $p _ { \boldsymbol { \theta } } ( \mathbf { x } , \mathbf { z } )$ is modeled via an auto-regressive model which results in the following factorization:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
p _ { \theta } ( \mathbf { x } , \mathbf { z } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( x _ { t } | z _ { 1 : t } , x _ { 1 : t - 1 } ) p _ { \theta } ( z _ { t } | x _ { 1 : t - 1 } , z _ { 1 : t - 1 } ) \quad .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
In contrast to the fixed prior of VAEs, $\mathcal { N } ( \mathbf { 0 } , \mathbf { I } )$ , sequential variants define prior distributions conditioned on the RNN hidden state $\mathbf { h }$ and implicitly on the input sequence $\mathbf { X }$ (Chung et al., 2015).
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2: Graphical model view of generative models of STCN (left) and STCN-dense (middle), and the inference model (right), which is shared by both variants. Diamonds represent the outputs of deterministic dilated convolution blocks where the dependence of $d _ { t }$ on the past inputs is not shown for clarity (see Eq. (2)). $x _ { t }$ and $z _ { t }$ are observable inputs and latent random variables, respectively. The generative task is to predict the next step in the sequence, given all past steps. Note that in the STCN-dense variant the next step is conditioned on all latent variables $z _ { t } ^ { l }$ for $l = 1 \ldots L$ .
|
| 91 |
+
|
| 92 |
+
# 3 STOCHASTIC TEMPORAL CONVOLUTIONAL NETWORKS
|
| 93 |
+
|
| 94 |
+
The mechanics of STCNs are related to those of VRNNs and LVAEs. Intuitively, the RNN state $h _ { t }$ is replaced by temporally independent TCN layers $d _ { t } ^ { l }$ . In the absence of an internal state, we define hierarchical latent variables $\dot { \boldsymbol { z } } _ { t } ^ { l }$ that are conditioned vertically, i.e., in the same time-step, but independent horizontally, i.e., across time-steps. We follow a similar approach to LVAEs (Sønderby et al., 2016) in defining the hierarchy in a top-down fashion and in how we estimate the approximate posterior. The inference network first computes the approximate likelihood, and then this estimate is corrected by the prior, resulting in the approximate posterior. The TCN layers $\mathbf { d }$ are shared between the inference and generator networks, analogous to VRNNs (Chung et al., 2015).
|
| 95 |
+
|
| 96 |
+
Figure 2 depicts the proposed STCN as a graphical model. STCNs consist of two main modules: the deterministic temporal convolutional network and the stochastic latent variable hierarchy. For a given input sequence $\mathbf { x } = \{ x _ { t } \} , t = 1 . . . T$ we first apply dilated convolutions over the entire sequence to compute a set of deterministic representations $\dot { d } _ { t } ^ { \check { l } } , l = 1 \ldots L$ . Here, $d _ { t } ^ { l }$ corresponds to the output of a block of dilated convolutions at layer $l$ and time-step $t$ . The output $d _ { t } ^ { l }$ is then used to update a set of random latent variables $z _ { t } ^ { l }$ arranged to correspond with different time-scales.
|
| 97 |
+
|
| 98 |
+
To preserve the parallelism of TCNs, we do not introduce an explicit dependency between different time-steps. However, we suggest that conditioning a latent variable $z _ { t } ^ { l - \bar { 1 } }$ on the preceding variable $z _ { t } ^ { l }$ implicitly introduces temporal dependencies. Importantly, the random latent variables in the upper layer have access to a larger receptive field due to its deterministic input $d _ { t - 1 } ^ { l }$ , whereas latent random variables in lower layers are updated with different, more local information. However, the latent variable $z _ { t } ^ { l - 1 }$ may receive longer-range information from $z _ { t } ^ { l }$ .
|
| 99 |
+
|
| 100 |
+
The generative and inference models are jointly trained by optimizing a step-wise variational lower bound on the log-likelihood (Kingma $\&$ Welling, 2013; Rezende et al., 2014). In the following sections we describe these components and build up the lower-bound for a single time-step $t$ .
|
| 101 |
+
|
| 102 |
+
# 3.1 GENERATIVE MODEL
|
| 103 |
+
|
| 104 |
+
Each sequence step $x _ { t }$ is generated from a set of latent variables $z _ { t }$ , split into layers as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
p _ { \theta } \big ( z _ { t } \vert x _ { 1 : t - 1 } \big ) = p _ { \theta } \big ( z _ { t } ^ { L } \vert d _ { t - 1 } ^ { L } \big ) \prod _ { l = 1 } ^ { L - 1 } p _ { \theta } \big ( z _ { t } ^ { l } \vert z _ { t } ^ { l + 1 } , d _ { t - 1 } ^ { l } \big ) \quad ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
p _ { \theta } ( z _ { t } ^ { l } | z _ { t } ^ { l + 1 } , d _ { t - 1 } ^ { l } ) = \mathcal { N } ( \mu _ { t , p } ^ { l } , \sigma _ { t , p } ^ { l } ) \quad \mathrm { a n d } \quad [ \mu _ { t , p } ^ { l } , \sigma _ { t , p } ^ { l } ] = f _ { p } ^ { ( l ) } ( z _ { t } ^ { l + 1 } , d _ { t - 1 } ^ { l } ) \quad .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Here the prior is modeled by a Gaussian distribution with diagonal covariance, as is common in the VAE framework. The subscript $p$ denotes items of the generative distribution. For the inference distribution we use the subscript $q$ . The distributions are parameterized by a neural network $f _ { p } ^ { ( l ) }$ and conditioned on: (1) the $d _ { t - 1 } ^ { l }$ computed by the dilated convolutions from the previous time-step, and (2) a sample from the preceding level at the same time-step zl+1t . Please note that at inference time we draw samples from the approximate posterior distribution $z _ { t } ^ { l + 1 } \sim q _ { \phi } ( z _ { t } ^ { l + 1 } | \cdot )$ . The generative model, on the other hand, uses the prior $z _ { t } ^ { l + 1 } \sim p _ { \theta } ( z _ { t } ^ { l + 1 } | \cdot )$ .
|
| 115 |
+
|
| 116 |
+
We propose two variants of the observation model. In the non-sequential scenario, the observations are defined to be conditioned on only the last latent variable in the hierarchy, i.e., $p _ { \theta } ( x _ { t } | z _ { t } ^ { 1 } )$ , following Sønderby et al. (2016); Gulrajani et al. (2016) and Rezende et al. (2014) our STCN variant uses the same observation model, allowing for an efficient optimization. However, latent units are likely to become inactive during training in this configuration (Burda et al., 2015; Bowman et al., 2015; Zhao et al., 2017) resulting in a loss of representational power.
|
| 117 |
+
|
| 118 |
+
The latent variables at different layers are conditioned on different contexts due to the inputs $d _ { t } ^ { l }$ . Hence, the latent variables are expected to capture complementary aspects of the temporal context. To propagate the information all the way to the final prediction and to ensure that gradients flow through all layers, we take inspiration from Huang et al. (2017) and directly condition the output probability on samples from all latent variables. We call this variant of our architecture STCN-dense.
|
| 119 |
+
|
| 120 |
+
The final predictions are then computed by the respective observation functions:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
p _ { \theta } ( x _ { t } | z _ { t } ) = f ^ { ( o ) } ( z _ { t } ^ { 1 } ) \quad \mathrm { a n d } \quad p _ { \theta } ^ { d e n s e } ( x _ { t } | z _ { t } ) = f ^ { ( o ) } ( z _ { t } ^ { 1 } , z _ { t } ^ { 2 } \dots z _ { t } ^ { L } ) \quad ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $f ^ { ( o ) }$ corresponds to the output layer constructed by stacking 1D convolutions or Wavenet blocks depending on the dataset.
|
| 127 |
+
|
| 128 |
+
# 3.2 INFERENCE MODEL
|
| 129 |
+
|
| 130 |
+
In the original VAE framework the inference model is defined as a bottom-up process, where the latent variables are conditioned on the stochastic layer below. Furthermore, the parameterization of the prior and approximate posterior distributions are computed separately (Burda et al., 2015; Rezende et al., 2014). In contrast, Sønderby et al. (2016) propose a top-down dependency structure shared across the generative and inference models. From a probabilistic point of view, the approximate Gaussian likelihood, computed bottom-up by the inference model, is combined with the Gaussian prior, computed top-down from the generative model. We follow a similar procedure in computing the approximate posterior.
|
| 131 |
+
|
| 132 |
+
First, the parameters of the approximate likelihood are computed for each stochastic layer $l$ :
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
[ \hat { \mu } _ { t , q } ^ { l } , \hat { \sigma } _ { t , q } ^ { l } ] = f _ { q } ^ { ( l ) } ( z _ { t } ^ { l + 1 } , d _ { t } ^ { l } ) \quad ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
followed by the downward pass, recursively computing the prior and approximate posterior by precision-weighted addition:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { l } { { \sigma _ { t , q } ^ { l } = \frac { 1 } { ( \hat { \sigma } _ { t , q } ^ { l } ) ^ { - 2 } + ( \sigma _ { t , p } ^ { l } ) ^ { - 2 } } \quad , } } \\ { { \mu _ { t , q } ^ { l } = \sigma _ { t , q } ^ { l } ( \hat { \mu } _ { t , q } ^ { l } ( \hat { \sigma } _ { t , q } ^ { l } ) ^ { - 2 } + \mu _ { t , p } ^ { l } ( \sigma _ { t , p } ^ { l } ) ^ { - 2 } ) \quad . } } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
Finally, the approximate posterior has the same decomposition as the prior (see Eq. (7)):
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
q _ { \phi } ( z _ { t } | x _ { 1 : t } ) = q _ { \phi } ( z _ { t } ^ { L } | d _ { t } ^ { L } ) \prod _ { l = 1 } ^ { L - 1 } q _ { \phi } ( z _ { t } ^ { l } | z _ { t } ^ { l + 1 } , d _ { t } ^ { l } ) \quad ,
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\begin{array} { r } { q _ { \phi } ( z _ { t } ^ { l } | z _ { t } ^ { l + 1 } , d _ { t } ^ { l } ) = \mathcal { N } ( \mu _ { t , q } ^ { l } , \sigma _ { t , q } ^ { l } ) \quad . } \end{array}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Note that the inference and generative network share the parameters of dilated convolutions $\mathrm { C o n v } ^ { ( l ) }$
|
| 155 |
+
|
| 156 |
+
# 3.3 LEARNING
|
| 157 |
+
|
| 158 |
+
The variational lower-bound on the log-likelihood at time-step $t$ can be defined as follows:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
\begin{array} { r l } & { \log p ( x _ { t } ) \geq \mathbb { E } _ { q _ { \phi } ( z _ { t } | x _ { t } ) } [ \log p \theta ( x _ { t } | z _ { t } ) ] - D _ { K L } ( q _ { \phi } ( z _ { t } | x _ { 1 : t } ) | | p \theta ( z _ { t } | x _ { 1 : t - 1 } ) ) } \\ & { \qquad = \mathbb { E } _ { q _ { \phi } ( z _ { t } ^ { 1 } \dots z _ { t } ^ { L } | x _ { t } ) } [ \log p \theta ( x _ { t } | z _ { t } ^ { 1 } \dots z _ { t } ^ { L } ) ] - D _ { K L } ( q _ { \phi } ( z _ { t } ^ { 1 } \dots z _ { t } ^ { L } | x _ { 1 : t } ) | | p \theta ( z _ { t } ^ { 1 } \dots z _ { t } ^ { L } | x _ { 1 : t - 1 } ) ) } \\ & { \mathcal { C } _ { t } ( \theta , \phi ; x _ { t } ) = \mathcal { L } _ { t } ^ { R e c o n } + \mathcal { L } _ { t } ^ { K L } . } \end{array}
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
Using the decompositions from Eq. (7) and (12), the Kullback-Leibler divergence term becomes:
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r l } { \displaystyle \mathcal { L } _ { t } ^ { K L } = - D _ { K L } \big ( q _ { \phi } ( \boldsymbol { z } _ { t } ^ { L } | \boldsymbol { d } _ { t } ^ { L } ) | | p _ { \theta } \big ( \boldsymbol { z } _ { t } ^ { L } | \boldsymbol { d } _ { t - 1 } ^ { L } \big ) \big ) } & { } \\ { \displaystyle - \sum _ { l = 1 } ^ { L - 1 } \mathbb { E } _ { q _ { \phi } ( \boldsymbol { z } _ { t } ^ { l + 1 } | \cdot ) } \big [ D _ { K L } \big ( q _ { \phi } \big ( \boldsymbol { z } _ { t } ^ { l } | \boldsymbol { z } _ { t } ^ { l + 1 } , \boldsymbol { d } _ { t } ^ { l } \big ) | | p _ { \theta } \big ( \boldsymbol { z } _ { t } ^ { l } | \boldsymbol { z } _ { t } ^ { l + 1 } , \boldsymbol { d } _ { t - 1 } ^ { l } \big ) \big ) \big ] } & { . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
The KL term is the same for the STCN and STCN-dense variants. The reconstruction term $\mathcal { L } _ { t } ^ { R e c o n }$ , however, is different. In STCN we only use samples from the lowest layer of the hierarchy, whereas in STCN-dense we use all latent samples in the observation model:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\begin{array} { r l } { \mathcal { L } _ { t } ^ { R e c o n } = \mathbb { E } _ { q _ { \phi } ( z _ { t } ^ { 1 } \ldots z _ { t } ^ { L } | x _ { t } ) } [ \log p _ { \theta } ( x _ { t } | z _ { t } ^ { 1 } ) ] } & { { } , } \\ { \mathcal { L } _ { t } ^ { R e c o n - d e n s e } = \mathbb { E } _ { q _ { \phi } ( z _ { t } ^ { 1 } \ldots z _ { t } ^ { L } | x _ { t } ) } [ \log p _ { \theta } ( x _ { t } | z _ { t } ^ { 1 } \ldots z _ { t } ^ { L } ] } & { { } . } \end{array}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
In the dense variant, samples drawn from the latent variables $z _ { t } ^ { l }$ are carried over the dense connections. Similar to Maaløe et al. (2016), the expectation over $z _ { t } ^ { l }$ variables are computed by Monte Carlo sampling using the reparameterization trick (Kingma & Welling, 2013; Rezende et al., 2014).
|
| 177 |
+
|
| 178 |
+
Please note that the computation of $\mathcal { L } _ { t } ^ { R e c o n - d e n s e }$ does not introduce any additional computational cost. In STCN, all latent variables have to be visited in terms of ancestral sampling in order to draw the latent sample $z _ { t } ^ { 1 }$ for the observation $x _ { t }$ . Similarly in STCN-dense, the same intermediate samples $z _ { t } ^ { l }$ are used in the prediction of $x _ { t }$ .
|
| 179 |
+
|
| 180 |
+
One alternative option to use the latent samples could be to sum individual samples before feeding them into the observation model, i.e., $s u m ( \dot { [ } z _ { t } ^ { 1 } \dots z _ { t } ^ { L } ] )$ , (Maaløe et al., 2016). We empirically found that this does not work well in STCN-dense. Instead, we concatenate all samples $\left[ z _ { t } ^ { 1 } \circ \cdots \circ z _ { t } ^ { L } \right]$ analogously to DenseNet (Huang et al., 2017) and (Kaiser et al., 2018).
|
| 181 |
+
|
| 182 |
+
# 4 EXPERIMENTS
|
| 183 |
+
|
| 184 |
+
We evaluate the proposed variants STCN and STCN-dense both quantitatively and qualitatively on modeling of digital handwritten text and speech. We compare with vanilla TCNs, RNNs, VRNNs and state-of-the art models on the corresponding tasks.
|
| 185 |
+
|
| 186 |
+
In our experiments we use two variants of the Wavenet model: (1) the original model proposed in (Van Den Oord et al., 2016) and (2) a variant that we augment with skip connections analogously to STCN-dense. This additional baseline evaluates the benefit of learning multi-scale representations in the deterministic setting. Details of the experimental setup are provided in the Appendix. Our code is available at https://ait.ethz.ch/projects/2019/stcn/.
|
| 187 |
+
|
| 188 |
+
Handwritten text: The IAM-OnDB and Deepwriting datasets consist of digital handwriting sequences where each time-step contains real-valued $( x , y )$ pen coordinates and a binary pen-up event. The IAM-OnDB data is split and pre-processed as done in (Chung et al., 2015). Aksan et al. (2018) extend this dataset with additional samples and better pre-processing.
|
| 189 |
+
|
| 190 |
+
Table 1 reveals that again both our variants outperform the vanilla variants of TCNs and RNNs on IAM-OnDB. While the stochastic VRNN and SWaveNet are competitive wrt to the STCN variant, both are outperformed by the STCN-dense version. The same relative ordering is maintained on the Deepwriting dataset, indicating that the proposed architecture is robust across datasets.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 3: (a) Handwriting samples from IAM-OnDB dataset. Generated samples from (b) VRNN, (c) SWaveNet and (d) our model STCN-dense. Each line corresponds to one sample.
|
| 194 |
+
|
| 195 |
+
Table 1: Average log-likelihood per sequence on TIMIT, Blizzard, IAM-OnDB and Deepwriting datasets. (Normal) and (GMM) stand for unimodal Gaussian or multi-modal Gaussian Mixture Model (GMM) as the observation model (Graves, 2013; Chung et al., 2015). Asterisks ∗ indicate that we used our re-implementation only for the Deepwriting dataset.
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Models</td><td>TIMIT</td><td>Blizzard</td><td>IAM-OnDB</td><td>Deepwriting</td></tr><tr><td>Wavenet (GMM)</td><td>30188</td><td>8190</td><td>1381</td><td>612</td></tr><tr><td>Wavenet-dense (GMM)</td><td>30636</td><td>8212</td><td>1380</td><td>642</td></tr><tr><td>RNN (GMM) Chung et al. (2015)</td><td>26643</td><td>7413</td><td>1358</td><td>528 *</td></tr><tr><td>VRNN (Normal) Chung et al.(2015)</td><td>~30235</td><td>~9516</td><td>≈1354</td><td>≥ 495 *</td></tr><tr><td>VRNN (GMM) Chung et al. (2015)</td><td>≈ 29604</td><td>~9392</td><td>≈1384</td><td>≥ 673 *</td></tr><tr><td>SRNN (Normal) Fraccaro et al. (2016)</td><td>≥ 60550</td><td>≥11991</td><td>n/a</td><td>n/a</td></tr><tr><td>Z-forcing (Normal) Goyal etal. (2017)</td><td>≥ 70469</td><td>≥ 15430</td><td>n/a</td><td>n/a</td></tr><tr><td>Var.Bi-LSTM (Normal) Shabanian et al.(2017)</td><td>≥ 73976</td><td>≥ 17319</td><td>n/a</td><td>n/a</td></tr><tr><td>SWaveNet (Normal) Lai etal. (2018)</td><td>≥ 72463</td><td>≥ 15708</td><td>≥1301</td><td>n/a</td></tr><tr><td>STCN (GMM)</td><td>≥ 69195</td><td>M 15800</td><td>≥ 1338</td><td>≥ 605</td></tr><tr><td>STCN-dense (GMM)</td><td>≥ 71386</td><td>≥ 16288</td><td>≥ 1796</td><td>≥ 797</td></tr><tr><td>STCN-dense-large (GMM)</td><td>≥ 77438</td><td>≥ 17670</td><td>n/a</td><td>n/a</td></tr></table>
|
| 198 |
+
|
| 199 |
+
Fig. 3 compares generated handwriting samples. While all models produce consistent style, our model generates more natural looking samples. Note that the spacing between words is clearly visible and most of the letters are distinguishable.
|
| 200 |
+
|
| 201 |
+
Speech modeling: TIMIT and Blizzard are standard benchmark dataset in speech modeling. The models are trained and tested on 200 dimensional real-valued amplitudes. We apply the same pre-processing as Chung et al. (2015). For this task we introduce STCN-dense-large, with increased model capacity. Here we use 512 instead of 256 convolution filters. Note that the total number of model parameters is comparable to SWaveNet and other SOA models.
|
| 202 |
+
|
| 203 |
+
On TIMIT, STCN-dense (Table 1) significantly outperforms the vanilla TCN and RNN, and stochastic models. On the Blizzard dataset, our model is marginally better than the Variational Bi-LSTM. Note that the inference models of SRNN (Fraccaro et al., 2016), Z-forcing (Goyal et al., 2017), and Variational Bi-LSTM (Shabanian et al., 2017) receive future information by using backward RNN cells. Similarly, SWaveNet (Lai et al., 2018) applies causal convolutions in the backward direction. Hence, the latent variable can be expected to model future dynamics of the sequence. In contrast, our models have only access to information up to the current time-step. These results indicate that the STCN variants perform very well on the speech modeling task.
|
| 204 |
+
|
| 205 |
+
Latent Space Analysis: Zhao et al. (2017) observe that in hierarchical latent variable models the upper layers have a tendency to become inactive, indicated by a low KL loss (Sønderby et al., 2016; Dieng et al., 2018). Table 2 shows the KL loss per latent variable and the corresponding log-likelihood measured by ELBO in our models. Across the datasets it can be observed that our models make use of many of the latent variables which may explain the strong performance across tasks in terms of log-likelihoods. Note that STCN uses a standard hierarchical structure. However, individual latent variables have different information context due to the corresponding TCN block’s receptive field. This observation suggests that the proposed combination of TCNs and stochastic variables is indeed effective. Furthermore, in STCN we see a similar utilization pattern of the $z$ variables across tasks, whereas STCN-dense may have more flexibility in modeling the temporal dependencies within the data due to its dense connections to the output layer.
|
| 206 |
+
|
| 207 |
+
Table 2: KL-loss per latent variable computed over the entire test split. KL5 corresponds to the KL-loss of the top-most latent variable.
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Dataset (Model)</td><td>ELBO</td><td>KL</td><td>KL1</td><td>KL2</td><td>KL3</td><td>KL4</td><td>KL5</td></tr><tr><td>IAM-OnDB (sTCN-dense)</td><td>≥ 1796.3</td><td>1653.9</td><td>17.9</td><td>1287.4</td><td>305.3</td><td>41.0</td><td>2.4</td></tr><tr><td>IAM-OnDB (sTCN)</td><td>≥ 1339.2</td><td>964.2</td><td>846.0</td><td>105.2</td><td>12.9</td><td>0.1</td><td>0.0</td></tr><tr><td>TIMIT (sTCN-dense)</td><td>≥ 71385.9</td><td>22297.5</td><td>16113.0</td><td>5641.6</td><td>529.0</td><td>8.3</td><td>5.7</td></tr><tr><td>TIMIT (STCN)</td><td>≥ 69194.9</td><td>23118.3</td><td>22275.5</td><td>487.2</td><td>355.5</td><td>0.0</td><td>0.0</td></tr></table>
|
| 210 |
+
|
| 211 |
+
Replacing TCN with RNN: To better understand potential symergies between dilated CNNs and the proposed latent variable hierarchy, we perform an ablation study, isolating the effect of TCNs and the latent space. To this end the deterministic TCN blocks are replaced with LSTM cells by keeping the latent structure intact. We dub this condition LadderRNN. We use the TIMIT and IAM-OnDB datasets for evaluation. Table 3 summarizes performance measured by the ELBO.
|
| 212 |
+
|
| 213 |
+
The most direct translation of the the STCN architecture into an RNN counterpart has 25 stacked LSTM cells with 256 units each. Similar to STCN, we use 5 stochastic layers (see Appendix 7.1). Note that stacking this many LSTM cells is unusual and resulted in instabilities during training. Hence, the performance is similar to vanilla RNNs. The second LadderRNN configuration uses 5 stacked LSTM cells with 512 units and a one-to-one mapping with the stochastic layers. On the TIMIT dataset, all LadderRNN configurations show a significant improvement. We also observe a pattern of improvement with densely connected latent variables.
|
| 214 |
+
|
| 215 |
+
This experiments shows that the proposed modular latent variable design does allow for the usage of different building blocks. Even when attached to LSTM cells, it boosts the log-likelihood performance (see 5x512- LadderRNN), in particular when used with dense connections. However, the empirical results suggest that the densely connected latent hierarchy interacts particularly well with dilated CNNs. We suggest this is due to the hierarchical nature on both sides of the architecture. On both datasets STCN models achieved the best performance and significantly improve with dense connections. This supports our contribution of a latent variable hierarchy, which models different aspects of information from the input time-series.
|
| 216 |
+
|
| 217 |
+
Table 3: ELBO of LadderRNN and STCN models using the same latent space configuration. The prefix of a model entries denote the number of RNN or TCN layers and unit size per layer. Models have similar number of trainable parameters.
|
| 218 |
+
|
| 219 |
+
<table><tr><td>Models</td><td>TIMIT</td><td>IAM-OnDB</td></tr><tr><td>25x256-LadderRNN (Normal)</td><td>≥ 28207</td><td>≥ 1305</td></tr><tr><td>25x256-LadderRNN-dense (Normal)</td><td>≥ 27413</td><td>>I >I 1278</td></tr><tr><td>25x256-LadderRNN (GMM)</td><td>≥ 24839</td><td>1381</td></tr><tr><td>25x256-LadderRNN-dense (GMM)</td><td>≥ 26240</td><td>≥ 1377</td></tr><tr><td>5x512-LadderRNN (Normal)</td><td>≥ 49770</td><td>≥ 1299</td></tr><tr><td>5x512-LadderRNN-dense (Normal)</td><td>M 48612</td><td>1374</td></tr><tr><td>5x512-LadderRNN (GMM)</td><td>M 47179</td><td>>I >I 1359</td></tr><tr><td>5x512-LadderRNN-dense (GMM)</td><td>≥ 50113</td><td>≥ 1581</td></tr><tr><td>25x256-STCN (Normal)</td><td>≥ 64913</td><td>≥ 1327</td></tr><tr><td>25x256-STCN-dense (Normal)</td><td>M 70294</td><td>N 1729</td></tr><tr><td>25x256-STCN (GMM)</td><td>M :69195</td><td>≥ 1339</td></tr><tr><td>25x256-STCN-dense (GMM)</td><td>M 71386</td><td>≥ 1796</td></tr></table>
|
| 220 |
+
|
| 221 |
+
# 5 RELATED WORK
|
| 222 |
+
|
| 223 |
+
Rezende et al. (2014) propose Deep Latent Gaussian Models (DLGM) and Sønderby et al. (2016) propose the Ladder Variational Autoencoder (LVAE). In both models the latent variables are hierarchically defined and conditioned on the preceding stochastic layer. LVAEs improve upon DLGMs via implementation of a top-down hierarchy both in the generative and inference model. The approximate posterior is computed via a precisionweighted update of the approximate likelihood (i.e., the inference model) and prior (i.e., the generative model). Similarly, the PixelVAE (Gulrajani et al., 2016) incorporates a hierarchical latent space decomposition and uses an autoregressive decoder. Zhao et al. (2017) show under mild conditions that straightforward stacking of latent variables (as is done e.g. in LVAE and PixelVAE) can be ineffective, because the latent variables that are not directly conditioned on the observation variable become inactive.
|
| 224 |
+
|
| 225 |
+
Due to the nature of the sequential problem domain, our approach differs in the crucial aspects that STCNs use dynamic, i.e., conditional, priors (Chung et al., 2015) at every level. Moreover, the hierarchy is not only implicitly defined by the network architecture but also explicitly defined by the information content, i.e., receptive field size. Dieng et al. (2018) both theoretically and empirically show that using skip connections from the latent variable to every layer of the decoder increases mutual information between the latent and observation variables. Similar to Dieng et al. (2018) in STCN-dense, we introduce skip connections from all latent variables to the output. In STCN the model is expected to encode and propagate the information through its hierarchy.
|
| 226 |
+
|
| 227 |
+
Yang et al. (2017) suggest using autoregressive TCN decoders to remedy the posterior collapse problem observed in language modeling with LSTM decoders (Bowman et al., 2015). van den Oord et al. (2017) and Dieleman et al. (2018) use TCN decoders conditioned on discrete latent variables to model audio signals.
|
| 228 |
+
|
| 229 |
+
Stochastic RNN architectures mostly vary in the way they employ the latent variable and parametrize the approximate posterior for variational inference. Chung et al. (2015) and Bayer & Osendorfer (2014) use the latent random variable to capture high-level information causing the variability observed in sequential data. Particularly Chung et al. (2015) shows that using a conditional prior rather than a standard Gaussian distribution is very effective in sequence modeling. In (Fraccaro et al., 2016; Goyal et al., 2017; Shabanian et al., 2017), the inference model, i.e., the approximate posterior, receives both the past and future summaries of the sequence from the hidden states of forward and backward RNN cells. The KL-divergence term in the objective enforces the model to learn predictive latent variables in order to capture the future states of the sequence.
|
| 230 |
+
|
| 231 |
+
Lai et al. (2018)’s SWaveNet is most closely related to ours. SWaveNet also introduces latent variables into TCNs. However, in SWaveNet the deterministic and stochastic units are coupled which may prevent stacking of larger numbers of TCN blocks. Since the number of stacked dilated convolutions determines the receptive field size, this directly correlates with the model capacity. For example, the performance of SWaveNet on the IAM-OnDB dataset degrades after stacking more than 3 stochastic layers (Lai et al., 2018), limiting the model to a small receptive field. In contrast, we aim to preserve the flexibility of stacking dilated convolutions in the base TCN. In STCNs, the deterministic TCN units do not have any dependency on the stochastic variables (see Figure 1) and the ratio of stochastic to deterministic units can be adjusted, depending on the task.
|
| 232 |
+
|
| 233 |
+
# 6 CONCLUSION
|
| 234 |
+
|
| 235 |
+
In this paper we proposed STCNs, a novel auto-regressive model, combining the computational benefits of convolutional architectures and expressiveness of hierarchical stochastic latent spaces. We have shown the effectivness of the approach across several sequence modelling tasks and datasets. The proposed models are trained via optimization of the ELBO objective. Tighter lower bounds such as IWAE (Burda et al., 2015) or FIVO (Maddison et al., 2017) may further improve modeling performance. We leave this for future work.
|
| 236 |
+
|
| 237 |
+
# ACKNOWLEDGEMENTS
|
| 238 |
+
|
| 239 |
+
This work was supported in parts by the ERC grant OPTINT (StG-2016-717054). We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research.
|
| 240 |
+
|
| 241 |
+
REFERENCES
|
| 242 |
+
Martin Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16), pp. 265–283, 2016. URL https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf.
|
| 243 |
+
Emre Aksan, Fabrizio Pece, and Otmar Hilliges. DeepWriting: Making Digital Ink Editable via Deep Generative Modeling. In SIGCHI Conference on Human Factors in Computing Systems, CHI ’18, New York, NY, USA, 2018. ACM.
|
| 244 |
+
Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271, 2018.
|
| 245 |
+
Justin Bayer and Christian Osendorfer. Learning stochastic recurrent networks. arXiv preprint arXiv:1411.7610, 2014.
|
| 246 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. arXiv preprint arXiv:1511.06349, 2015.
|
| 247 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
|
| 248 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger ¨ Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
|
| 249 |
+
Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In Advances in neural information processing systems, pp. 2980–2988, 2015.
|
| 250 |
+
Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv preprint arXiv:1612.08083, 2016.
|
| 251 |
+
Sander Dieleman, Aaron van den Oord, and Karen Simonyan. The challenge of realistic music generation: ¨ modelling raw audio at scale. arXiv preprint arXiv:1806.10474, 2018.
|
| 252 |
+
Adji B Dieng, Yoon Kim, Alexander M Rush, and David M Blei. Avoiding latent variable collapse with generative skip models. arXiv preprint arXiv:1807.04863, 2018.
|
| 253 |
+
Otto Fabius and Joost R van Amersfoort. Variational recurrent auto-encoders. arXiv preprint arXiv:1412.6581, 2014.
|
| 254 |
+
Marco Fraccaro, Søren Kaae Sønderby, Ulrich Paquet, and Ole Winther. Sequential neural models with stochastic layers. In Advances in neural information processing systems, pp. 2199–2207, 2016.
|
| 255 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. arXiv preprint arXiv:1705.03122, 2017.
|
| 256 |
+
Anirudh Goyal ALIAS PARTH Goyal, Alessandro Sordoni, Marc-Alexandre Cotˆ e, Nan Ke, and Yoshua Ben- ´ gio. Z-forcing: Training stochastic recurrent networks. In Advances in Neural Information Processing Systems, pp. 6713–6723, 2017.
|
| 257 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
|
| 258 |
+
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, and Aaron Courville. Pixelvae: A latent variable model for natural images. arXiv preprint arXiv:1611.05013, 2016.
|
| 259 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8):1735–1780, 1997.
|
| 260 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, volume 1, pp. 3, 2017.
|
| 261 |
+
Łukasz Kaiser, Aurko Roy, Ashish Vaswani, Niki Pamar, Samy Bengio, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. arXiv preprint arXiv:1803.03382, 2018.
|
| 262 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 263 |
+
Guokun Lai, Bohan Li, Guoqing Zheng, and Yiming Yang. Stochastic wavenet: A generative latent variable model for sequential data, 2018.
|
| 264 |
+
Lars Maaløe, Casper Kaae Sønderby, Søren Kaae Sønderby, and Ole Winther. Auxiliary deep generative models. arXiv preprint arXiv:1602.05473, 2016.
|
| 265 |
+
Chris J Maddison, John Lawson, George Tucker, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Teh. Filtering variational objectives. In Advances in Neural Information Processing Systems, pp. 6573–6583, 2017.
|
| 266 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 267 |
+
Samira Shabanian, Devansh Arpit, Adam Trischler, and Yoshua Bengio. Variational bi-lstms. arXiv preprint arXiv:1711.05717, 2017.
|
| 268 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder variational autoencoders. In Advances in neural information processing systems, pp. 3738–3746, 2016.
|
| 269 |
+
Aaron Van Den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalch- ¨ brenner, Andrew W Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. In SSW, pp. 125, 2016.
|
| 270 |
+
Aaron van den Oord, Nal Kalchbrenner, Lasse Espeholt, Oriol Vinyals, Alex Graves, et al. Conditional image ¨ generation with pixelcnn decoders. In Advances in Neural Information Processing Systems, pp. 4790–4798, 2016.
|
| 271 |
+
Aaron van den Oord, Oriol Vinyals, et al. Neural discrete representation learning. In Advances in Neural Information Processing Systems, pp. 6306–6315, 2017.
|
| 272 |
+
Zichao Yang, Zhiting Hu, Ruslan Salakhutdinov, and Taylor Berg-Kirkpatrick. Improved variational autoencoders for text modeling using dilated convolutions. arXiv preprint arXiv:1702.08139, 2017.
|
| 273 |
+
Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015.
|
| 274 |
+
Shengjia Zhao, Jiaming Song, and Stefano Ermon. Learning hierarchical features from generative models. arXiv preprint arXiv:1702.08396, 2017.
|
| 275 |
+
|
| 276 |
+
# 7 APPENDIX
|
| 277 |
+
|
| 278 |
+
# 7.1 NETWORK DETAILS
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 4: Generative model of STCN-dense architecture. Building blocks are highlighted. Note that the dependence of $d _ { t } ^ { l } , l = 1 \cdots L$ on past inputs is not visualized for clarity.
|
| 282 |
+
|
| 283 |
+
The network architecture of the proposed model is illustrated in Fig. 4. We make only a small modification to the vanilla Wavenet architecture. Instead of using skip connections from Wavenet blocks, we only use the latent sample $z _ { t }$ in order to make a prediction of $x _ { t }$ . In STCN-dense configuration, $z _ { t }$ is the concatenation of all latent variables in the hierarchy, i.e., $\boldsymbol { z } _ { t } = [ \boldsymbol { z } _ { t } ^ { 1 } \circ \cdot \cdot \cdot \circ \boldsymbol { z } _ { t } ^ { L } ]$ , whereas in STCN only $z _ { t } ^ { 1 }$ is fed to the output layer.
|
| 284 |
+
|
| 285 |
+
Each stochastic latent variable $z _ { t } ^ { l }$ (except the top-most $z _ { t } ^ { L }$ ) is conditioned on a deterministic TCN representation $d _ { t } ^ { l }$ and the preceding random variable $z _ { t } ^ { l + 1 }$ . The latent variables are calculated by using the latent layers $f _ { p } ^ { ( l ) }$ or $f _ { q } ^ { ( l ) }$ which are neural networks.
|
| 286 |
+
|
| 287 |
+
We do not define a latent variable per TCN layer. Instead, the stochastic layers are uniformly distributed where each random variable is conditioned on a number of stacked TCN layers $\dot { d } _ { t } ^ { l }$ . We stack $K$ Wavenet blocks (see figure 4 left) with exponentially increasing dilation size.
|
| 288 |
+
|
| 289 |
+
Observation Model: We use Normal or GMM distributions with 20 components to model real-valued data.
|
| 290 |
+
All Gaussian distributions have diagonal covariance matrix.
|
| 291 |
+
|
| 292 |
+
Output layer $f ^ { ( o ) }$ : For the IAM-OnDB and Deepwriting datasets we use 1D convolutions with ReLU nonlinearity. We stack 5 of these layers with 256 filters and filter size 1.
|
| 293 |
+
|
| 294 |
+
For TIMIT and Blizzard datasets Wavenet blocks in the output layer perform significantly better. We stack 5 Wavenet blocks with dilation size 1. For each convolution operation in the block we use 256 filters. The filter size of the dilated convolution is set to 2. The STCN-dense-large model is constructed by using 512 filters instead of 256.
|
| 295 |
+
|
| 296 |
+
TCN blocks $d _ { t } ^ { l }$ : The number of Wavenet blocks is usually determined by the desired receptive field size.
|
| 297 |
+
|
| 298 |
+
• For the handwriting datasets $K = 6$ and $L = 5$ . In total we have 30 Wavenet blocks where each convolution operation has 256 filters with size 2. • For speech datasets $K = 5$ and $L = 5$ . In total we have 25 Wavenet blocks where each convolution operation has 256 filters with size 2. The large model configuration uses 512 filters.
|
| 299 |
+
|
| 300 |
+
Latent layers $f _ { p } ^ { ( l ) }$ and $f _ { q } ^ { ( l ) }$ : The number of stochastic layers per task is given by $L$ . We used [32, 16, 8, 5, 2] dimensional latent variables for the handwriting tasks. It is [256, 128, 64, 32, 16] for speech datasets. Note that the first entry of the list corresponds to $z ^ { 1 }$ .
|
| 301 |
+
|
| 302 |
+
The mean and sigma parameters of the Normal distributions modeling the latent variables are calculated by the $f _ { p } ^ { ( l ) }$ and $f _ { q } ^ { ( l ) }$ networks. We stack $^ { 2 1 0 }$ convolutions with ReLU nonlinearity and filter size 1. The number of filters are the same as the number of Wavenet block filters for the corresponding task.
|
| 303 |
+
|
| 304 |
+
Finally, we clamped the latent sigma predictions between 0.001 and 5.
|
| 305 |
+
|
| 306 |
+
# 7.2 TRAINING DETAILS
|
| 307 |
+
|
| 308 |
+
In all STCN experiments we applied KL annealing. In all tasks, the weight of the KL term is initialized with 0 and increased by $1 \times e ^ { - 4 }$ at every step until it reaches 1.
|
| 309 |
+
|
| 310 |
+
The batch size was 20 for all datasets except for Blizzard where it was 128.
|
| 311 |
+
|
| 312 |
+
We use the ADAM optimizer with its default parameters and exponentially decay the learning rate. For the handwriting datasets the learning rate was initialized with $5 \times e ^ { - 4 }$ and followed a decay rate of 0.94 over 1000 decay steps. On the speech datasets it was initialized with $1 \times e ^ { - 3 }$ and decayed with a rate of 0.98. We applied early stopping by measuring the ELBO performance on the validation splits.
|
| 313 |
+
|
| 314 |
+
We implement STCN models in Tensorflow (Abadi et al., 2016). Our code and models achieving the SOA results are available at https://ait.ethz.ch/projects/2019/stcn/.
|
| 315 |
+
|
| 316 |
+
# 7.3 DETAILED RESULTS
|
| 317 |
+
|
| 318 |
+
Here we provide the extended results table with Normal observation model entries for available models.
|
| 319 |
+
|
| 320 |
+
Table 4: Average log-likelihood per sequence on TIMIT, Blizzard, IAM-OnDB and Deepwriting datasets. (Normal) and (GMM) stand for unimodal Gaussian or multi-modal Gaussian Mixture Model (GMM) as the observation model (Graves, 2013; Chung et al., 2015). Asterisks ∗ indicate that we used our re-implementation only for the Deepwriting dataset.
|
| 321 |
+
|
| 322 |
+
<table><tr><td>Models</td><td>TIMIT</td><td>Blizzard</td><td>IAM-OnDB</td><td>Deepwriting</td></tr><tr><td>Wavenet (Normal)</td><td>-7443</td><td>3784</td><td>1053</td><td>337</td></tr><tr><td>Wavenet (GMM)</td><td>30188</td><td>8190</td><td>1381</td><td>612</td></tr><tr><td>Wavenet-dense (Normal)</td><td>-8579</td><td>3712</td><td>1030</td><td>323</td></tr><tr><td>Wavenet-dense (GMM)</td><td>30636</td><td>8212</td><td>1380</td><td>642</td></tr><tr><td>RNN (Normal) Chung et al. (2015)</td><td>-1900</td><td>3539</td><td>1016</td><td>363 *</td></tr><tr><td>RNN (GMM) Chung et al. (2015)</td><td>26643</td><td>7413</td><td>1358</td><td>528 *</td></tr><tr><td>VRNN (Normal)Chung et al. (2015)</td><td>~ 30235</td><td>~9516</td><td>≈1354</td><td>≥ 495 *</td></tr><tr><td>VRNN (GMM) Chung et a. (2015)</td><td>~ 29604</td><td>~9392</td><td>≈1384</td><td>≥673 *</td></tr><tr><td>SRNN (Normal) Fraccaro et al. (2016)</td><td>≥ 60550</td><td>≥ 11991</td><td>n/a</td><td>n/a</td></tr><tr><td>Z-forcing (Normal)Goyal etal. (2017)</td><td>≥ 70469</td><td>≥ 15430</td><td>n/a</td><td>n/a</td></tr><tr><td>Var.Bi-LSTM (Normal)Shabanian et al. (2017)</td><td>≥ 73976</td><td>≥ 17319</td><td>n/a</td><td>n/a</td></tr><tr><td>SWaveNet (Normal)Lai et al.(2018)</td><td>≥ 72463</td><td>M 15708</td><td>≥1301</td><td>n/a</td></tr><tr><td>STCN(Normal)</td><td>≥ 64913</td><td>M 13273</td><td>≥ 1327</td><td>≥ 575</td></tr><tr><td>STCN(GMM)</td><td>≥ 69195</td><td>≥15800</td><td>≥ 1338</td><td>≥ 605</td></tr><tr><td>STCN-dense(Normal)</td><td>≥ 70294</td><td>≥ 15950</td><td>≥ 1729</td><td>≥ 740</td></tr><tr><td>STCN-dense(GMM)</td><td>≥ 71386</td><td>M 16288</td><td>≥ 1796</td><td>≥ 797</td></tr><tr><td>STCN-dense-large (GMM)</td><td>≥ 77438</td><td>≥ 17670</td><td>n/a</td><td>n/a</td></tr></table>
|
md/train/HyEtjoCqFX/HyEtjoCqFX.md
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SOFT Q-LEARNING WITH MUTUAL-INFORMATION REGULARIZATION
|
| 2 |
+
|
| 3 |
+
Jordi Grau-Moya, Felix Leibfried and Peter Vrancx
|
| 4 |
+
PROWLER.io
|
| 5 |
+
Cambridge, United Kingdom
|
| 6 |
+
{jordi}@prowler.io
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
We propose a reinforcement learning (RL) algorithm that uses mutual-information regularization to optimize a prior action distribution for better performance and exploration. Entropy-based regularization has previously been shown to improve both exploration and robustness in challenging sequential decision-making tasks. It does so by encouraging policies to put probability mass on all actions. However, entropy regularization might be undesirable when actions have significantly different importance. In this paper, we propose a theoretically motivated framework that dynamically weights the importance of actions by using the mutualinformation. In particular, we express the RL problem as an inference problem where the prior probability distribution over actions is subject to optimization. We show that the prior optimization introduces a mutual-information regularizer in the RL objective. This regularizer encourages the policy to be close to a nonuniform distribution that assigns higher probability mass to more important actions. We empirically demonstrate that our method significantly improves over entropy regularization methods and unregularized methods.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Reinforcement Learning (RL) (Sutton & Barto, 1998) is a framework for solving sequential decision-making problems under uncertainty. Contemporary state-of-the-art RL methods often use an objective that includes an entropy regularization term (Haarnoja et al., 2018c; 2017; Teh et al., 2017). Entropy regularized RL has been shown to capture multi-modal behaviour, as well as exhibiting superior exploration (Haarnoja et al., 2017). Additionally, the learned policies are more robust, as the entropy bonus accounts for future action stochasticity (Grau-Moya et al., 2016) and reduces value overestimation (Fox et al., 2016).
|
| 15 |
+
|
| 16 |
+
While encouraging high-entropy policies can provide several benefits, it is possible to devise examples where entropy regularization actually impedes exploration. Since high-entropy policies tend to spread the probability mass across all actions equally, they can perform poorly when the RL problem contains actions that are rarely useful. In this paper, we propose to overcome the previous limitation by designing a reinforcement learning algorithm that dynamically adjusts the importance of actions while learning. We motivate our algorithm by phrasing RL as an inference problem with an adaptive prior action distribution. Where previous work assumes a uniform prior distribution over the actions (Rawlik et al., 2012; Levine, 2018), we generalize the formulation by optimizing the prior. We show that this optimization process leads to an RL objective function with a regularizer based on the mutual information between states and actions.
|
| 17 |
+
|
| 18 |
+
Additionally, we develop a novel algorithm that uses such mutual-information regularization to obtain an optimal action-prior for better performance and exploration in high-dimensional state spaces. This novel regularizer for RL encourages policies to be close to the marginal distribution over actions. This results in assigning higher probability to actions frequently used by the optimal policy, while actions that are used infrequently have lower probability under the prior. We demonstrate significant improvements on 19 Atari games over a deep Q-network (Mnih et al., 2015) (DQN) baseline without any regularization and over soft Q-learning (Schulman et al., 2017; Leibfried et al., 2018) (SQL) that employs standard entropy regularization without prior adaptation.
|
| 19 |
+
|
| 20 |
+
# 2 BACKGROUND
|
| 21 |
+
|
| 22 |
+
# 2.1 REINFORCEMENT LEARNING
|
| 23 |
+
|
| 24 |
+
We consider the standard Markov decision process (MDP) setting. Formally, an MDP is defined as the tuple $\langle S , A , P , R , \gamma \rangle$ where $s$ is the state space, $\mathcal { A }$ the action space, and $P : \mathcal { S } \times \mathcal { A } \times \mathcal { S }$ $s [ 0 , 1 ]$ denotes the state transition function. Upon taking action $a _ { t } \in \mathcal A$ in state $s _ { t } \in S$ , the agent transitions to $s _ { t + 1 }$ with probability $\textstyle P ( s _ { t + 1 } | s _ { t } , a _ { t } )$ . The reward function $\mathcal { R } : \mathcal { S } \times \mathcal { A } \mathbb { R }$ i.e. quantifies the agent’s performance. The goal is to find a policy that maximizes the value function, $\pi ^ { * } ( a | s ) = \arg \operatorname* { m a x } _ { \pi } V ^ { \pi } ( s )$ , where $\begin{array} { r } { V ^ { \pi } ( s ) = \mathbb { E } \Big [ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } ) | s _ { 0 } = s \Big ] } \end{array}$ . Here, $\gamma$ is a discount factor ( $0 < \gamma < 1$ ) that allows to account for the future in different ways.
|
| 25 |
+
|
| 26 |
+
The policy-dependent state transition probabilities are defined as $\begin{array} { r } { P _ { \pi } ( s ^ { \prime } | s ) : = \sum _ { a } P ( s ^ { \prime } | a , s ) \pi ( a | s ) } \end{array}$ which can be written in matrix notation as $P _ { \pi } \in \mathbb { R } ^ { | S | } \times \mathbb { R } ^ { | S | }$ where the rows are indexed by $s$ and the columns by $s ^ { \prime }$ . This allows us to conveniently define the agent’s stationary distribution over states $\mu _ { \pi } ( s )$ and actions $\rho _ { \pi } ( a )$ as follows:
|
| 27 |
+
|
| 28 |
+
Definition 1 (Stationary distribution over states). The stationary distribution over states (assumed to exist and to be unique) is defined in vector form as $\begin{array} { r } { \mu _ { \pi } ^ { \top } : = \operatorname* { l i m } _ { t \infty } \nu _ { 0 } ^ { \top } P _ { \pi } ^ { t } } \end{array}$ with $\nu _ { 0 }$ being an arbitrary vector of probabilities over states at time $t ~ = ~ 0$ . The stationary distribution satisfies $\begin{array} { r } { \mu _ { \pi } ( s ^ { \prime } ) = \sum _ { s } P _ { \pi } ( s ^ { \prime } | s ) \mu _ { \pi } ( s ) } \end{array}$ and therefore is a fixed point under the state transition probabilities $\pmb { \mu } _ { \pi } ^ { \top } = \pmb { \mu } _ { \pi } ^ { \top } \pmb { P } _ { \pi }$ .
|
| 29 |
+
|
| 30 |
+
Definition 2 (Stationary distribution over actions). Let $\mu _ { \pi } ( s )$ be the stationary distribution over states induced by the policy $\pi$ . Then the stationary distribution over actions under the policy $\pi$ is defined as $\begin{array} { r } { \rho _ { \pi } ( a ) : = \sum _ { s \in { \cal S } } \mu _ { \pi } ( s ) \pi ( a | s ) } \end{array}$ .
|
| 31 |
+
|
| 32 |
+
# 2.2 MAXIMUM ENTROPY REINFORCEMENT LEARNING
|
| 33 |
+
|
| 34 |
+
Maximum entropy reinforcement learning augments the standard RL reward objective with an additional policy entropy term. The optimal value function under entropy regularization (Haarnoja et al., 2017) is defined as:
|
| 35 |
+
|
| 36 |
+
$$
|
| 37 |
+
\mathcal V ^ { * } ( s ) = \operatorname* { m a x } _ { \pi } \mathbb E \Bigg [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \bigg ( r ( s _ { t } , a _ { t } ) - \frac { 1 } { \beta } \log \pi ( a _ { t } | s _ { t } ) \bigg ) \Bigg | s _ { 0 } = s \Bigg ] ,
|
| 38 |
+
$$
|
| 39 |
+
|
| 40 |
+
where $\frac { 1 } { \beta }$ trades off between reward and entropy maximization, and the expectation operation is over state-action trajectories. The optimal policy that solves (1) can be written in closed form as: $\begin{array} { r } { \pi ^ { * } ( a | s ) = \frac { e ^ { \beta Q ^ { * } \tilde { ( s , a ) } } } { \sum _ { a \in \mathcal { A } } e ^ { \beta Q ^ { * } ( s , a ) } } } \end{array}$ eβQ (s,a)Pa∈A eβQ∗(s,a) , where Q∗(s, a) := r(s, a) + Ps0∈S P (s0|s, a)V ∗(s0). Note that the above represents a generalization of standard RL settings, where $\beta \to \infty$ corresponds to a standard RL valuation $( \mathrm { l i m } _ { \beta \infty } \mathcal { V } ^ { * } ( s ) = \mathrm { m a x } _ { \pi } V ^ { \pi } ( s ) )$ , while for $\beta 0$ we recover the valuation under a random uniform policy. For intermediate values of $\beta$ , we can trade off between reward maximization and entropy maximization.
|
| 41 |
+
|
| 42 |
+
Interestingly, one can formulate the maximum entropy RL objective as an inference problem (Levine, 2018) by specifying a prior distribution over trajectories that assumes a fixed uniform distribution over actions. Precisely this assumption is what encourages the policies to maximize entropy. As outlined in the introduction, encouraging policies to be close to a uniform distribution might be undesirable when some actions are simply non-useful or not frequently used.
|
| 43 |
+
|
| 44 |
+
In Section 3, we show that when relaxing the previous assumption, i.e. allowing for prior optimization, we obtain a novel variational inference formulation of the RL problem that constrains the policy’s mutual-information between states and actions. We show that such policies must be close to the marginal distribution over actions which automatically assigns high probability mass to overall useful actions and low probability to infrequently used actions.
|
| 45 |
+
|
| 46 |
+
Before proceeding, however, it is insightful to show how prior optimization bridges the gap between entropy regularization and mutual-information regularization in a non-sequential decision-making scenario that considers one time step only.
|
| 47 |
+
|
| 48 |
+
2.3 MUTUAL-INFORMATION REGULARIZATION FOR ONE-STEP DECISION-MAKING
|
| 49 |
+
|
| 50 |
+
In a one-step decision-making scenario, entropy regularization assumes the following form
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\operatorname* { m a x } _ { \pi } \sum _ { s , a } p ( s ) \pi ( a | s ) \left( r ( s , a ) - \frac { 1 } { \beta } \log \pi ( a | s ) \right) ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $p ( s )$ is some arbitrary distribution over states and the optimal policy balances expected reward maximization versus expected entropy maximization.
|
| 57 |
+
|
| 58 |
+
Entropy regularization discourages deviations from a uniform prior policy. In a more general setting, when discouraging deviations from an arbitrary prior $\rho ( a )$ , a similar objective can be written as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r l } & { \underset { \pi } { \mathop { \operatorname* { m a x } } } \displaystyle \sum _ { s , a } p ( s ) \pi ( a | s ) \left( r ( s , a ) - \frac { 1 } { \beta } \log \frac { \pi ( a | s ) } { \rho ( a ) } \right) = } \\ & { \underset { \pi } { \mathop { \operatorname* { m a x } } } \displaystyle \sum _ { s , a } p ( s ) \pi ( a | s ) r ( s , a ) - \frac { 1 } { \beta } \displaystyle \sum _ { s } p ( s ) \mathrm { K L } ( \pi ( \cdot | s ) | | \rho ( \cdot ) ) , } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where KL refers to the Kullback-Leiber (KL) divergence. This framework has been proposed before in the literature under the name information-theory for decision-making (Ortega & Braun, 2013).
|
| 65 |
+
|
| 66 |
+
Going one step further, one can also optimize for $\rho$ in addition to $\pi$ , which essentially means that policies are discouraged to deviate from an optimal prior distribution, leading to the following optimization problem
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\operatorname* { m a x } _ { \pi } \sum _ { s , a } p ( s ) \pi ( a | s ) r ( s , a ) - \frac { 1 } { \beta } \operatorname* { m i n } _ { \rho } \sum _ { s } p ( s ) \mathrm { K L } ( \pi ( \cdot | s ) | | \rho ( \cdot ) ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where we utilize the fact that only the expected $\mathrm { K L }$ penalty depends on $\rho$
|
| 73 |
+
|
| 74 |
+
The minimum expected $\mathrm { K L }$ relates to the mutual information as follows:
|
| 75 |
+
|
| 76 |
+
Proposition 1 (Mutual Information). Let $I _ { f }$ be a functional, in particular: $I _ { f } ( p _ { X } , p _ { Y | X } , q _ { Y } ) : =$ $\begin{array} { r } { \sum _ { x } p _ { X } ( x ) \mathrm { K L } ( p _ { Y | X } ( \cdot | x ) | | q _ { Y } ( \cdot ) ) } \end{array}$ , where $p _ { X } ( x )$ is the distribution of the input, $p _ { Y \mid X } ( y | x )$ is the conditional distribution of the output conditioned on the input, and $q _ { Y } ( y )$ a variational distribution of the output. Then, the mutual information 1 is recovered with
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
I [ X , Y ] = \operatorname* { m i n } _ { q _ { Y } } I _ { f } \big ( p _ { X } , p _ { Y | X } , q _ { Y } \big ) ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where the optimal variational distribution is $\begin{array} { r } { q _ { Y } ^ { \star } ( y ) = \sum _ { x } p _ { X } ( x ) p _ { Y | X } ( y | x ) , } \end{array}$ , i.e. the true marginal distribution. See e.g. (Cover & Thomas, 2006, Lemma 10.8.1) for details.
|
| 83 |
+
|
| 84 |
+
This allows us to rewrite the problem from Equation (3) as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\operatorname* { m a x } _ { \pi } \sum _ { s , a } p ( s ) \pi ( a | s ) r ( s , a ) - \frac { 1 } { \beta } I [ S ; A ] ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
yielding a penalty on the mutual information between states and actions.
|
| 91 |
+
|
| 92 |
+
Notice that this problem is mathematically equivalent to rate-distortion theory from informationtheory (Shannon, 1959) which formulates how to efficiently send information over an informationtheoretic channel with limited transmission rate. This framework has also been used to describe decision-making problems with limited information budgets (Sims, 2011; Genewein et al., 2015; Leibfried & Braun, 2015; 2016; Peng et al., 2017; Hihn et al., 2018). In a decision-making context, the agent is considered as information-theoretic channel $\pi ( a | s )$ where $s$ is the channel input and $a$ the channel output. The agent aims at maximizing expected reward under the constraint that the information transmission rate is limited, where the transmission rate is given by the mutual-information between states and actions (Cover & Thomas, 2006). Intuitively, this means that the agent has to discard reward-irrelevant information in $s$ to not exceed the limits in information transmission.
|
| 93 |
+
|
| 94 |
+
In the following section, we generalize the rate-distortion formulation for decision-making to be applicable to a sequential decision-making scenario, i.e. the RL setting. We propose an inferencebased formulation where the mutual information arises as a consequence of allowing for optimizing the action-prior distribution.
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\begin{array} { r } { ^ { 1 } I ( X ; Y ) : = \sum _ { x , y } p ( x , y ) \log \frac { p ( x , y ) } { p _ { Y } ( y ) p _ { X } ( x ) } = \sum _ { x } p _ { X } ( x ) \mathrm { K L } \big ( p _ { Y | X } ( \cdot | x ) | | p _ { Y } ( \cdot ) \big ) } \end{array}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 3 MUTUAL-INFORMATION REGULARIZATION IN RL
|
| 101 |
+
|
| 102 |
+
In this section, we first derive mutual-information regularization for the RL setting from a variational inference perspective. Subsequently, we derive expressions for the optimal policy and the optimal prior that are useful for constructing a practical algorithm.
|
| 103 |
+
|
| 104 |
+
# 3.1 VARIATIONAL INFERENCE RL FORMULATION WITH OPTIMAL ACTION-PRIORS
|
| 105 |
+
|
| 106 |
+
The RL problem can be expressed as an inference problem by introducing a binary random variable $R$ that denotes whether the trajectory $\tau : = ( s _ { 0 } , a _ { 0 } , \dots s _ { T } , a _ { T } )$ is optimal $R = 1$ ) or not $( R = 0$ ). The likelihood of an optimal trajectory can then be expressed as $\begin{array} { r } { p ( R = 1 | \tau ) \propto \exp ( \sum _ { t = 0 } ^ { T } r ( s _ { t } , a _ { t } ) ) } \end{array}$ (Levine, 2018). We additionally introduce a scaling factor $\beta > 0$ into the exponential, i.e. $p ( R =$ $\begin{array} { r } { 1 | \tau ) \propto \exp ( \beta \sum _ { t = 0 } ^ { T } r ( s _ { t } , a _ { t } ) ) } \end{array}$ . This will allow us to trade off reward and entropy maximization 2. Next, we can define the posterior trajectory probability assuming optimality, i.e. $p ( \tau | R = 1 )$ . Here we treat $\tau$ as a latent variable with prior probability $p ( \tau )$ , and we specify the log-evidence as $\begin{array} { r } { \log p ( R = 1 ) = \log \int p ( R = 1 | \tau ) p ( \tau ) \dot { d } \tau } \end{array}$ . We now introduce a variational distribution $q ( \tau )$ to approximate the posterior $p ( \tau | R = 1 )$ . This leads to an Evidence Lower BOund (ELBO) of the previous expression (scaled by $\textstyle { \frac { 1 } { \beta } } ) ^ { 3 }$ :
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r l } & { \displaystyle \frac { 1 } { \beta } \log p ( R = 1 ) = \frac { 1 } { \beta } \log \int p ( R = 1 | \tau ) p ( \tau ) d \tau } \\ & { \quad \quad \quad \geq \displaystyle \frac { 1 } { \beta } \mathbb { E } _ { \tau \sim q ( \tau ) } \left[ \log \frac { p ( R = 1 | \tau ) p ( \tau ) } { q ( \tau ) } \right] } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The generative model is written as $\begin{array} { r } { p ( \tau ) \ = \ p ( s _ { 0 } ) \prod _ { t = 0 } ^ { T - 1 } \rho ( a _ { t } ) P ( s _ { t + 1 } | s _ { t } , a _ { t } ) } \end{array}$ and the variational
|
| 113 |
+
distribution as maximization $\begin{array} { r } { q ( \tau ) = p ( s _ { 0 } ) \prod _ { t = 0 } ^ { T - 1 } \pi ( a _ { t } | s _ { t } ) P ( s _ { t + 1 } | s _ { t } , a _ { t } ) } \end{array}$ . The RL problem can now be stated as aRL objective is recovered when assuming $\pi$
|
| 114 |
+
a fixed uniform prior distribution over actions, i.e. $\begin{array} { r } { \rho ( a _ { t } ) = \frac { 1 } { | \mathcal { A } | } } \end{array}$ for all $t$ .
|
| 115 |
+
|
| 116 |
+
We obtain a novel variational RL formulation by introducing an adaptive prior over actions $\rho$ . Contrary to maximum entropy RL, where the prior of the generative model is fixed and uniform, here the prior over actions is subject to optimization. Starting from Equation (5) and substituting $p ( \tau )$ and $q ( \tau )$ we obtain the following ELBO: $\begin{array} { r l } & { \operatorname* { m a x } _ { \pi , \rho } \mathbb { E } _ { q } \left[ \sum _ { t = 0 } ^ { T } \left( r ( s _ { t } , a _ { t } ) - \frac { 1 } { \beta } \log \frac { \pi ( a _ { t } | s _ { t } ) } { \rho ( a _ { t } ) } \right) \right] . } \end{array}$ . Since we are interested in infinite horizon problems, we introduce a discount factor and take the limit $\operatorname* { l i m } _ { T \to \infty }$ (Haarnoja et al., 2017). This leads to the optimization objective that we use in our experiments:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\operatorname* { m a x } _ { \pi , \rho } \mathbb { E } _ { q } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( r ( s _ { t } , a _ { t } ) - \frac { 1 } { \beta } \log \frac { \pi ( a _ { t } | s _ { t } ) } { \rho ( a _ { t } ) } \right) \right] ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $0 < \gamma < 1$ is the discount factor. In the following, we show that the the solution for the prior and the policy can be expressed in a concise form giving rise to a novel RL regularization scheme.
|
| 123 |
+
|
| 124 |
+
# 3.2 RECURSION, OPTIMAL POLICIES AND OPTIMAL PRIORS
|
| 125 |
+
|
| 126 |
+
Crucial for the construction of a practical algorithm are concise expressions for the optimal policy and the prior. More concretely, the optimal policy takes the form of a Boltzmann distribution weighted by the prior $\rho$ . When fixing the policy, the optimal prior is the marginal distribution over actions under the discounted stationary distribution over states. This finding is important to devise a method for efficiently learning an optimal prior in practice.
|
| 127 |
+
|
| 128 |
+
Optimal policy for a fixed prior $\rho$ : We start by defining the value function with the information cost as $\begin{array} { r } { \mathcal { V } _ { \pi , \rho } ( s ) : = \mathbb { E } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \left( r ( s _ { t } , a _ { t } ) - \frac { 1 } { \beta } \log \frac { \pi ( a _ { t } | s _ { t } ) } { \rho ( a _ { t } ) } \right) | s _ { 0 } = s \right] } \end{array}$ where one can show that $\nu _ { \pi , \rho }$ satisfies a recursion similar to the Bellman equation:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\boldsymbol { \mathcal { V } } _ { \pi , \rho } ( s ) = \mathbb { E } _ { \pi } \left[ r ( s , a ) - \frac { 1 } { \beta } \log \frac { \pi ( a | s ) } { \rho ( a ) } + \gamma \mathbb { E } _ { s ^ { \prime } } [ \boldsymbol { \mathcal { V } } _ { \pi , \rho } ( s ^ { \prime } ) ] \right] .
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
When considering a fixed $\rho$ , the problem of maximizing Equation (7) over the policy can be solved analytically by standard variational calculus (Rubin et al., 2012; Genewein et al., 2015). The optimal policy is then given by
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\pi ^ { * } ( a | s ) : = \frac { 1 } { Z } \rho ( a ) \exp ( \beta Q _ { \pi ^ { * } , \rho } ( s , a ) )
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
with $\begin{array} { r } { Z = \sum _ { a } \rho ( a ) \exp ( \beta Q _ { \pi ^ { * } , \rho } ( s , a ) ) } \end{array}$ , and the the soft Q-function is defined as
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
Q _ { \pi , \rho } ( s , a ) : = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } } [ \mathcal { V } _ { \pi , \rho } ( s ^ { \prime } ) ] .
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
Being able to write the optimal policy in this way as a function of Q-values is needed in order to estimate the optimal prior as we show next.
|
| 147 |
+
|
| 148 |
+
Optimal prior for a fixed policy: In order to solve for the optimal prior, we rewrite the problem in Equation (6) as
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\operatorname* { m a x } _ { \pi , \rho } \sum _ { t = 0 } ^ { \infty } \sum _ { s } \gamma ^ { t } \nu _ { t } ( s ) \sum _ { a } \pi ( a | s ) \left( r ( s , a ) - \frac { 1 } { \beta } \log \frac { \pi ( a | s ) } { \rho ( a ) } \right) ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where we have defined the marginal distribution over states at time $t$ as
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\nu _ { t } ( s ) : = \sum _ { s _ { 0 } , a _ { 0 } , \ldots , s _ { t - 1 } , a _ { t - 1 } } p ( s _ { 0 } ) \left( \prod _ { t ^ { \prime } = 0 } ^ { t - 2 } \pi ( a _ { t ^ { \prime } } | s _ { t ^ { \prime } } ) P ( s _ { t ^ { \prime } + 1 } | s _ { t ^ { \prime } } , a _ { t ^ { \prime } } ) \right) \pi ( a _ { t - 1 } | s _ { t - 1 } ) P ( s | s _ { t - 1 } , a _ { t - 1 } ) .
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
For fixed $\pi$ , we eliminate the max operator for $\pi$ and all components that do not depend on $\rho$
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\operatorname* { m a x } _ { \rho } - \frac { 1 } { \beta } \sum _ { t = 0 } ^ { \infty } \sum _ { s } \gamma ^ { t } \nu _ { t } ( s ) \mathbf { K L } ( \pi ( \cdot | s ) | | \rho ( \cdot ) ) .
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
Swapping the sums and letting $\begin{array} { r } { p ( s ) : = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \nu _ { t } ( s ) } \end{array}$ be the unnormalized discounted marginal distribution over states, we obtain $\begin{array} { r } { \operatorname* { m a x } _ { \rho } - \frac { 1 } { \beta } \sum _ { s } p ( s ) \mathbf { K L } ( \pi ( \cdot | s ) | | \rho ( \cdot ) ) } \end{array}$ . The solution to the latter, $\begin{array} { r } { \rho ^ { \star } ( a ) = \frac { \sum _ { s } p ( s ) \pi ( a \mid s ) } { \sum _ { s , a } p ( s ) \pi ( a \mid s ) } } \end{array}$ , can easily be obtained by adding the constraint that the action-prior is a valid distribution (i.e., $\textstyle \sum _ { a } \rho ( a ) \ = \ 1$ and $\rho ( a ) \ > \ 0 \ \forall a )$ , and using the method of Lagrange multipliers and standard variational calculus. The connection to the mutual information becomes clear when plugging $\rho ^ { \star }$ back into the objective yielding $- k \cdot { \textstyle \frac { 1 } { \beta } } I ( S , A )$ scaled by a positive constant $k$ (because $p ( s )$ is not normalized) that can be absorbed into $\beta$ . Additionally, we also formalize the connection to the stationary mutual-information for the limit case of $\gamma 1$ in the Appendix.
|
| 167 |
+
|
| 168 |
+
With the form of the optimal prior for a fixed policy at hand, one can easily devise a stochastic approximation method (e.g. $\bar { \rho _ { i + 1 } } ( a ) = ( 1 - \bar { \alpha _ { \rho } } ) \rho _ { i } ( \bar { a } ) + \alpha _ { \rho } \pi ( a | s )$ with $\alpha _ { \rho } \in [ 0 , 1 ]$ and $s \sim p ( \cdot )$ to estimate the optimal $\rho$ using the current estimate of the optimal policy from Equation (8). We note that here we sample from the undiscounted distribution over states instead, rather than the true discounted state-distribution in the equation above. This is a common practice used in actor-critic RL that results in a biased estimator of the objective (Thomas, 2014).
|
| 169 |
+
|
| 170 |
+
# 4 MIRL: A PRACTICAL MUTUAL INFORMATION RL ALGORITHM
|
| 171 |
+
|
| 172 |
+
In this section, we present the MIRL agent. We focus on the tabular setting first and then port our algorithm to high-dimensional state spaces that require parametric function approximators.
|
| 173 |
+
|
| 174 |
+
# 4.1 MIRL FOR TABULAR Q-LEARNING
|
| 175 |
+
|
| 176 |
+
Our tabular MIRL agent is a modification of an ordinary Q-learning agent with a different update scheme for Q-values. In parallel to updating Q-values, the MIRL agent needs to update the prior $\rho$ as well as the parameter $\beta$ . The behavioral policy $\pi$ is also different and utilizes soft Q-values. This is outline in more detail below.
|
| 177 |
+
|
| 178 |
+
Prior Updates: We approximate the optimal prior by employing the following update equation,
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
\rho _ { i + 1 } ( a ) = ( 1 - \alpha _ { \rho } ) \rho _ { i } ( a ) + \alpha _ { \rho } \pi _ { i } ( a | s _ { i } )
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
where $s _ { i } \sim \nu _ { i } ( \cdot )$ and $\alpha _ { \rho }$ is a learning rate. Assuming a fixed policy, it is easy to show that this iterative update converges to $\begin{array} { r } { \rho _ { \pi } ( a ) = \bar { \sum } _ { s } \mu _ { \pi } ( s ) \pi ( a | s ) } \end{array}$ , thus estimating correctly the optimal prior.
|
| 185 |
+
|
| 186 |
+
-function Updates: Concurrently to learning the prior, MIRL updates the tabular Q-function as
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
Q ( s , a ) Q ( s , a ) + \alpha _ { Q } ( ( T _ { \mathrm { s o f t } } ^ { \rho } Q _ { \bar { \theta } } ) ( s , a , s ^ { \prime } ) - Q ( s , a ) )
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
where $\alpha _ { Q }$ is a learning rate and $T _ { \mathrm { s o f t } } ^ { \rho } Q$ is the empirical soft-operator defined as $( T _ { \mathrm { s o f t } } ^ { \rho } Q ) ( s , a , s ^ { \prime } ) : =$ $\begin{array} { r l } { r ( s , a ) + \gamma \frac { 1 } { \beta } \log \sum _ { a ^ { \prime } } \rho ( a ^ { \prime } ) \exp \left( \beta Q ( s ^ { \prime } , a ^ { \prime } ) \right) } & { { } } \end{array}$ . Importantly, this operator differs from other soft operators arising when employing entropy regularization. Entropy regularization assumes a fixed uniform prior, whereas in our case, the optimal prior is estimated in the course of learning.
|
| 193 |
+
|
| 194 |
+
Behavioural policy: Since the Q-function can be learned off-policy, the experience samples can conveniently be drawn from a behavioural policy $\pi _ { b }$ different from the current estimate of the optimal policy. As such, the behavioural policy used in our experiments is similar in spirit to an $\epsilon$ -greedy policy but it better exploits the existence of the estimated optimal prior when both exploring and exploiting. When exploring, MIRL’s behavioural policy samples from the current estimate of the optimal prior $\rho _ { i }$ which has adjusted probabilities, in contrast to vanilla $\epsilon$ -greedy that samples all actions with equal frequency. Additionally, when exploiting, MIRL selects the maximum probability action that depends not only on the Q-values but also on the current estimate of the optimal action-prior, instead of selecting the action with highest Q-value as in traditional $\epsilon$ -greedy. More formally, given a random sample $u \sim$ Uniform[0,1] and epsilon $\epsilon$ , the action $a _ { i }$ is obtained by
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
a _ { i } = { \displaystyle \left\{ \begin{array} { l l } { \arg \operatorname* { m a x } _ { a } \pi _ { i } ( a | s _ { i } ) , } & { { \mathrm { i f ~ } } u > \epsilon } \\ { a \sim \rho _ { i } ( \cdot ) } & { { \mathrm { i f ~ } } u \leq \epsilon , } \end{array} \right. }
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
where $\begin{array} { r } { \pi _ { i } ( a | s ) = \frac { 1 } { Z } \rho _ { i } ( a ) \exp ( \beta _ { i } Q _ { i } ( s , a ) ) } \end{array}$ , see Equation (8).
|
| 201 |
+
|
| 202 |
+
Parameter $\beta$ Updates: The parameter $\beta$ can be seen as a Lagrange multiplier that quantifies the magnitude of penalization for deviating from the prior. As such, a small fixed value of $\beta$ would restrict the class of available policies and evidently constrain the asymptotic performance of MIRL. In order to remedy this problem and obtain better asymptotic performance, we use the same adaptive $\beta$ -scheduling over rounds $i$ from (Fox et al., 2016) in which $\beta _ { i }$ is updated linearly according to $\beta _ { i + 1 } = c \cdot i$ with some positive constant $c$ . This update favours small values of $\beta$ at the beginning of training and large values towards the end of training when the error over Q-values is small. Therefore, towards the end of training when $\beta$ is large, MIRL recovers ordinary Q-learning without a constraint. This ensures that the asymptotic performance of MIRL is not hindered.
|
| 203 |
+
|
| 204 |
+
# 4.2 MIRL WITH PARAMETRIC FUNCTION APPROXIMATORS
|
| 205 |
+
|
| 206 |
+
For parametric function approximators, the scheme for updating the prior and the behavioural policy is the same as in the tabular setting but Q-function updates and $\beta$ -scheduling need to be adjusted for high-dimensional state spaces. The pseudocode of our proposed algorithm is outlined in Algorithm 1 and follows standard literature for parametric value learning, see e.g. Mnih et al. (2015).
|
| 207 |
+
|
| 208 |
+
Q-function Updates: Q-function parameters are obtained by minimizing the following loss
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
L ( \theta , \rho ) : = \mathbb { E } _ { s , a , r , s ^ { \prime } \sim \mathcal { M } } \left[ \Big ( ( T _ { \mathrm { s o f t } } ^ { \rho } Q _ { \bar { \theta } } ) ( s , a , s ^ { \prime } ) - Q _ { \theta } ( s , a ) \Big ) ^ { 2 } \right]
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
where $\mathcal { M }$ is a replay memory (Mnih et al., 2015), $Q _ { \bar { \theta } }$ is a target network that is updated after a certain number of training iterations and $T _ { \mathrm { s o f t } } ^ { \rho } Q$ is the empirical soft-operator from the tabular setting, here repeated for convenience $\begin{array} { r } { ( T _ { \mathrm { s o f f } } ^ { \rho } Q ) ( \vec { s , a } , s ^ { \prime } ) : = r ( s , a ) + \gamma \frac { 1 } { \beta } \log \sum _ { a ^ { \prime } } \rho ( a ^ { \prime } ) \exp { ( \beta Q ( s ^ { \prime } , a ^ { \prime } ) ) } . } \end{array}$ .
|
| 215 |
+
|
| 216 |
+
Parameter $\beta$ Updates: We use the same adaptive $\beta$ -scheduling from Leibfried et al. (2018) in which $\beta _ { i }$ is updated according to the inverse of the empirical loss of the Q-function, i.e. $\beta _ { i + 1 } =$ $\begin{array} { r } { ( 1 - \alpha _ { \beta } ) \beta _ { i } + \dot { \alpha } _ { \beta } \big ( \frac { 1 } { L ( \theta _ { i } , \rho _ { i + 1 } ) } \big ) } \end{array}$ . This provides more flexibility than the linear scheduling scheme from the tabular setting, more suitable for high-dimensional state spaces where it is impossible to visit all state-action pairs.
|
| 217 |
+
|
| 218 |
+
# Algorithm 1 MIRL
|
| 219 |
+
|
| 220 |
+
1: Input: the learning rates $\alpha _ { \rho }$ , $\alpha _ { Q }$ and $\alpha _ { \beta }$ , a $\mathrm { Q }$ -network $Q _ { \theta } ( s , a )$ , a target network $Q _ { \bar { \theta } } ( s , a )$ , a
|
| 221 |
+
behavioural policy $\pi _ { b }$ , an initial prior $\rho _ { 0 }$ and parameters $\theta _ { 0 }$ at $t = 0$ .
|
| 222 |
+
2: for $i = 1$ to $N$ iterations do
|
| 223 |
+
3: Get environment state $s _ { i }$ and apply action $a _ { i } \sim \pi _ { b } ( \cdot | s _ { i } )$
|
| 224 |
+
4: Get $r _ { i }$ , $s _ { i + 1 }$ and store $\left( { { s _ { i } } , { a _ { i } } , { r _ { i } } , { s _ { i + 1 } } } \right)$ in replay memory $\mathcal { M }$
|
| 225 |
+
5: Update prior $\rho _ { i + 1 } ( \cdot ) = \rho _ { i } ( \cdot ) ( 1 - \alpha _ { \rho } ) + \alpha _ { \rho } \pi _ { i } ( \cdot | s _ { i } )$
|
| 226 |
+
6: if $i$ mod update frequency $= = 0$ then
|
| 227 |
+
7: Update Q-function $\theta _ { i + 1 } = \theta _ { i } - \alpha _ { Q } \nabla _ { \theta } L ( \theta , \rho _ { i + 1 } ) | _ { \theta _ { i } }$ according to Equation (13)
|
| 228 |
+
8: Update parameter βi+1 = (1 − αβ)βi + αβ 1L(θi,ρi+1)
|
| 229 |
+
9: end if
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 1: Grid world experiments. Left column: The top shows a corridor grid world with $3 \times 2 0$ cells where the goal is on the right. The bottom shows an $8 \times 8$ grid world where an important action (left) has to be made exactly once to arrive at the goal. Middle column: Evaluation of Qlearning (QL), SQL with standard uniform exploration and with marginal exploration ${ ( \mathrm { S Q L } } . \mathrm { m } )$ , and MIRL. We clearly see that MIRL outperforms the baselines on the corridor, and is comparable to the baselines on the $8 \times 8$ world. Right column: We see that MIRL is able to identify the correct action (go right) faster than the baselines in the corrider (top). The bottom reports how having infrequent but important actions does not affect the performance of MIRL.
|
| 233 |
+
|
| 234 |
+
# 5 EXPERIMENTS
|
| 235 |
+
|
| 236 |
+
We evaluate our MIRL agent both in the tabular setting using a grid world domain, and in the parametric function approximator setting using the Atari domain.
|
| 237 |
+
|
| 238 |
+
# 5.1 GRID WORLD
|
| 239 |
+
|
| 240 |
+
As an intuitive example, we evaluate our method in a grid world domain where the agent has to reach a goal. Reaching the goal gives a reward of 9 but each step yields a reward of $- 1$ . After the end of an episode (when reaching the goal), the agent’s location is randomly re-sampled uniformly over the state space. We compare against two baselines, Q-learning without any regularization, and SQL (Fox et al., 2016) which employs entropy regularization with the dynamic $\beta$ -scheduling scheme outlined earlier. We train the agents for $2 . 5 \cdot 1 0 ^ { \overline { { 5 } } }$ environment steps following the procedure outlined in Fox et al. (2016). Both SQL and MIRL update the Lagrange multiplier $\beta$ over time by using a linear scheduling scheme with a constant $c = \mathrm { i } 0 ^ { - 3 }$ . MIRL additionally updates the estimate of the optimal prior by using a learning rate $\alpha _ { \rho } = 2 \cdot 1 0 ^ { - 3 }$ . In all experiments, we use an adaptive learning rate for Q-values $\alpha _ { Q } = n ( s , a ) ^ { - \omega }$ that depends on the state-action-visitation frequencies $n ( s , a )$ (Fox et al., 2016). See Appendix for further details.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 2: Left panel: Median normalized score across 19 Atari games. Comparison between our method mutual information RL (MIRL), SQL and DQN, demonstrating MIRL’s superior performance. Right panels: Top figures show the raw score for 2 example games reporting MIRL’s superior performance on RoadRunner and Seaquest. The bottom plots show the evolution of the estimated prior over actions. For RoadRunner the prior converges to stable values during training. In Seaquest, the algorithm seems not to have converged yet after 50 million environment steps which is why the prior probabilities have not converged yet either (however, the formation of separate trajectory clusters towards the end of training indicates the ongoing process of convergence). See Appendix for details and plots for all environments. The curves are smoothed with an exponential moving average with effective window size of $1 0 ^ { 6 }$ environment steps.
|
| 244 |
+
|
| 245 |
+
During the training of each algorithm, snapshots of the Q-tables (and the estimate of the prior in the case of MIRL) are stored every 100 environment steps for evaluation. The evaluation for a single snapshot is conducted by running the policy for 30 episodes lasting at most 100 environment steps. The epsilon value when in evaluation mode is set to $\epsilon = 0 . 0 5$ (same as in training). Every individual experiment is repeated with 10 different initial random seeds and results are averaged across seeds.
|
| 246 |
+
|
| 247 |
+
Figure 1 summarizes our grid world experiments on two instances: a corridor where the goal is to the right, and a square world where one important action has to be executed exactly once. In the corridor, MIRL clearly outperforms competing approaches (Q-learning and SQL), whereas in the square world, MIRL attains comparable performance as the baselines. Note that these results remain valid when equipping SQL with the same marginal exploration scheme as MIRL.
|
| 248 |
+
|
| 249 |
+
# 5.2 ATARI
|
| 250 |
+
|
| 251 |
+
We conduct experiments on 19 Atari games (Brockman et al., 2016) with Algorithm 1 (MIRL), and compare against DQN (Mnih et al., 2015) and SQL (Haarnoja et al., 2018c) with a dynamic $\beta$ -scheduling scheme based on loss evolution that leads to improved performance over vanilla SQL with fixed $\beta$ (Leibfried et al., 2018). The three algorithms use a neural network for the estimation of Q-values as in (Mnih et al., 2015). The network receives as an input the state $s$ which is composed of the last four frames of the game with some extra pre-processing (see Appendix), and it outputs a vector of Q-values, i.e. one value for each valid action. We train the network for $5 \cdot 1 0 ^ { 7 }$ environment steps, where a training iteration is performed every four steps. The target network $Q _ { \bar { \theta } }$ is updated every $1 0 ^ { 4 }$ training iterations. Both SQL and MIRL update the Lagrange multiplier $\beta$ over time by using an exponential moving average of the inverse loss 4 (Leibfried et al., 2018) with $\alpha _ { \beta } = 3 { \cdot } 1 0 ^ { - 5 }$ . In addition, MIRL updates the estimate of the optimal prior by using a learning rate $\alpha _ { \rho } = 5 \cdot 1 0 ^ { - 5 }$ . Additional details can be found in the Appendix.
|
| 252 |
+
|
| 253 |
+
For evaluation, we create snapshots of the network agents every $1 0 ^ { 5 }$ environment steps. Evaluating a single snapshot offline is done by running the policy for 30 episodes that last at most $4 . 5 \cdot 1 0 ^ { 5 }$ environment steps but terminate earlier in case of a terminal event. When evaluating the agents, the epsilon value is $\epsilon = 0 . 0 5$ , whereas in training $\epsilon$ is linearly annealed over the first $1 0 ^ { 6 }$ steps (Mnih et al., 2015) from 1.0 to 0.1.
|
| 254 |
+
|
| 255 |
+
To summarize the results across all games, we normalize the episodic rewards obtained in the evaluation. The normalized episodic rewards are computed as follows $\begin{array} { r l r } { z _ { \mathrm { n o r m a l i z e d } } } & { = } & { \frac { z - z _ { \mathrm { r a n d o m } } } { z _ { \mathrm { h u m a n } } - z _ { \mathrm { r a n d o m } } } \cdot 1 0 0 \% , } \end{array}$ where $z$ stands for the score obtained from our agent at test time, $\tilde { z } _ { \mathrm { r a n d o m } }$ stands for the score that a random agent obtains and $z _ { \mathrm { h u m a n } }$ for the score a human obtains. Random and human scores are taken from Mnih et al. (2015) and Van Hasselt et al. (2016). As seen in Figure 2, our algorithm significantly outperforms the baselines in terms of the median normalized score. In particular, after 50 million interactions we obtain about $3 0 \%$ higher median normalized score compared to SQL and $5 0 \%$ higher score compared to DQN. MIRL attains the final performance of SQL in about half the amount of interactions with the environment and, similarly, it attains DQN’s final performance in about five times less interactions.
|
| 256 |
+
|
| 257 |
+
In Table 1 we show the comparison between best-performing agents for all the
|
| 258 |
+
|
| 259 |
+
Table 1: Mean Normalized score in 19 Atari games for DQN, SQL and our approach MIRL.
|
| 260 |
+
|
| 261 |
+
<table><tr><td rowspan=1 colspan=1>Game</td><td rowspan=1 colspan=1>DQN (%)</td><td rowspan=1 colspan=1>SQL (%)</td><td rowspan=1 colspan=1>MIRL (%)</td></tr><tr><td rowspan=1 colspan=1>Alien</td><td rowspan=1 colspan=1>101.58</td><td rowspan=1 colspan=1>51.02</td><td rowspan=4 colspan=1>40.23357.40330.197.80</td></tr><tr><td rowspan=18 colspan=1>AssaultAsterixAsteroidsBankHeistBeamRiderBoxingChopperCommandDemonAttackGopherKangarooKrullKungFuMasterRiverraidRoadRunnerSeaquestSpaceInvadersStarGunnerUpNDown</td><td rowspan=1 colspan=1>250.61</td><td rowspan=1 colspan=1>283.62</td></tr><tr><td rowspan=1 colspan=1>166.32</td><td rowspan=1 colspan=1>242.73</td></tr><tr><td rowspan=1 colspan=1>9.74</td><td rowspan=1 colspan=1>8.57</td></tr><tr><td rowspan=1 colspan=1>97.12</td><td rowspan=1 colspan=1>94.62</td><td rowspan=3 colspan=1>166.26117.212338.89</td></tr><tr><td rowspan=1 colspan=1>99.16</td><td rowspan=1 colspan=1>113.64</td></tr><tr><td rowspan=1 colspan=1>2178.57</td><td rowspan=1 colspan=1>2283.33</td></tr><tr><td rowspan=1 colspan=1>72.71</td><td rowspan=1 colspan=1>26.37</td><td rowspan=2 colspan=1>65.03469.30</td></tr><tr><td rowspan=1 colspan=1>350.95</td><td rowspan=1 colspan=1>451.78</td></tr><tr><td rowspan=1 colspan=1>474.18</td><td rowspan=1 colspan=1>538.87</td><td rowspan=1 colspan=1>429.44</td></tr><tr><td rowspan=1 colspan=1>351.48</td><td rowspan=1 colspan=1>393.16</td><td rowspan=1 colspan=1>405.9</td></tr><tr><td rowspan=1 colspan=1>843.16</td><td rowspan=1 colspan=1>886.68</td><td rowspan=1 colspan=1>1036.04</td></tr><tr><td rowspan=1 colspan=1>122.14</td><td rowspan=1 colspan=1>142.04</td><td rowspan=1 colspan=1>121.41</td></tr><tr><td rowspan=1 colspan=1>77.21</td><td rowspan=1 colspan=1>109.37</td><td rowspan=1 colspan=1>76.02</td></tr><tr><td rowspan=1 colspan=1>548.90</td><td rowspan=1 colspan=1>613.62</td><td rowspan=1 colspan=1>695.88</td></tr><tr><td rowspan=1 colspan=1>21.95</td><td rowspan=1 colspan=1>36.00</td><td rowspan=1 colspan=1>64.86</td></tr><tr><td rowspan=1 colspan=1>166.62</td><td rowspan=1 colspan=1>200.38</td><td rowspan=2 colspan=1>164.79574.89</td></tr><tr><td rowspan=1 colspan=1>653.44</td><td rowspan=1 colspan=1>681.12</td><td rowspan=1 colspan=1>574.89</td></tr><tr><td rowspan=1 colspan=1>183.19</td><td rowspan=1 colspan=1>230.82</td><td rowspan=1 colspan=1>394.21</td></tr><tr><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>356.26</td><td rowspan=1 colspan=1>388.83</td><td rowspan=1 colspan=1>413.46</td></tr></table>
|
| 262 |
+
|
| 263 |
+
environments, where the best-performing agent is the agent that achieves the best score in evaluation mode considering all snapshots. Although this measure is not very robust, we include it since it is a commonly reported measure of performance in the field. MIRL outperforms the other baselines in 11 out of 19 games compared to SQL and DQN that are best on 5 and 3 games respectively.
|
| 264 |
+
|
| 265 |
+
In Figure 3, we conduct additional experiments on a subset of eight Atari games comparing MIRL and DQN with two different ablations of SQL: one ablation using uniform exploration and another ablation using the same marginal exploration scheme as MIRL (denoted SQL m). These experiments confirm the importance of the difference in values between MIRL and SQL rather than the difference in the exploration protocol.
|
| 266 |
+
|
| 267 |
+
# 6 RELATED WORK
|
| 268 |
+
|
| 269 |
+
The connection between reinforcement learning and inference is well established (Dayan & Hinton, 1997; Levine, 2018). Several authors have proposed RL algorithms based on optimizing the ELBO in Equation (5). In policy search, a popular approach is to optimize the lower bound using an iterative procedure similar to expectation maximization (Deisenroth et al., 2013). Different approximations can then be used for the trajectory distributions, resulting in different algorithms (Kober & Peters, 2009; Peters et al., 2010; Hachiya et al., 2011). The recent maximum a posteriori policy optimisation (MPO) (Abdolmaleki et al., 2018) framework uses a similar approach and combines an expectation maximization style update with off-policy estimation of a regularized Q-function. A key difference between MPO and our method is that MPO treats the approximate distribution $q ( \tau )$ as an auxiliary distribution used to optimize the policy that generates $p ( \tau )$ . In our method, as well as in the maximum entropy based methods discussed below, we optimize the policy used to generate $q ( \tau )$ , while using the distribution $p ( \tau )$ generated by the prior as an auxiliary distribution. While both approaches can be related to optimizing the ELBO, they can be shown to optimize different versions of the KL constraint on the target policy (Levine, 2018).
|
| 270 |
+
|
| 271 |
+
Maximum entropy reinforcement learning represents another family of inference-based RL methods. This formulation can be derived from the same evidence lower bound in Equation (5), by fixing the generative policy for $p ( \tau )$ to be a uniform prior. Maximum entropy RL has been derived under different conditions in many different settings. Ziebart et al. (2008) proposed maximum entropy learning for inverse reinforcement learning problems. Several authors have applied the same principles for trajectory optimization (Kappen, 2005; Todorov, 2008; Levine & Koltun, 2013). These maximum entropy methods typically assume the availability of some sort of transition model. More recently, maximum entropy learning has also been studied in model-free settings by introducing alternative soft-operators (Asadi & Littman, 2017) or soft Q-learning approaches (Rawlik et al., 2012; Fox et al., 2016; Haarnoja et al., 2017). Soft Q-learning learns a softened value function by replacing the hard maximum operator in the Q-learning update with a softmax operator. Several authors have discussed the benefits of this approach and provided generalizations under linear programming formulations (Neu et al., 2017). In particular, Fox et al. (2016) and Haarnoja et al. (2017) show that maximum entropy learning improves exploration and robustness. Furthermore, Haarnoja et al. (2018b) show that the resulting policies are composable and can be used to directly build solutions to unseen problems. Additionally, entropy-regularization has shown to be crucial to prove convergence guarantees on value learning with non-linear function approximators (Dai et al., 2018). The soft Qlearning framework has also been used in actor-critic settings (Haarnoja et al., 2018c) and to show a connection between value-based and policy gradient methods (Schulman et al., 2017; Nachum et al., 2017). The method has also been extended to hierarchical settings (Florensa et al., 2017; Haarnoja et al., 2018a). In the multi-task setting, the Distral framework (Teh et al., 2017) combines entropy regularization with an additional KL regularization used to transfer knowledge between tasks.
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 3: Normalized score for eight games comparing MIRL against standard SQL and a modified version of SQL that explores with the marginal distribution over actions (SQL m). The exploration method slightly improves SQL but not sufficiently enough to achieve MIRL’s performance. See individual plots and games in the Appendix.
|
| 275 |
+
|
| 276 |
+
The mutual information, central to our approach, is a basic quantity in information theory to measure the statistical dependence between two random variables. Machine learning applications that use the mutual information are numerous including the information-bottleneck method (Tishby et al., 1999), rate-distortion theory (Cover & Thomas, 2006; Tishby & Polani, 2011), clustering (Still & Bialek, 2004) and curiosity driven exploration (Still & Precup, 2012).
|
| 277 |
+
|
| 278 |
+
# 7 DISCUSSION AND CONCLUSION
|
| 279 |
+
|
| 280 |
+
Using a variational inference perspective, we derived a novel RL objective that allows optimization of the prior over actions. This generalizes previous methods in the literature that assume fixed uniform priors. We show that our formulation is equivalent to applying a mutual-information regularization and derive a novel algorithm (MIRL) that learns the prior over actions. We demonstrate that MIRL significantly improves performance over SQL and DQN.
|
| 281 |
+
|
| 282 |
+
We recognize that our approach might fail under certain conditions. For example, in the case when there is an action that is useful only once (similar to our
|
| 283 |
+
|
| 284 |
+
$8 \times 8$ grid world example) but is most of the times penalized with a negative reward. When the negative reward is too strong, MIRL might assign very low probability to that action and never explore it. However, this problem might be alleviated by a weighted mixing of our exploration policy with a uniform distribution.
|
| 285 |
+
|
| 286 |
+
An interesting direction for future work is to investigate the convergence properties of the alternating optimization problem presented here. We believe that, at least in the tabular case, the framework of stochastic approximation for two timescales (Borkar, 2009) is sufficient to prove convergence. On the experimental side, one could also investigate how our approach can be combined with the Rainbow framework (Hessel et al., 2017) which is the current state of the art in performance.
|
| 287 |
+
|
| 288 |
+
# REFERENCES
|
| 289 |
+
|
| 290 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. arXiv preprint arXiv:1806.06920, 2018.
|
| 291 |
+
|
| 292 |
+
Kavosh Asadi and Michael L Littman. An alternative softmax operator for reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 243– 252. JMLR. org, 2017.
|
| 293 |
+
|
| 294 |
+
Dimitri P Bertsekas. Dynamic Programming and Optimal Control: Volume 2. Athena Scientific, 1995.
|
| 295 |
+
|
| 296 |
+
Vivek S Borkar. Stochastic approximation: a dynamical systems viewpoint, volume 48. Springer, 2009.
|
| 297 |
+
|
| 298 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 299 |
+
|
| 300 |
+
Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, second edition, 2006.
|
| 301 |
+
|
| 302 |
+
Bo Dai, Albert Shaw, Lihong Li, Lin Xiao, Niao He, Zhen Liu, Jianshu Chen, and Le Song. Sbeed: Convergent reinforcement learning with nonlinear function approximation. In International Conference on Machine Learning, pp. 1133–1142, 2018.
|
| 303 |
+
|
| 304 |
+
Peter Dayan and Geoffrey E Hinton. Using expectation-maximization for reinforcement learning. Neural Computation, 9(2):271–278, 1997.
|
| 305 |
+
|
| 306 |
+
Marc Peter Deisenroth, Gerhard Neumann, Jan Peters, et al. A survey on policy search for robotics. Foundations and Trends $\textsuperscript { \textregistered }$ in Robotics, 2(1–2):1–142, 2013.
|
| 307 |
+
|
| 308 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
|
| 309 |
+
|
| 310 |
+
Roy Fox, Ari Pakman, and Naftali Tishby. Taming the noise in reinforcement learning via soft updates. In Proceedings of the Thirty-Second Conference on Uncertainty in Artificial Intelligence, pp. 202–211. AUAI Press, 2016.
|
| 311 |
+
|
| 312 |
+
Tim Genewein, Felix Leibfried, Jordi Grau-Moya, and Daniel Alexander Braun. Bounded rationality, abstraction, and hierarchical decision-making: An information-theoretic optimality principle. Frontiers in Robotics and AI, 2:27, 2015.
|
| 313 |
+
|
| 314 |
+
Jordi Grau-Moya, Felix Leibfried, Tim Genewein, and Daniel A Braun. Planning with informationprocessing constraints and model uncertainty in markov decision processes. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 475–491. Springer, 2016.
|
| 315 |
+
|
| 316 |
+
Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. In International Conference on Machine Learning, pp. 1352–1361, 2017.
|
| 317 |
+
|
| 318 |
+
Tuomas Haarnoja, Kristian Hartikainen, Pieter Abbeel, and Sergey Levine. Latent space policies for hierarchical reinforcement learning. In International Conference on Machine Learning, 2018a.
|
| 319 |
+
|
| 320 |
+
Tuomas Haarnoja, Vitchyr Pong, Aurick Zhou, Murtaza Dalal, Pieter Abbeel, and Sergey Levine. Composable deep reinforcement learning for robotic manipulation. arXiv preprint arXiv:1803.06773, 2018b.
|
| 321 |
+
|
| 322 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018c.
|
| 323 |
+
|
| 324 |
+
Hirotaka Hachiya, Jan Peters, and Masashi Sugiyama. Reward-weighted regression with sample reuse for direct policy search in reinforcement learning. Neural Computation, 23(11):2798–2832, 2011.
|
| 325 |
+
|
| 326 |
+
Matteo Hessel, Joseph Modayil, Hado Van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. arXiv preprint arXiv:1710.02298, 2017.
|
| 327 |
+
|
| 328 |
+
Heinke Hihn, Sebastian Gottwald, and Daniel Alexander Braun. Bounded rational decision-making with adaptive neural network priors. In IAPR Workshop on Artificial Neural Networks in Pattern Recognition, 2018.
|
| 329 |
+
|
| 330 |
+
Hilbert J Kappen. Path integrals and symmetry breaking for optimal control theory. Journal of statistical mechanics: theory and experiment, 2005(11):P11011, 2005.
|
| 331 |
+
|
| 332 |
+
Jens Kober and Jan R Peters. Policy search for motor primitives in robotics. In Advances in neural information processing systems, pp. 849–856, 2009.
|
| 333 |
+
|
| 334 |
+
Felix Leibfried and Daniel Alexander Braun. A reward-maximizing spiking neuron as a bounded rational decision maker. Neural Computation, 27:1682–1720, 2015.
|
| 335 |
+
|
| 336 |
+
Felix Leibfried and Daniel Alexander Braun. Bounded rational decision-making in feedforward neural networks. In Conference on Uncertainty in Artificial Intelligence, 2016.
|
| 337 |
+
|
| 338 |
+
Felix Leibfried, Jordi Grau-Moya, and Haitham B Ammar. An information-theoretic optimality principle for deep reinforcement learning. arXiv preprint arXiv:1708.01867, 2018.
|
| 339 |
+
|
| 340 |
+
Sergey Levine. Reinforcement learning and control as probabilistic inference: Tutorial and review. arXiv preprint arXiv:1805.00909, 2018.
|
| 341 |
+
|
| 342 |
+
Sergey Levine and Vladlen Koltun. Variational policy search via trajectory optimization. In Advances in Neural Information Processing Systems, pp. 207–215, 2013.
|
| 343 |
+
|
| 344 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 345 |
+
|
| 346 |
+
Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Bridging the gap between value and policy based reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2775–2785, 2017.
|
| 347 |
+
|
| 348 |
+
Gergely Neu, Anders Jonsson, and Vicenc¸ Gomez. A unified view of entropy-regularized markov ´ decision processes. arXiv preprint arXiv:1705.07798, 2017.
|
| 349 |
+
|
| 350 |
+
Pedro Ortega and Daniel Alexander Braun. Thermodynamics as a theory of decision-making with information-processing costs. Proceedings of the Royal Society A, 469(2153):20120683, 2013.
|
| 351 |
+
|
| 352 |
+
Zhen Peng, Tim Genewein, Felix Leibfried, and Daniel Alexander Braun. An information-theoretic on-line update principle for perception-action coupling. In IEEE/RSJ International Conference on Intelligent Robots and Systems, 2017.
|
| 353 |
+
|
| 354 |
+
Jan Peters, Katharina Mulling, and Yasemin Altun. Relative entropy policy search. In ¨ AAAI, pp. 1607–1612. Atlanta, 2010.
|
| 355 |
+
|
| 356 |
+
Martin Puterman. Markov decision processes: Discrete stochastic dynamic programming. 1994.
|
| 357 |
+
|
| 358 |
+
Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In Robotics: science and systems, volume 13, pp. 3052–3056, 2012.
|
| 359 |
+
|
| 360 |
+
Jonathan Rubin, Ohad Shamir, and Naftali Tishby. Trading value and information in mdps. In Decision Making with Imperfect Decision Makers, pp. 57–74. Springer, 2012.
|
| 361 |
+
|
| 362 |
+
John Schulman, Xi Chen, and Pieter Abbeel. Equivalence between policy gradients and soft qlearning. arXiv preprint arXiv:1704.06440, 2017.
|
| 363 |
+
|
| 364 |
+
Claude Shannon. Coding theorems for a discrete source with a fidelity criterion. Institute of Radio Engineers, International Convention Record, 7:142–163, 1959.
|
| 365 |
+
|
| 366 |
+
Christopher Sims. Rational inattention and monetary economics. Handbook of Monetary Economics, 3, 2011.
|
| 367 |
+
|
| 368 |
+
Susanne Still and William Bialek. How many clusters? an information-theoretic perspective. Neural computation, 16(12):2483–2506, 2004.
|
| 369 |
+
|
| 370 |
+
Susanne Still and Doina Precup. An information-theoretic approach to curiosity-driven reinforcement learning. Theory in Biosciences, 131(3):139–148, 2012.
|
| 371 |
+
|
| 372 |
+
R Sutton and A Barto. Reinforcement learning. MIT Press, Cambridge, 1998.
|
| 373 |
+
|
| 374 |
+
Yee Teh, Victor Bapst, Wojciech M Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In Advances in Neural Information Processing Systems, pp. 4496–4506, 2017.
|
| 375 |
+
|
| 376 |
+
Philip Thomas. Bias in natural actor-critic algorithms. In International Conference on Machine Learning, pp. 441–448, 2014.
|
| 377 |
+
|
| 378 |
+
Naftali Tishby and Daniel Polani. Information theory of decisions and actions. In Perception-Action Cycle. Springer, 2011.
|
| 379 |
+
|
| 380 |
+
Naftali Tishby, Fernando C Pereira, and William Bialek. The information bottleneck method. The 37th Annual Allerton Conference on Communication, Control, and Computing., 1999.
|
| 381 |
+
|
| 382 |
+
Emanuel Todorov. General duality between optimal control and estimation. In Decision and Control, 2008. CDC 2008. 47th IEEE Conference on, pp. 4286–4292. IEEE, 2008.
|
| 383 |
+
|
| 384 |
+
Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. 2016.
|
| 385 |
+
|
| 386 |
+
Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, volume 8, pp. 1433–1438. Chicago, IL, USA, 2008.
|
| 387 |
+
|
| 388 |
+
# A APPENDIX
|
| 389 |
+
|
| 390 |
+
# A.1 CONNECTION TO MUTUAL INFORMATION FOR $\gamma 1$
|
| 391 |
+
|
| 392 |
+
The goal of this section is to show that when $\gamma 1$ , Equation (6) can be expressed as the following average-reward formulation (Puterman, 1994) with a constraint on the stationary mutual information
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\operatorname* { m a x } _ { \pi } \mathbb { E } _ { s \sim \mu _ { \pi } } \left[ \sum _ { a } \pi ( a | s ) r ( s , a ) \right] \quad { \mathrm { s . t . ~ } } I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } ) \leq C ,
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
where $\mu _ { \pi }$ and $\rho _ { \pi }$ are the stationary distributions induced by the policy $\pi$ over states and actions, respectively, and thus $I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } )$ is defined as the stationary mutual-information. Note that for a fixed stationary distribution over states, this problem coincides exactly with the well-known ratedistortion problem (Cover & Thomas, 2006).
|
| 399 |
+
|
| 400 |
+
We start by expressing (6) as a constrained problem
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\operatorname* { m a x } _ { \pi } \mathbb { E } _ { q } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) \right] \mathrm { ~ s . t . ~ } \operatorname* { m i n } _ { \rho } \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) \leq K ( \gamma ) ,
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
where $\begin{array} { r } { K ( \gamma ) : = \frac { C } { 1 - \gamma } } \end{array}$ (although we have set $K ( \cdot )$ as a function of $\gamma$ , it is without loss of generality since we can always obtain a desired $K ( \cdot )$ by choosing an appropriate $C$ for a given $\gamma$ ) and the marginal probability of state $s _ { t }$ at time $t$ following the Markovian dynamics is written as in Equation (10).
|
| 407 |
+
|
| 408 |
+
A standard result in the MDP literature (Bertsekas, 1995) is that
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\arg \operatorname* { m a x } _ { \pi } \operatorname* { l i m } _ { \gamma 1 } ( 1 - \gamma ) \mathbb { E } _ { q } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ] \iff \arg \operatorname* { m a x } _ { \pi } \mathbb { E } _ { s \sim \mu _ { \pi } } [ \sum _ { a } \pi ( a | s ) r ( s , a ) ]
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
which basically says that the optimal policy for the limit $\gamma 1$ of an infinite horizon problem is equivalent to the average reward formulation. Now it only remains to make explicit a similar equivalence on the constraint.
|
| 415 |
+
|
| 416 |
+
We rewrite the constraint by multiplying on both sides by $( 1 - \gamma )$ assuming $\gamma \in ( 0 , 1 )$
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\operatorname* { m i n } _ { \rho } \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) \leq K ( \gamma ) \iff \operatorname* { m i n } _ { \rho } ( 1 - \gamma ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) \leq C .
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Taking the limit $\gamma 1$ in the last inequality and interchanging the limit and the min operators 5, we obtain the constraint $\begin{array} { r } { \operatorname* { m i n } _ { \rho } \operatorname* { l i m } _ { \gamma \to 1 } ( 1 - \gamma ) \dot { \sum } _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \mathbf { \bar { \pi } } , \mathbf { \bar { \rho } } ) \leq C } \end{array}$ . Then, we see the connection between the last inequality and the constraint on Equation (14) using the following Proposition 2.
|
| 423 |
+
|
| 424 |
+
Proposition 2. Let $\mu _ { \pi } ( s )$ and $\rho _ { \pi } ( a )$ be the stationary distribution over states and actions under policy $\pi$ according to Definitions (1) and (2). Then the stationary mutual information defined as $\begin{array} { r } { I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } ) : = \operatorname* { m i n } _ { \rho } I _ { f } ( \mu _ { \pi } \pi , \rho ) } \end{array}$ can also be written as
|
| 425 |
+
|
| 426 |
+
$$
|
| 427 |
+
I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } ) = \operatorname* { m i n } _ { \rho } \operatorname* { l i m } _ { \gamma 1 } ( 1 - \gamma ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho )
|
| 428 |
+
$$
|
| 429 |
+
|
| 430 |
+
where $\nu _ { t } ( s )$ is defined as in (10).
|
| 431 |
+
|
| 432 |
+
Proof. Following similar steps as in (Bertsekas, 1995, p.186) we have
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\begin{array} { r l r } { { I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } ) = \operatorname* { m i n } _ { \rho } \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \sum _ { t = 0 } ^ { N - 1 } I _ { f } ( \nu _ { t } , \pi , \rho ) } } \\ & { } & { = \underset { \rho } { \operatorname* { m i n } } \underset { N \to \infty } { \operatorname* { l i m } } \operatorname* { l i m } _ { \rho \to 1 } \frac { \sum _ { t = 0 } ^ { N - 1 } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) } { \sum _ { t = 0 } ^ { N } \gamma ^ { t } } } \\ & { } & { = \underset { \rho \ \gamma \to 1 } { \operatorname* { m i n } } \underset { N \to \infty } { \operatorname* { l i m } } \ \frac { \sum _ { t = 0 } ^ { N } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) } { \sum _ { t = 0 } ^ { N } \gamma ^ { t } } } \\ & { } & { = \underset { \rho \ \gamma \to 1 } { \operatorname* { m i n } } ( 1 - \gamma ) \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } I _ { f } ( \nu _ { t } , \pi , \rho ) , } \end{array}
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
where we used Proposition 3 (shown next) in the first equality and where the limits in the third equality can be interchanged due to the monotone convergence theorem. □
|
| 439 |
+
|
| 440 |
+
Proposition 3. Let $\mu _ { \pi } ( s )$ and $\rho _ { \pi } ( a )$ be the stationary distribution over states and actions under policy $\pi$ according to Definitions (1) and (2). Then the stationary mutual information defined as $I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } )$ can also be written as
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
I _ { f } ( \mu _ { \pi } , \pi , \rho _ { \pi } ) = \operatorname* { m i n } _ { \rho } \operatorname* { l i m } _ { N \to \infty } \frac { 1 } { N } \sum _ { t = 0 } ^ { N - 1 } \sum _ { s _ { t } } \nu _ { t } ( s _ { t } ) K L ( \pi ( \cdot | s _ { t } ) | | \rho ( \cdot ) ) ,
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
where $\nu _ { t } ( s )$ is defined as in (10).
|
| 447 |
+
|
| 448 |
+
Proof. Let ${ \mathcal { T } } _ { \rho } ( s ) : = \mathrm { K L } ( \pi ( \cdot | s ) | | \rho ( \cdot ) )$ and $\begin{array} { r } { \mathcal { T } _ { \rho _ { \pi } } ( s ) : = \mathrm { K L } ( \pi ( \cdot | s ) | | \rho _ { \pi } ( \cdot ) ) } \end{array}$ . Note that both previous quantities are bounded for all $t$ . Then
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { r l } & { \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) - \sum _ { \theta \to \pi } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) - \sum _ { \theta \to \pi } \rho _ { i } \rangle } \\ & { \quad - \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) - \sum _ { \theta \to \pi } \rho _ { i } \rangle \displaystyle \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) \rangle } \\ & { \quad = \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) } \\ & { \quad = \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) } \\ & { \quad = \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) , \mathcal { D } _ { \theta } ( \theta ) } \\ & { \quad = \operatorname* { m i n } _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { i = \theta \to \pi } ^ { N } \sum _ { \theta \to \theta \to \pi } \frac { 1 } { N } \displaystyle \sum _ { \theta \to \pi } \frac { 1 } { N } \sum _ { \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) \rangle } \\ & \quad = \sum _ { \theta \to \theta \to \pi } \rho _ { i } \langle \mathcal { D } _ { \theta } ( \theta ) \rangle \operatorname* { m a x } \frac { 1 } { N } \displaystyle \sum _ { \theta \to \pi } \ \end{array}
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
where we assumed that $\nu _ { t } ( s ) = \mu _ { \pi } ( s )$ for all $t > K$ and finite but large enough $K$
|
| 455 |
+
|
| 456 |
+
Since in practice we use a discount factor $\gamma \lessapprox 1$ , our original problem formulation in (6) can be seen as an approximation to the problem with stationary mutual-information constraints in (14).
|
| 457 |
+
|
| 458 |
+
The conclusion of this section is that we have established a clear link between the ELBO with optimizable priors and the average reward formulation with stationary mutual-information constraints.
|
| 459 |
+
|
| 460 |
+
# A.2 HYPERPARAMETERS
|
| 461 |
+
|
| 462 |
+
Here we describe the hyperparameters used for both the Grid World experiments (see Table 2) and the Atari experiments (see Table 3).
|
| 463 |
+
|
| 464 |
+
Table 2: Hyperparameters for tabular experiments.
|
| 465 |
+
|
| 466 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Y αp</td><td>0.99 2·10-3</td></tr></table>
|
| 467 |
+
|
| 468 |
+
Table 3: Hyperparameters for Atari experiments.
|
| 469 |
+
|
| 470 |
+
<table><tr><td>Parameter</td><td>Value</td></tr><tr><td>Frame size Frame skip</td><td>[84,84] 4</td></tr><tr><td>History frames (in s)</td><td>4</td></tr><tr><td>Reward clipping</td><td>{-1,0,+1}</td></tr><tr><td>Max environment steps</td><td>27000</td></tr><tr><td>Target update frequency (train. steps)</td><td>10000</td></tr><tr><td>Training update frequency (env. steps)</td><td>4</td></tr><tr><td>Batch size</td><td>32</td></tr><tr><td>Memory capacity</td><td>106</td></tr><tr><td>Y</td><td>0.99</td></tr><tr><td></td><td></td></tr><tr><td>αp</td><td>2.10-6</td></tr><tr><td>αQ</td><td>2.10-5</td></tr><tr><td>αβ β</td><td>3.3 ·10-6 0.01</td></tr></table>
|
| 471 |
+
|
| 472 |
+
# A.3 SPECIFIC PLOTS FOR INDIVIDUAL GAMES
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 4: Prior Evolution for all games. We can see that MIRL’s prior has fully converged for some games whereas for other games it is still about to converge.
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
Figure 5: Scores for all games on the evaluation snapshots.
|
| 479 |
+
|
| 480 |
+
# A.4 ABLATION STUDY
|
| 481 |
+
|
| 482 |
+
In the ablation study summarized in Figure 3, we show how marginal exploration affects SQL. In Figure 6, we show the same plot for individual games. We clearly see that the marginal exploration improves performance, but is not the defining factor for all the improvements obtained by MIRL.
|
| 483 |
+
|
| 484 |
+

|
| 485 |
+
Figure 6: Comparison between standard SQL $( \mathbf { S } \mathbf { Q } \mathbf { L } \mathbf { - } \mathbf { u } )$ , SQL with marginal exploration $( \mathrm { S Q L } \mathrm { . m } )$ , and MIRL.
|
| 486 |
+
|
| 487 |
+
# A.5 EVOLUTION OF THE LAGRANGE MULTIPLIER
|
| 488 |
+
|
| 489 |
+
In Figure 7, we show the evolution of $\beta$ over time (environment steps) for the MIRL agent. As we can see, the $\beta$ -values usually start at a high value (not shown for visual reasons) and typically go down and stabilize at some value. At first sight, this might be seen as a negative side effect since lower $\beta$ values imply a stronger constraint. However, we note that the constraint is highly dependent on the scale of the reward (or its sparsity), and therefore, the $\beta$ value is not meaningful without a proper specification of this reward scaling.
|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
Figure 7: Beta evolution over time.
|
| 493 |
+
|
| 494 |
+
Consequently, given that $\beta$ -values are not meaningful here, we propose to instead show the multiplication of $\beta$ times the current maximum Q-value estimates denoted as $\beta \times \operatorname* { m a x } Q$ . Note that $\bar { \beta Q } ( s , a )$ appears on the exponential term of the policy, i.e. $\begin{array} { r } { \pi ( a | s ) = \frac { 1 } { Z } \rho ( a ) \exp ( \beta Q ( s , a ) ) } \end{array}$ , and therefore, is the term that shapes the deviation from the action-prior distribution. Additionally, the Q-values serve us as proper scaling for each game and account also for the learning of the agent. In particular, while the agent is learning and increasing its reward acquisition, the Q-values are going to be higher, thus, effectively needing a smaller $\beta$ to shape the policy probabilities.
|
| 495 |
+
|
| 496 |
+
On Figure 8, we show the evolution of the term $\beta \times \operatorname* { m a x } Q$ for all the games. As we can see for the majority of games, $\beta \times \operatorname* { m a x } Q$ increases over time or has high value. This is important since a high value denotes that the policy is highly affected by this term.
|
| 497 |
+
|
| 498 |
+

|
| 499 |
+
Figure 8: Evolution of $\beta \times \operatorname* { m a x } Q$ over time while training. Specifically, for an environment step $i$ , we compute the $\beta _ { i } \operatorname* { m a x } _ { a } Q _ { \theta _ { i } } ( s _ { i } , a )$ , where $\beta _ { i }$ is the current $\beta$ -value, $Q _ { \theta _ { i } }$ the current approximation of $\mathrm { Q }$ and $s _ { i }$ is the state at the step $i$ .
|
md/train/HygUOoC5KX/HygUOoC5KX.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/LSFCEb3GYU7/LSFCEb3GYU7.md
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EMERGENT SYMBOLS THROUGH BINDING IN EXTERNAL MEMORY
|
| 2 |
+
|
| 3 |
+
Taylor W. Webb
|
| 4 |
+
University of California Los Angeles Los Angeles, CA
|
| 5 |
+
taylor.w.webb@gmail.com
|
| 6 |
+
Ishan Sinha, Jonathan D. Cohen
|
| 7 |
+
Princeton University
|
| 8 |
+
Princeton, NJ
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
A key aspect of human intelligence is the ability to infer abstract rules directly from high-dimensional sensory data, and to do so given only a limited amount of training experience. Deep neural network algorithms have proven to be a powerful tool for learning directly from high-dimensional data, but currently lack this capacity for data-efficient induction of abstract rules, leading some to argue that symbol-processing mechanisms will be necessary to account for this capacity. In this work, we take a step toward bridging this gap by introducing the Emergent Symbol Binding Network (ESBN), a recurrent network augmented with an external memory that enables a form of variable-binding and indirection. This binding mechanism allows symbol-like representations to emerge through the learning process without the need to explicitly incorporate symbol-processing machinery, enabling the ESBN to learn rules in a manner that is abstracted away from the particular entities to which those rules apply. Across a series of tasks, we show that this architecture displays nearly perfect generalization of learned rules to novel entities given only a limited number of training examples, and outperforms a number of other competitive neural network architectures.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Human intelligence is characterized by a remarkable capacity to detect the presence of simple, abstract rules that govern high-dimensional sensory data, such as images or sounds, and then apply these to novel data. This capacity has been extensively studied by psychologists in both the visual domain, in tasks such as Raven’s Progressive Matrices (Raven & Court, 1938), and the auditory domain, in tasks that employ novel, artificial languages (Marcus et al., 1999).
|
| 17 |
+
|
| 18 |
+
In recent years, deep neural network algorithms have reemerged as a powerful tool for learning directly from high-dimensional data, though many studies have now demonstrated that these models suffer from similar limitations as those faced by the earlier generation of neural networks: requiring enormous amounts of training data and tending to generalize poorly outside the distribution of those training data (Lake & Baroni, 2018; Barrett et al., 2018). This stands in sharp contrast to the ability of human learners to infer abstract structure from a limited number of training examples and then systematically generalize that structure to problems involving novel entities.
|
| 19 |
+
|
| 20 |
+
It has long been argued that the human ability to generalize in this manner depends crucially on a capacity for variable-binding, that is, the ability to represent a problem in terms of abstract symbollike variables that are bound to concrete entities (Holyoak & Hummel, 2000; Marcus, 2001). This in turn can be broken down into two components: 1) a mechanism for indirection, the ability to bind two representations together and then use one representation to refer to and retrieve the other (Kriete et al., 2013), and 2) a representational scheme whereby one of the bound representations codes for abstract variables, and the other codes for the values of those variables.
|
| 21 |
+
|
| 22 |
+
In this work, we present a novel architecture designed around the goal of having a capacity for abstract variable-binding. This is accomplished through two important design considerations. First, the architecture possesses an explicit mechanism for indirection, in the form of a two-column external memory. Second, the architecture is separated into two information-processing streams, one that maintains learned embeddings of concrete entities (in our case, images), and one in which a recurrent controller learns to represent and operate over task-relevant variables. These two streams only interact in the form of bindings in the external memory, allowing the controller to learn to perform tasks in a manner that is abstracted away from the particular entities involved. We refer to this architecture as the Emergent Symbol Binding Network (ESBN), due to the fact that this arrangement allows abstract, symbol-like representations to emerge during the learning process, without the need to incorporate symbolic machinery.
|
| 23 |
+
|
| 24 |
+
We evaluate this architecture on a suite of tasks involving relationships among images that are governed by abstract rules. Across these tasks, we show that the ESBN is capable of learning abstract rules from a limited number of training examples and systematically generalizing these rules to novel entities. By contrast, the other architectures that we evaluate are capable of learning these rules in some cases, but fail to generalize them successfully when trained on a limited number of problems involving a limited number of entities. We conclude from these results that a capacity for variable-binding is a necessary component for human-like abstraction and generalization, and that the ESBN is a promising candidate for how to incorporate such a capacity into neural network algorithms.
|
| 25 |
+
|
| 26 |
+
# 2 TASKS
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 1: Abstract rule learning tasks. Each task involves generalizing rules to objects not seen during training. (a) Same/different discrimination task. (b) Relational match-to-sample task (answer is 2). (c) Distribution-of-three task (answer is 2). (d) Identity rules task (ABA pattern, answer is 1).
|
| 30 |
+
|
| 31 |
+
We consider a series of tasks, each involving the application of an abstract rule to a set of images. For all tasks, we employ the same set of $n = 1 0 0$ images, in which each image is a distinct Unicode character (the specific characters used are shown in A.7). We construct training sets in which $m$ images are withheld (where $0 \leq m \leq n - o .$ , and $o$ is the minimum number of images necessary to create a problem in a given task) consisting of problems that employ only the remaining $( n -$ $m$ ) images, and then test on problems that employ only the $m$ withheld images, thus requiring generalization to novel entities. In the easiest generalization regime $\mathbf { \bar { \rho } } m = 0$ ) the test set contains problems composed of the same entities as observed during training (though the exact order of these entities differs). In the most extreme generalization regime, we evaluate models that have only been trained on the minimum number of entities for a given task, and then must generalize what they learn to the majority of the $n$ images in the complete set. This regime poses an extremely challenging test of the ability to learn to perform these tasks from limited training experience, in a manner that is abstracted away from the specific entities observed during training.
|
| 32 |
+
|
| 33 |
+
The first task that we study is a same/different discrimination task (Figure 1a). In this task, two images are presented, and the task is to determine whether they are the same or different. Though this task may appear quite simple, it has been shown that the ability to generalize this simple rule to novel entities is actually a significant challenge for deep neural networks (Kim et al., 2018), a pattern that we also observe in our results.
|
| 34 |
+
|
| 35 |
+
The second task that we consider is a relational match-to-sample (RMTS) task (Figure 1b), essentially a higher-order version of a same/different task. In this task, a source pair of objects is compared to two target pairs. The task is to identify the target pair with the same relation as the source pair; e.g., if the source pair contains two of the same object, to identify the target pair that contains two of the same object. It was initially believed that the ability to perform this task is not unique to humans (Premack, 1983), but it has now been shown that this ability depends on a visual entropy confound that arises from using large arrays of objects rather than simple pairs (Fagot et al., 2001). When the task is presented in a manner that does not allow this confound to be exploited (as is the case in our experiments), the ability to perform the task with novel entities appears to be unique to humans, and therefore is a good test of the human ability for abstract rule learning.
|
| 36 |
+
|
| 37 |
+
Next we consider a task based on Raven’s Progressive Matrices (RPM; Raven & Court (1938)). RPM is a commonly used visual problem-solving task, and is one of the most widely used tests of fluid intelligence (Snow et al., 1984), the ability to reason and make inferences in a novel domain (as opposed to crystallized intelligence, the ability to solve familiar tasks). In this task, a $3 \times 3$ array of figural elements is presented, in which the elements are governed by a simple rule, or set of rules, with the lower right element of the array left blank. The task is to infer the rule that governs the elements in the array, and then use that rule to select from among 8 candidate completions. Many of the rules that govern RPM problems are relations involving sets. One such rule is sometimes referred to as distribution-of-three (Carpenter et al., 1990), according to which the same set of three elements (e.g. a triangle, square, and circle) will appear in each row, though the order doesn’t matter. The task in this case is simply to identify the set, determining which element is missing from the final row, and locating this element among the choices.
|
| 38 |
+
|
| 39 |
+
Though multiple RPM-inspired datasets have recently been proposed (Barrett et al., 2018; Zhang et al., 2019), in this work we choose to strip away unnecessary complexity, focusing on $2 \times 3$ arrays governed by a single rule (Figure 1c), in order to focus specifically on the capacity for generalization of an abstract rule to novel entities. We find that, even in this simplified setting, this form of generalization is extremely challenging.
|
| 40 |
+
|
| 41 |
+
The final task that we consider is a visual version of the identity rules task studied by Marcus et al. (1999). In this task, an abstract pattern (e.g. ABA or ABB) must be inferred from a sequence of elements. For instance, in the original study, the following sequence ‘ga ni ga, li na li, wo fe wo’ is governed by an ABA rule, whereas the sequence ‘ga ni ni, li na na, wo fe fe’ is governed by an ABB rule. This study played an important role in debates concerning the presence of algebraic rulelike processes in human cognition, because it demonstrated that even 7-month-old human infants are capable of detecting this abstract regularity and generalizing it to novel entities, whereas neural networks tend to overfit to the specific entities involved and fail to generalize the rule.
|
| 42 |
+
|
| 43 |
+
In our implementation, we use visual images rather than sounds, and present the task as a $2 \times 3$ array (Figure 1d). In this task, each problem is governed by either an ABA, ABB, or AAA rule. The task is to determine which of these patterns is present in the first row, and then to apply that pattern by selecting an element from a set of 4 choices to complete the second row.
|
| 44 |
+
|
| 45 |
+
For all four tasks, we consider generalization regimes in which some number of images $( m \in$ $\{ 0 , 5 0 , 8 5 , 9 5 \}$ out of $n = 1 0 0$ ) are withheld from training. For the same/different discrimination task, on which only two images are necessary to construct a problem, we also consider the case in which $m = 9 8$ (such that the training set consists of problems involving only $n - m = 2$ images, the minimum number necessary to construct the task).
|
| 46 |
+
|
| 47 |
+
In most settings, we construct training sets consisting of $1 0 ^ { 4 }$ problems. This is a tiny fraction of all possible problems (on the order of $\mathrm { { \bar { 1 0 } ^ { 9 } } }$ when the multiple choice options are considered)1 Thus, even in the easiest generalization regime $( m = 0$ ) this is an extremely small amount of training data relative to the size of the task space. In the most extreme regimes, in which $m \geq 9 5$ , it is only possible to construct a few hundred problems, resulting in even more limited training experience.
|
| 48 |
+
|
| 49 |
+
# 3 APPROACH
|
| 50 |
+
|
| 51 |
+
For each task, we treat the problem as a sequence of images $\pmb { x } _ { t = 1 } . . . \pmb { x } _ { t = T }$ , with an associated target $\textbf { { y } }$ . In the same/different discrimination task, there are $T \ = \ 2$ images, and $\textbf { { y } }$ is a binary target indicating whether the images are the same or different. In the RMTS task, there are $T = 6$ images, consisting of the source pair followed by two target pairs, and $\textbf { { y } }$ is a binary target indicating which target pair matches the source pair. In both the distribution-of-three task and the identity rules task, there are $T = 9$ images, consisting of the three entries in the first row, the two non-empty entries in the second row, and the four multiple-choice options, and $\textbf { { y } }$ is a four-way classification target, indicating which of the multiple-choice options is correct.
|
| 52 |
+
|
| 53 |
+
All images are $3 2 \times 3 2$ grayscale images containing a single Unicode character. For each problem, we first process each image independently by a shared encoder $f _ { e }$ , generating image embeddings $z _ { t = 1 } , . . . z _ { t = T }$ , and then pass these embeddings to a sequential model component $f _ { s }$ that generates a response (either through a sigmoid output layer for tasks with a binary target, or a softmax layer for tasks with a four-way classification target). The sequential component is either the ESBN or one of a number of alternative architectures described below. We use the same encoder architecture $f _ { e }$ (detailed in A.3) for all models. All components are trained end-to-end, including the encoder.
|
| 54 |
+
|
| 55 |
+
# 3.1 TEMPORAL CONTEXT NORMALIZATION
|
| 56 |
+
|
| 57 |
+
We use temporal context normalization (TCN), recently shown to improve out-of-distribution generalization in relational reasoning tasks (Webb et al., 2020). TCN is similar to batch normalization, but, instead of normalizing over the batch dimension, normalizes over a task-relevant temporal window. This has the effect of preserving information about the relations between the entities present within this window (e.g. the size of those entities relative to one another), resulting in better generalization of learned relations to novel contexts (i.e. out-of-distribution).
|
| 58 |
+
|
| 59 |
+
We found that TCN significantly improved generalization for all of the models on all of the tasks studied in the present work2. Therefore, the primary results we report all incorporate this technique ( A.5.1 includes a comparison of the performance of all models on all tasks with and without TCN). Specifically, we applied TCN to the embeddings $z _ { t = 1 } , . . . z _ { t = T }$ extracted by the encoder. Webb et al. (2020) also reported that it is sometimes useful to apply TCN separately to different components of a sequence. We found that this was the case for the RMTS task that we studied, in which we found it useful to apply TCN separately to the embeddings for the source pair and each target pair. For all of the other tasks that we studied, TCN was applied over the entire sequence for each problem.
|
| 60 |
+
|
| 61 |
+
# 3.2 EMERGENT SYMBOL BINDING NETWORK
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
Figure 2: Emergent Symbol Binding Network. $f _ { s }$ consists of an LSTM controller plus output layers for $\hat { \pmb { y } }$ , $k _ { w }$ , and $g$ (not shown). $f _ { e }$ is a multilayer feedforward encoder that translates an image $_ { \textbf { \em x } }$ into a low-dimensional embedding $_ { z }$ . These two pathways only interact indirectly via a key/value memory.
|
| 65 |
+
|
| 66 |
+
The ESBN (Figure 2; Algorithm 1) uses an LSTM controller $( f _ { s } )$ with a differentiable external memory that is explicitly separated into keys $( M _ { k } )$ and values $( M _ { v } )$ . At each time step $t$ , a key/value pair is written to memory. The keys written to memory, $k _ { w _ { t } }$ , are generated by an output layer from the LSTM controller, and the values are the individual input embeddings, ${ \boldsymbol { z } } _ { t }$ , of the input sequence, unmodified by the LSTM. Our hypothesis was that factoring the model into two separate information processing streams would allow the LSTM to learn how to represent abstract variables in the keys it generates, which could then be explicitly bound to associated values (image embeddings) learned by the separate encoder network $( f _ { e } )$ , allowing the ESBN to employ a form of indirection.
|
| 67 |
+
|
| 68 |
+
To retrieve keys from memory, similarity scores are computed by comparing (via a dot product) the image embedding ${ \boldsymbol { z } } _ { t }$ to all of the values in memory $M _ { v _ { t - 1 } }$ . These similarity scores are passed through a softmax nonlinearity to generate weights ${ \pmb w } _ { k _ { t } }$ , and passed through a sigmoid nonlinearity (with learned gain and bias parameters, $\gamma$ and $\beta$ ) to generate confidence values $c _ { k _ { t } }$ (one weight and confidence value per entry in memory). The weights are used to compute 1) a weighted sum of all keys in memory $M _ { k _ { t - 1 } }$ , and 2) a weighted sum of all associated confidence values $c _ { k _ { t } }$ . Finally, the retrieved key and associated confidence value are concatenated and multiplied by a learned sigmoidal gate $g _ { t }$ to form $\boldsymbol { k } _ { \boldsymbol { r } _ { t } }$ , the input to the LSTM controller at the next time step.
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Algorithm 1: Emergent Symbol Binding Network. (ll) indicates the concatenation of a vector and a scalar, forming a vector with one additional dimension.{,} indicates the concatenation of a matrix and a vector,forming a matrix with one additional row. o() is the logistic sigmoid function.</td></tr><tr><td>ht=0←0; Mkt=0←{}; Mut=o←{; for t in1...Tdo Zt←fe(xt);</td></tr><tr><td>yt,gt,kwt,ht ←fs(ht-1,krt-1); if t is 1 then krt←0; else</td></tr><tr><td>Wkt ← softmax(Mut-1·zt); Ckt← σ(γ(Mvt-1·zt)+β);</td></tr><tr><td>t-1 krt←gt M Wkt(i)(Mkt-1(i)llckt (i)) ; i=1</td></tr></table>
|
| 71 |
+
|
| 72 |
+
# 3.3 ALTERNATIVE ARCHITECTURES
|
| 73 |
+
|
| 74 |
+
The simplest alternative architecture that we consider is an LSTM (Hochreiter & Schmidhuber, 1997) without external memory. We pass the low-dimensional embeddings $z _ { t = 1 } , . . . z _ { t = T }$ directly to the LSTM, and generate a prediction $\hat { \pmb { y } }$ by passing the final hidden state through an output layer.
|
| 75 |
+
|
| 76 |
+
Next we consider two alternative external memory architectures: the Neural Turing Machine (NTM; Graves et al. (2014)) and Metalearned Neural Memory (MNM; Munkhdalai et al. (2019)). This comparison allows us to determine to what extent our results depend on the specific details of the ESBN’s external memory, and, in particular, the separation between its two informationprocessing pathways vs. the mere presence of an external memory. Our NTM implementation consists of an LSTM controller (which takes image embeddings as input, and generates a prediction $\hat { \textbf { \textit { y } } }$ as output) that interacts with an external memory using both content-based and location-based read/write mechanisms. Our MNM implementation employs the publicly available code from the original paper, modified so as to employ the same encoder architecture and TCN procedure as the other architectures that we test. Just as with the ESBN, we allow both of these architectures an extra time step to process the information retrieved from memory following the final input.
|
| 77 |
+
|
| 78 |
+
We also consider the Relation Net (RN; Santoro et al. (2017)), an architecture that has proven to be an effective approach for a wide range of relational reasoning tasks. In our implementation, we treat the low-dimensional image embeddings as individual ‘objects’ in the RN framework, using a shared MLP to process all pair-wise combinations of these embeddings, summing the outputs from this MLP, and then passing them to another MLP that generates the prediction $\hat { \boldsymbol y }$ .
|
| 79 |
+
|
| 80 |
+
We also compare our model against the Transformer (Vaswani et al., 2017), an architecture originally developed in the domain of natural language processing, but has proven to be effective for a wide range of sequential data, and demonstrated a capacity for some degree of extrapolation (Saxton et al., 2019). After applying the transformer architecture to the sequence of image embeddings (allowing self-attention between these embeddings), we compute an average of the (transformed) embeddings, and then pass this to a small MLP that then generates the task output $\hat { \pmb { y } }$ .
|
| 81 |
+
|
| 82 |
+
Finally, we consider the PrediNet (Shanahan et al., 2019). PrediNet was designed with the goal of being ‘explicitly relational,’ and has been shown to be effective at generalizing learned relations to novel entities. We apply the PrediNet’s multi-head attention over the 1D temporal sequence of image embeddings (as opposed to applying attention over a 2D image, as in the original work), and then pass the output of the PrediNet module to a small MLP that generates $\hat { \boldsymbol y }$ .
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 3: Results for all four tasks with $m$ objects withheld (out of $n = 1 0 0$ ) during training. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 86 |
+
|
| 87 |
+
Figure 3 shows the generalization results for all four tasks. Our primary finding is that the ESBN displayed nearly perfect generalization $( \geq 9 5 \% )$ of the learned rule in all four tasks, even when trained on a very limited number of problems (just hundreds of problems, in the case of the most extreme generalization regimes) involving a limited number of entities (as few as just two entities, in the case of the same/different task), and tested on completely novel entities. Some of the alternative architectures that we evaluated showed a surprising capability to generalize to novel entities in some tasks as seen, for instance, in the generalization results for the Transformer and RN on the same/different and RMTS tasks (though we note that all architectures incorporate TCN, without which generalization is significantly worse, as shown in A.5.1). Nevertheless, none of these alternative architectures were able to generalize what they learned in the most extreme generalization regimes, whereas the ESBN performed comparably well across all regimes.
|
| 88 |
+
|
| 89 |
+
Notably, the RN performed very poorly on the distribution-of-three and identity rules tasks, even in the easiest regime $( m = 0$ ). We speculate that this results from the fact that the RN is biased toward pair-wise relations, whereas these tasks are both based on a ternary relation. It is possible to represent this ternary relation as a combination of pair-wise relations, but doing so requires a more complex strategy and therefore likely more training data. We include results in A.5.2 demonstrating that the RN is capable of successfully generalizing in this task (though not in the most extreme regimes) when trained on an order of magnitude more data $1 0 ^ { 5 }$ instead of $1 0 ^ { 4 }$ examples). We also present results for the Temporal Relation Network (Zhou et al., 2018), an RN variant that incorporates ternary relations via subsampling, though we find that this doesn’t help as much as increasing the amount of training data.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 4: Training accuracy time courses for all models on the $m = 0$ regime. Each time course reflects an average over 10 trained networks. Error bars reflect the standard error of the mean.
|
| 93 |
+
|
| 94 |
+
In addition to requiring a very small amount of training data and generalizing systematically to novel entities, the ESBN also requires very little training time. Figure 4 shows training accuracy time courses for the RMTS, distribution-of-three, and identity rules tasks for all models 3. The ESBN converged to nearly perfect training accuracy within 100 to 200 training updates on all four tasks, whereas the other models required thousands, or even tens of thousands of training updates to reach convergence4.
|
| 95 |
+
|
| 96 |
+
We also performed some experiments to better understand how the ESBN operates, and why it was so effective. First, we tested whether the systematic generalization exhibited by the ESBN was dependent on the use of convolutional layers in the encoder, which naturally confer a significant degree of generalization in tasks that involve shape recognition. We found that the ESBN generalized to novel entities comparably well when using either an MLP encoder or a random projection (see A.5.4 for details), suggesting that the ESBN is capable of generalizing learned rules to any arbitrary set of entities, regardless of how those entities are encoded. For comparison, we also performed the same experiments with the Transformer (the best performing alternative architecture on our tasks) and found that, by contrast, its performance was significantly impaired by the use of a random projection instead of a convolutional encoder.
|
| 97 |
+
|
| 98 |
+
Second, we performed an ablation experiment on the confidence value appended to retrieved memories. We found that ablation of these confidence values impaired the ESBN’s performance in both the same/different and RMTS tasks, but not the distribution-of-three or identity rules tasks (see A.5.5 for details). A likely reason for this result is that the distribution-of-three and identity rules tasks only require retrieval of the best match from memory, whereas the same/different and RMTS tasks require a sense of how good of a match that memory is, which is exactly the information that the confidence value conveys. This dissociation mirrors the distinction sometimes made in cognitive psychology between recollection and familiarity (Yonelinas, 2001).
|
| 99 |
+
|
| 100 |
+
Third, we performed an analysis of the key representations learned by the controller. We hypothesized that the controller would learn to represent abstract variables in the keys that it writes to memory, and that these representations therefore shouldn’t vary based on the values to which they are bound. This analysis revealed a high degree of overlap between the keys written during training and test (involving entirely different entities), suggesting that this was indeed the case (see A.6 for details). This ability to arbitrarily bind values to variables, without affecting the representations of those variables, is a key property of symbol-processing systems, and is likely the basis of the strong systematic generalization exhibited by the ESBN.
|
| 101 |
+
|
| 102 |
+
# 5 RELATED WORK
|
| 103 |
+
|
| 104 |
+
There have been a number of proposals for augmenting neural networks with an external memory. An influential early line of work, Complementary Learning Systems (McClelland et al., 1995), proposed that neural systems benefit from having components that learn on different time scales, and argues that this combination allows neural networks both to learn general, abstract structure (using standard learning algorithms) and to rapidly encode arbitrary new items (using an external memory). In recent years, there have been a number of proposals for how to implement the latter efficiently, including Fast Weights (Ba et al., 2016a), the NTM and closely related Differentiable Neural Computer (Graves et al., 2016), and the Differentiable Neural Dictionary (DND; Pritzel et al. (2017)). Our external memory approach is most closely related to the DND, which also involves a two-column key/value memory. Variations on key/value memory have also been employed in other more recently proposed approaches, such as the Memory Recall Agent (Fortunato et al., 2019) and the Dual-Coding Episodic Memory (Hill et al., 2020), where it afforded various benefits in terms of generalization. One critical difference between our model and this previous work is that the ESBN’s controller is forced to interact with perceptual inputs only indirectly through its memory, a design decision that we argue is crucial to its ability to systematically generalize what it learns.
|
| 105 |
+
|
| 106 |
+
It is worth noting that architectures such as Fast Weights and the NTM are, in principle, capable of implementing variable-binding, though it is a separate question whether such a strategy will result from learning in any particular task. Along these lines, a recent study from Chen et al. (2019) found that both of these architectures are capable of generalizing learned structure to novel entities when allowed a sufficiently dense sampling of the space of potential objects (the ‘objects’ in their study were randomly sampled 50-dimensional vectors). This contrasts with our findings, in which the NTM performed poorly when trained on far fewer samples from a much higher-dimensional space (in the $m = 9 5$ regime). This suggests that indirection and variable-binding, though possible in principle for architectures such as the NTM, do not emerge in practice when given only a limited amount of training experience, whereas this capacity is explicitly built into the ESBN.
|
| 107 |
+
|
| 108 |
+
At a high level, the idea of factoring a model into two distinct information processing streams, one that codes abstract task-relevant variables or roles and one that codes concrete entities, has been explored before. Kriete et al. (2013) proposed the PBWM Indirection model, in which one population of neurons acted as a pointer to another population of neurons by gating its activity, and showed that this model enabled a significant degree of generalization to novel role/filler bindings. Whittington et al. (2019) proposed the Tolman-Eichenbaum machine, a model that is capable of learning abstract relational structure (such as 2D spatial maps), and showed that this model captured a number of phenomena relating to grid cells and place cells. Russin et al. (2019) proposed Syntactic Attention, an architecture involving separate pathways for processing syntax vs. semantics, and showed that this approach was capable of a significant degree of compositional generalization on the challenging SCAN dataset. Relative to this previous work, our central contribution is the development of a simple model that can learn abstract rules directly from high-dimensional data (images), exploiting this same high-level idea to enable nearly perfect generalization of those rules to novel entities.
|
| 109 |
+
|
| 110 |
+
There has been extensive modeling work focusing on some of the tasks that we study. The recent development of two datasets modeled after Raven’s Progressive Matrices, Procedurally Generated Matrices (Barrett et al., 2018), and RAVEN (Zhang et al., 2019), has spurred the development of models that are capable of solving RPM-like problems (Jahrens & Martinetz, 2020; Wu et al., 2020). However, these models typically require very large training sets (on the order of $1 0 ^ { 6 }$ training examples), and largely fail to generalize outside of the specific conditions under which they are trained, whereas the ESBN exhibits the ability to learn rapidly and generalize out-of-distribution.
|
| 111 |
+
|
| 112 |
+
There have also been a number of models proposed to account for the human ability to rapidly learn identity rules (Alhama & Zuidema, 2019). Though some of these models achieved significant generalization of learned identity rules to novel entities, they did so mostly through the inclusion of highly task-specific mechanisms. By contrast, our aim in the present work was to present a general approach that could be applied to a wider range of tasks.
|
| 113 |
+
|
| 114 |
+
Finally, there have been a number of recent proposals for so-called ‘neurosymbolic’ models, incorporating elements from both the neural network and symbolic modeling frameworks (Mao et al., 2019; Nye et al., 2020). Though we have emphasized the notion of ‘emergent symbols’ in the present work, we stress that this is quite distinct from neurosymbolic modeling efforts since we do not explicitly incorporate any symbolic machinery into the ESBN. Instead, our approach was to show how the functional equivalent of symbols can emerge in a neural network model with an appropriate architecture and binding mechanism.
|
| 115 |
+
|
| 116 |
+
# 6 DISCUSSION
|
| 117 |
+
|
| 118 |
+
# 6.1 LIMITATIONS AND FUTURE WORK
|
| 119 |
+
|
| 120 |
+
One open question is whether the strict division between the two information processing streams in the ESBN is necessary, and whether it limits the sorts of relations and rules that it can learn. In future work, it may be desirable to soften this division, for instance by encouraging it in a regularization term, rather than strictly enforcing it architecturally.
|
| 121 |
+
|
| 122 |
+
A second limitation is that the tasks we study are not as complex as other similar tasks that have recently been studied, such as the two recently proposed RPM-like benchmarks (Barrett et al., 2018; Zhang et al., 2019). In the present work, we intentionally stripped away some of this complexity in order to make progress on the issue of out-of-distribution generalization. Extending the ESBN to more complex tasks will likely require the incorporation of visual attention mechanisms to enable selective sequential processing of individual elements within a scene. There are many recently proposed approaches for doing this (Gregor et al., 2015; Locatello et al., 2020). In future work, we look forward to extending the ESBN in this manner and testing it on more complex tasks.
|
| 123 |
+
|
| 124 |
+
# 6.2 RELATION TO WORK IN NEUROSCIENCE
|
| 125 |
+
|
| 126 |
+
It is worth considering how the present work relates to pre-existing theories of how the brain might implement variable-binding. Classic proposals for variable-binding in neural systems emphasize dynamic binding of representations, either by computing the tensor product between those representations (Smolensky, 1990), or by establishing synchronous activation between two pools of units (Hummel & Holyoak, 1997). An alternative proposal is that variable-binding is accomplished via semi-permanent synaptic changes in the hippocampus, relying on the same mechanism that plays a central role in episodic memory (Cer & O’Reilly, 2006). This approach relies on contextual information and retrieval processes to prevent potential interference between conflicting memories, rather than explicit unbinding mechanisms. Our model is more in line with the latter account, since it does not possess an unbinding mechanism. As such, our model can be seen as part of a recent trend toward the reinterpretation of putatively working memory functions in terms of episodic memory (Beukers et al., 2020).
|
| 127 |
+
|
| 128 |
+
# 7 CONCLUSION
|
| 129 |
+
|
| 130 |
+
In this work, we have presented a model of abstract rule learning based on a novel architecture, the ESBN, and shown that this model is capable of rapidly learning abstract rules directly from images given only a small amount of training experience, and then successfully generalizing those rules to novel entities. Key to the model’s performance is its separation into two streams that only interact through indirection, allowing the ESBN to learn tasks in a manner that is abstracted away from the specific entities involved, and resulting in the emergence of symbol-like representations. We believe that these results suggest that such a variable-binding capacity is an essential ingredient for achieving human-like abstraction and generalization, and hope that the ESBN will be a useful tool for doing so.
|
| 131 |
+
|
| 132 |
+
# ACKNOWLEDGMENTS
|
| 133 |
+
|
| 134 |
+
We would like to thank Zachary Dulberg, Steven Frankland, Randall O’Reilly, Alexander Petrov, and Simon Segert for their helpful feedback and discussions.
|
| 135 |
+
|
| 136 |
+
# REFERENCES
|
| 137 |
+
|
| 138 |
+
Raquel G Alhama and Willem Zuidema. A review of computational models of basic rule learning: The neural-symbolic debate and beyond. Psychonomic bulletin & review, 26(4):1174–1194, 2019.
|
| 139 |
+
|
| 140 |
+
Jimmy Ba, Geoffrey E Hinton, Volodymyr Mnih, Joel Z Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In Advances in Neural Information Processing Systems, pp. 4331–4339, 2016a.
|
| 141 |
+
|
| 142 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016b.
|
| 143 |
+
|
| 144 |
+
David GT Barrett, Felix Hill, Adam Santoro, Ari S Morcos, and Timothy Lillicrap. Measuring abstract reasoning in neural networks. arXiv preprint arXiv:1807.04225, 2018.
|
| 145 |
+
|
| 146 |
+
Andrew Beukers, Kenneth A Norman, and Jonathan D Cohen. Is activity silent working memory just episodic memory?, 2020.
|
| 147 |
+
|
| 148 |
+
Patricia A Carpenter, Marcel A Just, and Peter Shell. What one intelligence test measures: a theoretical account of the processing in the raven progressive matrices test. Psychological review, 97 (3):404, 1990.
|
| 149 |
+
|
| 150 |
+
Daniel M Cer and Randall C O’Reilly. Neural mechanisms of binding in the hippocampus and neocortex: insights from computational models., 2006.
|
| 151 |
+
|
| 152 |
+
Catherine Chen, Qihong Lu, Andre Beukers, Christopher Baldassano, and Kenneth A Norman. Learning to perform role-filler binding with schematic knowledge. arXiv preprint arXiv:1902.09006, 2019.
|
| 153 |
+
|
| 154 |
+
Joel Fagot, Edward A Wasserman, and Michael E Young. Discriminating the relation between ¨ relations: the role of entropy in abstract conceptualization by baboons (papio papio) and humans (homo sapiens). Journal of Experimental Psychology: Animal Behavior Processes, 27(4):316, 2001.
|
| 155 |
+
|
| 156 |
+
Meire Fortunato, Melissa Tan, Ryan Faulkner, Steven Hansen, Adria Puigdom \` enech Badia, Gavin \` Buttimore, Charles Deck, Joel Z Leibo, and Charles Blundell. Generalization of reinforcement learners with working and episodic memory. In Advances in Neural Information Processing Systems, pp. 12469–12478, 2019.
|
| 157 |
+
|
| 158 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 249–256, 2010.
|
| 159 |
+
|
| 160 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. arXiv preprint arXiv:1410.5401, 2014.
|
| 161 |
+
|
| 162 |
+
Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka GrabskaBarwinska, Sergio G ´ omez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, ´ et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538 (7626):471–476, 2016.
|
| 163 |
+
|
| 164 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015.
|
| 165 |
+
|
| 166 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
|
| 167 |
+
|
| 168 |
+
Felix Hill, Olivier Tieleman, Tamara von Glehn, Nathaniel Wong, Hamza Merzic, and Stephen Clark. Grounded language learning fast and slow. arXiv preprint arXiv:2009.01719, 2020.
|
| 169 |
+
|
| 170 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 171 |
+
|
| 172 |
+
Keith J Holyoak and John E Hummel. The proper treatment of symbols in a connectionist architecture. Cognitive dynamics: Conceptual change in humans and machines, 229:263, 2000.
|
| 173 |
+
|
| 174 |
+
John E Hummel and Keith J Holyoak. Distributed representations of structure: A theory of analogical access and mapping. Psychological review, 104(3):427, 1997.
|
| 175 |
+
|
| 176 |
+
Marius Jahrens and Thomas Martinetz. Solving raven’s progressive matrices with multi-layer relation networks. arXiv preprint arXiv:2003.11608, 2020.
|
| 177 |
+
|
| 178 |
+
Junkyung Kim, Matthew Ricci, and Thomas Serre. Not-so-clevr: learning same–different relations strains feedforward neural networks. Interface focus, 8(4):20180011, 2018.
|
| 179 |
+
|
| 180 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 181 |
+
|
| 182 |
+
Trenton Kriete, David C Noelle, Jonathan D Cohen, and Randall C O’Reilly. Indirection and symbol-like processing in the prefrontal cortex and basal ganglia. Proceedings of the National Academy of Sciences, 110(41):16390–16395, 2013.
|
| 183 |
+
|
| 184 |
+
Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In International Conference on Machine Learning, pp. 2873–2882. PMLR, 2018.
|
| 185 |
+
|
| 186 |
+
Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-centric learning with slot attention. arXiv preprint arXiv:2006.15055, 2020.
|
| 187 |
+
|
| 188 |
+
Jiayuan Mao, Chuang Gan, Pushmeet Kohli, Joshua B Tenenbaum, and Jiajun Wu. The neurosymbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. arXiv preprint arXiv:1904.12584, 2019.
|
| 189 |
+
|
| 190 |
+
Gary Marcus. The algebraic mind, 2001.
|
| 191 |
+
|
| 192 |
+
Gary F Marcus, Sugumaran Vijayan, S Bandi Rao, and Peter M Vishton. Rule learning by sevenmonth-old infants. Science, 283(5398):77–80, 1999.
|
| 193 |
+
|
| 194 |
+
James L McClelland, Bruce L McNaughton, and Randall C O’Reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review, 102(3):419, 1995.
|
| 195 |
+
|
| 196 |
+
Tsendsuren Munkhdalai, Alessandro Sordoni, Tong Wang, and Adam Trischler. Metalearned neural memory. In Advances in Neural Information Processing Systems, pp. 13331–13342, 2019.
|
| 197 |
+
|
| 198 |
+
Maxwell I Nye, Armando Solar-Lezama, Joshua B Tenenbaum, and Brenden M Lake. Learning compositional rules via neural program synthesis. arXiv preprint arXiv:2003.05562, 2020.
|
| 199 |
+
|
| 200 |
+
David Premack. The codes of man and beasts. Behavioral and Brain Sciences, 6(1):125–136, 1983.
|
| 201 |
+
|
| 202 |
+
Alexander Pritzel, Benigno Uria, Sriram Srinivasan, Adria Puigdomenech, Oriol Vinyals, Demis Hassabis, Daan Wierstra, and Charles Blundell. Neural episodic control. arXiv preprint arXiv:1703.01988, 2017.
|
| 203 |
+
|
| 204 |
+
John C Raven and JH Court. Raven’s progressive matrices. Western Psychological Services Los Angeles, CA, 1938.
|
| 205 |
+
|
| 206 |
+
Jake Russin, Jason Jo, Randall C O’Reilly, and Yoshua Bengio. Compositional generalization in a deep seq2seq model by separating syntax and semantics. arXiv preprint arXiv:1904.09708, 2019.
|
| 207 |
+
|
| 208 |
+
Adam Santoro, David Raposo, David G Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In Advances in neural information processing systems, pp. 4967–4976, 2017.
|
| 209 |
+
|
| 210 |
+
David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. arXiv preprint arXiv:1904.01557, 2019.
|
| 211 |
+
|
| 212 |
+
Murray Shanahan, Kyriacos Nikiforou, Antonia Creswell, Christos Kaplanis, David Barrett, and Marta Garnelo. An explicitly relational neural network architecture. arXiv preprint arXiv:1905.10307, 2019.
|
| 213 |
+
|
| 214 |
+
Ishan Sinha, Taylor W Webb, and Jonathan D Cohen. A memory-augmented neural network model of abstract rule learning. arXiv preprint arXiv:2012.07172, 2020.
|
| 215 |
+
|
| 216 |
+
Paul Smolensky. Tensor product variable binding and the representation of symbolic structures in connectionist systems. Artificial intelligence, 46(1-2):159–216, 1990.
|
| 217 |
+
|
| 218 |
+
Richard E Snow, Patrick C Kyllonen, and Brachia Marshalek. The topography of ability and learning correlations. Advances in the psychology of human intelligence, 2(S 47):103, 1984.
|
| 219 |
+
|
| 220 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 221 |
+
|
| 222 |
+
Taylor W Webb, Zachary Dulberg, Steven M Frankland, Alexander A Petrov, Randall C O’Reilly, and Jonathan D Cohen. Learning representations that support extrapolation. arXiv preprint arXiv:2007.05059, 2020.
|
| 223 |
+
|
| 224 |
+
James CR Whittington, Timothy H Muller, Shirley Mark, Guifen Chen, Caswell Barry, Neil Burgess, and Timothy EJ Behrens. The tolman-eichenbaum machine: Unifying space and relational memory through generalisation in the hippocampal formation. BioRxiv, pp. 770495, 2019.
|
| 225 |
+
|
| 226 |
+
Yuhuai Wu, Honghua Dong, Roger Grosse, and Jimmy Ba. The scattering compositional learner: Discovering objects, attributes, relationships in analogical reasoning. arXiv preprint arXiv:2007.04212, 2020.
|
| 227 |
+
|
| 228 |
+
Andrew P Yonelinas. Consciousness, control, and confidence: the 3 cs of recognition memory. Journal of Experimental Psychology: General, 130(3):361, 2001.
|
| 229 |
+
|
| 230 |
+
Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. Raven: A dataset for relational and analogical visual reasoning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5317–5327, 2019.
|
| 231 |
+
|
| 232 |
+
Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 803–818, 2018.
|
| 233 |
+
|
| 234 |
+
# A APPENDIX
|
| 235 |
+
|
| 236 |
+
# A.1 CODE AVAILABILITY
|
| 237 |
+
|
| 238 |
+
All code, including code for dataset generation, model implementation, training, and evaluation, is available on GitHub.
|
| 239 |
+
|
| 240 |
+
# A.2 DATASET GENERATION
|
| 241 |
+
|
| 242 |
+
In this section, we provide details on the dataset generation process for all tasks. In all of our simulations, a dataset was generated from scratch (according to the procedures described below) at the beginning of each training run, such that different runs involved different datasets, though the statistics were the same across these datasets. We did this to prevent the possibility that our results would reflect biases present in a particular dataset.
|
| 243 |
+
|
| 244 |
+
Table 1: Training and test set sizes for the same/different discrimination task.
|
| 245 |
+
|
| 246 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85</td><td>m= 95</td><td>m=98</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Training</td><td>18,810</td><td>4,900</td><td>420</td><td>40</td><td>4</td></tr><tr><td>Test</td><td>990</td><td>4,900</td><td>10,000</td><td>10,000</td><td>10,000</td></tr></table>
|
| 247 |
+
|
| 248 |
+
# A.2.1 SAME/DIFFERENT DISCRIMINATION
|
| 249 |
+
|
| 250 |
+
Given $n = 1 0 0$ total images, with $m = 0$ withheld during training, there are $n ^ { 2 } = 1 0 ^ { 4 }$ possible same/different problems. To prevent the potential for networks to be biased by the fact that the overwhelming majority of these are ‘different’ problems, we created balanced datasets by including duplicates of the ‘same’ problems. Specifically, we randomly sampled (with replacement) $n ( n - 1 )$ of the $n$ unique ‘same’ trials and combined them with the $n ( n - 1 )$ unique ‘different’ trials, resulting in $2 n ( n - 1 ) = 1 9$ , 800 total problems. We reserved 990 of these problems for test, yielding training sets including 18, 810 problems (ensuring that duplicates of the same problem did not appear in both the training and test sets).
|
| 251 |
+
|
| 252 |
+
We followed a similar procedure for the other regimes, generating balanced datasets by duplicating the ‘same’ problems when necessary. These datasets incorporated either all of the problems that resulted from this procedure (given the $n { - } m$ images available for training, or the $m$ images available for test), or $1 0 , 0 0 0$ problems, whichever was smaller. The exact size of each of these datasets is shown in Table 1.
|
| 253 |
+
|
| 254 |
+
# A.2.2 RMTS
|
| 255 |
+
|
| 256 |
+
Table 2: Training and test set sizes for the RMTS task.
|
| 257 |
+
|
| 258 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Training</td><td>10,000</td><td>10,000</td><td>10,000</td><td>480</td></tr><tr><td>Test</td><td>10.000</td><td>10,000</td><td>10,000</td><td>10,000</td></tr></table>
|
| 259 |
+
|
| 260 |
+
For the RMTS task, we constructed balanced training and test sets ensuring that there were an equal number of problems with a ‘same’ vs. ‘different’ source pair. These datasets contained either 10, 000 problems, or the minimum number of problems possible in a given regime, whichever was smaller (Table 2). For most regimes, 10, 000 problems constitutes a tiny fraction of the full space of possible problems (ranging from $1 0 ^ { 9 }$ for the $m = 0$ regime to $1 0 ^ { 5 }$ for the training set in the $m = 8 5$ regime), and thus there was no need to duplicate problems to achieve balanced datasets. For the $m = 9 5$ regime, there are only 480 possible training problems, which happen to include the same number of ‘same’ and ‘different’ trial types.
|
| 261 |
+
|
| 262 |
+
# A.2.3 DISTRIBUTION-OF-THREE
|
| 263 |
+
|
| 264 |
+
Table 3: Training and test set sizes for the distribution-of-three task.
|
| 265 |
+
|
| 266 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Training</td><td>10,000</td><td>10,000</td><td>10,000</td><td>360</td></tr><tr><td>Test</td><td>10,000</td><td>10,000</td><td>10,000</td><td>10,000</td></tr></table>
|
| 267 |
+
|
| 268 |
+
For the distribution-of-three task, we generated problems by randomly selecting three of the available images in a given regime (either $n - m$ images during training, or $m$ images during test), and then randomly sampling two permutations of those images for the two rows (allowing the possibility that the same permutation appears in both rows) of the $2 \times 3$ matrix. We then randomly selected a fourth image to appear with the other three as possible answers, and randomly permuted these four answer choices. When taking into account the identity of this fourth image, and the permutation of the answer choices, the number of unique distribution-of-three problems in the $m = 0$ regime is on the order of $1 0 ^ { 1 0 }$ .
|
| 269 |
+
|
| 270 |
+
For most regimes, we randomly created training and test sets consisting of 10, 000 randomly sampled problems. For the $m = 9 5$ regime, the training set consisted of 360 problems (the total number of unique problems possible in this regime when not considering the identity and order of the answer choices, which were randomly selected).
|
| 271 |
+
|
| 272 |
+
# A.2.4 IDENTITY RULES
|
| 273 |
+
|
| 274 |
+
Table 4: Training and test set sizes for the identity rules task.
|
| 275 |
+
|
| 276 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m=95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Training</td><td>10,000</td><td>10,000</td><td>10,000</td><td>8,640</td></tr><tr><td>Test</td><td>10,000</td><td>10,000</td><td>10,000</td><td>10,000</td></tr></table>
|
| 277 |
+
|
| 278 |
+
For the identity rules task, we constructed datasets with an approximately balanced (through uniform random sampling) number of ABA, ABB, and AAA problems. These datasets consisted of either $1 0 , 0 0 0$ problems, or the minimum number of possible problems in a given regime, whichever was smaller (Table 4). For the training set in the $m = 9 5$ regime, datasets consisting of 8, 640 problems were constructed from the 7, 200 possible unique problems in this regime, by duplicating the AAA problems to match the number of ABA/ABB problems. For all other datasets, $1 0 , 0 0 0$ problems constituted a small fraction of the total number of possible problems (ranging from $1 0 ^ { \bar { 9 } }$ for the $m = 0$ regime to $1 0 ^ { 6 }$ for the training set in the $m = 8 5$ regime), and no duplication was necessary to achieve balanced problem types.
|
| 279 |
+
|
| 280 |
+
# A.3 IMPLEMENTATION DETAILS FOR ALL MODELS
|
| 281 |
+
|
| 282 |
+
# A.3.1 ENCODER
|
| 283 |
+
|
| 284 |
+
We used the same feedforward encoder architecture to process each of the images in a sequence $\pmb { x } _ { t = 1 } . . . \pmb { x } _ { t = T }$ , generating low-dimensional embeddings $z _ { t = 1 } , . . . z _ { t = T }$ that were then passed to the core sequential component of each model (either the ESBN or one of the alternative architectures)5. This encoder consisted of three convolutional layers, each with 32 channels, a $4 \times 4$ kernel, and a stride of 2, followed by two fully-connected layers with 256 units and 128 units respectively. All layers used ReLU nonlinearities. All weights were initialized using a Kaiming normal distribution (He et al., 2015), and all biases were initialized to 0.
|
| 285 |
+
|
| 286 |
+
# A.3.2 TASK OUTPUT LAYER
|
| 287 |
+
|
| 288 |
+
All models had an output layer for generating $\hat { \boldsymbol y }$ . The number of units and the nonlinearity depended on the task. For the same/different and RMTS tasks, the output layer had 1 unit and a sigmoid nonlinearity (producing a number between 0 and 1 to code for ‘same’ vs. ‘different’, or pair 1 vs. pair 2). For the distribution-of-three and identity rules tasks, the output layer had 4 units and a softmax nonlinearity (to select 1 of the 4 answer choices). The weights of the output layer were initialized using an Xavier normal distribution (Glorot & Bengio, 2010), and the biases were initialized to 0.
|
| 289 |
+
|
| 290 |
+
# A.3.3 ESBN
|
| 291 |
+
|
| 292 |
+
The details of the ESBN’s operations are given in Algorithm 1. The LSTM controller had 1 layer with 512 units, and employed the standard tanh nonlinearities and sigmoidal gates. The controller also had output layers for $k _ { w }$ (256 units with a ReLU nonlinearity), $g$ (1 unit with a sigmoid nonlinearity), and $\hat { \boldsymbol y }$ . The input to the controller at each time step was $k _ { r }$ , the key retrieved from memory at the previous time step (along with the associated confidence value, $c _ { k } .$ ). At the beginning of each sequence, $k _ { r }$ and the controller’s hidden state $^ { h }$ were initialized to 0.
|
| 293 |
+
|
| 294 |
+
After processing a full sequence, the ESBN was allowed an additional time step for the controller to process the retrieved key associated with the final input. After this additional time step, the final hidden state of the LSTM was passed through the task output layer to generate the prediction $\hat { \pmb { y } }$ . We note that it is also possible to retrieve values from memory (from $M _ { v }$ ) using a similar procedure and then decode these values to make predictions in image space (Sinha et al., 2020), but in the present work we focus only on the classification component of the model.
|
| 295 |
+
|
| 296 |
+
The input weights for the LSTM controller were initialized using an Xavier normal distribution with a gain value of $5 / 3$ . The weights for the LSTM’s gates, as well as the weights for the output layer for the gate $g$ , were initialized with an Xavier normal distribution (with a gain of 1). The weights for the output layer that produced $k _ { w }$ were initialized using a Kaiming normal distribution. All biases were initialized to 0. The parameters $\gamma$ and $\beta$ were initialized to 1 and 0 respectively.
|
| 297 |
+
|
| 298 |
+
# A.3.4 LSTM
|
| 299 |
+
|
| 300 |
+
The LSTM architecture had 1 layer with 512 units. Image embeddings were passed to the LSTM as a sequence, after which $\hat { \pmb { y } }$ was generated through a task output layer. The LSTM’s hidden state was initialized to 0 at the beginning of each sequence. The LSTM’s weights were initialized using the same scheme as the LSTM controller in the ESBN (using an Xavier normal distribution, with a gain of $5 / 3$ for the input weights and 1 for the gates), and biases were initialized to 0.
|
| 301 |
+
|
| 302 |
+
# A.3.5 NTM
|
| 303 |
+
|
| 304 |
+
The NTM had an LSTM controller (1 layer with 512 units). The LSTM’s hidden state was initialized to 0 at the beginning of each sequence, and the LSTM’s parameters were initialized in the same way as the LSTM architecture and the controller for the ESBN. The NTM had one write head and one read head. The read head had the following output layers:
|
| 305 |
+
|
| 306 |
+
1. read key: 256 units, tanh nonlinearity, weights initialized using an Xavier normal distribution with a gain of $5 / 3$ .
|
| 307 |
+
2. key strength: 1 unit, softplus nonlinearity, weights initialized using a Kaiming normal distribution.
|
| 308 |
+
3. interpolation gate: 1 unit, sigmoid nonlinearity, weights initialized using an Xavier normal distribution with a gain of 1.
|
| 309 |
+
4. shift weights: 3 units (corresponding to the allowable shifts $- 1 , 0$ , and 1), softmax nonlinearity, weights initialized using an Xavier normal distribution with a gain of 1.
|
| 310 |
+
|
| 311 |
+
The write head had the following output layers:
|
| 312 |
+
|
| 313 |
+
1. erase vector: 256 units, sigmoid nonlinearity, weights initialized using an Xavier normal distribution with a gain of 1.
|
| 314 |
+
2. add vector: 256 units, tanh nonlinearity, weights initialized using an Xavier normal distribution with a gain of $5 / 3$ .
|
| 315 |
+
3. write key: 256 units, tanh nonlinearity, weights initialized using an Xavier normal distribution with a gain of $5 / 3$ .
|
| 316 |
+
4. key strength: 1 unit, softplus nonlinearity, weights initialized using a Kaiming normal distribution.
|
| 317 |
+
5. interpolation gate: 1 unit, sigmoid nonlinearity, weights initialized using an Xavier normal distribution with a gain of 1.
|
| 318 |
+
6. shift weights: 3 units (corresponding to the allowable shifts $- 1 , 0$ , and 1), softmax nonlinearity, weights initialized using an Xavier normal distribution with a gain of 1.
|
| 319 |
+
|
| 320 |
+
All biases for these output layers were initialized to 0. The NTM used these outputs to interact with its external memory, employing all of the location- and content-based mechanisms described in the original work (Graves et al., 2014). Cosine similarity was used as a similarity measure for the content-based mechanisms. The memory matrix had 10 rows of size 256. The initial state of the memory at the beginning of each sequence was learned. The learned initial state was initialized (at the beginning of training) using an Xavier normal distribution.
|
| 321 |
+
|
| 322 |
+
The input to the LSTM controller at each time step consisted of the image embedding corresponding to that time step and the read vector from the previous time step. At the beginning of each sequence, the read vector, read weights, and write weights were initialized to 0. Just as with the ESBN, the NTM was allowed an additional time step to process the read vector retrieved from memory after observing the final image embedding, after which $\hat { \pmb { y } }$ was generated through an output layer from the LSTM controller.
|
| 323 |
+
|
| 324 |
+
# A.3.6 MNM
|
| 325 |
+
|
| 326 |
+
We implemented the MNM using publicly available code released with the original publication (Munkhdalai et al., 2019). Specifically, we used the version of MNM that employs a learned local update (‘MNM-p’ in the original paper). Before passing the images in our tasks to the MNM model, we applied the same encoder and TCN procedure used for the other architectures that we tested. Other than this modification, the original implementation, including all architectural hyperparameters, was unmodified.
|
| 327 |
+
|
| 328 |
+
# A.3.7 RN
|
| 329 |
+
|
| 330 |
+
The RN implementation consisted of two MLPs. The first MLP (used to process all pair-wise combinations of image embeddings) had a hidden layer of size 512 and an output layer of size 256. The outputs from the first MLP were summed, and then passed to the second MLP, which had a hidden layer of size 256 and an output layer for generating $\hat { y }$ . All layers (except the output layer) used ReLU nonlinearities. All weights were initialized using a Kaiming normal distribution (except the output layer, which was initialized according to the description in A.3.2), and all biases were initialized to 0. Before passing the image embeddings to the first MLP, they were appended with a tag (an integer from 0 to $T - 1$ ) indicating their position in the input sequence.
|
| 331 |
+
|
| 332 |
+
# A.3.8 TRN
|
| 333 |
+
|
| 334 |
+
The TRN employs two key design decisions intended to prevent the combinatorial explosion that would naturally result from the inclusion of n-ary relations:
|
| 335 |
+
|
| 336 |
+
1. Only considering temporally ordered, non-redundant sets (whereas the original RN considers all possible pairs of objects, including both permutations of the same pair, and the pair of each object with itself).
|
| 337 |
+
2. Subsampling from these sets.
|
| 338 |
+
|
| 339 |
+
We found that it was computationally feasible to implement a TRN with ternary relations in our tasks by only using (1), without the need to subsample. Thus, our implementation considers all temporally ordered, non-redundant sets of two and three.
|
| 340 |
+
|
| 341 |
+
Each pair of image embeddings was processed by an MLP with a hidden layer of size 512 and an output layer of size 256. The outputs of this MLP for all pairs were then summed, and processed by an additional fully-connected layer with 256 units, yielding a single vector representing all pairs.
|
| 342 |
+
|
| 343 |
+
Each set of three image embeddings was processed by a separate MLP with the same hyperparameters (hidden layer of 512 units, output layer of 256 units). The outputs of this MLP for all sets of three were then summed, and processed by a separate fully-connected layer with 256 units, yielding a single vector representing all sets of three.
|
| 344 |
+
|
| 345 |
+
These two vectors, representing all pairs and sets of three, were then summed and passed to an additional fully-connected layer with 256 units, and then to the output layer to generate $\hat { \pmb { y } }$ . All layers (except for the output layer) used ReLU nonlinearities. All weights in these layers were initialized using a Kaiming normal distribution, and all biases were initialized to 0.
|
| 346 |
+
|
| 347 |
+
Just as with the RN, we append the image embeddings with a tag indicating their position in the sequence before passing them to the first MLP in the TRN.
|
| 348 |
+
|
| 349 |
+
# A.3.9 TRANSFORMER
|
| 350 |
+
|
| 351 |
+
The Transformer implementation consisted of a single Transformer encoder layer. We also experimented with 2- and 3-layer Transformers but these did not generalize as well as the 1-layer Transformer in the tasks that we studied. Positional encoding (as described by Vaswani et al. (2017)) was applied to the sequence of image embeddings, which were then passed to the Transformer layer. The self-attention layer had 8 heads. The MLP had a single hidden layer with 512 units, and used ReLU nonlinearities. Residual connections and layer normalization (Ba et al., 2016b) were used following both the self-attention layer and the MLP. The self-attention weights (for generating the keys, queries, and values) were initialized using an Xavier normal distribution. The MLP weights were initialized using a Kaiming normal distribution.
|
| 352 |
+
|
| 353 |
+
After applying the Transformer layer, the (transformed) embeddings were averaged and passed to an output MLP. The output MLP had a single hidden layer with 256 units, and an output layer for generating $\hat { \pmb { y } }$ . The hidden layer used ReLU nonlinearities, and the weights were initialized using a Kaiming normal distribution. All biases were initialized to 0.
|
| 354 |
+
|
| 355 |
+
# A.3.10 PREDINET
|
| 356 |
+
|
| 357 |
+
The PrediNet implementation was as close as possible to the model described in the original work (Shanahan et al., 2019), except that the multi-head attention was applied over the 1D temporal sequence of image embeddings, rather than over a 2D feature map (since there was no spatial component to the tasks that we studied). Before being passed to the PrediNet module, the image embeddings were appended with a tag (an integer from 0 to $T - 1 \dot s$ ) indicating their temporal position. The PrediNet module used keys of size 16, 32 heads, and 16 relations. All weights in the PrediNet module were initialized using an Xavier normal distribution.
|
| 358 |
+
|
| 359 |
+
The output of all PrediNet heads was concatenated and passed to an output MLP. This MLP had a single hidden layer with 8 units, and an output layer for generating $\hat { \boldsymbol y }$ . The hidden layer used ReLU nonlinearities, and the weights were initialized using a Kaiming normal distribution. All biases were initialized to 0.
|
| 360 |
+
|
| 361 |
+
# A.4 TRAINING DETAILS
|
| 362 |
+
|
| 363 |
+
Table 5: Learning rates for all models trained without TCN.
|
| 364 |
+
|
| 365 |
+
<table><tr><td></td><td>Same/different</td><td>RMTS</td><td>Distribution-of-threeIdentity rules</td><td></td></tr><tr><td colspan="5"></td></tr><tr><td>ESBN</td><td>5e-5</td><td>5e-5</td><td>5e-5</td><td>5e-5</td></tr><tr><td>Transformer</td><td>5e-4</td><td>5e-4</td><td>5e-4</td><td>5e-4</td></tr><tr><td>NTM</td><td>5e-4</td><td>5e-4</td><td>5e-4</td><td>5e-4</td></tr><tr><td>MNM</td><td>5e-4</td><td>5e-4</td><td>5e-4</td><td>5e-4</td></tr><tr><td>LSTM</td><td>5e-4</td><td>5e-4</td><td>5e-4</td><td>5e-4</td></tr><tr><td>PrediNet</td><td>5e-4</td><td>5e-4</td><td>5e-5</td><td>5e-5</td></tr><tr><td>RN</td><td>5e-4</td><td>5e-5</td><td>5e-4</td><td>5e-4</td></tr></table>
|
| 366 |
+
|
| 367 |
+
All models were trained with a batch size of 32 using the ADAM optimizer (Kingma & Ba, 2014). The learning rate for all models trained with TCN was $5 e ^ { - } 4$ . Some of the models failed to converge when trained without TCN, requiring a smaller learning rate of $5 e ^ { - } 5$ . The learning rates used for all models when trained without TCN are shown in Table 5.
|
| 368 |
+
|
| 369 |
+
Because different generalization regimes (different values for $m$ ) involved different training set sizes, and therefore involved fewer training updates per epoch, the number of training epochs required to reliably achieve convergence varied based on the regime. The default number of training epochs for all tasks and regimes is shown in Table 6.
|
| 370 |
+
|
| 371 |
+
Some models required additional training on some tasks to reach convergence. The PrediNet and the RN required longer training on the distribution-of-three task (Table 7), and the PrediNet, RN, and Transformer required longer training on the identity rules task (Table 8).
|
| 372 |
+
|
| 373 |
+
Table 6: Default number of training epochs for all tasks and regimes.
|
| 374 |
+
|
| 375 |
+
<table><tr><td></td><td>m=0</td><td>m=50 m=85m=95</td><td></td><td></td><td>m=98</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Same/different</td><td>50</td><td>50</td><td>50</td><td>100</td><td>100</td></tr><tr><td>RMTS</td><td>50</td><td>50</td><td>50</td><td>200</td><td>1</td></tr><tr><td>Distribution-of-three</td><td>50</td><td>50</td><td>50</td><td>150</td><td></td></tr><tr><td>Identity rules</td><td>50</td><td>50</td><td>50</td><td>50</td><td>1</td></tr></table>
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
m = 0 \quad m = 5 0 \quad m = 8 5 \quad m = 9 5
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Table 7: Number of training epochs for the PrediNet and RN on the distribution-of-three task.
|
| 382 |
+
|
| 383 |
+
<table><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PrediNet</td><td>100</td><td>100</td><td>100</td><td>150</td></tr><tr><td>RN</td><td>150</td><td>150</td><td>150</td><td>800</td></tr></table>
|
| 384 |
+
|
| 385 |
+
Table 8: Number of training epochs for the PrediNet, RN, and Transformer on the identity rules task.
|
| 386 |
+
|
| 387 |
+
<table><tr><td></td><td></td></tr><tr><td>100 100</td><td>100</td></tr></table>
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
m = 0 \quad m = 5 0 \quad m = 8 5 \quad m = 9 5
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
When training the RN on larger datasets for the distribution-of-three and identity rules tasks, the same learning rate and number of training epochs as used when training on smaller datasets was sufficient to reach convergence.
|
| 394 |
+
|
| 395 |
+
# A.5 SUPPLEMENTARY RESULTS
|
| 396 |
+
|
| 397 |
+
# A.5.1 RESULTS WITH AND WITHOUT TCN
|
| 398 |
+
|
| 399 |
+
Tables 9 - 12 show the results for all models trained both with and without TCN. With the exception of the PrediNet on the same/different task, every model benefited on every task from the incorporation of TCN, in many cases substantially. Results for models trained with TCN (indicated by $^ \bullet +$ TCN’) correspond to the results presented in Figure 3 (except for the results of the PrediNet on the same/different task, for which the version of the model trained without TCN is plotted in Figure 3).
|
| 400 |
+
|
| 401 |
+
We note that, even with a lower learning rate of $5 e ^ { - } 5$ , some models failed to converge without TCN, such as the ESBN on the same/different task, or the RN on the RMTS task. It is possible that some of these models might have performed better if we had optimized them further by training for longer or trying different learning rates, but we opted not to do that since TCN was so effective across all of the models and tasks that we studied.
|
| 402 |
+
|
| 403 |
+
Table 9: Results for same/different task. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 404 |
+
|
| 405 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td><td>m=98</td></tr><tr><td colspan="6"></td></tr><tr><td>ESBN+TCN</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>ESBN</td><td>50.0 ± 0.02</td><td>50.0 ± 0.0</td><td>50.1 ± 0.1</td><td>49.8 ± 0.2</td><td>50.1 ± 0.1</td></tr><tr><td>Transformer+ TCN</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>72.3 ± 5.2</td></tr><tr><td>Transformer</td><td>100.0 ± 0.0</td><td>99.9 ± 0.02</td><td>95.4 ± 0.6</td><td>73.7 ± 1.8</td><td>56.1 ± 1.3</td></tr><tr><td>NTM+ TCN</td><td>100.0 ± 0.0</td><td>99.99 ± 0.0</td><td>94.9 ± 0.6</td><td>66.7 ± 2.5</td><td>53.3 ± 1.4</td></tr><tr><td>NTM</td><td>99.0 ± 0.9</td><td>98.6 ± 0.3</td><td>84.9 ± 2.4</td><td>57.0 ± 2.2</td><td>52.5 ± 0.9</td></tr><tr><td>MNM+ TCN</td><td>100.0 ± 0.0</td><td>99.95 ± 0.03</td><td>97.8 ± 0.4</td><td>72.0 ± 2.4</td><td>52.3 ± 0.5</td></tr><tr><td>MNM</td><td>98.9 ± 0.1</td><td>95.1 ± 1.8</td><td>88.6 ±1.1</td><td>59.1 ± 1.6</td><td>51.7 ± 0.7</td></tr><tr><td>LSTM+TCN</td><td>100.0 ± 0.0</td><td>99.97 ± 0.01</td><td>96.9 ± 0.3</td><td>69.4 ± 1.5</td><td>54.8 ± 1.1</td></tr><tr><td>LSTM</td><td>88.2 ±3.2</td><td>97.0 ± 0.5</td><td>85.5 ± 2.4</td><td>61.8 ± 1.7</td><td>56.5 ± 1.6</td></tr><tr><td>PrediNet+ TCN</td><td>100.0 ± 0.0</td><td>99.7 ± 0.1</td><td>96.0 ± 1.3</td><td>67.2 ± 2.9</td><td>61.6 ± 2.3</td></tr><tr><td>PrediNet</td><td>100.0 ± 0.0</td><td>99.9 ± 0.03</td><td>97.0 ± 0.4</td><td>90.0 ± 1.6</td><td>68.5 ± 2.8</td></tr><tr><td>RN + TCN</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>99.9 ± 0.04</td><td>66.8 ± 6.6</td></tr><tr><td>RN</td><td>99.98 ± 0.02</td><td>98.5 ± 0.4</td><td>53.2 ±1.4</td><td>50.5 ± 0.2</td><td>52.3 ± 0.7</td></tr></table>
|
| 406 |
+
|
| 407 |
+
Table 10: Results for relational match-to-sample task. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 408 |
+
|
| 409 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ESBN+TCN</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>95.0 ± 0.7</td></tr><tr><td>ESBN</td><td>86.4 ± 6.1</td><td>69.4 ± 6.5</td><td>50.0 ± 0.1</td><td>51.0 ± 0.5</td></tr><tr><td>Transformer</td><td>100.0 ± 0.0</td><td>99.98 ± 0.01</td><td>99.1 ± 0.4</td><td>79.8 ± 2.5</td></tr><tr><td>Transformer</td><td>99.4 ± 0.1</td><td>96.8 ± 0.7</td><td>86.4 ± 1.9</td><td>49.9 ± 0.2</td></tr><tr><td>NTM+TCN</td><td>100.0 ± 0.0</td><td>99.97 ± 0.01</td><td>96.8 ± 0.5</td><td>80.1 ± 2.3</td></tr><tr><td>NTM</td><td>99.5 ± 0.1</td><td>92.5 ± 4.7</td><td>81.2 ± 1.5</td><td>50.1 ± 0.2</td></tr><tr><td>MNM+TCN</td><td>99.99 ± 0.0</td><td>99.9 ± 0.03</td><td>98.7 ± 0.3</td><td>50.0 ± 0.2</td></tr><tr><td>MNM</td><td>74.6 ± 7.6</td><td>63.6 ± 5.7</td><td>78.3 ± 3.7</td><td>50.0 ± 0.2</td></tr><tr><td>LSTM+ TCN</td><td>99.99 ± 0.0</td><td>99.8 ± 0.03</td><td>94.9 ± 1.3</td><td>60.7 ± 3.7</td></tr><tr><td>LSTM</td><td>99.1 ± 0.3</td><td>90.2 ± 2.0</td><td>80.9 ± 1.1</td><td>50.2 ± 0.1</td></tr><tr><td>PrediNet+TCN</td><td>99.7 ± 0.1</td><td>99.6 ± 0.1</td><td>94.6 ± 2.2</td><td>68.4 ± 2.7</td></tr><tr><td>PrediNet</td><td>54.9 ± 4.7</td><td>50.1 ± 0.2</td><td>65.9 ± 3.7</td><td>49.7 ± 0.2</td></tr><tr><td>RN+TCN</td><td>100.0 ± 0.0</td><td>99.99 ± 0.0</td><td>99.5 ± 0.3</td><td>79.6 ± 2.1</td></tr><tr><td>RN</td><td>50.1 ± 0.2</td><td>49.9 ± 0.2</td><td>50.2 ± 0.2</td><td>50.0 ± 0.1</td></tr></table>
|
| 410 |
+
|
| 411 |
+
Table 11: Results for distribution-of-three task. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 412 |
+
|
| 413 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85 m= 95</td></tr><tr><td colspan="4"></td></tr><tr><td>ESBN+TCN</td><td>98.7 ± 0.4</td><td>99.0 ± 0.3</td><td>99.5 ± 0.2 99.7 ± 0.1</td></tr><tr><td>ESBN</td><td>99.98 ± 0.0</td><td>97.4 ± 0.2</td><td>92.4 ± 1.1 62.0 ± 4.0</td></tr><tr><td>Transformer+ TCN</td><td>88.7 ± 2.6</td><td>95.0 ± 1.2</td><td>92.7 ± 1.5 32.1 ± 1.0</td></tr><tr><td>Transformer</td><td>62.1 ± 3.3</td><td>68.6 ± 3.6 72.6 ± 4.4</td><td>28.0 ± 0.8</td></tr><tr><td>NTM+TCN</td><td>95.5 ± 0.4</td><td>95.2 ± 0.4</td><td>94.3 ± 0.8 34.0 ± 0.5</td></tr><tr><td>NTM</td><td>92.9 ± 0.5</td><td>87.1 ± 1.4</td><td>78.2 ± 1.4 26.7 ± 0.3</td></tr><tr><td>MNM+ TCN</td><td>94.7 ± 0.3</td><td>93.6 ± 0.4 90.6 ± 0.7</td><td>32.2 ± 0.6</td></tr><tr><td>MNM</td><td>58.5 ± 8.9</td><td>68.7 ± 6.2 48.4 ± 5.5</td><td>25.6 ± 0.3</td></tr><tr><td>LSTM+TCN</td><td>96.0 ± 0.6</td><td>94.8 ± 0.5</td><td>92.9 ± 0.8 34.8 ± 0.8</td></tr><tr><td>LSTM</td><td>91.3 ± 0.6</td><td>85.3 ± 1.5</td><td>71.6 ± 4.3 27.5 ± 0.3</td></tr><tr><td>PrediNet+TCN</td><td>95.2 ± 0.3</td><td>94.6 ± 0.4</td><td>93.3 ± 0.9 27.8 ± 0.5</td></tr><tr><td>PrediNet</td><td>75.1 ± 3.0</td><td>65.7 ± 7.4</td><td>78.0 ± 6.0 25.7 ± 0.1</td></tr><tr><td>RN+TCN</td><td>35.6 ± 3.0</td><td>50.6 ± 7.6</td><td>72.2 ± 6.8 26.5 ± 0.3</td></tr><tr><td>RN</td><td>25.1 ± 0.1</td><td>24.9 ± 0.1 25.7 ± 0.3</td><td>25.2 ± 0.1</td></tr></table>
|
| 414 |
+
|
| 415 |
+
Table 12: Results for identity rules task. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 416 |
+
|
| 417 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td></tr><tr><td colspan="5"></td></tr><tr><td>ESBN+TCN</td><td>99.6 ± 0.2</td><td>99.6 ± 0.1</td><td>99.9 ± 0.04</td><td>99.2 ± 0.4</td></tr><tr><td>ESBN</td><td>100.0 ± 0.0</td><td>99.4 ± 0.1</td><td>97.8 ± 0.2</td><td>95.2 ± 0.4</td></tr><tr><td>Transformer+ TCN</td><td>98.3 ± 0.7</td><td>97.1 ± 1.0</td><td>92.0 ±1.7</td><td>67.1 ± 2.4</td></tr><tr><td>Transformer</td><td>75.5 ± 4.1</td><td>71.6 ± 5.1</td><td>85.4 ± 4.6</td><td>38.6 ± 2.2</td></tr><tr><td>NTM+TCN</td><td>98.2 ± 0.6</td><td>97.8 ± 0.5</td><td>93.9 ± 0.6</td><td>64.9 ± 1.2</td></tr><tr><td>NTM</td><td>94.6 ± 0.3</td><td>90.1 ± 0.8</td><td>82.2 ± 1.2</td><td>25.0 ± 0.1</td></tr><tr><td>MNM+TCN</td><td>95.2 ± 0.4</td><td>93.8 ± 0.4</td><td>90.8 ± 0.5</td><td>61.5 ± 1.5</td></tr><tr><td>MNM</td><td>70.9 ± 10.2</td><td>69.5 ± 9.7</td><td>49.8 ± 8.4</td><td>24.9 ± 0.2</td></tr><tr><td>LSTM+TCN</td><td>98.9 ± 0.1</td><td>97.7 ± 0.3</td><td>92.1 ± 0.7</td><td>62.5 ± 1.1</td></tr><tr><td>LSTM</td><td>93.8 ± 0.5</td><td>89.3 ± 0.6</td><td>73.7 ± 5.7</td><td>24.8 ± 0.1</td></tr><tr><td>PrediNet+ TCN</td><td>93.0 ± 0.8</td><td>92.8 ± 0.7</td><td>89.8 ± 0.8</td><td>59.9 ± 2.6</td></tr><tr><td>PrediNet</td><td>40.8 ± 0.4</td><td>40.5 ± 1.9</td><td>40.3 ± 2.2</td><td>32.2 ± 0.6</td></tr><tr><td>RN+ TCN</td><td>41.5 ± 6.7</td><td>40.2 ± 1.0</td><td>48.7 ± 2.0</td><td>41.4 ± 2.0</td></tr><tr><td>RN</td><td>41.1 ± 7.2</td><td>37.3 ± 3.4</td><td>31.6 ± 2.8</td><td>25.4 ± 0.4</td></tr></table>
|
| 418 |
+
|
| 419 |
+
# A.5.2 PERFORMANCE OF RN ON TERNARY RELATIONS
|
| 420 |
+
|
| 421 |
+
Table 13 shows the results for the RN (w/ TCN) on the distribution-of-three and identity rules tasks when trained on larger training sets $1 0 ^ { 5 }$ instead of $1 0 ^ { 4 }$ training examples). These results show that with more training data, the RN, which is biased toward processing pair-wise relations, is able to learn these tasks (which are based on ternary relations) in a manner that enables some degree of generalization. Note that these results do not include the $m = 9 5$ regime, because there are not enough images in that regime to create larger training sets than were originally used.
|
| 422 |
+
|
| 423 |
+
Table 13: Results for the RN on the distribution-of-three and identity rules tasks when trained on a larger training set. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 424 |
+
|
| 425 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Distribution-of-three</td><td>84.5 ± 10.0</td><td>84.6 ± 9.9</td><td>72.4 ± 9.7</td></tr><tr><td>Identity rules</td><td>89.2 ± 5.0</td><td>99.7 ± 0.1</td><td>86.6 ± 4.1</td></tr></table>
|
| 426 |
+
|
| 427 |
+
We also tested the TRN, which incorporates ternary relations through subsampling, on these tasks (with the standard training set size of $1 0 ^ { 4 }$ training examples). Table 14 shows the results. This yielded a slight improvement over the RN (when trained on $1 0 ^ { 4 }$ training examples), though not as much of an improvement as resulted from training the RN with a larger training set. This result may seem surprising given that the TRN explicitly incorporates ternary relations. We note two possible explanations for this result:
|
| 428 |
+
|
| 429 |
+
1. The systematic comparison of every pair of objects, including permutations and comparisons of each object with itself, allows the RN to take advantage of a very powerful form of data augmentation, enforcing a certain degree of systematicity in the relations that it learns. By only considering temporally ordered and non-redundant sets, the TRN is not able to take advantage of this to the same extent, and therefore might not learn relations that generalize as well.
|
| 430 |
+
2. The distribution-of-three and identity rules tasks both involve not only ternary sets, but the higher-order comparison of multiple pairs of ternary sets (the first row vs. the combination of the second row with each candidate answer). One could presumably engineer a solution to this problem within the RN framework, but we take it as a strength of the ESBN that no such special engineering is necessary in this case.
|
| 431 |
+
|
| 432 |
+
Table 14: Results for the TRN on the distribution-of-three and identity rules tasks. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 433 |
+
A.5.3 TRAINING TIME COURSES FOR SAME/DIFFERENT TASK
|
| 434 |
+
|
| 435 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85</td><td>m = 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Distribution-of-three</td><td></td><td></td><td>60.2±5.4 77.5±5.7 88.7±0.8</td><td>327.8±0.5</td></tr><tr><td>Identity rules</td><td></td><td>40.3 ± 2.0 43.6± 2.0</td><td>52.8 ± 2.7</td><td>44.9 ± 1.0</td></tr></table>
|
| 436 |
+
|
| 437 |
+
Figure 5 shows the training time courses for all models on the same/different task. Unlike the other three tasks we studied (for which training time courses are shown in Figure 4), all models were able to learn this task within a few hundred training updates (though all models except the ESBN failed to generalize in the most extreme regime).
|
| 438 |
+
|
| 439 |
+
# A.5.4 ALTERNATIVE ENCODER ARCHITECTURES
|
| 440 |
+
|
| 441 |
+
In order to determine whether the systematic generalization exhibited by the ESBN depended to some extent on the convolutional layers in its encoder, we performed experiments with two alternative encoder architectures: a multilayer perceptron (MLP) encoder, and a random projection.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 5: Training accuracy time courses on $m = 0$ regime of the same/different task. Each time course reflects an average over 10 trained networks. Error bars reflect the standard error of the mean.
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
Figure 6: Results for all four tasks with convolutional (conv), multilayer perceptron (MLP), or random (rand) encoders. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 448 |
+
|
| 449 |
+
The MLP encoder consisted of 3 fully-connected layers, with 512, 256, and 128 units, each of which used ReLU nonlinearities. All weights were initialized using a Kaiming normal distribution, and all biases were set to 0.
|
| 450 |
+
|
| 451 |
+
The random projection encoder involved only a single, untrained, fully-connected layer that projected from the flattened image to 128 units, followed by a ReLU nonlinearity. Weights were sampled from a Kaiming normal distribution, and biases were set to 0.
|
| 452 |
+
|
| 453 |
+
Figure 6 and Tables 15 - 18 show the results for these experiments, along with the original version of the model (with a convolutional encoder) for comparison. To enable a fair comparison with the original model, all experiments employed TCN. The results show that the ESBN performed comparably well with all three of the encoder architectures. This was confirmed by performing paired t-tests on the average test accuracy in each task/generalization condition (each combination of task and value of $m$ ) for the MLP vs. convolutional encoder $t = - 1 . 7$ , $p = 0 . 1$ ) and for the random vs. convolutional encoder $t = 1 . 6$ , $p = 0 . 1 3$ ).
|
| 454 |
+
|
| 455 |
+
For comparison, we also performed experiments with these alternative encoders in the Transformer architecture. These experiments revealed that, in contrast with the ESBN, the Transformer’s performance was significantly impaired by the use of a random vs. convolutional encoder $( t = - 4 . 0$ , $p = 0 . 0 0 1 )$ , though it appeared to perform comparably well with an MLP vs. convolutional encoder $t = - 1 . 6$ , $p = 0 . 1 4 )$ ).
|
| 456 |
+
|
| 457 |
+
Table 15: Results for same/different task with convolutional (conv), multilayer perceptron (MLP), or random (rand) encoders. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 458 |
+
|
| 459 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m=95</td><td>m=98</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ESBN (conv)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>ESBN (MLP)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>ESBN (rand)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>Transformer (conv)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>72.3 ± 5.2</td></tr><tr><td>Transformer (MLP)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>77.6 ± 4.6</td></tr><tr><td>Transformer (rand)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>50.6 ± 0.3</td></tr></table>
|
| 460 |
+
|
| 461 |
+
Table 16: Results for relational match-to-sample task with convolutional (conv), multilayer perceptron (MLP), or random (rand) encoders. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 462 |
+
|
| 463 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ESBN (conv)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>95.0 ± 0.7</td></tr><tr><td>ESBN (MLP)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>97.2 ± 0.2</td></tr><tr><td>ESBN (rand)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>93.8 ± 0.4</td></tr><tr><td>Transformer (conv)</td><td>100.0 ± 0.0</td><td>99.98 ± 0.01</td><td>99.1 ± 0.4</td><td>79.8 ± 2.5</td></tr><tr><td>Transformer (MLP)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>99.9 ± 0.1</td><td>73.6 ± 5.3</td></tr><tr><td>Transformer (rand)</td><td>99.99 ± 0.01</td><td>99.9 ± 0.04</td><td>95.4 ± 3.2</td><td>46.8 ± 1.7</td></tr></table>
|
| 464 |
+
|
| 465 |
+
Table 17: Results for distribution-of-three task with convolutional (conv), multilayer perceptron (MLP), or random (rand) encoders. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 466 |
+
|
| 467 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m=85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ESBN (conv)</td><td>98.7 ± 0.4</td><td>99.0 ± 0.3</td><td>99.5 ± 0.2</td><td>99.7 ± 0.1</td></tr><tr><td>ESBN (MLP)</td><td>99.0 ± 0.1</td><td>98.4 ± 0.3</td><td>98.0 ± 0.3</td><td>95.9 ± 0.5</td></tr><tr><td>ESBN (rand)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>Transformer (conv)</td><td>88.7 ± 2.6</td><td>95.0 ± 1.2</td><td>92.7 ± 1.5</td><td>32.1 ± 1.0</td></tr><tr><td>Transformer (MLP)</td><td>92.7 ± 2.1</td><td>93.3 ± 1.5</td><td>92.1 ± 0.8</td><td>35.3 ± 1.2</td></tr><tr><td>Transformer (rand)</td><td>66.0 ± 6.2</td><td>80.8 ± 2.5</td><td>60.9 ± 2.4</td><td>26.9 ± 0.4</td></tr></table>
|
| 468 |
+
|
| 469 |
+
Table 18: Results for identity rules task with convolutional (conv), multilayer perceptron (MLP), or random (rand) encoders. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 470 |
+
|
| 471 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85</td><td>m= 95</td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ESBN (conv.)</td><td>99.6 ± 0.2</td><td>99.6 ± 0.1</td><td>99.9 ± 0.04</td><td>99.2 ± 0.4</td></tr><tr><td>ESBN (MLP)</td><td>99.3 ± 0.2</td><td>98.6 ± 0.3</td><td>97.7 ± 0.4</td><td>95.5 ± 1.0</td></tr><tr><td>ESBN (random)</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr><tr><td>Transformer (conv.)</td><td>98.3 ± 0.7</td><td>97.1 ± 1.0</td><td>92.0 ±1.7</td><td>67.1 ± 2.4</td></tr><tr><td>Transformer (MLP)</td><td>85.5 ± 4.0</td><td>84.8 ± 3.8</td><td>86.4 ± 2.3</td><td>59.8 ± 1.5</td></tr><tr><td>Transformer (random)</td><td>47.8 ±1.1</td><td>51.4 ± 1.9</td><td>48.6 ±1.1</td><td>27.5 ± 0.6</td></tr></table>
|
| 472 |
+
|
| 473 |
+
# A.5.5 CONFIDENCE ABLATION EXPERIMENT
|
| 474 |
+
|
| 475 |
+
In order to determine the importance of the confidence values appended to retrieved memories, we tested a version of the ESBN without these confidence values. These results are shown in Table 19 and Figure 7. The ablation of confidence values prevented the ESBN from being able to perform the same/different task at all, and resulted in much slower training on the RMTS task. By contrast, ablation of confidence values did not affect performance, either in terms of generalization or training time, for the distribution-of-three or identity rules tasks. This can be explained by the fact that these tasks only require the retrieval of the best match from memory, whereas the same/different and RMTS tasks require the model to know how good of a match the best match is, which is precisely the information conveyed by confidence values.
|
| 476 |
+
|
| 477 |
+
Table 19: Results for the confidence ablation experiment. Results reflect test accuracy averaged over 10 trained networks $\pm$ the standard error of the mean).
|
| 478 |
+
|
| 479 |
+
<table><tr><td></td><td>m=0</td><td>m= 50</td><td>m= 85</td><td>m= 95</td><td>m= 98</td></tr><tr><td colspan="6"></td></tr><tr><td>Same/different</td><td>50.0 ± 0.02</td><td>50.0 ± 0.0</td><td>50.0 ± 0.05</td><td>49.8 ± 0.1</td><td>50.0 ± 0.1</td></tr><tr><td>RMTS</td><td>99.95 ± 0.01</td><td>99.9 ± 0.02</td><td>99.9 ± 0.02</td><td>96.0 ± 0.6</td><td></td></tr><tr><td>Distribution-of-three</td><td>99.2 ± 0.2</td><td>99.0 ± 0.3</td><td>99.5 ± 0.3</td><td>99.8 ± 0.1</td><td></td></tr><tr><td>Identity rules</td><td>99.6 ± 0.1</td><td>99.6 ± 0.2</td><td>99.8 ± 0.1</td><td>99.2 ± 0.2</td><td></td></tr></table>
|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
Figure 7: Training accuracy time courses for the ESBN model without confidence values on the $m = 0$ regime, shown with the time courses for all other models for comparison. Each time course reflects an average over 10 trained networks. Error bars reflect the standard error of the mean.
|
| 483 |
+
|
| 484 |
+
It is also worth noting one potential alternative to an explicit, inbuilt confidence value. In our implementation, the ESBN’s memory is empty at the beginning of each sequence that it processes. However, when multiple entries are present in memory, as will generally be the case in realistic, temporally extended settings, the presentation of a previously unseen item will result in the retrieval of a mixture of (weakly matched) memories. This mixed representation can therefore serve as a reliable cue for the degree to which the current percept matches a stored memory, obviating the need for an explicit confidence value. To demonstrate this, we implemented a version of the ESBN that begins each sequence with a single, learned key/value entry stored in memory (initialized to 0 at the beginning of training). Table 20 shows that this approach allows the ESBN to learn and perfectly generalize on the same/different task. Figure 8 shows that this approach allows the ESBN to retain the short training time of the original model on the RMTS task.
|
| 485 |
+
|
| 486 |
+
Table 20: Results on the same/different task for the ESBN model with a learned default memory instead of confidence values. Results reflect test accuracy averaged over 10 trained networks ( $\pm$ the standard error of the mean).
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
Figure 8: Training accuracy time courses on $m = 0$ regime of the RMTS task for the ESBN model with a learned default memory instead of confidence values. Each time course reflects an average over 10 trained networks. Error bars reflect the standard error of the mean.
|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
Figure 9: Representations learned by ESBN (projected along first two principal components). (a) Keys written to memory during time steps 1-9 (training set). (b) Keys written to memory during time steps 1-3 (training set vs. test set). (c) Keys retrieved from memory following second appearance of objects that first appeared during time steps 1-3 (training set vs. test set).
|
| 493 |
+
|
| 494 |
+
To better understand how the ESBN works, we performed an analysis of the representations that it learned on the distribution-of-three task. Specifically, we performed an analysis of a network trained on the most difficult generalization regime $( m = 9 5 $ ), by performing principal component analysis (PCA) on all key vectors written to and retrieved from memory for both the training and test sets, and visualizing these vectors along the first two principal components.
|
| 495 |
+
|
| 496 |
+
First, we looked at the keys that were written to memory $( k _ { w } )$ . We found that the keys for the first three time steps were tightly clustered, whereas the keys for the subsequent time steps (4-9) were more diffuse (Figures 9a and 9b). This makes sense because, in the distribution-of-three task, the ESBN only needs to be able to reliably retrieve what it wrote during the first three time steps (when the objects in the first row were presented). For time steps 4-9, the only important consideration is that the keys written to memory not overlap with those written during the first three time steps, which also appears to be the case.
|
| 497 |
+
|
| 498 |
+
Second, we compared the keys written to memory for the first three time steps in the training vs. test sets (Figure 9b). This revealed that, for a given time step, the keys written to memory in the training vs. test sets were remarkably similar (so much so that they are completely overlapping for time steps 1 and 2).
|
| 499 |
+
|
| 500 |
+
Third, we looked at the keys that were retrieved from memory following the second appearance of the objects that appeared on time steps 1-3. We found that 1) these closely matched the distribution of keys written to memory during time steps 1-3, and 2) these were highly overlapping for the training vs. test sets (Figure 9c).
|
| 501 |
+
|
| 502 |
+
Taken together, these results help to explain why the ESBN was so successful in this generalization regime, despite the very small degree of overlap between the distribution of training and test images. Because the ESBN’s controller was relatively isolated from the part of the model that deals with image embeddings, it was able to learn to encode abstract symbol-like representations (such as ‘first image’, ‘second image’, and ‘third image’), that did not depend on the identity of the images. Then, when queried with an image, was able to successfully retrieve the image’s corresponding abstract encoding, even when that image was quite different than those observed during training. That is, the model learned representations to use as keys that could be used for binding and indirection in the same way that symbols are used in traditional computational architectures.
|
| 503 |
+
|
| 504 |
+
# A.7 UNICODE CHARACTERS
|
| 505 |
+
|
| 506 |
+
Figure 10 shows all 100 images that were used to construct the abstract rule learning tasks.
|
| 507 |
+
|
| 508 |
+

|
| 509 |
+
Figure 10
|
md/train/LU687itn08w/LU687itn08w.md
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Offline RL Without Off-Policy Evaluation
|
| 2 |
+
|
| 3 |
+
# David Brandfonbrener
|
| 4 |
+
|
| 5 |
+
William F. Whitney
|
| 6 |
+
|
| 7 |
+
Rajesh Ranganath
|
| 8 |
+
|
| 9 |
+
# Joan Bruna
|
| 10 |
+
|
| 11 |
+
Department of Computer Science, Center for Data Science New York University david.brandfonbrener@nyu.edu
|
| 12 |
+
|
| 13 |
+
# Abstract
|
| 14 |
+
|
| 15 |
+
Most prior approaches to offline reinforcement learning (RL) have taken an iterative actor-critic approach involving off-policy evaluation. In this paper we show that simply doing one step of constrained/regularized policy improvement using an on-policy Q estimate of the behavior policy performs surprisingly well. This onestep algorithm beats the previously reported results of iterative algorithms on a large portion of the D4RL benchmark. The one-step baseline achieves this strong performance while being notably simpler and more robust to hyperparameters than previously proposed iterative algorithms. We argue that the relatively poor performance of iterative approaches is a result of the high variance inherent in doing off-policy evaluation and magnified by the repeated optimization of policies against those estimates. In addition, we hypothesize that the strong performance of the one-step algorithm is due to a combination of favorable structure in the environment and behavior policy.
|
| 16 |
+
|
| 17 |
+
# 1 Introduction
|
| 18 |
+
|
| 19 |
+
An important step towards effective real-world RL is to improve sample efficiency. One avenue towards this goal is offline RL (also known as batch RL) where we attempt to learn a new policy from data collected by some other behavior policy without interacting with the environment. Recent work in offline RL is well summarized by Levine et al. [2020].
|
| 20 |
+
|
| 21 |
+
In this paper, we challenge the dominant paradigm in the deep offline RL literature that primarily relies on actor-critic style algorithms that alternate between policy evaluation and policy improvement [Fujimoto et al., 2018a, 2019, Peng et al., 2019, Kumar et al., 2019, 2020, Wang et al., 2020b, Wu et al., 2019, Kostrikov et al., 2021, Jaques et al., 2019, Siegel et al., 2020, Nachum et al., 2019]. All these algorithms rely heavily on off-policy evaluation to learn the critic. Instead, we find that a simple baseline which only performs one step of policy improvement using the behavior Q function often outperforms the more complicated iterative algorithms. Explicitly, we find that our one-step algorithm beats prior results of iterative algorithms on most of the gym-mujoco [Brockman et al., 2016] and Adroit [Rajeswaran et al., 2017] tasks in the the D4RL benchmark suite [Fu et al., 2020].
|
| 22 |
+
|
| 23 |
+
We then dive deeper to understand why such a simple baseline is effective. First, we examine what goes wrong for the iterative algorithms. When these algorithms struggle, it is often due to poor off-policy evaluation leading to inaccurate Q values. We attribute this to two causes: (1) distribution shift between the behavior policy and the policy to be evaluated, and (2) iterative error exploitation whereby policy optimization introduces bias and dynamic programming propagates this bias across the state space. We show that empirically both issues exist in the benchmark tasks and that one way to avoid these issues is to simply avoid off-policy evaluation entirely.
|
| 24 |
+
|
| 25 |
+
Finally, we recognize that while the the one-step algorithm is a strong baseline, it is not always the best choice. In the final section we provide some guidance about when iterative algorithms can perform better than the simple one-step baseline. Namely, when the dataset is large and behavior policy has good coverage of the state-action space, then off-policy evaluation can succeed and iterative algorithms can be effective. In contrast, if the behavior policy is already fairly good, but as a result does not have full coverage, then one-step algorithms are often preferable.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: A cartoon illustration of the difference between one-step and multi-step methods. All algorithms constrain themselves to a neighborhood of “safe” policies around $\beta$ . A one-step approach (left) only uses the on-policy ${ \widehat Q } ^ { \beta }$ , while a multi-step approach (right) repeatedly uses off-policy $\widehat { Q } ^ { \pi _ { i } }$ .
|
| 29 |
+
|
| 30 |
+
Our main contributions are:
|
| 31 |
+
|
| 32 |
+
• A demonstration that a simple baseline of one step of policy improvement outperforms more complicated iterative algorithms on a broad set of offline RL problems. • An examination of failure modes of off-policy evaluation in iterative offline RL algorithms. • A description of when one-step algorithms are likely to outperform iterative approaches.
|
| 33 |
+
|
| 34 |
+
# 2 Setting and notation
|
| 35 |
+
|
| 36 |
+
We will consider an offline RL setup as follows. Let $\mathcal { M } = \{ { S } , \mathcal { A } , \rho , P , R , \gamma \}$ be a discounted infinitehorizon MDP. In this work we focus on applications in continuous control, so we will generally assume that both $s$ and $\mathcal { A }$ are continuous and bounded. We consider the offline setting where rather than interacting with $\mathcal { M }$ , we only have access to a dataset $D _ { N }$ of $N$ tuples of $\left( { { s _ { i } } , { a _ { i } } , { r _ { i } } } \right)$ collected by some behavior policy $\beta$ with initial state distribution $\rho$ . Let $r ( s , a ) = \mathbb { E } _ { r \mid s , a } [ r ]$ be the expected reward. Define the state-action value function for any policy $\pi$ by $Q ^ { \pi } ( s , a ) : = \mathbb { E } _ { P , \pi | s _ { 0 } = s }$ , $\begin{array} { r } { { \bf \Gamma } _ { a _ { 0 } = a } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ] } \end{array}$ The objective is to maximize the expected return $J$ of the learned policy:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
J ( \pi ) : = \underset { \rho , P , \pi } { \mathbb { E } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) \right] = \underset { a \sim \pi | s } { \mathbb { E } } \left[ Q ^ { \pi } ( s , a ) \right] .
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
Following $\mathrm { F u }$ et al. [2020] and others in this line of work, we allow access to the environment to tune a small $( < 1 0 )$ set of hyperparameters. See Paine et al. [2020] for a discussion of the active area of research on hyperparameter tuning for offline RL. We also discuss this further in Appendix $\textrm { C }$ .
|
| 43 |
+
|
| 44 |
+
# 3 Related work
|
| 45 |
+
|
| 46 |
+
Iterative algorithms. Most prior work on deep offline RL consists of iterative actor-critic algorithms. The primary innovation of each paper is to propose a different mechanism to ensure that the learned policy does not stray too far from the data generated by the behavior policy. Broadly, we group these methods into three camps: policy constraints/regularization, modifications of imitation learning, and Q regularization:
|
| 47 |
+
|
| 48 |
+
1. The majority of prior work acts directly on the policy. Some authors have proposed explicit constraints on the learned policy to only select actions where $( s , a )$ has sufficient support under the data generating distribution [Fujimoto et al., 2018a, 2019, Laroche et al., 2019]. Another proposal is to regularize the learned policy towards the behavior policy [Wu et al., 2019] usually either with a KL divergence [Jaques et al., 2019] or MMD [Kumar et al., 2019]. This is a very straighforward way to stay close to the behavior with a hyperparameter that determines just how close. All of these algorithms are iterative and rely on off-policy evaluation.
|
| 49 |
+
|
| 50 |
+
2. Siegel et al. [2020], Wang et al. [2020b], Chen et al. [2020] all use algorithms that filter out datapoints with low Q values and then perform imitation learning. Wang et al. [2018], Peng et al. [2019] use a weighted imitation learning algorithm where the weights are determined by exponentiated Q values. These algorithms are iterative.
|
| 51 |
+
|
| 52 |
+
3. Another way to prevent the learned policy from choosing unknown actions is to incorporate some form of regularization to encourage staying near the behavior and being pessimistic about unknown state, action pairs [Wu et al., 2019, Nachum et al., 2019, Kumar et al., 2020, Kostrikov et al., 2021, Gulcehre et al., 2021]. However, being able to properly quantify uncertainty about unknown states is notoriously difficult when dealing with neural network value functions [Buckman et al., 2020].
|
| 53 |
+
|
| 54 |
+
One-step algorithms. Some recent work has also noted that optimizing policies based on the behavior value function can perform surprisingly well. As we do, Goo and Niekum [2020] studies the continuous control tasks from the D4RL benchmark, but they examine a complicated algorithm involving ensembles, distributional Q functions, and a novel regularization technique. In contrast, we analyze a substantially simpler algorithm and get better performance on the D4RL tasks. We also focus more of our contribution on understanding and explaining this performance. Gulcehre et al. [2021] studies the discrete action setting and finds that a one-step algorithm (which they call “behavior value estimation”) outperforms prior work on Atari games and other discrete action tasks from the RL Unplugged benchmark [Gulcehre et al., 2020]. They also introduce a novel regularizer for the evaluation step. In contrast, we consider the continuous control setting. This is a substantial difference in setting since continuous control requires actor-critic algorithms with parametric policies while in the discrete setting the policy improvement step can be computed exactly from the Q function. Moreover, while Gulcehre et al. [2021] attribute the poor performance of iterative algorithms to “overestimation”, we define and separate the issues of distribution shift and iterative error exploitation which can combine to cause overestimation. This separation helps to expose the difference between the fundamental limits of off-policy evaluation from the specific problems induced by iterative algorithms, and will hopefully be a useful distinction to inspire future work. Finally, a one-step variant is also briefly discussed in Nadjahi et al. [2019], but is not the focus of that work.
|
| 55 |
+
|
| 56 |
+
There are also important connections between the one-step algorithm and the literature on conservative policy improvement [Kakade and Langford, 2002, Schulman et al., 2015, Achiam et al., 2017], which we discuss in more detail in Appendix B.
|
| 57 |
+
|
| 58 |
+
# 4 Defining the algorithms
|
| 59 |
+
|
| 60 |
+
In this section we provide a unified algorithmic template for model-free offline RL algorithms as offline approximate modified policy iteration. We show how this template captures our one-step algorithm as well as a multi-step policy iteration algorithm and an iterative actor-critic algorithm. Then any choice of policy evaluation and policy improvement operators can be used to define one-step, multi-step, and iterative algorithms.
|
| 61 |
+
|
| 62 |
+
# 4.1 Algorithmic template
|
| 63 |
+
|
| 64 |
+
# Algorithm 1: OAMPI
|
| 65 |
+
|
| 66 |
+
We consider a generic offline approximate modified policy iteration (OAMPI) scheme, shown in Algorithm 1 (and based off of Puterman and Shin [1978], Scherrer et al. [2012]). Essentially the algorithm alternates between two steps. First, there is a policy evaluation step where we estimate the Q function of the cur
|
| 67 |
+
|
| 68 |
+
input : $K$ , dataset $D _ { N }$ , estimated behavior $\hat { \beta }$
|
| 69 |
+
Set $\pi _ { 0 } = \hat { \beta }$ . Initialize $\widehat { Q } ^ { \pi _ { - 1 } }$ randomly.
|
| 70 |
+
for $k = I$ , . . . , $K$ do Policy evaluation: $\widehat { Q } ^ { \pi _ { k - 1 } } = \mathcal { E } ( \pi _ { k - 1 } , D _ { N } , \widehat { Q } ^ { \pi _ { k - 2 } } )$ Policy improvement: $\pi _ { k } = \mathcal { I } ( \widehat { Q } ^ { \pi _ { k - 1 } } , \widehat { \beta } , D _ { N } , \pi _ { k - 1 } )$
|
| 71 |
+
end
|
| 72 |
+
|
| 73 |
+
rent policy $\pi _ { k - 1 }$ by $\widehat { Q } ^ { \pi _ { k - 1 } }$ using only the dataset $D _ { N }$ . Implementations also often use the prior $\mathrm { Q }$ estimate $\widehat { Q } ^ { \pi _ { k - 2 } }$ to warm-start the approximation process. Second, there is a policy improvement step. This step takes in the estimated $\mathrm { Q }$ function $\widehat { Q } ^ { \pi _ { k - 1 } }$ , the estimated behavior $\hat { \beta }$ , and the dataset $D _ { N }$ and produces a new policy $\pi _ { k }$ . Again an algorithm may use $\pi _ { k - 1 }$ to warm-start the optimization. Moreover, we expect this improvement step to be regularized or constrained to ensure that $\pi _ { k }$ remains in the support of $\beta$ and $D _ { N }$ . Choices for this step are discussed below. Now we discuss a few ways to instantiate the template.
|
| 74 |
+
|
| 75 |
+
One-step. The simplest algorithm sets the number of iterations $K = 1$ . We learn $\hat { \beta }$ by maximum likelihood and train the policy evaluation step to estimate $Q ^ { \beta }$ . Then we use any one of the policy improvement operators discussed below to learn $\pi _ { 1 }$ . Importantly, this algorithm completely avoids off-policy evaluation.
|
| 76 |
+
|
| 77 |
+
Multi-step. The multi-step algorithm now sets $K > 1$ . The evaluation operator must evaluate off-policy since $D _ { N }$ is collected by $\beta$ , but evaluation steps for $K \geq 2$ require evaluating policies $\pi _ { k - 1 } \neq \beta$ . Each iteration is trained to convergence in both the estimation and improvement steps.
|
| 78 |
+
|
| 79 |
+
Iterative actor-critic. An actor critic approach looks somewhat like the multi-step algorithm, but does not attempt to train to convergence at each iteration and uses a much larger $K$ . Here each iteration consists of one gradient step to update the Q estimate and one gradient step to improve the policy. Since all of the evaluation and improvement operators that we consider are gradient-based, this algorithm can adapt the same evaluation and improvement operators used by the multi-step algorithm. Most algorithms from the literature fall into this category [Fujimoto et al., 2018a, Kumar et al., 2019, 2020, Wu et al., 2019, Wang et al., 2020b, Siegel et al., 2020].
|
| 80 |
+
|
| 81 |
+
# 4.2 Policy evaluation operator
|
| 82 |
+
|
| 83 |
+
Following prior work on continuous state and action problems, we always evaluate by simple fitted Q evaluation [Fujimoto et al., 2018a, Kumar et al., 2019, Siegel et al., 2020, Wang et al., 2020b, Paine et al., 2020, Wang et al., 2021]. In practice this is optimized by TD-style learning with the use of a target network [Mnih et al., 2015] as in DDPG [Lillicrap et al., 2015]. We do not use any double Q learning or Q ensembles [Fujimoto et al., 2018b]. For the one-step and multi-step algorithms we train the evaluation procedure to convergence on each iteration and for the iterative algorithm each iteration takes a single stochastic gradient step. See Voloshin et al. [2019], Wang et al. [2021] for more comprehensive examinations of policy evaluation and some evidence that this simple fitted Q iteration approach is reasonable. It is an interesting direction for future work to consider other operators that use things like importance weighting [Munos et al., 2016] or pessimism [Kumar et al., 2020, Buckman et al., 2020].
|
| 84 |
+
|
| 85 |
+
# 4.3 Policy improvement operators
|
| 86 |
+
|
| 87 |
+
To instantiate the template, we also need to choose a specific policy improvement operator $\mathcal { T }$ . We consider the following improvement operators selected from those discussed in the related work section. Each operator has a hyperparameter controlling deviation from the behavior policy.
|
| 88 |
+
|
| 89 |
+
Behavior cloning. The simplest baseline worth including is to just return $\hat { \beta }$ as the new policy $\pi$ Any policy improvement operator ought to perform at least as well as this baseline.
|
| 90 |
+
|
| 91 |
+
Constrained policy updates. Algorithms like BCQ [Fujimoto et al., 2018a] and SPIBB [Laroche et al., 2019] constrain the policy updates to be within the support of the data/behavior. In favor of simplicity, we implement a simplified version of the BCQ algorithm that removes the “perturbation network” which we call Easy BCQ. We define a new policy $\hat { \pi } _ { k } ^ { M }$ by drawing $M$ samples from $\hat { \beta }$ and then executing the one with the highest value according to ${ \widehat Q } ^ { \beta }$ . Explicitly:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\hat { \pi } _ { k } ^ { M } ( a | s ) = \mathbb { 1 } [ a = \arg \operatorname* { m a x } _ { a _ { j } } \{ \widehat { Q } ^ { \pi _ { k - 1 } } ( s , a _ { j } ) : a _ { j } \sim \pi _ { k - 1 } ( \cdot | s ) , 1 \leq j \leq M \} ] .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Regularized policy updates. Another common idea proposed in the literature is to regularize towards the behavior policy [Wu et al., 2019, Jaques et al., 2019, Kumar et al., 2019]. For a general divergence $D$ we can define an algorithm that maximizes a regularized objective:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\hat { \pi } _ { k } ^ { \alpha } = \arg \operatorname* { m a x } _ { \pi } \sum _ { i } \underset { a \sim \pi | s } { \mathbb { E } } \big [ \widehat { Q } ^ { \pi _ { k - 1 } } ( s _ { i } , a ) \big ] - \alpha D ( \hat { \beta } ( \cdot | s _ { i } ) , \pi ( \cdot | s _ { i } ) )
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
A comprehensive review of different variants of this method can be found in $\mathrm { W u }$ et al. [2019] which does not find dramatic differences across regularization techniques. In practice, we will use reverse KL divergence, i.e. $K L ( \pi ( \cdot | s _ { i } ) | | \hat { \beta } ( \cdot | s _ { i } ) )$ . To compute the reverse KL, we draw samples from $\pi ( \cdot | s _ { i } )$ and use the density estimate $\hat { \beta }$ to compute the divergence. Intuitively, this regularization forces $\pi$ to remain within the support of $\beta$ rather than incentivizing $\pi$ to cover $\beta$ .
|
| 104 |
+
|
| 105 |
+
Variants of imitation learning. Another idea, proposed by [Wang et al., 2018, Siegel et al., 2020, Wang et al., 2020b, Chen et al., 2020] is to modify an imitation learning algorithm either by filtering or weighting the observed actions to incentivize policy improvement. The weighted version that we implement uses exponentiated advantage estimates to weight the observed actions:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\hat { \pi } _ { k } ^ { \tau } = \arg \operatorname* { m a x } _ { \pi } \sum _ { i } \exp ( \tau ( \widehat { Q } ^ { \pi _ { k - 1 } } ( s _ { i } , a _ { i } ) - \widehat { V } ( s _ { i } ) ) ) \log \pi ( a _ { i } | s _ { i } ) .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
With these definitions, we can now move on to testing various combinations of algorithmic template (one-step, multi-step, or iterative) and improvement operator (Easy BCQ, reverse KL regularization, or exponentially weighted imitation).
|
| 112 |
+
|
| 113 |
+
# 5 Benchmark Results
|
| 114 |
+
|
| 115 |
+
Our main empirical finding is that one step of policy improvement is sufficient to beat state of the art results on much of the D4RL benchmark suite [Fu et al., 2020]. This is striking since prior work focuses on iteratively estimating the Q function of the current policy iterate, but we only use one step derived from ${ \widehat Q } ^ { \beta }$ . Results are shown in Table 1. Full experimental details are in Appendix C and code can be found at https://github.com/davidbrandfonbrener/onestep-rl.
|
| 116 |
+
|
| 117 |
+
Table 1: Results of one-step algorithms on the D4RL benchmark. The first column gives the best results across several iterative algorithms considered in Fu et al. [2020]. Each algorithm is tuned over 6 values of their respective hyperparameter. We report the mean and standard error over 10 seeds of the training process and using 100 evaluation episodes per seed. We bold the best result on each dataset and blue any result where a one-step algorithm beat the best reported iterative result from Fu et al. [2020]. We use m for medium, m-e for medium-expert, m-re for medium-replay, r for random, and c for cloned.
|
| 118 |
+
|
| 119 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Iterative</td><td colspan="3">One-step</td></tr><tr><td>Fu et al. [2020]</td><td>BC</td><td>Easy BCQ</td><td>Rev. KL Reg</td><td>Exp.Weight</td></tr><tr><td>halfcheetah-m</td><td>46.3</td><td>42.1 ± 0.1</td><td>52.6 ± 0.1</td><td>55.6 ± 0.2</td><td>48.6± 0.0</td></tr><tr><td>walker2d-m</td><td>81.1</td><td>70.2 ±1.3</td><td>86.9 ± 0.4</td><td>85.6 ± 0.4</td><td>80.3 ±1.1</td></tr><tr><td>hopper-m</td><td>58.8</td><td>49.8 ± 0.6</td><td>69.7 ± 2.1</td><td>83.3 ± 1.4</td><td>56.7 ± 0.8</td></tr><tr><td>halfcheetah-m-e</td><td>64.7</td><td>60.1 ± 0.8</td><td>77.0 ± 0.9</td><td>93.5 ± 0.1</td><td>91.7 ± 0.9</td></tr><tr><td>walker2d-m-e</td><td>111.0</td><td>93.6 ± 5.6</td><td>111.8 ± 0.2</td><td>110.9 ± 0.1</td><td>112.9 ± 0.2</td></tr><tr><td>hopper-m-e</td><td>111.9</td><td>48.1 ± 1.5</td><td>81.4 ± 1.9</td><td>102.1 ± 1.3</td><td>83.1 ± 7.0</td></tr><tr><td>halfcheetah-m-re</td><td>47.7</td><td>34.9 ± 0.3</td><td>38.4± 0.3</td><td>42.4± 0.1</td><td>38.6 ± 0.5</td></tr><tr><td>walker2d-m-re</td><td>26.7</td><td>23.9 ± 1.6</td><td>66.4 ± 2.0</td><td>71.6 ± 3.1</td><td>49.3 ± 3.5</td></tr><tr><td>hopper-m-re</td><td>48.6</td><td>21.2 ± 1.3</td><td>77.3 ± 2.7</td><td>71.0 ± 8.1</td><td>94.1 ± 2.4</td></tr><tr><td>halfcheetah-r</td><td>35.4</td><td>2.2 ± 0.0</td><td>5.4 ± 0.1</td><td>6.9 ± 1.0</td><td>3.7± 0.2</td></tr><tr><td>walker2d-r</td><td>7.3</td><td>0.7 ± 0.1</td><td>4.2 ± 0.2</td><td>6.1 ± 0.3</td><td>5.2 ± 0.2</td></tr><tr><td>hopper-r</td><td>12.2</td><td>2.6± 0.4</td><td>6.7 ± 0.1</td><td>7.8± 0.3</td><td>5.6 ± 0.6</td></tr><tr><td>pen-c</td><td>56.9</td><td>49.3 ± 2.2</td><td>67.0 ± 1.1</td><td>55.3 ± 1.9</td><td>54.7 ± 2.3</td></tr><tr><td>hammer-c</td><td>2.1</td><td>0.5 ± 0.1</td><td>2.8 ± 0.5</td><td>0.2±0.0</td><td>1.2 ± 0.2</td></tr><tr><td>relocate-c</td><td>-0.1</td><td>0.0± 0.0</td><td>0.3 ± 0.0</td><td>0.1 ± 0.0</td><td>0.1 ± 0.0</td></tr><tr><td>door-c</td><td>0.4</td><td>0.0± 0.0</td><td>0.4 ± 0.2</td><td>0.0 ± 0.1</td><td>0.1 ± 0.1</td></tr></table>
|
| 120 |
+
|
| 121 |
+
As we can see in the table, all of the one-step algorithms usually outperform the best iterative algorithms tested by Fu et al. [2020]. The one notable exception is the case of random data (especially on halfcheetah), where iterative algorithms have a clear advantage. We will discuss potential causes of this further in Section 7.
|
| 122 |
+
|
| 123 |
+
To give a more direct comparison that controls for any potential implementation details, we use our implementation of reverse KL regularization to create multi-step and iterative algorithms. We are not using algorithmic modifications like Q ensembles, regularized Q values, or early stopping that have been used in prior work. But, our iterative algorithm recovers similar performance to prior regularized actor-critic approaches. These results are shown in Table 2.
|
| 124 |
+
|
| 125 |
+
Table 2: Results of reverse KL regularization on the D4RL benchmark across one-step, multi-step, and iterative algorithms. Again we run 6 hyperparameters and report the mean and standard error across 10 seeds using 100 evaluation episodes.
|
| 126 |
+
|
| 127 |
+
<table><tr><td></td><td>One-step</td><td>Multi-step</td><td>Iterative</td></tr><tr><td>halfcheetah-m</td><td>55.6± 0.2</td><td>40.8 ± 8.6</td><td>47.4 ± 3.5</td></tr><tr><td>walker2d-m</td><td>85.6 ± 0.4</td><td>75.9 ± 0.5</td><td>75.4 ± 0.8</td></tr><tr><td>hopper-m</td><td>83.3 ± 1.4</td><td>53.0 ±1.0</td><td>54.2 ± 0.6</td></tr><tr><td>halfcheetah-m-e</td><td>93.5 ± 0.1</td><td>93.6 ± 0.3</td><td>93.6 ± 0.2</td></tr><tr><td>walker2d-m-e</td><td>110.9 ± 0.1</td><td>76.3 ± 15.9</td><td>108.2 ± 0.3</td></tr><tr><td>hopper-m-e</td><td>102.1 ± 1.3</td><td>101.3 ± 3.9</td><td>82.7 ± 7.4</td></tr><tr><td>halfcheetah-r</td><td>6.9 ± 1.0</td><td>13.7 ± 1.7</td><td>16.3 ± 1.6</td></tr><tr><td>walker2d-r</td><td>6.1 ± 0.3</td><td>5.0±0.3</td><td>5.1± 0.3</td></tr><tr><td>hopper-r</td><td>7.8 ± 0.3</td><td>15.4 ± 2.9</td><td>9.7 ± 0.1</td></tr></table>
|
| 128 |
+
|
| 129 |
+
Put together, these results immediately suggest some guidance to the practitioner: it is worthwhile to run the one-step algorithm as a baseline before trying something more elaborate. The one-step algorithm is substantially simpler than prior work, but frequently achieves better performance.
|
| 130 |
+
|
| 131 |
+
# 6 What goes wrong for iterative algorithms?
|
| 132 |
+
|
| 133 |
+
The benchmark experiments show that one step of policy improvement often beats iterative and multi-step algorithms. In this section we dive deeper to understand why this happens. First, by examining the learning curves of each of the algorithms we note that iterative algorithms require stronger regularization to avoid instability. Then we identify two causes of this instability: distribution shift and iterative error exploitation.
|
| 134 |
+
|
| 135 |
+
Distribution shift causes evaluation error by reducing the effective sample size in the fixed dataset for evaluating the current policy and has been extensively considered in prior work as discussed below. Iterative error exploitation occurs when we repeatedly optimize policies against our Q estimates and exploit their errors. This introduces a bias towards overestimation at each step (much like the training error in supervised learning is biased to be lower than the test error). Moreover, by iteratively re-using the data and using prior Q estimates to warmstart training at each step, the errors from one step are amplified at the next. This type of error is particular to multi-step and iterative algorithms.
|
| 136 |
+
|
| 137 |
+
# 6.1 Learning curves and hyperparameter sensitivity
|
| 138 |
+
|
| 139 |
+
To begin to understand why iterative and multi-step algorithms can fail it is instructive to look at the learning curves. As shown in Figure 2, we often observe that the iterative algorithm will begin to learn and then crash. Regularization can help to prevent this crash since strong enough regularization towards the behavior policy ensures that the evaluation is nearly on-policy.
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Learning curves and final performance on halfcheetah-medium across different algorithms and regularization hyperparameters (all using the reverse KL regularized improvement operator). Error bars show min and max over 3 seeds. Similar figures for other datasets from D4RL can be found in Appendix D.
|
| 143 |
+
|
| 144 |
+
In contrast, the one-step algorithm is more robust to the regularization hyperparameter. The rightmost panel of the figure shows this clearly. While iterative and multi-step algorithms can have their performance degrade very rapidly with the wrong setting of the hyperparameter, the one-step approach is more stable. Moreover, we usually find that the optimal setting of the regularization hyperparameter is lower for the one-step algorithm than the iterative or multi-step approaches.
|
| 145 |
+
|
| 146 |
+
# 6.2 Distribution shift
|
| 147 |
+
|
| 148 |
+
Any algorithm that relies on off-policy evaluation will struggle with distribution shift in the evaluation step. Trying to evaluate a policy that is substantially different from the behavior reduces the effective sample size and increases the variance of the estimates. Explicitly, by distribution shift we mean the shift between the behavior distribution (the distribution over state-action pairs in the dataset) and the evaluation distribution (the distribution that would be induced by the policy $\pi$ we want to evaluate).
|
| 149 |
+
|
| 150 |
+
Prior work. There is a substantial body of prior theoretical work that suggests that off-policy evaluation can be difficult and this difficulty scales with some measure of distribution shift. Wang et al. [2020a], Amortila et al. [2020], Zanette [2021] give exponential (in horizon) lower bounds on sample complexity in the linear setting even with good feature representations that can represent the desired Q function and assuming good data coverage. Upper bounds generally require very strong assumptions on both the representation and limits on the distribution shift [Wang et al., 2021, Duan et al., 2020, Chen and Jiang, 2019]. Moreover, the assumed bounds on distribution shift can be exponential in horizon in the worst case. On the empirical side, Wang et al. [2021] demonstrates issues with distribution shift when learning from pre-trained features and provides a nice discussion of why distribution shift causes error amplification. Fujimoto et al. [2018a] raises a similar issue under the name “extrapolation error”. Regularization and constraints are meant to reduce issues stemming from distribution shift, but also reduce the potential for improvement over the behavior.
|
| 151 |
+
|
| 152 |
+
Empirical evidence. Both the multi-step and iterative algorithms in our experiments rely on offpolicy evaluation as a key subroutine. We examine how easy it is to evaluate the policies encountered along the learning trajectory. To control for issues of iterative error exploitation (discussed in the next subsection), we train Q estimators from scratch on a heldout evaluation dataset sampled from the behavior policy. We then evaluate these trained Q function on rollouts from 1000 datapoints sampled from the replay buffer. Results are shown in Figure 3.
|
| 153 |
+
|
| 154 |
+
The results show a correlation betweed KL and MSE. Moreover, we see that the MSE generally increases over training. One way to mitigate this, as seen in the figure, is to use a large value of $\alpha$ . We just cannot take a very large step before running into problems with distribution shift. But, when we take such a small step, the information from the on-policy ${ \widehat Q } ^ { \beta }$ is about as useful as the newly estimated ${ \widehat { Q } } ^ { \pi }$ . This is seen, for example, in Figure 2 where we get very similar performance across algorithms at high levels of regularization.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 3: Results of running the iterative algorithm on halfcheetah-medium. Each checkpointed policy is evaluated by a Q function trained from scratch on heldout data. MSE refers to $\mathbb { E } _ { s , a \sim \beta } [ ( \hat { Q } ^ { \pi _ { i } } ( s , a ) -$ $Q ^ { \pi _ { i } } ( s , a ) ) ^ { 2 } ]$ and KL refers to $\mathbb { E } _ { s \sim \beta } [ K L ( \pi ( \cdot | s ) | | \beta ( \cdot | s ) ]$ . Left: 90 policies taken from various points in training with various hyperaparmeters and random seeds. Center: MSE learning curves. Right: KL learning curves. Error bars show min and max over 3 random seeds.
|
| 158 |
+
|
| 159 |
+
# 6.3 Iterative error exploitation
|
| 160 |
+
|
| 161 |
+
The previous subsection identifies how any algorithm that uses off-policy evaluation is fundamentally limited by distribution shift, even if we were given fresh data and trained Q functions from scratch at every iteration. But, in practice, iterative algorithms repeatedly iterate between optimizing policies against estimated Q functions and re-estimating the Q functions using the same data and using the Q function from the previous step to warm-start the re-estimation. This induces dependence between steps that causes a problem that we call iterative error exploitation.
|
| 162 |
+
|
| 163 |
+
Intuition about the problem. In short, iterative error exploitation happens because $\pi _ { i }$ tends to choose overestimated actions in the policy improvement step, and then this overestimation propagates via dynamic programming in the policy evaluation step. To illustrate this issue more formally, consider the following: at each $s , a$ we suffer some Bellman error $\varepsilon _ { \beta } ^ { \pi } ( s , a )$ based on our fixed dataset collected by $\beta$ . Formally,
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\widehat { Q } ^ { \pi } ( s , a ) = r ( s , a ) + \gamma \operatorname * { \mathbb { E } } _ { \mathbf { \Phi } _ { s ^ { \prime } \mid s , a } \atop { a ^ { \prime } \sim \pi \mid s ^ { \prime } } } [ \widehat { Q } ^ { \pi } ( s ^ { \prime } , a ^ { \prime } ) ] + \varepsilon _ { \beta } ^ { \pi } ( s , a ) .
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Intuitively, $\varepsilon _ { \beta } ^ { \pi }$ will be larger at state-actions with less coverage in the dataset collected by $\beta$ . Note that $\varepsilon _ { \beta } ^ { \pi }$ can absorb all error whether it is caused by the finite sample size or function approximation error.
|
| 170 |
+
|
| 171 |
+
All that is needed to cause iterative error exploitation is that the $\epsilon _ { \beta } ^ { \pi }$ are highly correlated across different $\pi$ , but for simplicity, we will assume that $\varepsilon _ { \beta } ^ { \pi }$ is the same for all policies $\pi$ estimated from our fixed offline dataset and instead write $\varepsilon _ { \beta }$ . Now that the errors do not depend on the policy we can treat the errors as auxiliary rewards that obscure the true rewards and see that
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\widehat { Q } ^ { \pi } ( s , a ) = Q ^ { \pi } ( s , a ) + \widetilde { Q } _ { \beta } ^ { \pi } ( s , a ) , \qquad \widetilde { Q } _ { \beta } ^ { \pi } ( s , a ) : = \underset { \pi | s _ { 0 } , a _ { 0 } = s , a } { \mathbb { E } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \varepsilon _ { \beta } ( s _ { t } , a _ { t } ) \right] .
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
This assumption is somewhat reasonable since we expect the error to primarily depend on the data. And, when the prior Q function is used to warm-start the current one (as is generally the case in practice), the approximation errors are automatically passed between steps.
|
| 178 |
+
|
| 179 |
+
Now we can explain the problem. Recall that under our assumption the $\varepsilon _ { \beta }$ are fixed once we have a dataset and likely to have larger magnitude the further we go from the support of the dataset. So, with each step $\pi _ { i }$ is able to better maximize $\varepsilon _ { \beta }$ , thus moving further from $\beta$ and increasing the magnitude of $\widetilde { Q } _ { \beta } ^ { \pi _ { i } }$ relative to $Q ^ { \pi _ { i } }$ . Even though $Q ^ { \pi _ { i } }$ may provide better signal than $Q ^ { \beta }$ , it can easily be drowned out by $\widetilde { Q } _ { \beta } ^ { \pi _ { i } }$ . In contrast, $\widetilde { Q } _ { \beta } ^ { \beta }$ has small magnitude, so the one-step algorithm is robust to errors1.
|
| 180 |
+
|
| 181 |
+
An example. Now we consider a simple gridworld example to illustrate iterative error exploitation. This example fits exactly into the setup outlined above since all errors are due to reward estimation so the $\varepsilon _ { \beta }$ is indeed constant over all $\pi$ . The gridworld we consider has one deterministic good state with reward 1 and many stochastic bad states that have rewards distributed as $\mathcal { N } ( - 0 . 5 , 1 )$ . We collect a dataset of 100 trajectories, each of length 100. One run of the multi-step offline regularized policy iteration algorithm is illustrated in Figure 4.
|
| 182 |
+
|
| 183 |
+
In the example we see that one step often outperforms multiple steps of improvement. Intuitively, when there are so many noisy states, it is likely that a few of them will be overestimated. Since the data is re-used for each step, these overestimations persist and propagate across the state space due to iterative error exploitation. This property of having many bad, but poorly estimated states likely also exists in the high-dimensional control problems encountered in the benchmark where there are many ways for the robots to fall down that are not observed in the data for non-random behavior. Moreover, both settings have larger errors in areas where we have less data. So even though the errors in the gridworld are caused by noise in the rewards, while errors in D4RL are caused by function approximation, we think this is a useful mental model of the problem.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 4: An illustration of multi-step offline regularized policy iteration. The leftmost panel in each row shows the true reward (top) or error $\varepsilon _ { \beta }$ (bottom). Then each subsequent panel plots $\pi _ { i }$ (with arrow size proportional to $\pi _ { i } ( a | s ) .$ ) over either $Q ^ { \pi _ { i } }$ (top) or $\widetilde { Q } _ { \beta } ^ { \pi }$ (bottom), averaged over actions at each state. The one-step policy $( \pi _ { 1 } )$ has the highest value. The behavior policy here is a mixture of optimal $\pi ^ { * }$ and uniform $u$ with coefficient 0.2 so that $\beta = 0 . 2 \cdot \pi ^ { * } + 0 . 8 \cdot u$ . We set $\alpha = 0 . 1$ as the regularization parameter for reverse KL regularization.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 5: Histograms of overestimation error $( \widehat { Q } ^ { \pi _ { i } } ( s , a ) - Q ^ { \pi _ { i } } ( s , a ) )$ on halfcheetah-medium with the iterative algorithm. Left: errors from the training Q function. Right: errors from an independently trained Q function.
|
| 190 |
+
|
| 191 |
+
Empirical evidence. In practice we cannot easily visualize the progression of errors. However, the dependence between steps still arises as overestimation of the Q values. We can track the overestimation of the Q values over training as a way to measure how much bias is being induced by optimizing against our dependent Q estimators. As a control we can also train Q estimators from scratch on independently sampled evaluation data. These independently trained Q functions do not have the same overestimation bias even though the squared error does tend to increase as the policy moves further from the behavior (as seen in Figure 3). Explicitly, we track 1000 state, action pairs from the replay buffer over training. For each checkpointed policy we perform 3 rollouts at each state to get an estimate of the true Q value and compare this to the estimated Q value. Results are shown in Figure 5.
|
| 192 |
+
|
| 193 |
+
# 7 When are multiple steps useful?
|
| 194 |
+
|
| 195 |
+
So far we have focused on why the one-step algorithm often works better than the multi-step and iterative algorithms. However, we do not want to give the impression that one-step is always better. Indeed, our own experiments in Section 5 show a clear advantage for the multi-step and iterative approaches when we have randomly collected data. While we cannot offer a precise delineation of when one-step will outperform multi-step, in this section we offer some intuition as to when we can expect to see benefits from multiple steps of policy improvement.
|
| 196 |
+
|
| 197 |
+
As seen in Section 6, multi-step and iterative algorithms have problems when they propagate estimation errors. This is especially problematic in noisy and/or high dimensional environments. While the multi-step algorithms propagate this noise more widely than the one-step algorithm, they also propagate the signal. So, when we have sufficient coverage to reduce the magnitude of the noise, this increased propagation of signal can be beneficial. The D4RL experiments suggest that we are usually on the side of the tradeoff where the errors are large enough to make one-step preferable.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 6: Performance of all three algorithms with reverse KL regularization across mixtures between halfcheetah-random and halfcheetah-medium. Error bars indicate min and max over 3 seeds.
|
| 201 |
+
|
| 202 |
+
In Appendix A we illustrate a simple gridworld example where a slight modification of the behavior policy from Figure 4 makes multi-step dramatically outperform one-step. This modified behavior policy (1) has better coverage of the noisy states (which reduces error, helping multi-step), and (2) does a worse job propagating the reward from the good state (hurting one-step).
|
| 203 |
+
|
| 204 |
+
We can also test empirically how the behavior policy effects the tradeoff between error and signal propagation. To do this we construct a simple experiment where we mix data from the random behavior policy with data from the medium behavior policy. Explicitly we construct a dataset $D$ out of the datasets $D _ { r }$ for random and $D _ { m }$ for medium such that each trajectory in $D$ comes from the medium dataset with probability $p _ { m }$ . So for $p _ { m } = 0$ we have the random dataset and $p _ { m } = 1$ we have the medium dataset, and in between we have various mixtures. Results are shown in Figure 6. It takes surprisingly little data from the medium policy for one-step to outperform the iterative algorithm.
|
| 205 |
+
|
| 206 |
+
# 8 Discussion, limitations, and future work
|
| 207 |
+
|
| 208 |
+
This paper presents the surprising effectiveness of a simple one-step baseline for offline RL. We examine the failure modes of iterative algorithms and the conditions where we might expect them to outperform the simple one-step baseline. This provides guidance to a practitioner that the simple one-step baseline is a good place to start when approaching an offline RL problem.
|
| 209 |
+
|
| 210 |
+
But, we leave many questions unanswered. One main limitation is that we lack a clear theoretical characterization of which environments and behaviors can guarantee that one-step outperforms multi-step or visa versa. Such results will likely require strong assumptions, but could provide useful insight. We don’t expect this to be easy as it requires understanding policy iteration which has been notoriously difficult to analyze, often converging much faster than the theory would suggest [Sutton and Barto, 2018, Agarwal et al., 2019]. Another limitation is that while only using one step is perhaps the simplest way to avoid the problems of off-policy evaluation, there are possibly other more elaborate algorithmic solutions that we did not consider here. However, our strong empirical results suggest that the one-step algorithm is at least a strong baseline.
|
| 211 |
+
|
| 212 |
+
Broader impact. Our paper studies a simple and effective baseline approach to the offline RL problem. The effectiveness of this baseline raises some serious questions about the utility of prior work proposing substantially more complicated methods. By making this observation of prior shortcomings, our paper has the potential to encourage researchers to derive new and better methods for offline RL. This has many potential impacts on fields as diverse as robotics and healthcare where better offline decision making can lead to better real-world performance. As always, we note that machine learning improvements come in the form of “building machines to do $\mathbf { X }$ better”. For a sufficiently malicious or ill-informed choice of X, almost any progress in machine learning might indirectly lead to a negative outcome, and our work is not excluded from that.
|
| 213 |
+
|
| 214 |
+
# Acknowledgements
|
| 215 |
+
|
| 216 |
+
This work is partially supported by the Alfred P. Sloan Foundation, NSF RI-1816753, NSF CAREER CIF 1845360, NSF CHS-1901091, Samsung Electronics, and the Institute for Advanced Study. DB is supported by the Department of Defense (DoD) through the National Defense Science & Engineering Graduate Fellowship (NDSEG) Program.
|
| 217 |
+
|
| 218 |
+
# References
|
| 219 |
+
|
| 220 |
+
Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In International Conference on Machine Learning, pages 22–31. PMLR, 2017.
|
| 221 |
+
|
| 222 |
+
Alekh Agarwal, Nan Jiang, and S. Kakade. Reinforcement learning: Theory and algorithms. 2019.
|
| 223 |
+
|
| 224 |
+
P. Amortila, Nan Jiang, and Tengyang Xie. A variant of the wang-foster-kakade lower bound for the discounted setting. ArXiv, abs/2011.01075, 2020.
|
| 225 |
+
|
| 226 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. URL http://arxiv.org/abs/ 1606.01540.
|
| 227 |
+
|
| 228 |
+
Jacob Buckman, Carles Gelada, and Marc G. Bellemare. The importance of pessimism in fixed-dataset policy optimization, 2020.
|
| 229 |
+
|
| 230 |
+
John Burkhardt. The truncated normal distribution, 2014.
|
| 231 |
+
|
| 232 |
+
Jinglin Chen and Nan Jiang. Information-theoretic considerations in batch reinforcement learning. In Proceedings of the 36th International Conference on Machine Learning. PMLR, 2019.
|
| 233 |
+
|
| 234 |
+
Xinyue Chen, Zijian Zhou, Zheng Wang, Che Wang, Yanqiu Wu, and Keith Ross. Bail: Bestaction imitation learning for batch deep reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020.
|
| 235 |
+
|
| 236 |
+
Yaqi Duan, Zeyu Jia, and Mengdi Wang. Minimax-optimal off-policy evaluation with linear function approximation. In International Conference on Machine Learning, pages 2701–2709. PMLR, 2020.
|
| 237 |
+
|
| 238 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
|
| 239 |
+
|
| 240 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. arXiv preprint arXiv:1812.02900, 2018a.
|
| 241 |
+
|
| 242 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018b.
|
| 243 |
+
|
| 244 |
+
Scott Fujimoto, Edoardo Conti, Mohammad Ghavamzadeh, and Joelle Pineau. Benchmarking batch deep reinforcement learning algorithms. arXiv preprint arXiv:1910.01708, 2019.
|
| 245 |
+
|
| 246 |
+
Wonjoon Goo and Scott Niekum. You only evaluate once – a simple baseline algorithm for offline rl. In Offline Reinforcement Learning Workshop at Neural Information Processing Systems, 2020.
|
| 247 |
+
|
| 248 |
+
Caglar Gulcehre, Ziyu Wang, Alexander Novikov, Tom Le Paine, Sergio Gómez Colmenarejo, Konrad Zolna, Rishabh Agarwal, Josh Merel, Daniel Mankowitz, Cosmin Paduraru, et al. Rl unplugged: Benchmarks for offline reinforcement learning. arXiv preprint arXiv:2006.13888, 2020.
|
| 249 |
+
|
| 250 |
+
Caglar Gulcehre, Sergio Gómez Colmenarejo, Ziyu Wang, Jakub Sygnowski, Thomas Paine, Konrad Zolna, Yutian Chen, Matthew Hoffman, Razvan Pascanu, and Nando de Freitas. Regularized behavior value estimation. arXiv preprint arXiv:2103.09575, 2021.
|
| 251 |
+
|
| 252 |
+
Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog, 2019.
|
| 253 |
+
|
| 254 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In ICML, volume 2, pages 267–274, 2002.
|
| 255 |
+
|
| 256 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 257 |
+
|
| 258 |
+
Ilya Kostrikov, Jonathan Tompson, Rob Fergus, and Ofir Nachum. Offline reinforcement learning with fisher divergence critic regularization. arXiv preprint arXiv:2103.08050, 2021.
|
| 259 |
+
|
| 260 |
+
Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, pages 11761–11771, 2019.
|
| 261 |
+
|
| 262 |
+
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 263 |
+
|
| 264 |
+
Romain Laroche, Paul Trichelair, and Remi Tachet Des Combes. Safe policy improvement with baseline bootstrapping. In International Conference on Machine Learning, pages 3652–3661. PMLR, 2019.
|
| 265 |
+
|
| 266 |
+
Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 267 |
+
|
| 268 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 269 |
+
|
| 270 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 271 |
+
|
| 272 |
+
Rémi Munos, Tom Stepleton, Anna Harutyunyan, and Marc Bellemare. Safe and efficient off-policy reinforcement learning. In Advances in Neural Information Processing Systems, pages 1054–1062, 2016.
|
| 273 |
+
|
| 274 |
+
Ofir Nachum, Bo Dai, Ilya Kostrikov, Yinlam Chow, Lihong Li, and Dale Schuurmans. Algaedice: Policy gradient from arbitrary experience. arXiv preprint arXiv:1912.02074, 2019.
|
| 275 |
+
|
| 276 |
+
Kimia Nadjahi, Romain Laroche, and Rémi Tachet des Combes. Safe policy improvement with soft baseline bootstrapping, 2019.
|
| 277 |
+
|
| 278 |
+
Tom Le Paine, Cosmin Paduraru, Andrea Michi, Caglar Gulcehre, Konrad Zolna, Alexander Novikov, Ziyu Wang, and Nando de Freitas. Hyperparameter selection for offline reinforcement learning, 2020.
|
| 279 |
+
|
| 280 |
+
Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019.
|
| 281 |
+
|
| 282 |
+
Martin L Puterman and Moon Chirl Shin. Modified policy iteration algorithms for discounted markov decision problems. Management Science, 24(11):1127–1137, 1978.
|
| 283 |
+
|
| 284 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017.
|
| 285 |
+
|
| 286 |
+
Bruno Scherrer, Victor Gabillon, Mohammad Ghavamzadeh, and Matthieu Geist. Approximate modified policy iteration. arXiv preprint arXiv:1205.3054, 2012.
|
| 287 |
+
|
| 288 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International conference on machine learning, pages 1889–1897, 2015.
|
| 289 |
+
|
| 290 |
+
Noah Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavior modelling priors for offline reinforcement learning. In International Conference on Learning Representations, 2020.
|
| 291 |
+
|
| 292 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 293 |
+
|
| 294 |
+
Hado Van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with double qlearning. In Thirtieth AAAI conference on artificial intelligence, 2016.
|
| 295 |
+
|
| 296 |
+
Cameron Voloshin, Hoang M Le, Nan Jiang, and Yisong Yue. Empirical study of off-policy policy evaluation for reinforcement learning. arXiv preprint arXiv:1911.06854, 2019.
|
| 297 |
+
|
| 298 |
+
Qing Wang, Jiechao Xiong, Lei Han, Han Liu, Tong Zhang, et al. Exponentially weighted imitation learning for batched historical data. In Advances in Neural Information Processing Systems, pages 6288–6297, 2018.
|
| 299 |
+
|
| 300 |
+
Ruosong Wang, Dean P. Foster, and Sham M. Kakade. What are the statistical limits of offline rl with linear function approximation?, 2020a.
|
| 301 |
+
|
| 302 |
+
Ruosong Wang, Yifan Wu, Ruslan Salakhutdinov, and Sham M Kakade. Instabilities of offline rl with pre-trained neural representation. arXiv preprint arXiv:2103.04947, 2021.
|
| 303 |
+
|
| 304 |
+
Ziyu Wang, Alexander Novikov, Konrad Zolna, Josh S Merel, Jost Tobias Springenberg, Scott E Reed, Bobak Shahriari, Noah Siegel, Caglar Gulcehre, Nicolas Heess, et al. Critic regularized regression. Advances in Neural Information Processing Systems, 33, 2020b.
|
| 305 |
+
|
| 306 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning, 2019.
|
| 307 |
+
|
| 308 |
+
Andrea Zanette. Exponential lower bounds for batch reinforcement learning: Batch rl can be exponentially harder than online rl, 2021.
|
| 309 |
+
|
| 310 |
+
# Checklist
|
| 311 |
+
|
| 312 |
+
1. For all authors...
|
| 313 |
+
|
| 314 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 315 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 8 and Section 7.
|
| 316 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 8.
|
| 317 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 318 |
+
|
| 319 |
+
2. If you are including theoretical results...
|
| 320 |
+
|
| 321 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 322 |
+
|
| 323 |
+
3. If you ran experiments...
|
| 324 |
+
|
| 325 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplement.
|
| 326 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix C
|
| 327 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] In all relevant figures.
|
| 328 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix C
|
| 329 |
+
|
| 330 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 331 |
+
|
| 332 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] Data from Fu et al. [2020].
|
| 333 |
+
(b) Did you mention the license of the assets? [Yes] The license is Apache 2.0.
|
| 334 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Code in supplement.
|
| 335 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] Data is simulated.
|
| 336 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] Data is simulated.
|
| 337 |
+
|
| 338 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 339 |
+
|
| 340 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 341 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 342 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/LVWcGZr-8h/LVWcGZr-8h.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# On Success and Simplicity: A Second Look at Transferable Targeted Attacks
|
| 2 |
+
|
| 3 |
+
Zhengyu Zhao, Zhuoran Liu, Martha Larson Radboud University {z.zhao,z.liu,m.larson}@cs.ru.nl
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Achieving transferability of targeted attacks is reputed to be remarkably difficult. The current state of the art has resorted to resource-intensive solutions that necessitate training model(s) for each target class with additional data. In our investigation, we find, however, that simple transferable attacks which require neither model training nor additional data can achieve surprisingly strong targeted transferability. This insight has been overlooked until now, mainly because the widespread practice of attacking with only few iterations has largely limited the attack convergence to optimal targeted transferability. In particular, we, for the first time, identify that a very simple logit loss can largely surpass the commonly adopted crossentropy loss, and yield even better results than the resource-intensive state of the art. Our analysis spans a variety of transfer scenarios, especially including three new, realistic scenarios: an ensemble transfer scenario with little model similarity, a worse-case scenario with low-ranked target classes, and also a real-world attack on the Google Cloud Vision API. Results in these new transfer scenarios demonstrate that the commonly adopted, easy scenarios cannot fully reveal the actual strength of different attacks and may cause misleading comparative results. We also show the usefulness of the simple logit loss for generating targeted universal adversarial perturbations in a data-free manner. Overall, the aim of our analysis is to inspire a more meaningful evaluation on targeted transferability. Code is available at https://github.com/ZhengyuZhao/Targeted-Tansfer.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Deep neural networks have achieved remarkable performance in various machine learning tasks, but are known to be vulnerable to adversarial attacks [1]. A key property of adversarial attacks that makes them critical in realistic, black-box scenarios is their transferability [2, 3]. Current work on adversarial transferability has achieved great success for non-targeted attacks [4–12], while several initial attempts [3, 4, 13] at targeted transferability have shown its extreme difficulty. Targeted transferability is known to be much more challenging and worth exploring since it can raise more critical concerns by fooling models into predicting a chosen, highly dangerous target class.
|
| 12 |
+
|
| 13 |
+
However, so far state-of-the-art results can only be secured by resource-intensive transferable attacks [14–16]. Specifically, the FDA approach [14, 15] is based on modeling layer-wise feature distributions by training target-class-specific auxiliary classifiers on large-scale labeled data, and then optimizing adversarial perturbations using these auxiliary classifiers from across the deep feature space. The TTP approach [16] is based on training target-class-specific Generative Adversarial Networks (GANs) through global and local distribution matching, and then using the trained generator to directly generate perturbations on any given input image.
|
| 14 |
+
|
| 15 |
+
In this paper, we take a second, thorough look at current research on targeted transferability. Our main contribution is the finding that simple transferable attacks [4, 6, 8] that require neither model training nor additional data can actually achieve surprisingly strong targeted transferability. We argue that this insight has been overlooked mainly because current research has unreasonably restricted the attack convergence by only using a small number of iterations (see detailed discussion in Section 3). Another key contribution of our work is, for the first time, demonstrating the general superiority of a very simple logit loss, which even outperforms the resource-intensive state of the art.
|
| 16 |
+
|
| 17 |
+
In order to validate the general effectiveness of simple transferable attacks, in Section 4.1, we conduct extensive experiments in a wide range of transfer scenarios. We test the commonly adopted single-model and ensemble transfer scenarios, but also introduce three new scenarios that are more challenging and realistic: an ensemble transfer scenario with little model similarity, a worse-case scenario with low-ranked target classes, and also a real-world attack on the Google Cloud Vision API. Experimental results in these new scenarios suggest that evaluation in only the commonly adopted, easy scenarios cannot reveal the actual strength of different attacks, and may cause misleading comparative results. Additional experiments in Section 4.2 have shown the better performance of the simple transferable attacks than the state-of-the-art resource-intensive approaches. Finally, in Section 4.3, inspired by the observation that the generated perturbations themselves reflect specific target semantics, we use the simple Logit attack to generate targeted Universal Adversarial Perturbations (UAPs) in a data-free manner. In contrast, recent advances in targeted UAPs [16–19] have inevitably relied on large-scale optimization over additional data.
|
| 18 |
+
|
| 19 |
+
Overall, we hope our analysis of the weakness of commonly adopted attack settings and transfer scenarios will inspire a more meaningful evaluation on targeted transferability.
|
| 20 |
+
|
| 21 |
+
# 2 Related Work
|
| 22 |
+
|
| 23 |
+
In this section, we review existing simple transferable attacks (Section 2.1), and also recent resourceintensive transferable attacks (Section 2.2). Finally, we discuss related work on generating universal adversarial perturbations.
|
| 24 |
+
|
| 25 |
+
# 2.1 Simple Transferable Attacks
|
| 26 |
+
|
| 27 |
+
We refer to transferable attacks that require neither model training nor additional data, but only use iterative optimization on a single (original) image as simple transferable attacks. Simple transferable attacks have been extensively studied in the non-targeted case [4–12], and also attempted in the targeted case [3, 4, 20]. These attacks are commonly built up on the well-known Iterative-Fast Gradient Sign Method (I-FGSM) [21, 22], which can be formulated as:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\begin{array} { r } { \pmb { x } _ { 0 } ^ { \prime } = \pmb { x } , \pmb { x } _ { i + 1 } ^ { \prime } = \pmb { x } _ { i } ^ { \prime } - \alpha \cdot \mathrm { s i g n } ( \nabla _ { \pmb { x } } J ( \pmb { x } _ { i } ^ { \prime } , y _ { t } ) ) , } \end{array}
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\pmb { x } _ { i } ^ { \prime }$ denotes the perturbed image in the $i$ -th iteration, and $y _ { t }$ is the target class label. In order to ensure the imperceptibility, the added perturbations are restricted with respect to some $L _ { p }$ distance, i.e., satisfying $\| { \pmb x } ^ { \prime } - { \pmb x } \| _ { p } \overset { \cdot } { \le } \epsilon$ . Current transferable attack methods have commonly adopted the $L _ { \infty }$ distance, but can also be easily adapted to the $L _ { 2 }$ distance based on an $L _ { 2 }$ normalization [23].
|
| 34 |
+
|
| 35 |
+
For the loss function $J ( \cdot , \cdot )$ , most simple transferable attacks have adopted the Cross-Entropy (CE) loss. However, the CE loss has been recently shown to be insufficient in the targeted case due to its decreasing gradient problem [20]. To address this problem, the authors in [20] have proposed the $\mathbf { P 0 + T r i p }$ loss, in which the Poincare distance was used to adapt the gradients’ magnitude: ´
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
L _ { P o } = d ( { \pmb u } , { \pmb v } ) = \mathrm { a r c c o s h } ( 1 + \delta ( { \pmb u } , { \pmb v } ) ) ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\delta ( \pmb { u } , \pmb { v } ) = \frac { 2 \cdot \| \pmb { u } - \pmb { v } \| _ { 2 } ^ { 2 } } { ( 1 - \| \pmb { u } \| _ { 2 } ^ { 2 } ) ( 1 - \| \pmb { v } \| _ { 2 } ^ { 2 } ) } , \pmb { u } = \frac { l ( \pmb { x } ^ { \prime } ) } { \| l ( \pmb { x } ^ { \prime } ) \| } , \pmb { v } = \operatorname* { m a x } \{ \pmb { v } - \pmb { \xi } , 0 \} ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\textbf { \em u }$ is the normalized logit vector and $\pmb { v }$ is the one-hot vector with respect to the target class. $\xi = 1 0 ^ { - 5 }$ is a small constant to ensure numerical stability. The following triplet loss is also integrated for pushing the image away from the original class while pulling it into the target class:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
L _ { T r i p } = [ D ( l ( \pmb { x } ^ { \prime } ) , y _ { t } ) - D ( l ( \pmb { x } ^ { \prime } ) , y _ { o } ) + \gamma ] _ { + } , D ( l ( \pmb { x } ^ { \prime } ) , y ) = 1 - \frac { \| l ( \pmb { x } ^ { \prime } ) \cdot \pmb { y } \| _ { 1 } } { \| l ( \pmb { x } ^ { \prime } ) \| _ { 2 } \| y \| _ { 2 } } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The overall loss function is then formulated as $L _ { P o + T r i p } = L _ { P o } + \lambda L _ { T r i p }$ . Note that in the original work, ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ was evaluated in the commonly adopted, easy ensemble transfer scenario, which only involves models with similar architectures.
|
| 52 |
+
|
| 53 |
+
In addition to devising new loss functions, there are other transfer methods [4, 6, 8, 9] developed based on the assumption that preventing the attack optimization from overfitting to the specific source model can improve transferability. Such transfer methods can be easily plugged into different attacks without modifications, in contrast to the above methods that need to apply new attack loss functions. In this paper, we consider three [4, 6, 8] of such transfer methods that have been widely used in the literature, as described in the following text.
|
| 54 |
+
|
| 55 |
+
Momentum Iterative-FGSM (MI-FGSM) [4] integrates a momentum term, which accumulates previous gradients in order to achieve more stable update directions. It can be expressed as:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
{ \bf \mathcal { G } } _ { i + 1 } = \mu \cdot { \bf g } _ { i } + \frac { \nabla _ { x } J ( { \pmb x } _ { i } ^ { \prime } , y _ { t } ) } { \| \nabla _ { \pmb x } J ( { \pmb x } _ { i } ^ { \prime } , y _ { t } ) \| _ { 1 } } , ~ { \pmb x } _ { i + 1 } ^ { \prime } = { \pmb x } _ { i } ^ { \prime } - \alpha \cdot \mathrm { ~ \mathrm { s i g n } } ( { \pmb g } _ { i } ) ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $\mathbf { \pmb { g } } _ { i }$ is the accumulated gradients at the $i$ -th iteration, and $\mu$ is a decay factor. Another similar technique that instead uses the Nesterov accelerated gradient was explored in [9].
|
| 62 |
+
|
| 63 |
+
Translation Invariant-FGSM (TI-FGSM) [6] randomly translates the input image during attack optimization in order to prevent the attack from overfitting to the specific source model. This approach is inspired by the data augmentation techniques used for preventing overfitting in normal model training. Instead of calculating gradients for multiple translated images separately, the authors have proposed an approximate solution to accelerate the implementation. It is achieved by directly computing locally smoothed gradients on the original image via convolution with a kernel:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\pmb { x } _ { i + 1 } ^ { \prime } = \pmb { x } _ { i } ^ { \prime } - \alpha \cdot \mathrm { s i g n } ( W * \nabla _ { \pmb { x } } J ( \pmb { x } _ { i } ^ { \prime } , y _ { t } ) ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $W$ is the convolution kernel used for smoothing. TI-FGSM was originally designed for boosting transferability with adversarially-trained models as target models and has been recently shown that a smaller kernel size should be used when transferring to normally-trained models [12].
|
| 70 |
+
|
| 71 |
+
Diverse Input-FGSM (DI-FGSM) [8] follows a similar idea to TI-FGSM, but applies random resizing and padding for data augmentation. Another important difference is that DI-FGSM randomizes augmentation parameters over iterations rather than fixing them as in TI-FGSM. The attack optimization of DI-FGSM can be formulated as:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\pmb { x } _ { i + 1 } ^ { \prime } = \pmb { x } _ { i } ^ { \prime } - \alpha \cdot \mathrm { s i g n } \big ( \nabla _ { \pmb { x } } J ( T ( \pmb { x } _ { i } ^ { \prime } , p ) , y _ { t } ) \big ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where the stochastic transformation $T ( \pmb { x } _ { i } ^ { \prime } , p )$ is implemented with probability $p$ at each iteration. In Section 4.1, we demonstrate that simple transfer attacks with these three transfer methods can actually achieve surprisingly strong targeted transferability in a wide range of transfer scenarios.
|
| 78 |
+
|
| 79 |
+
# 2.2 Resource-Intensive Transferable Attacks
|
| 80 |
+
|
| 81 |
+
Due to the broad consensus that achieving targeted transferability is extremely difficult, recent researchers have resorted to resource-intensive approaches that require training target-class-specific models on large-scale additional data. Specifically, the Feature Distribution Attack (FDA) [14] follows the same attack pipeline as the above simple transferable attacks, but requires auxiliary classifiers that have been trained on additional labeled data as part of the source model. Each auxiliary classifier is a small, binary, one-versus-all classifier trained for a specific target class at a specific layer. That is to say, the number of auxiliary classifiers is the number of layers that are probed multiplied by the number of target classes that are required to model [14]. The attack loss function of FDA can be formulated as:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
L _ { F D A } = J ( \mathcal { F } _ { l } ( \pmb { x } ^ { \prime } ) , y _ { t } ) - \eta \frac { \| \mathcal { F } _ { l } ( \pmb { x } ^ { \prime } ) - \mathcal { F } _ { l } ( \pmb { x } ) \| _ { 2 } } { \| \mathcal { F } _ { l } ( \pmb { x } ) \| _ { 2 } } ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where each auxiliary classifiers $F _ { l } ( \cdot )$ can model the probability that a feature map at layer $l$ is from a specific target class $y _ { t }$ . $\mathbf { F D A } ^ { ( N ) } \mathbf { + x e n t }$ [15] extends FDA by aggregating features from $L$ layers and also incorporating the cross-entropy loss $H ( \cdot , \cdot )$ of the original network $\mathcal F ( \cdot )$ . The loss function of $\mathrm { F D A } ^ { ( N ) } -$ +xent can be expressed as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
L _ { F D A ^ { ( N ) } + x e n t } = \sum _ { l \in L } \lambda _ { l } ( L _ { F D A } + \gamma H ( \mathcal { F } ( \pmb { x } ^ { \prime } ) , y _ { t } ) ) , \mathrm { ~ w h e r e ~ } \sum _ { l \in L } \lambda _ { l } = 1 .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Very recently, TTP [16] has achieved state-of-the-art targeted transferability by directly generating perturbations using target-class-specific GANs that have been trained via matching the distributions of perturbations and a specific target class both globally and locally. Specifically, the global distribution matching is achieved by minimizing the Kullback Leibler (KL) divergence, and the local distribution matching is by enforcing the neighbourhood similarity. In order to further boost the performance, data augmentation techniques, such as image rotation, crop resize, horizontal flip, color jittering and gray-scale transformation, have been applied during model training. We refer the readers to [16] for more technical details of TTP.
|
| 94 |
+
|
| 95 |
+
These two transferable attacks, $\mathrm { F D A } ^ { ( N ) } +$ xent and TTP, are resource intensive due to the use of largescale model training and additional data. However, in Section 4.2, we show that simple transferable attacks, which require neither model training nor additional data, can actually achieve even better performance than them.
|
| 96 |
+
|
| 97 |
+
# 2.3 Universal Adversarial Perturbations
|
| 98 |
+
|
| 99 |
+
Previous research has shown the existence of Universal Adversarial Perturbations (UAPs), i.e., a single image perturbation vector that fools a classifier on multiple images [24]. UAPs have been extensively studied for non-targeted attacks [24–28], but also explored in the more challenging, targeted case [17–19]. Although recent studies have shown comparable performance of using reconstructed class impressions [25] or proxy datasets [18] to original training data, large-scale optimization over image data is still necessary for most existing methods. Differently, a data-free approach [26] has been proposed for non-targeted UAPs by iteratively optimizing randomly-initialized perturbations with an objective of disrupting the intermediate features of the model at multiple layers. However, this approach cannot be applied to targeted UAPs because targeted perturbations aim at a specific direction but not random disruption as in the non-targeted case. To bridge this gap, in Section 4.3, we demonstrate how the simple Logit attack can be used to generate targeted UAPs in a data-free manner.
|
| 100 |
+
|
| 101 |
+
# 3 New Insights into Simple Transferable Attacks
|
| 102 |
+
|
| 103 |
+
In this section, we revisit simple transferable targeted attacks, and provide new insights into them. Specifically, we demonstrate that simple transferable attacks that are based on existing transfer methods (TI-, MI-, and DI-FGSM) need more iterations to converge, and attacking with a simple logit loss can yield much better results than the commonly adopted Cross-Entropy (CE) loss.
|
| 104 |
+
|
| 105 |
+
# 3.1 Existing Transfer Methods with More Iterations Yield Good Results
|
| 106 |
+
|
| 107 |
+
Existing attempts have concluded that using simple transferable attacks to achieve targeted transferability is extremely difficult [3, 4, 13–15]. However, these attempts have been limited to the MI transfer method. Here, we tested all the three transfer methods. As can be seen form Figure 1, integrating all the three transfer methods leads to the best performance. In particular, we find that using only DI can actually yield substantial targeted transferability, while using only TI or MI makes little difference to the original poor targeted transferability. The fact that DI outperforms TI may be explained by the fact that DI randomizes the image augmentation parameters over iterations rather than fixing them as in TI. In this way, the gradients towards the target class become more generic and so avoid overfitting to the white-box source model. MI is essentially different from DI and TI because it can only stabilize update directions but not serve to achieve more accurate gradient directions towards a specific (target) class.
|
| 108 |
+
|
| 109 |
+
As we have pointed out in Section 1, common practice of generating transferable targeted perturbations [13–15, 20] has limited the attack optimization to few iterations (typically $\leq 2 0$ ). This is somewhat understandable given that extensive research on non-targeted transferability has done the same. However, as can be seen from Figure 1, targeted attacks actually require much more iterations to converge to optimal transferability, in contrast to the fast convergence of non-targeted attacks. This implies that evaluating the targeted transferability under only few iterations is problematic. On the one hand, comparing different optimization processes that have not converged is not meaningful and may cause misleading comparisons (see evidence in Section 4.1). This observation is consistent with the evaluation suggestion in [29] that restricting the number of iterations without verifying the attack convergence is one of the common pitfalls in evaluating adversarial robustness. Several advanced defenses have been defeated by simply increasing the number of iterations [30]. On the other hand, considering the realistic threat model, it is not meaningful to artificially restrict the computational power of a practical attack (e.g., to fewer than several thousand attack iterations) [31].
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 1: Transfer success rates of simple transferable attacks using CE or logit loss in the non-targeted and targeted scenarios.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 2: White-box (wb) and black-box (bb) attack performance in terms of the predicted confidence (left, higher is better) and ranking (right, lower is better) of the target class.
|
| 116 |
+
|
| 117 |
+
# 3.2 A Simple yet Strong Logit Attack
|
| 118 |
+
|
| 119 |
+
Existing simple transferable attacks have commonly adopted the Cross-Entropy (CE) loss. However, as pointed out in [20], during the attack optimization, the CE loss will cause the gradient to decrease and tend to vanish as the number of iterations is increased. To address this problem, the ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ loss [20] takes a very aggressive strategy by arbitrarily reversing the decrease of the gradient, i.e., gradually increasing the magnitude of the gradients over iterations. However, we argue that this operation has led to too large step size, and as a result cause the attack optimization to overshoot the minima. Our results in Section 4.1 support this argument by showing that $\mathrm { P o + }$ Trip even yielded worse results than CE in the ensemble transfer scenario with diverse model architectures, since the loss surface is relatively non-smooth.
|
| 120 |
+
|
| 121 |
+
Here, for the loss function, we eliminate the final softmax function used in the CE loss and just backpropagate the gradients from the logit output:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
L _ { L o g i t } = - l _ { t } ( { \bf r } ^ { \prime } ) ,
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $l _ { t } ( \cdot )$ denotes the logit output with respect to the target class. Although the idea of attacking logits is not new, its superior performance in targeted transferability has not been recognized so far. We also find that using the well-known logit-based loss, C&W [32], yields consistently worse results (see detailed comparisons in Appendix A). Another logit loss that is similar to the C&W loss has also been adopted by [18], but in the task of generating UAPs with large-scale data.
|
| 128 |
+
|
| 129 |
+
Below, we show that this logit loss leads to stronger gradients than the CE loss. As can be observed from Equation 10, the gradient of the CE loss with respect to the target logit input, $z _ { t }$ , will monotonically decrease as the probability of the target class, $p _ { t }$ , increases during attack optimization. In addition, due to the use of the softmax function, $p _ { t }$ will quickly reach 1, and as a result the gradient tends to vanish. This phenomenon makes the attack hard to improve even with more iterations applied. Differently, as shown by Equation 11, the gradient of the logit loss equals a constant. In this way, the attack can keep improving as the number of iterations is increased. In Appendix B, we provide further comparisons on the trends of loss/gradient magnitude and the target logit value over iterations, which show that the logit loss leads to better results than both CE and ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ .
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { c } { { { \cal L } _ { C E } = - 1 \cdot \log ( p _ { t } ) = - \log ( { \displaystyle \frac { e ^ { z _ { t } } } { \sum e ^ { z _ { j } } } } ) = - z _ { t } + \log ( \sum _ { } e ^ { z _ { j } } ) , } } \\ { { { \cal \frac { \partial L _ { C E } } { \partial z _ { t } } } = - 1 + { \displaystyle \frac { \partial \log ( \sum e ^ { z _ { j } } ) } { \partial e ^ { z _ { t } } } } \cdot { \displaystyle \frac { \partial e ^ { z _ { t } } } { \partial z _ { t } } } = - 1 + { \displaystyle \frac { e ^ { z _ { t } } } { \sum e ^ { z _ { j } } } } = - 1 + p _ { t } . } } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
L _ { L o g i t } = - z _ { t } , \frac { \partial L _ { L o g i t } } { \partial z _ { t } } = - 1 .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Table 1: Targeted transfer success rates $( \% )$ in the single-model transfer scenario. We consider three attacks with different loss functions: cross-entropy (CE), Poincare distance with Triplet loss ´ $( { \mathrm { P o } } + { \mathrm { T r i p } } )$ [20], and the logit loss. Results with 20/100/300 iterations are reported.
|
| 140 |
+
|
| 141 |
+
<table><tr><td rowspan="2">Attack</td><td colspan="3">Source Model: Res50</td><td colspan="3">Source Model: Dense121</td></tr><tr><td>→Dense121</td><td>→VGG16</td><td>→Inc-v3</td><td>→Res50</td><td>→VGG16</td><td>→Inc-v3</td></tr><tr><td>CE</td><td>26.9/39.4/42.6</td><td>17.3/27.3/30.4</td><td>2.4/3.8/4.1</td><td>13.1/17.3/19.4</td><td>7.7/10.8/10.9</td><td>1.9/3.3/3.5</td></tr><tr><td>Po+Trip</td><td>26.7/53.0/54.7</td><td>18.8/34.2/34.4</td><td>2.9/6.0/5.9</td><td>10.1/14.7/14.7</td><td>6.7/8.3/7.7</td><td>2.1/3.0/2.7</td></tr><tr><td>Logit</td><td>29.3/63.3/72.5</td><td>24.0/55.7/62.7</td><td>3.0/7.2/9.4</td><td>17.2/39.7/43.7</td><td>13.5/35.3/38.7</td><td>2.7/6.9/7.6</td></tr><tr><td rowspan="2">Attack</td><td colspan="3">Source Model: VGG16</td><td colspan="3">Source Model: Inc-v3</td></tr><tr><td>→Res50</td><td>→Dense121</td><td>→Inc-v3</td><td>→Res50</td><td>→Dense121</td><td>→VGG16</td></tr><tr><td>CE</td><td>0.7/0.4/0.6</td><td>0.5/0.3/0.1</td><td>0/0.1/0</td><td>0.6/2.1/2.4</td><td>0.8/2.5/2.9</td><td>0.7/1.6/2.0</td></tr><tr><td>Po+Trip</td><td>0.6/0.8/0.5</td><td>0.6/0.6/0.7</td><td>0.2/0.1/0.1</td><td>0.6/2.0/2.5</td><td>0.8/3.1/3.3</td><td>0.5/2.1/2.0</td></tr><tr><td>Logit</td><td>3.3/8.7/11.2</td><td>3.6/11.7/13.2</td><td>0.2/0.7/0.9</td><td>0.8/1.6/2.9</td><td>1.2/2.8/5.3</td><td>0.7/2.2/3.7</td></tr></table>
|
| 142 |
+
|
| 143 |
+
# 4 Experimental Evidence on Simple Transferable Attacks
|
| 144 |
+
|
| 145 |
+
In this section, we provide experimental evidence to show the general effectiveness of simple transferable attacks. Firstly, in Section 4.1, we evaluate the simple transferable attacks in a variety of transfer scenarios, including single-model transfer, ensemble transfer (easy and challenging scenarios), a worse-case scenario with low-ranked target classes, and a real-world attack on the Google Cloud Vision API. Then, in Section 4.2, we compare the simple transferable attacks with two state-of-the-art resource-intensive transferable attacks, $\mathrm { F D A } ^ { ( N ) } { + } \mathrm { x e n i }$ [15] and TTP [16]. Finally, in Section 4.3, we apply the Logit attack to achieving targeted UAPs in a data-free manner.
|
| 146 |
+
|
| 147 |
+
Following recent work [14–16, 20], we focus on targeted transferability of ImageNet-like images, which is known to be much more difficult than other data sets (e.g, MNIST and CIFAR-10) with smaller-size images and fewer classes. Specifically, we used the 1000 images from the development set of the ImageNet-Compatible Dataset1, which was introduced along with the NIPS 2017 Competition on Adversarial Attacks and Defenses. All these images are associated with 1000 ImageNet class labels and cropped to $2 9 9 \times 2 9 9$ before use. Our experiments were run on an NVIDIA Tesla P100 GPU with 12GB of memory.
|
| 148 |
+
|
| 149 |
+
# 4.1 Simple Transferable Attacks in Various Transfer Scenarios
|
| 150 |
+
|
| 151 |
+
We tested three different attack losses: CE, ${ \mathrm { P o + T r i p } }$ [20] and Logit. All attacks used TI, MI, and DI with optimal hyperparameters provided in their original work. Specifically, $\| \mathbf { W } \| _ { 1 } = 5$ was used for ‘TI’ as suggested by [12]. For each image, we used the target label that was officially specified in the dataset. If not mentioned specifically, all attacks were run with 300 iterations to ensure convergence. When being executed with a batch size of 20, the optimization process took about three seconds per image. A moderate step size of 2 was used for all attacks, and the results were shown to be not sensitive to the setting of step size (see evidence in Appendix C). We considered four diverse classifier architectures: ResNet [33], DenseNet [34], VGGNet [35], and Inception [36]. Following the common practice, the perturbations were restricted by $L _ { \infty }$ norm with $\epsilon = 1 6$ .
|
| 152 |
+
|
| 153 |
+
Single-model transfer. Table 1 reports the targeted transferability when transferring between each pair of different model architectures. As can be seen, the logit loss outperformed CE and ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ by a large margin in almost all cases. When comparing different model architectures, we can find that the attacks achieved lower performance when transferring from the VGGNet16 or Inception-v3 than from ResNet50 or DenseNet121. This is consistent with the observations in [14, 15] and may be explained by the fact that skip connections in ResNet50 and DenseNet121 boosts transferability [37]. Another finding is that when using Inception-v3 as the target model, the transfer success rates were always low. This might be explained by the heavily engineered nature of the Inception architecture, i.e., the Inception architecture has multiple-size convolution and two auxiliary classifiers.
|
| 154 |
+
|
| 155 |
+
Table 2: Targeted transfer success rates $( \% )$ in the commonly adopted, easy ensemble transfer scenario, where the hold-out target model (denoted by $\cdot \underline { { \cdot } }$ ) and the ensemble models share similar architectures. Results with 20/100 iterations are reported.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Attack</td><td>-Inc-v3</td><td>-Inc-v4</td><td>-IncRes-v2</td><td>-Res50</td><td>-Res101</td><td>-Res152</td><td>Average</td></tr><tr><td>CE</td><td>48.8/85.3</td><td>47.2/83.3</td><td>47.5/83.9</td><td>50.9/89.8</td><td>58.5/93.2</td><td>56.7/90.7</td><td>51.6/87.7</td></tr><tr><td>Po+Trip</td><td>59.3/84.4</td><td>55.0/82.4</td><td>51.4/80.8</td><td>56.9/85.0</td><td>60.5/87.9</td><td>57.6/85.7</td><td>56.8/84.4</td></tr><tr><td>Logit</td><td>56.4/85.5</td><td>52.9/85.8</td><td>54.4/85.1</td><td>57.5/90.0</td><td>64.4/91.4</td><td>61.3/90.8</td><td>57.8/88.1</td></tr></table>
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Targeted transfer success rates $( \% )$ in our challenging ensemble transfer scenario, where each hold-out target model shares no similar architecture with the source models used for ensemble.
|
| 161 |
+
|
| 162 |
+
Ensemble transfer in both easy and challenging scenarios. A common approach to further boosting transferability is to generate perturbations on an ensemble of white-box source models. Following the common practice, we simply assigned equal weights to all the source models. We first look at the commonly adopted ensemble transfer scenario [4, 6, 20, 38] in which each hold-out target model shares a similar architecture with some of the white-box ensemble models. As can be seen from Table 2, the transfer success rates of all three attacks have got saturated when given enough iterations to converge. As a result, this transfer scenario could not fully reveal the actual strength of different attacks. We can also observe that ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ performed better than the CE loss only when the attack optimization is unreasonably restricted to 20 iterations, but became even worse with enough iterations. This finding suggests that evaluating different attacks under only few iterations may cause misleading comparative results.
|
| 163 |
+
|
| 164 |
+
We next considered a more challenging transfer scenario with no architectural overlap between the source ensemble models and the target model, in order to fully reveal the potential of different attacks. This scenario is also more realistic since it is hard for an attacker to know the specific architecture of a real-world target mode. Figure 3 shows that in this scenario, the Logit largely outperformed CE and ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ . In addition, the results of both CE and Logit were substantially improved over the single-model transfer results reported in Table 1. However, ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ performed even worst in some cases maybe because its use of arbitrarily increasing the gradient magnitude has caused the optimization to overshoot the minima in this ensemble transfer scenario where the loss surface is relatively non-smooth due to the model diversity. Note that as in the single transfer scenario, transferring to Inception-v3 is still the most difficult.
|
| 165 |
+
|
| 166 |
+
Table 3: Targeted transfer success rates $( \% )$ when varying the target from the high-ranked class to low.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Attack</td><td>2nd</td><td>10th</td><td>200th</td><td>500th</td><td>800th</td><td>1000th</td></tr><tr><td>CE</td><td>89.9</td><td>76.7</td><td>49.7</td><td>43.1</td><td>37.0</td><td>25.1</td></tr><tr><td>Po+Trip</td><td>82.6</td><td>77.6</td><td>58.4</td><td>53.6</td><td>49.1</td><td>38.2</td></tr><tr><td>Logit</td><td>83.8</td><td>81.3</td><td>75.0</td><td>71.0</td><td>65.1</td><td>52.8</td></tr></table>
|
| 169 |
+
|
| 170 |
+
A worse-case transfer scenario with lowranked target classes. In conventional security studies, a comprehensive evaluation commonly involves a range of attack scenarios with varied difficulty. Existing work on white-box adversarial attacks [32, 21, 23, 38] has also looked at different cases with varied difficulty regarding the ranking position of the target class in the prediction list of the original image.
|
| 171 |
+
|
| 172 |
+
Specifically, in the best case, the targeted success is basically equal to non-targeted success, i.e., an attack is regarded to be successful as long as it can succeed on any arbitrary target other than the original class. In the average case, the target class is randomly specified, while in the worst case, the target is specified as the lowest-ranked/least-likely class.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 4: Successful targeted adversarial images on Google Cloud Vision generated by the Logit attack with ensemble transfer. More examples can be found in Appendix D.
|
| 176 |
+
|
| 177 |
+
Table 4: Non-targeted and targeted transfer success rates $( \% )$ of different attacks on Google Cloud Vision.
|
| 178 |
+
|
| 179 |
+
<table><tr><td></td><td>CE</td><td>Po+Trip</td><td>Logit</td></tr><tr><td>Targeted</td><td>7</td><td>8</td><td>18</td></tr><tr><td>Non-targeted</td><td>51</td><td>44</td><td>51</td></tr></table>
|
| 180 |
+
|
| 181 |
+
However, to the best of our knowledge, current evaluation of transfer-based attacks has been limited to the best and average cases. To address this limitation, we consider a worse-case transfer scenario by varying the target from the highest-ranked class gradually to the lowest one. As can be seen from Table 3, there exists a non-negligible correlation between the ranking position of the target class and the targeted transferability. More specifically, it becomes increasingly difficult as the target moves down the prediction list. We can also observe that the results with higher-ranked targets might not reveal the actual strength of different attacks as in the more realistic, worse cases with lower-ranked targets. In particular, only looking the best case with the highest-ranked target may lead to a misleading conclusion that CE leads to the most effective attack. This finding suggests that a more meaningful evaluation on targeted transferability should further increase difficulty beyond the current best and average cases.
|
| 182 |
+
|
| 183 |
+
Transfer-based attacks on Google Cloud Vision. Most existing work on fooling real-world computer vision systems has been focused on the query-based attacks, where a large number of queries are required [39–41]. Although several recent studies have also explored real-world transfer-based attacks, they were limited to face recognition and the non-targeted attacks [42–44]. In contrast, we applied the simple transferable attacks in the more challenging, targeted case on a more generallyused image recognition system, the Google Cloud Vision API. Specifically, we used the targeted adversarial images generated on the ensemble of all four diverse source models with 300 iterations.
|
| 184 |
+
|
| 185 |
+
The API predicts a list of semantic labels along with confidence scores. Specifically, only the top classes with confidence no lower than $5 0 \%$ are returned, and at most 10 classes are shown. Note that the confidence score here is not a probability (which would sum to one). We measured both the targeted and non-targeted transferability. Since all returned labels are with relatively high confidence $( \geq 5 0 \% )$ ), we do not limit our measure of success rates to only top-1 class. Instead, for non-targeted success, we measured whether or not the ground-truth class appeared in the returned list, while for targeted success, whether or not the target class appeared. Due to the fact that the semantic label set predicted by the API does not exactly correspond to the 1000 ImageNet classes, we treated semantically similar classes as the same class.
|
| 186 |
+
|
| 187 |
+
Table 4 reports the results averaged over 100 images that originally yield correct predictions. As can be seen, in general, achieving targeted transfer success is much more difficult than non-targeted success. In particular, the Logit attack achieved the best targeted transferability, with quasi-imperceptible perturbations shown in Figure 4. Our results reveal the potential vulnerability of Google Cloud Vision against simple transfer-based attacks, which require no query interaction.
|
| 188 |
+
|
| 189 |
+
# 4.2 Simple vs. Resource-Intensive Transferable Attacks
|
| 190 |
+
|
| 191 |
+
In this subsection, we compared simple transferable attacks with state-of-the-art resource-intensive approaches, TTP [16] and FDA(N)+xent [15], which necessitate training target-class-specific models on additional data.
|
| 192 |
+
|
| 193 |
+
Compared with TTP. We compared the Logit attack with the state-of-the-art TTP, which is based on training target-class-specific GANs on additional data. We tested both Logit and TTP on our dataset following the “10-Targets (all-source)” setting in [16]. We chose ResNet50 as the white-box model in the single-model transfer scenario and an ensemble of $\mathrm { R e s N e t } \{ 1 8 , 5 0 , 1 0 1 , 1 5 2 \}$ in the ensemble transfer scenario. DenseNet121 and VGG16 bn are tested as the target models. Note that the same knowledge of the white-box model is available to both attacks but it is leveraged in different ways.
|
| 194 |
+
|
| 195 |
+
Specifically, for the Logit attack, the white-box model is used as a source model for iterative attack optimization, while for TTP, it is used as a discriminator during training the GANs.
|
| 196 |
+
|
| 197 |
+
As shown in Table 5, under the commonly adopted $\epsilon = 1 6$ , the Logit attack can achieve comparable results to TTP in all cases. Specifically, we can observe that the model ensemble is more helpful to Logit than for TTP. This might be because even with the single model as the discriminator, TTP can learn good enough features of target semantics by training with the objective of matching the perturbation and target class distributions with large-scale data. The clearer target semantics learned by TTP can be confirmed by comparing the unbounded perturbations achieved by TTP (e.g., Figure 3 in [16]) with those by the Logit shown in Figure 5.
|
| 198 |
+
|
| 199 |
+
Table 5: Targeted transfer success rates $( \% )$ of Logit vs. TTP in single-model and ensemble transfer scenarios under two norm bounds.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Bound</td><td>Attack</td><td>D121</td><td>V16</td><td>D121-ens</td><td>V16-ens</td></tr><tr><td rowspan="2">e= 16</td><td>TTP</td><td>79.6</td><td>78.6</td><td>92.9</td><td>89.6</td></tr><tr><td>Logit</td><td>75.9</td><td>72.5</td><td>99.4</td><td>97.7</td></tr><tr><td rowspan="2">e=8</td><td>TTP</td><td>37.5</td><td>46.7</td><td>63.2</td><td>66.2</td></tr><tr><td>Logit</td><td>44.5</td><td>46.8</td><td>92.6</td><td>87.0</td></tr></table>
|
| 202 |
+
|
| 203 |
+
This fact that TTP perturbations heavily rely on semantic patterns of the target class might cause TTP to degrade under lower norm bounds. To validate this assumption, we further compared Logit and TTP under $\epsilon = 8$ . As expected, the Logit attack consistently surpassed TTP, especially with a very large margin in the ensemble transfer scenario. The different comparing results for the two perturbation sizes also suggest that comparing attacks only under a single perturbation size may not reveal their characteristics.
|
| 204 |
+
|
| 205 |
+
Table 6: Targeted transfer success rates $( \% )$ of unbounded adversarial images by different attacks with the same iteration budget.
|
| 206 |
+
|
| 207 |
+
<table><tr><td></td><td>FDA(4) +xent</td><td>CE</td><td>Po+Trip</td><td>Logit</td></tr><tr><td>Res50-→Dense121</td><td>65.8</td><td>69.3</td><td>88.1</td><td>84.1</td></tr><tr><td>Res50→VGG16</td><td>48.1</td><td>54.1</td><td>67.8</td><td>74.2</td></tr></table>
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 5: Unbounded adversarial examples that reflect target semantics. More examples can be found in Appendix E.
|
| 211 |
+
|
| 212 |
+
Compared with FDA(N)+xent. We compared the three simple transferable attacks (CE, ${ \mathrm { P o } } { + } { \mathrm { T r i p } }$ and Logit) with $\mathrm { F D A } ^ { ( N ) }$ +xent on generating unbounded adversarial images, in consistence with “distal transfer” in $[ 1 5 ] ^ { 2 }$ . Specifically, the adversarial perturbations were initialized as random Gaussian noise and allowed to be as large as possible. Although such unbounded adversarial images may not be practically compelling, they can provide better isolated indication on transferability by eliminating the dependency on the source images and the bound restrictions. The results were averaged over 4000 image examples, each of which was optimized towards a random target class. As suggested by [15], the MI transfer method was removed since it empirically harms the performance in this unbounded case.
|
| 213 |
+
|
| 214 |
+
Table 6 shows that all the three simple transferable attacks achieved stronger targeted transferability than $\mathrm { F D A } ^ { ( N ) } \mathrm { + x e n t }$ . As can be seen from Figure 5, the unbounded adversarial perturbations can somehow reflect the target semantics. This finding suggests that achieving targeted transferability relies on robust, semantic features [45] that are expected to be learned by various models and also understood by humans. In this way, achieving targeted transferability is fundamentally different from non-targeted transferability, for which attacking non-robust features is known to be sufficient [45]. It is also worth noting that in practical scenarios with small norm bounds, the semantically-aligned perturbations would not be expected to change human judgements.
|
| 215 |
+
|
| 216 |
+
# 4.3 Simple Logit Attack for Targeted UAPs in a Data-Free Manner
|
| 217 |
+
|
| 218 |
+
The above observation that the perturbations can reflect certain target semantics motivates us to apply the Logit attack to achieving targeted Universal Adversarial Perturbations (UAPs), which can drive multiple original images into a specific target class. Existing attempts at achieving targeted UAPs have mainly relied on large-scale optimization over additional data [17–19]. However, the simple Logit attack can be easily extended to generate targeted UAPs in a data-free manner. The only difference from the above transferable Logit attack is that here a mean image (all pixel values set as 0.5 out of [0,1]) is used as the original image.
|
| 219 |
+
|
| 220 |
+
Table 7: Success rates $( \% )$ of targeted UAPs generated by CE and Logit attacks for different models.
|
| 221 |
+
|
| 222 |
+
<table><tr><td>Attack</td><td>Inc-v3</td><td>Res50</td><td>Dense121</td><td>VGG16</td></tr><tr><td>CE</td><td>2.6</td><td>9.2</td><td>8.7</td><td>20.1</td></tr><tr><td>Logit</td><td>4.7</td><td>22.8</td><td>21.8</td><td>65.9</td></tr></table>
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 6: UAPs $\epsilon = 1 6$ , VGG16) with different classes using CE and Logit. More examples can be found in Appendix F.
|
| 226 |
+
|
| 227 |
+
In our experiment, for each target class, we generated a single targeted UAP vector $\epsilon = 1 6$ ) with 300 iterations and applied it to all 1000 images in our dataset. Table 7 reports the results averaged over all the 1000 ImageNet classes. As can be seen, the logit loss can yield substantial success, remarkably outperforming the CE loss. This can be confirmed by Figure 6, which shows the Logit attack can yield more semantically-aligned perturbations than CE. This observation also supports the claim from [18] that universal perturbations contain dominant features, and images act like noise with respect to perturbations.
|
| 228 |
+
|
| 229 |
+
# 5 Conclusion and Outlook
|
| 230 |
+
|
| 231 |
+
In this paper, we have demonstrated that achieving targeted transferability is not as difficult as current work concludes. Specifically, we find that simple transferable attacks can actually achieve surprisingly strong targeted transferability when given enough iterations for convergence. We have validated the effectiveness of simple transferable attacks in a wide range of transfer scenarios, including three newly-introduced challenging scenarios. These challenging scenarios have better revealed the actual strength of different attacks. In particular, we demonstrate that a very simple Logit attack is superior in all transfer scenarios, achieving even better results than the state-of-the-art resource-intensive approaches. We also show the potential usefulness of the Logit attack for generating targeted universal adversarial perturbations in a data-free manner. Overall, we hope our findings will inspire future research to conduct a more meaningful evaluation on targeted transferability. Our future work will focus on studying why different model architectures yield different transferability. In particular, the very low success rates when targeting Inception-v3 should be explored. Moving forward, there needs to be a more comprehensive discussion on the resource consumption of different attacks from multiple aspects, such as training and inference time, hardware resources, and data size.
|
| 232 |
+
|
| 233 |
+
Strong transferability can obviously benefit black-box applications of adversarial images for social good, such as protecting user privacy [42, 43, 46–48]. In addition, it will also motivate the community to design stronger defenses given our finding that even simple attacks can generate highly transferable adversarial images. It remains a possibility that our methodology may be misused by malicious actors to break legitimate systems. However, we firmly believe that the help that our paper can provide to researchers significantly outweighs the help that it may provide an actual malicious actor.
|
| 234 |
+
|
| 235 |
+
# Acknowledgments
|
| 236 |
+
|
| 237 |
+
This work was carried out on the Dutch national e-infrastructure with the support of SURF Cooperative.
|
| 238 |
+
|
| 239 |
+
# References
|
| 240 |
+
|
| 241 |
+
[1] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 242 |
+
[2] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 243 |
+
[3] Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In ICLR, 2017.
|
| 244 |
+
[4] Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In CVPR, 2018.
|
| 245 |
+
[5] Wen Zhou, Xin Hou, Yongjun Chen, Mengyun Tang, Xiangqi Huang, Xiang Gan, and Yong Yang. Transferable adversarial perturbations. In ECCV, 2018.
|
| 246 |
+
[6] Yinpeng Dong, Tianyu Pang, Hang Su, and Jun Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In CVPR, 2019.
|
| 247 |
+
[7] Qian Huang, Isay Katsman, Horace He, Zeqi Gu, Serge Belongie, and Ser-Nam Lim. Enhancing adversarial example transferability with an intermediate level attack. In ICCV, 2019.
|
| 248 |
+
[8] Cihang Xie, Zhishuai Zhang, Yuyin Zhou, Song Bai, Jianyu Wang, Zhou Ren, and Alan L Yuille. Improving transferability of adversarial examples with input diversity. In CVPR, 2019.
|
| 249 |
+
[9] Jiadong Lin, Chuanbiao Song, Kun He, Liwei Wang, and John E Hopcroft. Nesterov accelerated gradient and scale invariance for adversarial attacks. In ICLR, 2020.
|
| 250 |
+
[10] Yingwei Li, Song Bai, Yuyin Zhou, Cihang Xie, Zhishuai Zhang, and Alan L Yuille. Learning transferable adversarial examples via ghost networks. In AAAI, 2020.
|
| 251 |
+
[11] Weibin Wu, Yuxin Su, Xixian Chen, Shenglin Zhao, Irwin King, Michael R Lyu, and Yu-Wing Tai. Boosting the transferability of adversarial samples via attention. In CVPR, 2020.
|
| 252 |
+
[12] Lianli Gao, Qilong Zhang, Jingkuan Song, Xianglong Liu, and Heng Tao Shen. Patch-wise attack for fooling deep neural network. In ECCV, 2020.
|
| 253 |
+
[13] Nathan Inkawhich, Wei Wen, Hai Helen Li, and Yiran Chen. Feature space perturbations yield more transferable adversarial examples. In CVPR, 2019.
|
| 254 |
+
[14] Nathan Inkawhich, Kevin Liang, Lawrence Carin, and Yiran Chen. Transferable perturbations of deep feature distributions. In ICLR, 2020.
|
| 255 |
+
[15] Nathan Inkawhich, Kevin J Liang, Binghui Wang, Matthew Inkawhich, Lawrence Carin, and Yiran Chen. Perturbing across the feature hierarchy to improve standard and strict blackbox attack transferability. In NeurIPS, 2020.
|
| 256 |
+
[16] Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli. On generating transferable targeted perturbations. In ICCV, 2021.
|
| 257 |
+
[17] Omid Poursaeed, Isay Katsman, Bicheng Gao, and Serge Belongie. Generative adversarial perturbations. In CVPR, 2018.
|
| 258 |
+
[18] Chaoning Zhang, Philipp Benz, Tooba Imtiaz, and In So Kweon. Understanding adversarial examples from the mutual influence of images and perturbations. In CVPR, 2020.
|
| 259 |
+
[19] Philipp Benz, Chaoning Zhang, Tooba Imtiaz, and In So Kweon. Double targeted universal adversarial perturbations. In ACCV, 2020.
|
| 260 |
+
[20] Maosen Li, Cheng Deng, Tengjiao Li, Junchi Yan, Xinbo Gao, and Heng Huang. Towards transferable targeted attack. In CVPR, 2020.
|
| 261 |
+
[21] Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. In ICLR, 2017.
|
| 262 |
+
[22] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 263 |
+
[23] Jer´ ome Rony, Luiz G. Hafemann, Luiz S. Oliveira, Ismail Ben Ayed, Robert Sabourin, and Eric ˆ Granger. Decoupling direction and norm for efficient gradient-based $L _ { 2 }$ adversarial attacks and defenses. In CVPR, 2019.
|
| 264 |
+
[24] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In CVPR, 2017.
|
| 265 |
+
[25] Konda Reddy Mopuri, Phani Krishna Uppala, and R Venkatesh Babu. Ask, acquire, and attack: Data-free UAP generation using class impressions. In ECCV, 2018.
|
| 266 |
+
[26] Konda Reddy Mopuri, Aditya Ganeshan, and R Venkatesh Babu. Generalizable data-free objective for crafting universal adversarial perturbations. IEEE TPAMI, 41(10):2452–2465, 2018.
|
| 267 |
+
[27] Muzammal Naseer, Salman H Khan, Harris Khan, Fahad Shahbaz Khan, and Fatih Porikli. Cross-domain transferability of adversarial perturbations. In NeurIPS, 2019.
|
| 268 |
+
[28] Yingwei Li, Song Bai, Cihang Xie, Zhenyu Liao, Xiaohui Shen, and Alan L Yuille. Regional homogeneity: Towards learning transferable universal adversarial perturbations against defenses. In ECCV, 2020.
|
| 269 |
+
[29] Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, Aleksander Madry, and Alexey Kurakin. On evaluating adversarial robustness. In arXiv preprint arXiv:1902.06705, 2019.
|
| 270 |
+
[30] Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. In NeurIPS, 2020.
|
| 271 |
+
[31] Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018.
|
| 272 |
+
[32] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE S&P, 2017.
|
| 273 |
+
[33] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 274 |
+
[34] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, 2017.
|
| 275 |
+
[35] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 276 |
+
[36] Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
|
| 277 |
+
[37] Dongxian Wu, Yisen Wang, Shu-Tao Xia, James Bailey, and Xingjun Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. In ICLR, 2020.
|
| 278 |
+
[38] Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick \` McDaniel. Ensemble adversarial training: Attacks and defenses. In ICLR, 2018.
|
| 279 |
+
[39] Pin-Yu Chen, Huan Zhang, Yash Sharma, Jinfeng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In AISec, 2017.
|
| 280 |
+
[40] Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In ICLR, 2018.
|
| 281 |
+
[41] Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In ICML, 2018.
|
| 282 |
+
[42] Valeriia Cherepanova, Micah Goldblum, Harrison Foley, Shiyuan Duan, John Dickerson, Gavin Taylor, and Tom Goldstein. LowKey: Leveraging adversarial attacks to protect social media users from facial recognition. In ICLR, 2021.
|
| 283 |
+
[43] Arezoo Rajabi, Rakesh B Bobba, Mike Rosulek, Charles Wright, and Wu-chi Feng. On the (im) practicality of adversarial perturbation for image privacy. PoPETs, 2021.
|
| 284 |
+
[44] Shawn Shan, Emily Wenger, Jiayun Zhang, Huiying Li, Haitao Zheng, and Ben Y Zhao. Fawkes: Protecting privacy against unauthorized deep learning models. In USENIX Security, 2020.
|
| 285 |
+
[45] Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Logan Engstrom, Brandon Tran, and Aleksander Madry. Adversarial examples are not bugs, they are features. In NeurIPS, 2019.
|
| 286 |
+
[46] Martha Larson, Zhuoran Liu, Simon Brugman, and Zhengyu Zhao. Pixel privacy: Increasing image appeal while blocking automatic inference of sensitive scene information. In MediaEval Multimedia Benchmark Workshop, 2018.
|
| 287 |
+
[47] Zhuoran Liu, Zhengyu Zhao, and Martha Larson. Who’s afraid of adversarial queries? the impact of image modifications on content-based image retrieval. In ICMR, 2019.
|
| 288 |
+
[48] Seong Joon Oh, Mario Fritz, and Bernt Schiele. Adversarial image perturbation for privacy protection a game theory perspective. In ICCV, 2017.
|
| 289 |
+
|
| 290 |
+
# Checklist
|
| 291 |
+
|
| 292 |
+
1. For all authors...
|
| 293 |
+
|
| 294 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 295 |
+
(b) Did you describe the limitations of your work? [Yes] We described the limitation in the first sentence of the final section.
|
| 296 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We discuss them at the end of the final section.
|
| 297 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 298 |
+
|
| 299 |
+
2. If you are including theoretical results...
|
| 300 |
+
|
| 301 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 302 |
+
|
| 303 |
+
3. If you ran experiments...
|
| 304 |
+
|
| 305 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The code (including instructions and a link to data we have used) has been submitted as the supplemental material.
|
| 306 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Our experiments did not involve any model training, but all the algorithm details were specified.
|
| 307 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We fixed the random seed for all the experiments. Now the main randomness comes from the $p$ in the existing method, DI (see Eq. 6). We confirm that it has little impact on the results.
|
| 308 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We mentioned the run time of the attacks and our hardware settings in Section 4.
|
| 309 |
+
|
| 310 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 311 |
+
|
| 312 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] In Section 4.
|
| 313 |
+
(b) Did you mention the license of the assets? [Yes] In a footnote of Section 4.
|
| 314 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] We did not use any new assets.
|
| 315 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] In the same footnote as above.
|
| 316 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] In the same footnote as above.
|
| 317 |
+
|
| 318 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 319 |
+
|
| 320 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 321 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 322 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/MNVjrDpu6Yo/MNVjrDpu6Yo.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sparse Training via Boosting Pruning Plasticity with Neuroregeneration
|
| 2 |
+
|
| 3 |
+
Shiwei Liu1∗, Tianlong Chen2, Xiaohan Chen2, Zahra Atashgahi3, $\mathbf { L u \ Y i n ^ { 1 } }$ , Huanyu $\mathbf { K o u } ^ { 4 }$ , Li Shen5, Mykola Pechenizkiy1,6, Zhangyang Wang2, Decebal Constantin Mocanu1,3 1Eindhoven University of Technology, 2University of Texas at Austin 3University of Twente,4University of Leeds, $^ 5 \mathrm { J D }$ Explore Academy, 6University of Jyväskylä {s.liu3,l.yin,m.pechenizkiy}@tue.nl, {tianlong.chen,xiaohan.chen,atlaswang}@utexas.edu {z.atashgahi,d.c.mocanu}@utwente.nl, {khydouble1,mathshenli}@gmail.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Works on lottery ticket hypothesis (LTH) and single-shot network pruning (SNIP) have raised a lot of attention currently on post-training pruning (iterative magnitude pruning), and before-training pruning (pruning at initialization). The former method suffers from an extremely large computation cost and the latter usually struggles with insufficient performance. In comparison, during-training pruning, a class of pruning methods that simultaneously enjoys the training/inference efficiency and the comparable performance, temporarily, has been less explored. To better understand during-training pruning, we quantitatively study the effect of pruning throughout training from the perspective of pruning plasticity (the ability of the pruned networks to recover the original performance). Pruning plasticity can help explain several other empirical observations about neural network pruning in literature. We further find that pruning plasticity can be substantially improved by injecting a brain-inspired mechanism called neuroregeneration, i.e., to regenerate the same number of connections as pruned. We design a novel gradual magnitude pruning (GMP) method, named gradual pruning with zerocost neuroregeneration (GraNet), that advances state of the art. Perhaps most impressively, its sparse-to-sparse version for the first time boosts the sparse-tosparse training performance over various dense-to-sparse methods with ResNet50 on ImageNet without extending the training time. We release all codes in https://github.com/Shiweiliuiiiiiii/GraNet.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Neural network pruning is the most common technique to reduce the parameter count, storage requirements, and computational costs of modern neural network architectures. Recently, posttraining pruning [49, 29, 18, 47, 10, 54, 74, 5, 57, 75] and before-training pruning [31, 30, 67, 63, 6, 11] have been two fast-rising fields, boosted by lottery tickets hypothesis (LTH) [10] and singleshot network pruning (SNIP) [31]. The process of post-training pruning typically involves fully pre-training a dense network as well as many cycles of retraining (either fine-tuning [18, 17, 39] or rewinding [12, 54]). As the training costs of the state-of-the-art models, e.g., GPT-3 [4] and FixEfficientNet-L2 [64] have exploded, this process can lead to a large amount of overhead cost.
|
| 12 |
+
|
| 13 |
+
Recently emerged methods for pruning at initialization significantly reduce the training cost by identifying a trainable sub-network before the main training process. While promising, the existing methods fail to match the performance achieved by the magnitude pruning after training [11].
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Schematic view of GraNet. Left: Gradual pruning starts with a sparse subnetwork and gradually prune the subnetwork to the target sparsity during training. Right: We perform zero-cost neuroregeneration after each gradual pruning step. Light blue blocks/lines refer to the “damaged” connections and orange blocks/lines refer to the regenerated new connections.
|
| 17 |
+
|
| 18 |
+
Compared with the above-mentioned two classes of pruning, during-training pruning is a class of methods that reap the acceleration benefits of sparsity early on the training and meanwhile achieve promising performance by consulting the information obtained during training. There are some works [77, 13, 33] attempting to gradually prune the network to the desired sparsity during training, while they mainly focus on the performance improvement. Up to now, the understanding of duringtraining pruning has been less explored due to its more complicated dynamical process, and the performance gap still exists between pruning during training and full dense training.
|
| 19 |
+
|
| 20 |
+
To better understand the effect of pruning during the optimization process (not at inference), we study the ability of the pruned models to recover the original performance after a short continued training with the current learning rate, which we call pruning plasticity (see Section 3.1 for a more formal definition). Inspired by the neuroregeneration mechanism in the nervous system where new neurons and connections are synthesized to recover the damage in the nervous system [26, 41, 73], we examine if allowing the pruned network to regenerate new connections can improve pruning plasticity, and hence contribute to pruning during training. We consequently propose a parameter-efficient method to regenerate new connections during the gradual pruning process. Different from the existing works for pruning understanding which mainly focus on dense-to-sparse training [42] (training a dense model and prune it to the target sparsity), we also consider sparse-to-sparse training (training a sparse model yet adaptively re-creating the sparsity pattern) which recently has received an upsurge of interest in machine learning [44, 3, 9, 48, 8, 37, 36].
|
| 21 |
+
|
| 22 |
+
In short, we have the following main findings during the course of the study:
|
| 23 |
+
|
| 24 |
+
#1. Both pruning rate and learning rate matter for pruning plasticity. When pruned with low pruning rates (e.g., 0.2), both dense-to-sparse training and sparse-to-sparse training can easily recover from pruning. On the contrary, if too many parameters are removed at one time, almost all models suffer from accuracy drops. This finding makes a connection to the success of the iterative magnitude pruning [10, 54, 5, 6, 65], where usually a pruning process with a small pruning rate (e.g., 0.2) needs to be iteratively repeated for good performance.
|
| 25 |
+
|
| 26 |
+
Pruning plasticity also gradually decreases as the learning rate drops. When pruning happens during the training phase with large learning rates, models can easily recover from pruning (up to a certain level). However, pruning plasticity drops significantly after the second learning rate decay, leading to a situation where the pruned networks can not recover with continued training. This finding helps to explain several observations (1) for gradual magnitude pruning (GMP), it is always optimal to end pruning before the second learning rate drop [77, 13]; (2) dynamic sparse training (DST) benefits from a monotonically decreasing pruning rate with cosine or linear update schedule [8, 9]; (3) rewinding techniques [12, 54] outperform fine-tuning as rewinding retrains subnetworks with the original learning rate schedule whereas fine-tuning often retrains with the smallest learning rate.
|
| 27 |
+
|
| 28 |
+
#2. Neuroregeneration improves pruning plasticity. Neuroregeneration [41, 73] refers to the regrowth or repair of nervous tissues, cells, or cell products. Conceptually, it involves synthesizing new neurons, glia, axons, myelin, or synapses, providing extra resources in the long term to replace those damaged by the injury, and achieving a lasting functional recovery. Such mechanism is closely related to the brain plasticity [51], and we borrow this concept to developing a computational regime.
|
| 29 |
+
|
| 30 |
+
We show that, while regenerating the same number of connections as pruned, the pruning plasticity is observed to improve remarkably, indicating a more neuroplastic model being developed. However, it increases memory and computational overheads and seems to contradict the benefits of pruningduring-training. This however raises the question: can we achieve efficient neuroregeneration during training with no extra costs? We provide an affirmative answer to this question.
|
| 31 |
+
|
| 32 |
+
#3. Pruning plasticity with neuroregeneration can be leveraged to substantially boost sparse training performance. The above-mentioned findings of pruning plasticity can generalize to the final performance level under a full continued training to the end. Imitating the neuroregeneration behavior [41, 73], we propose a new sparse training method – gradual pruning with zero-cost neuroregeneration (GraNet), which is capable of performing regeneration without increasing the parameter count.
|
| 33 |
+
|
| 34 |
+
In experiments, GraNet establishes the new state-of-the-art performance bar for dense-to-sparse training and sparse-to-sparse training, respectively. Particularly, the latter for the first time boosts the sparse-to-sparse training performance over various dense-to-sparse methods by a large margin without extending the training time, with ResNet-50 on ImageNet. Besides the consistent performance improvement, we find the subnetworks that GraNet learns are more accurate than the ones learned by the existing gradual pruning method, providing explanations for the success of GraNet.
|
| 35 |
+
|
| 36 |
+
# 2 Related Work
|
| 37 |
+
|
| 38 |
+
Post-Training Pruning. Methods that yield a sparse neural network from a pre-trained network by pruning the unimportant weights or neurons, to the best of our knowledge, were proposed in [24] and [50]. After that, various pruning methods have emerged to provide increasingly efficient methods to identify sparse neural networks for inference. The pruning criterion includes weight magnitude [18, 10], gradient [61] Hessian [29, 19, 59], Taylor expansion [47, 46], etc. Low-rank decomposition [7, 23, 17, 71] are also used to induce structured sparsity in terms of channels or filters. Most of the above-mentioned pruning methods require many pruning and re-training cycles to achieve the desired performance.
|
| 39 |
+
|
| 40 |
+
During-Training Pruning. Instead of inheriting weights from a pre-trained model, some works attempt to discover well-performing sparse neural networks with one single training process.
|
| 41 |
+
|
| 42 |
+
Gradual Magnitude Pruning (GMP), introduced in [77] and studied further in [13], gradually sparsifies the neural network during the training process until the desired sparsity is reached. Besides, [40] and [68] are prior works that enforce the network to sparse during training via $L _ { 0 }$ and $L _ { 1 }$ regularization, respectively. [60, 34, 55, 70, 28] moved further by introducing trainable sparsity heuristics to learn the sparse masks and weights simultaneously. These methods are all classified as dense-to-sparse training as they start from a dense network.
|
| 43 |
+
|
| 44 |
+
Dynamic Sparse Training (DST) [44, 3, 48, 8, 9, 36, 35, 25] is another class of methods that prune models during training. The key factor of DST is that it starts from a random initialized sparse network and optimizes the sparse topology as well as the weights simultaneously during training (sparse-to-sparse training). Without an extended training time [37], sparse-to-sparse training usually falls short of dense-to-sparse training in terms of the prediction accuracy. For further details, see the survey of [43, 21].
|
| 45 |
+
|
| 46 |
+
Before-Training Pruning. Motivated by SNIP [31], many works [67, 63, 6] have emerged recently to explore the possibility of obtaining a trainable sparse neural network before the main training process. [11] demonstrates that the existing methods for pruning at initialization perform equally well when the unpruned weights are randomly shuffled, which reveals that what these methods discover is the layer-wise sparsity ratio, rather than the indispensable weight values and positions. Our analysis shows that both the mask positions and weight values are crucial for GraNet.
|
| 47 |
+
|
| 48 |
+
# 3 Methodology for Pruning Plasticity
|
| 49 |
+
|
| 50 |
+
The primary goal of this paper is to study the effect of pruning as well as neuroregeneration on neural networks during the standard training process. Therefore, we do not consider post-training pruning and before-training pruning. Below, we introduce in detail the definition of pruning plasticity and the experimental design that we used to study pruning plasticity.
|
| 51 |
+
|
| 52 |
+
# 3.1 Metrics
|
| 53 |
+
|
| 54 |
+
Let us denote $W _ { t } \in \mathbb { R } ^ { d }$ as the weights of the network and $m _ { t } \in \{ 0 , 1 \} ^ { d }$ as the binary mask yielded from the pruning method at epoch $t$ . Thus, the pruned network can be denoted as $W _ { t } \odot m _ { t }$ . Let $T$ be the total number of epochs the model should be trained. Let $\mathbf { C O N T R A I N } ^ { k } ( W _ { t } \odot m _ { t } , a )$ refers to the function that continues to train the pruned model for $k$ epochs with the learning rate schedule $a$ .
|
| 55 |
+
|
| 56 |
+
Definition of Pruning plasticity. We define pruning plasticity as $t _ { \mathrm { C O N T R A I N } ^ { k } ( W _ { t } \odot m _ { t } , a _ { t } ) } - t _ { \mathrm { P R E } }$ , where $t _ { \mathrm { P R E } }$ is the test accuracy measured before pruning and $t _ { \mathrm { C O N T R A I N } ^ { k } \left( W _ { t } \odot m _ { t } , a _ { t } \right) }$ is the test accuracy measured after $k$ epoch of continued training $\mathbf { C O N T R A I N } ^ { k } ( W _ { t } \odot m _ { t } , a _ { t } )$ . Specifically, to better understand the effect of pruning on the current model status and to avoid the effect of learning rate decay, we fix the learning rate as the one when the model is pruned, i.e, $a _ { t }$ . This setting is also appealing to GMP [77, 13] and DST [44, 9, 48, 37] in which most of the pruned models are continually trained with the current learning rate for some time.
|
| 57 |
+
|
| 58 |
+
Final performance gap. Nevertheless, we also investigate the effect of pruning on the final performance, that is, continually training the pruned networks to the end with the remaining learning rate schedule CONTRAINT −t(Wt mt, a[t+1:T ]). In this case, we report tCONTRAINT−t(Wtmt,a[t+1:T]) − $t _ { \mathrm { F I N A L } }$ , where $t _ { \mathrm { F I N A L } }$ is the final test accuracy of the unpruned models.
|
| 59 |
+
|
| 60 |
+
# 3.2 Architectures and Datasets
|
| 61 |
+
|
| 62 |
+
We choose two commonly used architectures to study pruning plasticity, VGG-19 [58] with batch normalization on CIFAR-10 [27], and ResNet-20 [20] on CIFAR-10.
|
| 63 |
+
|
| 64 |
+
We share the summary of the networks, data, and hyperparameters of dense-to-sparse training in Table 1. We use standard implementations and hyperparameters available online, with the exception of the small batch size for the ResNet-50 on ImageNet due to the limited hardware resources $( 2 \times$ Tesla V100). All accuracies are in line with the baselines reported in the references [8, 11, 67, 9, 37].
|
| 65 |
+
|
| 66 |
+
Table 1: Summary of the architectures and hyperparameters we study in this paper.
|
| 67 |
+
|
| 68 |
+
<table><tr><td>Model</td><td>Data</td><td>#Epoch</td><td>Batch Size</td><td>LR</td><td>LR Decay, Epoch</td><td>Weight Decay</td><td>Test Accuracy</td></tr><tr><td>ResNet-20</td><td>CIFAR-10</td><td>160</td><td>128</td><td>0.1(β= 0.9)</td><td>10×,[80,120]</td><td>0.0005</td><td>92.41±0.04</td></tr><tr><td rowspan="2">VGG-19</td><td>CIFAR-10</td><td>160</td><td>128</td><td>0.1(β=0.9)</td><td>10×,[80,120]</td><td>0.0005</td><td>93.85±0.05</td></tr><tr><td>CIFAR-100</td><td>160</td><td>128</td><td>0.1 (β=0.9)</td><td>10×,[80,120]</td><td>0.0005</td><td>73.43±0.08</td></tr><tr><td rowspan="3">ResNet-50</td><td>CIFAR-10</td><td>160</td><td>128</td><td>0.1(β=0.9)</td><td>10×,[80,120]</td><td>0.0005</td><td>94.75±0.01</td></tr><tr><td>CIFAR-100</td><td>160</td><td>128</td><td>0.1 (β=0.9)</td><td>10×,[80,120]</td><td>0.0005</td><td>78.23±0.18</td></tr><tr><td>ImageNet</td><td>100</td><td>64</td><td>0.1(β=0.9)</td><td>10×,[30,60,90]</td><td>0.0004</td><td>76.80±0.09</td></tr></table>
|
| 69 |
+
|
| 70 |
+
# 3.3 How to Prune, and How to Regenerate
|
| 71 |
+
|
| 72 |
+
Structured and Unstructured Pruning. We consider unstructured and structured pruning in this paper. Structured pruning prunes weights in groups, or removes the entire neurons, convolutional filters, or channels, enabling acceleration with the off-the-shelf hardware. In particular, we choose the filter pruning method used in Li et al. [32]. Unstructured sparsity is a more promising direction not only due to its outstanding performance at extreme sparsities but the increasing support for sparse operation in the practical hardware [35, 14, 52, 76, 22]. For example, Liu et al. [35] illustrated for the first time the true potential of DST, demonstrating significant training/inference efficiency improvement over the dense training. Different from prior conventions [77, 13, 33, 2] where values of the pruned weights are kept, we set the pruned weights to zero to eliminate the historical information for all implementations in this paper.
|
| 73 |
+
|
| 74 |
+
Magnitude pruning. We prune the weights with the smallest magnitude, as it has evolved as the standard method when pruning happens during training, e.g., GMP [77, 13] and DST [44, 9, 37]. We are also aware of other pruning criteria including but not limited to Hessian [29, 19, 59], Taylor expansion [47, 46], connection sensitivity [31], Gradient Flow [67], Neural Tangent Kernel [38, 16].
|
| 75 |
+
|
| 76 |
+
One-shot pruning. To isolate the pruning effect at different training stages and to avoid the interaction between two iterations of pruning, we focus on one-shot pruning. Please note that iterative pruning can also be generalized in our setting, as our experimental design includes neural networks trained at various sparsities and each of them is further pruned with various pruning rates.
|
| 77 |
+
|
| 78 |
+
Layer-wise pruning and global pruning. We study both the layer-wise magnitude pruning and global magnitude pruning for pruning plasticity. Global magnitude pruning prunes different layers together and leads to non-uniform sparsity distributions; layer-wise pruning operates layer by layer, resulting in uniform distributions.
|
| 79 |
+
|
| 80 |
+
Gradient-based regeneration. The simplest regeneration scheme is to randomly activate new connections [3, 44]. However, it would take a lot of time for random regeneration to discover the important connections, especially for the very extreme sparsities. Alternatively, gradients, including those for the connections with zero weights, provide good indicators for the connection importance. For this reason, we focus on gradient-based regeneration proposed in Rigged Lottery ( RigL) [9], i.e., regenerating the same number of connections as pruned with the largest gradient magnitude.
|
| 81 |
+
|
| 82 |
+
# 3.4 Experimental Results
|
| 83 |
+
|
| 84 |
+
We study pruning plasticity during training with/without regeneration, for both dense training and sparse training. We report the results of ResNet-20 on CIFAR-10 with unstructured global pruning in the main body of the paper. The rest of the experiments are given in Appendix A. Unless otherwise stated, results are qualitatively similar across all networks. Concretely, we first pre-train networks at four sparsity levels, including 0, 0.5, 0.9, and 0.98. The sparse neural networks are trained with uniform distribution (i.e., all layers have the same sparsity). We further choose four pruning rates, e.g., 0.2, 0.5, 0.9, and 0.98, to measure the corresponding pruning plasticity of the pre-trained networks.
|
| 85 |
+
|
| 86 |
+
Pruning plasticity. We continue to train the pruned model for 30 epochs and report pruning plasticity in Figure 2. Overall, the learning rate schedule, the pruning rate, and the sparsity of the original models all have a big impact on pruning plasticity. Pruning plasticity decreases as the learning rate decays for all models with different sparsity levels. The models trained with a large learning rate 0.1 can easily recover, or exceed the original performance except for the extremely large pruning rate 0.98. However, the models obtained during the later training phases can recover only with the mild pruning rate choices, e.g., 0.2 (orange lines) and 0.5 (green lines).
|
| 87 |
+
|
| 88 |
+
We next demonstrate the effect of connection regeneration on pruning plasticity in the bottom row of Figure 2. It is clear to see that connection regeneration significantly improves pruning plasticity of all the cases, especially for the models that are over-pruned (purple lines). Still, even with connection regeneration, pruning plasticity suffers from performance degradation when pruning occurs after the learning rate drops.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Unstructured Pruning: Pruning plasticity (see Section 3.1 for definition) under a 30- epoch continued training with and without connection regeneration for ResNet-20 on CIFAR-10. The vertical red lines refer to the points when the learning rate is decayed. “Pre-trained Sparsity” refers to the original sparsity of the pre-trained networks before pruning. The pruning method is the magnitude global pruning.
|
| 92 |
+
|
| 93 |
+
Final performance gap. Compared with the current model status, people might be more interested in the effect of pruning on the final performance. We further measure the performance gap between the original test accuracy of the unpruned models and the final test accuracy of the pruned model under a full continued training $\mathrm { C O N T R A I N } ^ { T - t } ( W _ { t } \odot m _ { t } , a _ { [ t + 1 : T ] } )$ in Figure 3.
|
| 94 |
+
|
| 95 |
+
We observe that, in this case, large learning rates do not enjoy large performance improvement, but still, the performance gap increases as the learning rate drops. It is reasonable to conjecture that the accuracy improvement of pruning plasticity with the large learning rate, 0.1, is due to the unconverged performance during the early phase of training. Besides, it is surprising to find that the final performance of extreme sparse networks (e.g., the third column and the fourth column) significantly benefits from mild pruning. Again, the ability of the pruned model to recover from pruning remarkably improves after regenerating the connections back.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 3: Unstructured Pruning: Final performance gap between the unpruned models and the pruned models for ResNet-20 on CIFAR-10. The vertical red lines refer to the points when the learning rate is decayed. “Pre-trained Sparsity” refers to the original sparsity of the pre-trained networks before pruning. The pruning method is the magnitude global pruning.
|
| 99 |
+
|
| 100 |
+
# 4 Gradual Pruning with Zero-Cost Neuroregeneration
|
| 101 |
+
|
| 102 |
+
So far, we have known that regenerating the important connections to the pruned models during training substantially improves pruning plasticity as well as the final performance. However, naively regenerating extra connections increases the parameter count and conflicts with the motivation of gradual pruning.
|
| 103 |
+
|
| 104 |
+
Inspired by the mechanism of neuroregeneration in the nervous system, we propose a novel sparse training method which we call gradual pruning with zero-cost neuroregeneration (GraNet). GraNet consults the information produced throughout training and regenerates important connections during training in a parameter-efficient fashion. See Appendix B.1 for the pseudocode of GraNet. We introduce the main components of GraNet below.
|
| 105 |
+
|
| 106 |
+
# 4.1 Gradual Pruning
|
| 107 |
+
|
| 108 |
+
We follow the gradual pruning scheme used in [77] and gradually sparsifies the dense network to the target sparsity level over $n$ pruning iterations. Let us define $s _ { i }$ is the initial sparsity, $s _ { f }$ is the target sparsity, $t _ { 0 }$ is is the starting epoch of gradual pruning, $t _ { f }$ is the end epoch of gradual pruning, and $\Delta t$ is the pruning frequency. The pruning rate of each pruning iteration is:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
s _ { t } = s _ { f } + ( s _ { i } - s _ { f } ) \left( 1 - \frac { t - t _ { 0 } } { n \Delta t } \right) ^ { 3 } , t \in \left\{ t _ { 0 } , t _ { 0 } + \Delta t , . . . , t _ { 0 } + n \Delta t \right\} .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We choose global pruning for our method as it generally achieves better performance than uniform pruning. We also report the performance of the uniform sparsity as used in [13] in Appendix C.3.
|
| 115 |
+
|
| 116 |
+
The conventional gradual pruning methods [77, 13] change the mask (not the weight values) to fulfill the pruning operation, so that the pruned connections have the possibility to be reactivated in the later training phases. Despite this, since the weights of the pruned connections are not updated, they have a small chance to receive sufficient updates to exceed the pruning threshold. This hinders the regeneration of the important connections.
|
| 117 |
+
|
| 118 |
+
# 4.2 Zero-Cost Neuroregeneration
|
| 119 |
+
|
| 120 |
+
The main difference between GraNet and the conventional GMP methods [77, 13] is the Zero-Cost Neuroregeneration. Imitating the neuroregeneration of the peripheral nervous system [41, 73] where new neurons and connections are synthesized to replace the damaged ones, we first detect and eliminate the “damaged” connections, and then regenerate the same number of new connections. By doing this, we can achieve connection regeneration without increasing the number of connections.
|
| 121 |
+
|
| 122 |
+
Concretely, we identify the “damaged” connections as the ones with the smallest weight magnitudes. Small magnitude indicates that either the weight’s gradient is small or a large number of oscillations occur to the gradient direction. Therefore, these weights have a small contribution to the training loss and can be removed. Again, we use the gradient as the importance score for regeneration, same as the regrow method as used in RigL [9].
|
| 123 |
+
|
| 124 |
+
Why we call it “Zero-Cost Neuroregeneration"? In addition to not increasing the connection (parameter) count, the backward pass of our method is sparse most of the time even though our regeneration utilizes the dense gradient to identify the important connections. We perform neuroregeneration immediately after each gradual pruning step, meaning that the regeneration occurs only once every several thousand iterations. The extra overhead to calculate the dense gradient can be amortized compared with the whole training costs. Compared with the methods [33, 69] that require updating all the weights in the backward pass, our method is much more training efficient, as around 2/3 of the training FLOPs is owing to the backward pass [9, 72].
|
| 125 |
+
|
| 126 |
+
Let us denote $r$ as the ratio of the number of the regenerated connections to the total number of connections; $W$ is the network weight. We first remove $r$ proportion of “damaged” weights with the smallest magnitude by:
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
W ^ { \prime } = \mathrm { T o p K } \left( | W | , 1 - r \right) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Here $\mathrm { T o p K } ( v , k )$ returns the weight tensor retaining the top $k$ -proportion of elements from $v$ . Immediately after that, we regenerate $r$ proportion of new connections based on the gradient magnitude:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
W = W ^ { \prime } + \mathrm { T o p K } \left( | \mathbf { g } _ { i \notin W ^ { \prime } } | , r \right) ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\left| { \bf g } _ { i \notin W ^ { \prime } } \right|$ are the gradient magnitude of the zero weights. We perform Zero-Cost Neuroregeneration layer by layer from the beginning of the training to the end.
|
| 139 |
+
|
| 140 |
+
GraNet can naturally generalize to the dense-to-sparse training scenario and the sparse-to-sparse training scenario by setting the initial sparsity level $s _ { i } = 0$ and $s _ { i } > 0$ in Eq. (1), respectively. For simplicity, we set $s _ { i } = 0 . 5$ , $t _ { 0 } = 0$ , and $t _ { f }$ as the epoch when performing the first learning rate decay for the sparse-to-sparse training. Different from the existing sparse-to-sparse training methods, i.e., SET [44], RigL [9], and ITOP [37], in which the sparsity is fixed throughout training, GraNet starts from a denser yet still sparse model and gradually prunes the sparse model to the desired sparsity. Although starting with more parameters, the global pruning technique of gradual pruning helps GraNet quickly evolve to a better sparsity distribution than RigL with lower feedforward FLOPs and higher test accuracy. What’s more, GraNet sparsifies all layers including the first convolutional layer and the last fully-connected layer.
|
| 141 |
+
|
| 142 |
+
# 4.3 Experimental Results
|
| 143 |
+
|
| 144 |
+
We conduct various experiments to evaluate the effectiveness of GraNet. We compare GraNet with various dense-to-sparse methods and sparse-to-sparse methods. The results of Rigged Lottery (RigL) and GMP with CIFAR-10/100 were reproduced by our implementation with PyTorch so that the only difference between GraNet and GMP is the Zero-Cost Neuroregeneration. For each model, we divide the results into three groups from top to bottom: pruning at initialization, dynamic sparse training and dense-to-sparse methods. See Appendix B for more implementation details used in the experiments. GraNet $\mathit { s } _ { i } = 0 . 5$ ) refers to the sparse-to-sparse version and the and GraNet ${ \bf \nabla } _ { s _ { i } } = 0$ ) refers to the dense-to-sparse version.
|
| 145 |
+
|
| 146 |
+
CIFAR-10/100. The results of CIFAR-10/100 are shared in Table 2. We can observe that performance differences among different methods on CIFAR-10 are generally small, but still, GraNet ${ \bf \Phi } _ { s _ { i } } = 0 $ ) consistently improves the performance over GMP except for the sparsity $9 5 \%$ , and achieves the highest accuracy in 4 out of 6 cases. In terms of the more complex data CIFAR-100, the performance differences between the during-training pruning methods and before-training pruning methods are much larger. GraNet $( s _ { i } = 0$ ) again consistently outperforms GMP with all sparsities, highlighting the benefits of Zero-Cost Neuroregeneration. It is maybe more interesting that GraNet ${ \bf \nabla } _ { s _ { i } } = 0$ ) even outperforms the post-training method, subdifferential inclusion for sparsity (SIS), by a large margin.
|
| 147 |
+
|
| 148 |
+
In terms of sparse-to-sparse training, our proposed GraNet ( $s _ { i } = 0 . 5$ ) has a dominant performance over other methods. Especially at the very extreme sparsity 0.98, our method outperforms RigL by $1 . 4 0 \%$ and $2 . 2 2 \%$ with VGG-19 on CIFAR-10 and CIFAR-100, respectively.
|
| 149 |
+
|
| 150 |
+
ImageNet. Due to the small data size, the experiments with CIFAR-10/100 may not be sufficient to draw a solid conclusion. We further evaluate our method with ResNet-50 on ImageNet in Table 3.
|
| 151 |
+
|
| 152 |
+
Table 2: Test accuracy of pruned VGG-19 and ResNet-50 on CIFAR-10/100. We mark the best sparse-to-sparse training results in blue and the best dense-to-sparse training results in bold. The results reported with (mean $\pm$ std) are run with three different random seeds by us. The rest are obtained from [66] and [67]. Note that the accuracy of RigL is higher than the ones reported in [66], as we choose a large update interval following the In-Time Over-Parameterization strategy [37]. $s _ { i }$ refers to the initial sparsity of GraNet.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td></tr><tr><td>Pruning ratio</td><td>90%</td><td>95%</td><td>98%</td><td>90%</td><td>95%</td><td>98%</td></tr><tr><td>VGG-19 (Dense)</td><td>93.85±0.05</td><td>1</td><td>1</td><td>73.43±0.08</td><td>1</td><td>=</td></tr><tr><td>SNIP [31]</td><td>93.63</td><td>93.43</td><td>92.05</td><td>72.84</td><td>71.83</td><td>58.46</td></tr><tr><td>GraSP[67]</td><td>93.30</td><td>93.04</td><td>92.19</td><td>71.95</td><td>71.23</td><td>68.90</td></tr><tr><td>SynFlow [63]</td><td>93.35</td><td>93.45</td><td>92.24</td><td>71.77</td><td>71.72</td><td>70.94</td></tr><tr><td>Deep-R [3]</td><td>90.81</td><td>89.59</td><td>86.77</td><td>66.83</td><td>63.46</td><td>59.58</td></tr><tr><td>SET[44]</td><td>92.46</td><td>91.73</td><td>89.18</td><td>72.36</td><td>69.81</td><td>65.94</td></tr><tr><td>RigL[9]</td><td>93.38±0.11</td><td>93.06±0.09</td><td>91.98±0.09</td><td>73.13±0.28</td><td>72.14±0.15</td><td>69.82±0.09</td></tr><tr><td>GraNet (si= 0.5) (ours)</td><td>93.73±0.08</td><td>93.66±0.07</td><td>93.38±0.15</td><td>73.30±0.13</td><td>73.18±0.31</td><td>72.04±0.13</td></tr><tr><td>STR [28]</td><td>93.73</td><td>93.27</td><td>92.21</td><td>71.93</td><td>71.14</td><td>69.89</td></tr><tr><td>SIS [66]</td><td>93.99</td><td>93.31</td><td>93.16</td><td>72.06</td><td>71.85</td><td>71.17</td></tr><tr><td>GMP [13]</td><td>93.59±0.10</td><td>93.58±0.07</td><td>93.52±0.03</td><td>73.10±0.12</td><td>72.30±0.15</td><td>72.07±0.37</td></tr><tr><td>GraNet (si= O) (ours)</td><td>93.80±0.10</td><td>93.72±0.11</td><td>93.63±0.08</td><td>73.74±0.30</td><td>73.10±0.04</td><td>72.35±0.26</td></tr><tr><td>ResNet-50 (Dense)</td><td>94.75±0.01</td><td></td><td></td><td>78.23±0.18</td><td></td><td></td></tr><tr><td>SNIP [31]</td><td>92.65</td><td>90.86</td><td>87.21</td><td>73.14</td><td>69.25</td><td>58.43</td></tr><tr><td>GraSP [67]</td><td>92.47</td><td>91.32</td><td>88.77</td><td>73.28</td><td>70.29</td><td>62.12</td></tr><tr><td>SynFlow [63]</td><td>92.49</td><td>91.22</td><td>88.82</td><td>73.37</td><td>70.37</td><td>62.17</td></tr><tr><td>RigL [9]</td><td>94.45±0.43</td><td>93.86±0.25</td><td>93.26±0.22</td><td>76.50±0.33</td><td>76.03±0.34</td><td>75.06±0.27</td></tr><tr><td>GraNet (si= 0.5) (ours)</td><td>94.64±0.27</td><td>94.38±0.28</td><td>94.01±0.23</td><td>77.89±0.33</td><td>77.16±0.52</td><td>77.14±0.45</td></tr><tr><td>STR [28]</td><td>92.59</td><td>91.35</td><td>88.75</td><td>73.45</td><td>70.45</td><td>62.34</td></tr><tr><td>SIS [66]</td><td>92.81</td><td>91.69</td><td>90.11</td><td>73.81</td><td>70.62</td><td>62.75</td></tr><tr><td>GMP[13]</td><td>94.34±0.09</td><td>94.52±0.08</td><td>94.19±0.04</td><td>76.91±0.23</td><td>76.42±0.51</td><td>75.58±0.20</td></tr><tr><td>GraNet (si = O) (ours)</td><td>94.49±0.08</td><td>94.44±0.01</td><td>94.34±0.17</td><td>77.29±0.45</td><td>76.71±0.26</td><td>76.10±0.20</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 3: Test accuracy of pruned ResNet-50 on ImageNet dataset. The best results of DST methods are marked as blue and the best results of pruning during training methods are marked in bold. The training/test FLOPs are normalized with the FLOPs of a dense model. $s _ { i }$ refers to the initial sparsity of GraNet.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Method</td><td>Top-1 Accuracy</td><td>FLOPs (Train)</td><td>FLOPs (Test)</td><td>TOP-1 Accuracy</td><td>FLOPs (Train)</td><td>FLOPs (Test)</td></tr><tr><td>Dense</td><td>76.8±0.09</td><td>1x (3.2e18)</td><td>1x (8.2e9)</td><td>76.8±0.09</td><td>1x (3.2e18)</td><td>1x (8.2e9)</td></tr><tr><td>Pruning ratio</td><td></td><td>80%</td><td></td><td></td><td>90%</td><td></td></tr><tr><td rowspan="3">Static (ERK) Small-Dense</td><td>72.1±0.04</td><td>0.42×</td><td>0.42×</td><td>67.7±0.12</td><td>0.24×</td><td>0.24×</td></tr><tr><td>72.1±0.06</td><td>0.23×</td><td>0.23×</td><td>67.2±0.12</td><td>0.10×</td><td>0.10×</td></tr><tr><td>72.0±0.06</td><td>0.23×</td><td>0.23×</td><td>67.2±0.12</td><td>0.10×</td><td>0.10×</td></tr><tr><td rowspan="5">SET [44] DSR[48] RigL (ERK) [9]</td><td>72.9±0.39</td><td>0.23×</td><td>0.23×</td><td>69.6±0.23</td><td>0.10×</td><td>0.10×</td></tr><tr><td>73.3</td><td>0.40×</td><td>0.40×</td><td>71.6</td><td>0.30×</td><td>0.30×</td></tr><tr><td>75.1±0.05</td><td>0.42×</td><td>0.42×</td><td>73.0±0.04</td><td>0.25×</td><td>0.24×</td></tr><tr><td>75.2±0.11</td><td>0.61×</td><td>0.42×</td><td>72.9±0.06</td><td>0.50×</td><td>0.24×</td></tr><tr><td>76.0</td><td>0.37×</td><td>0.35×</td><td>74.5</td><td>0.25×</td><td>0.20×</td></tr><tr><td>STR [28]</td><td>76.1</td><td>n/a</td><td>0.17×</td><td>74.0</td><td>n/a</td><td>0.08×</td></tr><tr><td>DPF [33]</td><td>75.1</td><td>0.71×</td><td>0.23×</td><td>n/a</td><td>n/a</td><td>n/a</td></tr><tr><td>GMP[13]</td><td>75.6</td><td>0.56×</td><td>0.23×</td><td>73.9</td><td>0.51×</td><td>0.10×</td></tr><tr><td>GraNet (si = 0) (ours)</td><td>75.8</td><td>0.34×</td><td>0.28×</td><td>74.2</td><td>0.23×</td><td>0.16×</td></tr></table>
|
| 159 |
+
|
| 160 |
+
We only run this experiment once due to the limited resources. We set $t _ { 0 } = 0$ and $t _ { f } = 3 0$ for both GraNet $( s _ { i } = 0$ ) and GraNet ${ \mathit { s } } _ { i } = 0 . 5 { \mathit { \Sigma } }$ ) on ImageNet. Again, GraNet $( s _ { i } = 0$ ) outperforms GMP consistently with only half training FLOPs and achieves the highest accuracy among all the dense-to-sparse methods at sparsity of 0.9. Surprisingly, GraNet ${ \mathit { s } } _ { i } = 0 . 5 { \mathit { \Sigma } }$ ) significantly boosts the sparse-to-sparse training performance, even over the dense-to-sparse training. Concretely, GraNet
|
| 161 |
+
|
| 162 |
+
$s _ { i } = 0 . 5 )$ ) outperforms RigL by $0 . 9 \%$ and $1 . 5 \%$ at sparsity 0.8 and 0.9, respectively. To the best of our knowledge, this is the first time in the literature that sparse-to-sparse training reaches a test accuracy of $76 \%$ with ResNet-50 on ImageNet at sparsity 0.8, without extension of training time. It is reasonable for GraNet $\mathit { s } _ { i } = 0 . 5$ ) to achieve better accuracy than RigL, since the denser models at the beginning help GraNet explore more the parameter space. According to the In-Time Over-Parameterization hypothesis [37], the performance of sparse training methods is highly correlated with the total number of parameters that the sparse model has visited.
|
| 163 |
+
|
| 164 |
+
We further report the training/inference FLOPs required by all pruning methods. Compared with other dense-to-sparse methods, the final networks learned by GraNet $( s _ { i } = 0 )$ ) require more FLOPs to test, whereas the overall training FLOPs required by GraNet ${ { s } _ { i } } = 0$ ) are smaller than others. Even though starting from a denser model, GraNet $\mathit { s } _ { i } = 0 . 5$ ) requires less training and inference FLOPs than the state-of-the-art method, i.e., RigL. The sparsity budgets for 0.9 sparse ResNet-50 on ImageNet-1K learned by our methods are reported in Appendix D. We also report how FLOPs of the pruned ResNet-50 evolve during the course of training in Appendix E.
|
| 165 |
+
|
| 166 |
+
# 4.4 Effect of the Initial Sparsity
|
| 167 |
+
|
| 168 |
+
As we mentioned earlier, the denser initial network is the key factor in the success of GraNet. We conducted experiments to study the effect of the initial sparsity on GraNet with ResNet-50 on ImageNet. The initial sparsity is chosen from [0.0, 0.5, 0.6, 0.7, 0.8, 0.9] and the final sparsity is fixed as 0.9. The results are shared in Table 4. We can see the training FLOPs of GraNet are quite robust to the initial sparsity. Surprisingly yet reasonably, it seems that the the smaller the initial sparsity is (up to 0.5), the better final sparsity distribution GraNet finds, with higher test accuracy and fewer feedforward FLOPs. The lower feedforward FLOPs of the final network perfectly balance the overhead caused by the denser initial network.
|
| 169 |
+
|
| 170 |
+
Table 4: Effect of the initial sparsity on GraNet with ResNet-50 on ImageNet. The training/test FLOPs are normalized with the FLOPs of a dense model.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Method</td><td>Si</td><td>Sf</td><td>Top-1 [%] Accuracy</td><td>FLOPs (Train)</td><td>FLOPs (Test)</td></tr><tr><td>GraNet</td><td>0.0</td><td>0.9</td><td>74.2</td><td>0.23×</td><td>0.16×</td></tr><tr><td>GraNet</td><td>0.5</td><td>0.9</td><td>74.5</td><td>0.25×</td><td>0.20×</td></tr><tr><td>GraNet</td><td>0.6</td><td>0.9</td><td>74.4</td><td>0.25×</td><td>0.22×</td></tr><tr><td>GraNet</td><td>0.7</td><td>0.9</td><td>74.2</td><td>0.24×</td><td>0.22×</td></tr><tr><td>GraNet</td><td>0.8</td><td>0.9</td><td>74.1</td><td>0.25×</td><td>0.24×</td></tr><tr><td>RigL</td><td>0.9</td><td>0.9</td><td>73.0</td><td>0.25×</td><td>0.24×</td></tr></table>
|
| 173 |
+
|
| 174 |
+
# 4.5 Performance of GraNet at Extreme Sparsities
|
| 175 |
+
|
| 176 |
+
In this section, we share the results of GraNet and RigL at extreme sparsities. The initial sparsity is set as 0.5. When the final sparsity is relatively smaller (e.g., 0.8, 0.9), GraNet requires a lower (or the same) number of training FLOPs than RigL, whereas GraNet requires more training FLOPs than RigL when the final sparsity is extremely high (e.g., 0.95, 0.965). This makes sense since when the sparsity is extremely high, the saved FLOPs count of the distribution discovered by GraNet is too small to amortize the overhead caused by denser initial models. Yet, the increased number of training FLOPs of GraNet leads to substantial accuracy improvement $( > 2 \% )$ over RigL. The efficiency of GraNet ( $s _ { i } = 0 . 5$ ) comes from two important technical differences compared with RigL: (1) better final sparse distribution discovered by global pruning; (2) a shorter period of gradual pruning time (the first 30 epochs for ResNet-50 on ImageNet). Although starting with more parameters, the global pruning enables GraNet to quickly (first 30 epochs) evolve to a better sparsity distribution with lower test FLOPs than ERK. After 30 epochs of gradual pruning, the network continues to be trained with this better distribution for 70 epochs, so that the overhead in the early training phase with larger training FLOPs is amortized by the later and longer training phase with fewer training FLOPs.
|
| 177 |
+
|
| 178 |
+
Table 5: Comparison between GraNet and RigL at extreme sparsities with ResNet-50 on ImageNet. The training/test FLOPs are normalized with the FLOPs of a dense model.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Method</td><td>Si</td><td>sf</td><td>Top-1[%] Accuracy</td><td>FLOPs (Train)</td><td>FLOPs (Test)</td></tr><tr><td>RigL GraNet</td><td>0.8</td><td>0.8</td><td>75.1</td><td>0.42×</td><td>0.42×</td></tr><tr><td>RigL</td><td>0.5 0.9</td><td>0.8 0.9</td><td>76.0 73.0</td><td>0.37× 0.25×</td><td>0.35× 0.24×</td></tr><tr><td>GraNet</td><td>0.5</td><td>0.9</td><td>74.5</td><td>0.25×</td><td>0.20×</td></tr><tr><td>RigL GraNet</td><td>0.95 0.5</td><td>0.95 0.95</td><td>69.7 72.3</td><td>0.12× 0.17×</td><td>0.12× 0.12×</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RigL</td><td>0.965</td><td>0.965</td><td>67.2</td><td>0.11×</td><td>0.11×</td></tr><tr><td>GraNet</td><td>0.5</td><td>0.965</td><td>70.5</td><td>0.15×</td><td>0.09×</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 4.6 Ablation Study of Random Reinitialization
|
| 183 |
+
|
| 184 |
+
Next, we ask whether what GraNet learned are the specific sparse connectivity or the sparse connectivity together with the weight values. We randomly reinitialize the pruned network with the same mask and retrain it. The results are given in Figure 4. The performance of the reinitialized networks falls significantly short of the performance achieved by GraNet $( s _ { i } = 0 )$ ), indicating that what was learned by GraNet is the sparse connectivity together with the weight values. Besides, we find that the retraining performance of GraNet is higher than GMP. This further confirms that Zero-Cost Neuroregeneration helps the gradual pruning find more accurate mask positions.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 4: Reinitialization ablation on subnetworks discovered by GMP and GraNet $( s _ { i } = 0$
|
| 188 |
+
|
| 189 |
+
# 4.7 Comparison between Re-training and Extended Training
|
| 190 |
+
|
| 191 |
+
In this section, we study if re-training techniques can further improve the performance of the subnetworks discovered by GraNet. The authors of Lottery Ticket Hypothesis (LTH) [10] introduced a retraining technique, even if they did not evaluate it as such, where the subnetworks discovered by iterative magnitude pruning can be re-trained in isolation to full accuracy with the original initializations. Later on, learning rate rewinding (LRR) [54] was proposed further to improve the re-training performance by only rewinding the learning rate. Since GraNet also utilizes magnitude pruning to discover subnetworks, it is natural to test if these re-training techniques can bring benefits to GraNet. As shown in Table 6, both re-training techniques do not bring benefits to GraNet. Instead of re-training the subnetworks, we find that simply extending the training time significantly boosts the performance of GraNet with similar computational costs.
|
| 192 |
+
|
| 193 |
+
Table 6: Effects of LTH and LRR on the subnetworks learned by GraNet. Methods with $_ 2 \times$ refer to extending the training steps by 2 times. The results are reported with top-1 test accuracy $[ \% ]$ .
|
| 194 |
+
|
| 195 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td></tr><tr><td>Pruning ratio</td><td>90%</td><td>95%</td><td>98%</td><td>90%</td><td>95%</td><td>98%</td></tr><tr><td>VGG-19 (Dense)</td><td>93.85±0.05</td><td>=</td><td></td><td>73.43±0.08</td><td>=</td><td>1</td></tr><tr><td>GraNet (si = 0)</td><td>93.80±0.10</td><td>93.72±0.11</td><td>93.63±0.08</td><td>73.74±0.30</td><td>73.10±0.04</td><td>72.35±0.26</td></tr><tr><td>+Lottery Ticket Hypothesis</td><td>93.63±0.04</td><td>93.29±0.05</td><td>92.46±0.08</td><td>72.97±0.25</td><td>71.76±0.22</td><td>69.28±0.36</td></tr><tr><td>+ Learning Rate Rewinding</td><td>93.84±0.14</td><td>93.72±0.06</td><td>93.53±0.04</td><td>73.71±0.08</td><td>73.24±0.24</td><td>72.50±0.26</td></tr><tr><td>GraNet2x (si = 0)</td><td>94.17±0.03</td><td>93.98±0.07</td><td>93.94±0.11</td><td>74.80±0.29</td><td>73.65±0.32</td><td>73.63±0.05</td></tr><tr><td>ResNet-50 (Dense)</td><td>94.75±0.01</td><td></td><td></td><td>78.23±0.18</td><td></td><td></td></tr><tr><td>GraNet (si = 0)</td><td>94.49±0.08</td><td>94.44±0.01</td><td>94.34±0.17</td><td>77.29±0.45</td><td>76.71±0.26</td><td>76.10±0.20</td></tr><tr><td>+Lottery Ticket Hypothesis</td><td>93.96±0.10</td><td>93.70±0.15</td><td>92.94±0.14</td><td>75.74±0.19</td><td>74.31±0.10</td><td>71.99±0.08</td></tr><tr><td>+ Learning Rate Rewinding</td><td>94.55±0.13</td><td>94.39±0.13</td><td>94.20±0.25</td><td>77.40±0.14</td><td>76.90±0.19</td><td>75.75±0.25</td></tr><tr><td>GraNet2× (si= 0)</td><td>95.09±0.15</td><td>94.84±0.11</td><td>94.69±0.24</td><td>78.18±0.20</td><td>78.17±0.20</td><td>77.15±0.29</td></tr></table>
|
| 196 |
+
|
| 197 |
+
# 5 Conclusion, and Reflection of Broader Impacts
|
| 198 |
+
|
| 199 |
+
In this paper, we re-emphasize the merit of during-training pruning. Compared with the recently proposed works, i.e., LTH and SNIP, during-training pruning is an efficient yet performant class of pruning methods that have received much less attention. We quantitatively study pruning during training from the perspective of pruning plasticity. Inspired by the findings from pruning plasticity and the mechanism of neuroregeneration in the nervous system, we further proposed a novel sparse training method, GraNet, that performs the cost-free connection regeneration during training. GraNet advances the state of the art in both dense-to-sparse training and sparse-to-sparse training.
|
| 200 |
+
|
| 201 |
+
Our paper re-emphasizes the great potential of during-training pruning in reducing the training/inference resources required by ML models without sacrificing accuracy. It has a significant environmental impact on reducing the energy cost of the ML models and CO2 emissions [1, 53, 15, 56, 62].
|
| 202 |
+
|
| 203 |
+
# 6 Acknowledgement
|
| 204 |
+
|
| 205 |
+
This project is partially financed by the Dutch Research Council (NWO). We thank the reviewers for the constructive comments and questions, which improved the quality of our paper.
|
| 206 |
+
|
| 207 |
+
# References
|
| 208 |
+
|
| 209 |
+
[1] Z. Atashgahi, G. Sokar, T. van der Lee, E. Mocanu, D. C. Mocanu, R. Veldhuis, and M. Pechenizkiy. Quick and robust feature selection: the strength of energy-efficient sparse training for autoencoders. arXiv:2012.00560, 2020.
|
| 210 |
+
[2] B. Bartoldson, A. Morcos, A. Barbu, and G. Erlebacher. The generalization-stability tradeoff in neural network pruning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 20852–20864. Curran Associates, Inc., 2020.
|
| 211 |
+
[3] G. Bellec, D. Kappel, W. Maass, and R. Legenstein. Deep rewiring: Training very sparse deep networks. In International Conference on Learning Representations, 2018. arXiv:1711.05136 (2017).
|
| 212 |
+
[4] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020.
|
| 213 |
+
[5] T. Chen, J. Frankle, S. Chang, S. Liu, Y. Zhang, M. Carbin, and Z. Wang. The lottery tickets hypothesis for supervised and self-supervised pre-training in computer vision models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 16306–16316, June 2021.
|
| 214 |
+
[6] P. de Jorge, A. Sanyal, H. Behl, P. Torr, G. Rogez, and P. K. Dokania. Progressive skeletonization: Trimming more fat from a network at initialization. In International Conference on Learning Representations, 2021. arXiv:cs.CV/2006.09081.
|
| 215 |
+
[7] E. Denton, W. Zaremba, J. Bruna, Y. LeCun, and R. Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. Twenty-eighth Conference on Neural Information Processing Systems. arXiv:1404.0736, 2014.
|
| 216 |
+
[8] T. Dettmers and L. Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019.
|
| 217 |
+
[9] U. Evci, T. Gale, J. Menick, P. S. Castro, and E. Elsen. Rigging the lottery: Making all tickets winners. In International Conference on Machine Learning, pages 2943–2952. PMLR, 2020.
|
| 218 |
+
[10] J. Frankle and M. Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations, 2019. arXiv:1803.03635.
|
| 219 |
+
[11] J. Frankle, G. K. Dziugaite, D. Roy, and M. Carbin. Pruning neural networks at initialization: Why are we missing the mark? In International Conference on Learning Representations, 2021. arXiv:2009.08576.
|
| 220 |
+
[12] J. Frankle, G. K. Dziugaite, D. M. Roy, and M. Carbin. The lottery ticket hypothesis at scale. arXiv preprint arXiv:1903.01611, 2019.
|
| 221 |
+
[13] T. Gale, E. Elsen, and S. Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
|
| 222 |
+
[14] T. Gale, M. Zaharia, C. Young, and E. Elsen. Sparse gpu kernels for deep learning. arXiv preprint arXiv:2006.10901, 2020.
|
| 223 |
+
[15] E. García-Martín, C. F. Rodrigues, G. Riley, and H. Grahn. Estimation of energy consumption in machine learning. Journal of Parallel and Distributed Computing, 134:75–88, 2019.
|
| 224 |
+
[16] T. Gebhart, U. Saxena, and P. Schrater. A unified paths perspective for pruning at initialization. arXiv preprint arXiv:2101.10552, 2021.
|
| 225 |
+
[17] J. Guo, Y. Li, W. Lin, Y. Chen, and J. Li. Network decoupling: From regular to depthwise separable convolutions. arXiv preprint arXiv:1808.05517, 2018.
|
| 226 |
+
[18] S. Han, J. Pool, J. Tran, and W. Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pages 1135–1143, 2015.
|
| 227 |
+
[19] B. Hassibi and D. G. Stork. Second order derivatives for network pruning: Optimal brain surgeon. Morgan Kaufmann, 1993.
|
| 228 |
+
[20] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770– 778, 2016.
|
| 229 |
+
[21] T. Hoefler, D. Alistarh, T. Ben-Nun, N. Dryden, and A. Peste. Sparsity in deep learning: Pruning and growth for efficient inference and training in neural networks. Journal of Machine Learning Research, 22(241):1–124, 2021.
|
| 230 |
+
[22] I. Hubara, B. Chmiel, M. Island, R. Banner, S. Naor, and D. Soudry. Accelerated sparse neural training: A provable and efficient method to find n: M transposable masks. arXiv preprint arXiv:2102.08124, 2021.
|
| 231 |
+
[23] M. Jaderberg, A. Vedaldi, and A. Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014.
|
| 232 |
+
[24] S. A. Janowsky. Pruning versus clipping in neural networks. Physical Review A, 39(12):6600, 1989.
|
| 233 |
+
[25] S. Jayakumar, R. Pascanu, J. Rae, S. Osindero, and E. Elsen. Top-kast: Top-k always sparse training. Advances in Neural Information Processing Systems, 33:20744–20754, 2020.
|
| 234 |
+
[26] E. R. Kandel, J. H. Schwartz, T. M. Jessell, S. Siegelbaum, A. J. Hudspeth, and S. Mack. Principles of neural science, volume 4. McGraw-hill New York, 2000.
|
| 235 |
+
[27] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 236 |
+
[28] A. Kusupati, V. Ramanujan, R. Somani, M. Wortsman, P. Jain, S. Kakade, and A. Farhadi. Soft threshold weight reparameterization for learnable sparsity. In International Conference on Machine Learning, pages 5544–5555. PMLR, 2020.
|
| 237 |
+
[29] Y. LeCun, J. S. Denker, and S. A. Solla. Optimal brain damage. In Advances in neural information processing systems, pages 598–605, 1990.
|
| 238 |
+
[30] N. Lee, T. Ajanthan, S. Gould, and P. H. S. Torr. A signal propagation perspective for pruning neural networks at initialization. In International Conference on Learning Representations, 2020. arXiv:1906.06307.
|
| 239 |
+
[31] N. Lee, T. Ajanthan, and P. H. Torr. Snip: Single-shot network pruning based on connection sensitivity. International Conference on Learning Representations, 2018.
|
| 240 |
+
[32] H. Li, A. Kadav, I. Durdanovic, H. Samet, and H. P. Graf. Pruning filters for efficient convnets. International Conference on Learning Representations, 2016.
|
| 241 |
+
[33] T. Lin, S. U. Stich, L. Barba, D. Dmitriev, and M. Jaggi. Dynamic model pruning with feedback. In International Conference on Learning Representations, 2020.
|
| 242 |
+
[34] J. Liu, Z. Xu, R. Shi, R. C. C. Cheung, and H. K. So. Dynamic sparse training: Find efficient sparse network from scratch with trainable masked layers. In International Conference on Learning Representations, 2020.
|
| 243 |
+
[35] S. Liu, D. C. Mocanu, A. R. R. Matavalam, Y. Pei, and M. Pechenizkiy. Sparse evolutionary deep learning with over one million artificial neurons on commodity hardware. Neural Computing and Applications, 33(7):2589–2604, 2021.
|
| 244 |
+
[36] S. Liu, D. C. Mocanu, Y. Pei, and M. Pechenizkiy. Selfish sparse rnn training. In Proceedings of the 39th International Conference on Machine Learning, pages 6893–6904. PMLR, 2021.
|
| 245 |
+
[37] S. Liu, L. Yin, D. C. Mocanu, and M. Pechenizkiy. Do we actually need dense overparameterization? in-time over-parameterization in sparse training. In Proceedings of the 39th International Conference on Machine Learning, pages 6989–7000. PMLR, 2021.
|
| 246 |
+
[38] T. Liu and F. Zenke. Finding trainable sparse networks through neural tangent transfer. In International Conference on Machine Learning, pages 6336–6347. PMLR, 2020.
|
| 247 |
+
[39] Z. Liu, M. Sun, T. Zhou, G. Huang, and T. Darrell. Rethinking the value of network pruning. International Conference on Learning Representations, 2019.
|
| 248 |
+
[40] C. Louizos, M. Welling, and D. P. Kingma. Learning sparse neural networks through l_0 regularization. International Conference on Learning Representations, 2018.
|
| 249 |
+
[41] M. Mahar and V. Cavalli. Intrinsic mechanisms of neuronal axon regeneration. Nature Reviews Neuroscience, 19(6):323–337, 2018.
|
| 250 |
+
[42] D. Mittal, S. Bhardwaj, M. M. Khapra, and B. Ravindran. Recovering from random pruning: On the plasticity of deep convolutional neural networks. In 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), pages 848–857. IEEE, 2018.
|
| 251 |
+
[43] D. C. Mocanu, E. Mocanu, T. Pinto, S. Curci, P. H. Nguyen, M. Gibescu, D. Ernst, and Z. A. Vale. Sparse training theory for scalable and efficient agents. International Conference on Autonomous Agents and Multiagent Systems (AAMAS). arXiv:2103.01636, 2021.
|
| 252 |
+
[44] D. C. Mocanu, E. Mocanu, P. Stone, P. H. Nguyen, M. Gibescu, and A. Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):2383, 2018.
|
| 253 |
+
[45] D. Molchanov, A. Ashukha, and D. Vetrov. Variational dropout sparsifies deep neural networks. In International Conference on Machine Learning, pages 2498–2507. PMLR, 2017.
|
| 254 |
+
[46] P. Molchanov, A. Mallya, S. Tyree, I. Frosio, and J. Kautz. Importance estimation for neural network pruning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11264–11272, 2019.
|
| 255 |
+
[47] P. Molchanov, S. Tyree, T. Karras, T. Aila, and J. Kautz. Pruning convolutional neural networks for resource efficient inference. International Conference on Learning Representations, 2016.
|
| 256 |
+
[48] H. Mostafa and X. Wang. Parameter efficient training of deep convolutional neural networks by dynamic sparse reparameterization. International Conference on Machine Learning, 2019.
|
| 257 |
+
[49] M. C. Mozer and P. Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in neural information processing systems, pages 107–115, 1989.
|
| 258 |
+
[50] M. C. Mozer and P. Smolensky. Using relevance to reduce network size automatically. Connection Science, 1(1):3–16, 1989.
|
| 259 |
+
[51] P. G. Nagappan, H. Chen, and D.-Y. Wang. Neuroregeneration and plasticity: a review of the physiological mechanisms for achieving functional recovery postinjury. Military Medical Research, 7(1):1–16, 2020.
|
| 260 |
+
[52] Nvidia. Nvidia a100 tensor core gpu architecture. https://www.nvidia.com/content/dam/enzz/Solutions/Data-Center/nvidia-ampere-architecture-whitepaper.pdf, 2020.
|
| 261 |
+
[53] D. Patterson, J. Gonzalez, Q. Le, C. Liang, L.-M. Munguia, D. Rothchild, D. So, M. Texier, and J. Dean. Carbon emissions and large neural network training. arXiv preprint arXiv:2104.10350, 2021.
|
| 262 |
+
[54] A. Renda, J. Frankle, and M. Carbin. Comparing rewinding and fine-tuning in neural network pruning. In International Conference on Learning Representations, 2020. arXiv:2003.02389.
|
| 263 |
+
[55] P. Savarese, H. Silva, and M. Maire. Winning the lottery with continuous sparsification. arXiv preprint arXiv:1912.04427, 2019.
|
| 264 |
+
[56] R. Schwartz, J. Dodge, N. A. Smith, and O. Etzioni. Green ai. arXiv preprint arXiv:1907.10597, 2019.
|
| 265 |
+
[57] Y. Shen, L. Shen, H.-Z. Huang, X. Wang, and W. Liu. Cpot: Channel pruning via optimal transport. arXiv preprint arXiv:2005.10451, 2020.
|
| 266 |
+
[58] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. International Conference on Learning Representations, 2014.
|
| 267 |
+
[59] S. P. Singh and D. Alistarh. Woodfisher: Efficient second-order approximation for neural network compression. Advances in Neural Information Processing Systems, 33, 2020.
|
| 268 |
+
[60] S. Srinivas, A. Subramanya, and R. Venkatesh Babu. Training sparse neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 138–145, 2017.
|
| 269 |
+
[61] N. Strom. Scalable distributed dnn training using commodity gpu cloud computing. In Sixteenth Annual Conference of the International Speech Communication Association, 2015.
|
| 270 |
+
[62] E. Strubell, A. Ganesh, and A. McCallum. Energy and policy considerations for deep learning in nlp. arXiv preprint arXiv:1906.02243, 2019.
|
| 271 |
+
[63] H. Tanaka, D. Kunin, D. L. Yamins, and S. Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. Advances in Neural Information Processing Systems. arXiv:2006.05467, 2020.
|
| 272 |
+
[64] H. Touvron, A. Vedaldi, M. Douze, and H. Jegou. Fixing the train-test resolution discrepancy. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 273 |
+
[65] S. Verdenius, M. Stol, and P. Forré. Pruning via iterative ranking of sensitivity statistics. arXiv preprint arXiv:2006.00896, 2020.
|
| 274 |
+
[66] S. Verma and J.-C. Pesquet. Sparsifying networks via subdifferential inclusion. In M. Meila and T. Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 10542–10552. PMLR, 18–24 Jul 2021.
|
| 275 |
+
[67] C. Wang, G. Zhang, and R. Grosse. Picking winning tickets before training by preserving gradient flow. In International Conference on Learning Representations, 2020.
|
| 276 |
+
[68] W. Wen, C. Wu, Y. Wang, Y. Chen, and H. Li. Learning structured sparsity in deep neural networks. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
|
| 277 |
+
[69] M. Wortsman, A. Farhadi, and M. Rastegari. Discovering neural wirings. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 278 |
+
[70] X. Xiao, Z. Wang, and S. Rajasekaran. Autoprune: Automatic network pruning by regularizing auxiliary parameters. Advances in neural information processing systems, 32, 2019.
|
| 279 |
+
[71] Y. Xu, Y. Li, S. Zhang, W. Wen, B. Wang, Y. Qi, Y. Chen, W. Lin, and H. Xiong. Trained rank pruning for efficient deep neural networks. arXiv preprint arXiv:1812.02402, 2018.
|
| 280 |
+
[72] D. Yang, A. Ghasemazar, X. Ren, M. Golub, G. Lemieux, and M. Lis. Procrustes: a dataflow and accelerator for sparse deep neural network training. In 2020 53rd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), pages 711–724. IEEE, 2020.
|
| 281 |
+
[73] G. Yiu and Z. He. Glial inhibition of cns axon regeneration. Nature Reviews Neuroscience, 7(8):617–627, 2006.
|
| 282 |
+
[74] H. You, C. Li, P. Xu, Y. Fu, Y. Wang, X. Chen, R. G. Baraniuk, Z. Wang, and Y. Lin. Drawing early-bird tickets: Towards more efficient training of deep networks. arXiv preprint arXiv:1909.11957, 2019.
|
| 283 |
+
[75] G. Yuan, L. Shen, and W.-S. Zheng. A block decomposition algorithm for sparse optimization. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 275–285, 2020.
|
| 284 |
+
[76] A. Zhou, Y. Ma, J. Zhu, J. Liu, Z. Zhang, K. Yuan, W. Sun, and H. Li. Learning n:m fine-grained structured sparse neural networks from scratch. In International Conference on Learning Representations, 2021.
|
| 285 |
+
[77] M. H. Zhu and S. Gupta. To prune, or not to prune: Exploring the efficacy of pruning for model compression, 2018.
|
md/train/N9oPAFcuYWX/N9oPAFcuYWX.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/QYjO70ACDK/QYjO70ACDK.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DISTRIBUTIONAL SLICED-WASSERSTEIN AND APPLICATIONS TO GENERATIVE MODELING
|
| 2 |
+
|
| 3 |
+
Khai Nguyen VinAI Research, Vietnam v.khainb@vinai.io
|
| 4 |
+
|
| 5 |
+
Nhat $\mathbf { H o } ^ { * }$ University of Texas, Austin VinAI Research, Vietnam minhnhat@utexas.edu
|
| 6 |
+
|
| 7 |
+
Tung Pham VinAI Research, Vietnam v.tungph4@vinai.io
|
| 8 |
+
|
| 9 |
+
# Hung Bui
|
| 10 |
+
|
| 11 |
+
VinAI Research, Vietnam v.hungbh1@vinai.io
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Sliced-Wasserstein distance (SW) and its variant, Max Sliced-Wasserstein distance (Max-SW), have been used widely in the recent years due to their fast computation and scalability even when the probability measures lie in a very high dimensional space. However, SW requires many unnecessary projection samples to approximate its value while Max-SW only uses the most important projection, which ignores the information of other useful directions. In order to account for these weaknesses, we propose a novel distance, named Distributional Sliced-Wasserstein distance (DSW), that finds an optimal distribution over projections that can balance between exploring distinctive projecting directions and the informativeness of projections themselves. We show that the DSW is a generalization of Max-SW, and it can be computed efficiently by searching for the optimal push-forward measure over a set of probability measures over the unit sphere satisfying certain regularizing constraints that favor distinct directions. Finally, we conduct extensive experiments with large-scale datasets to demonstrate the favorable performances of the proposed distances over the previous sliced-based distances in generative modeling applications.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Optimal transport (OT) is a classical problem in mathematics and operation research. Due to its appealing theoretical properties and flexibility in practical applications, it has recently become an important tool in the machine learning and statistics community; see for example, (Courty et al., 2017; Arjovsky et al., 2017; Tolstikhin et al., 2018; Gulrajani et al., 2017) and references therein. The main usage of OT is to provide a distance named Wasserstein distance, to measure the discrepancy between two probability distributions. However, that distance suffers from expensive computational complexity, which is the main obstacle to using OT in practical applications.
|
| 20 |
+
|
| 21 |
+
There have been two main approaches to overcome the high computational complexity problem: either approximate the value of OT or apply the OT adaptively to specific situations. The first approach was initiated by (Cuturi, 2013) using an entropic regularizer to speed up the computation of the OT (Sinkhorn, 1967; Knight, 2008). The entropic regularization approach has demonstrated its usefulness in several application domains (Courty et al., 2014; Genevay et al., 2018; Bunne et al., 2019). Along this direction, several works proposed efficient algorithms for solving the entropic OT (Altschuler et al., 2017; Lin et al., 2019b;a) as well as methods to stabilize these algorithms (Chizat et al., 2018; Peyré & Cuturi, 2019; Chizat et al., 2018; Schmitzer, 2019). However, these algorithms have complexities of the order $\mathcal { O } ( k ^ { 2 } )$ , where $k$ is the number of supports. It is expensive when we need to compute the OT repeatedly, especially in learning the data distribution.
|
| 22 |
+
|
| 23 |
+
The second approach, known as "slicing", takes a rather different perspective. It leverages two key ideas: the OT closed-form expression for two distributions in one-dimensional space, and the transformation of a distribution into a set of projected one-dimensional distributions by the Radon transform (RT) (Helgason, 2010). The popular proposal along this direction is Sliced-Wasserstein (SW) distance (Bonneel et al., 2015), which samples the projecting directions uniformly over a unit sphere in the data ambient space and takes the expectation of the resulting one-dimensional OT distance. The SW distance hence requires a significantly lower computation cost than the original Wasserstein distance and is more scalable than the first approach. Due to its solid statistical guarantees and efficient computation, the SW distance has been successfully applied to a variety of practical tasks (Deshpande et al., 2018; Liutkus et al., 2019; Kolouri et al., 2018; Wu et al., 2019; Deshpande et al., 2019) where it has been shown to have comparative performances to other distances and divergences between probability distributions. However, there is an inevitable bottleneck of computing the SW distance. Specifically, the expectation with respect to the uniform distribution of projections in SW is intractable to compute; therefore, the Monte Carlo method is employed to approximate it. Nevertheless, drawing from a uniform distribution of directions in high-dimension can result in an overwhelming number of irrelevant directions, especially when the actual data lies in a low-dimensional manifold. Hence, SW typically needs to have a large number of samples to yield an accurate estimation of the discrepancy. Alternatively, in the other extreme, Max Sliced-Wasserstein (Max-SW) distance (Deshpande et al., 2019) uses only one important direction to distinguish the probability distributions. However, other potentially relevant directions are ignored in Max-SW. Therefore, Max-SW can miss some important differences between the two distributions in high dimension. We note that the linear projections in the Radon transform can be replaced by non-linear projections resulting in the generalized sliced-Wasserstein distance and its variants (Beylkin, 1984; Kolouri et al., 2019).
|
| 24 |
+
|
| 25 |
+
Apart from these main directions, there are also few proposals that try either to modify them or to combine the advantages of the above-mentioned approaches. In particular, Paty & Cuturi (2019) extended the idea of the max-sliced distance to the max-subspace distance by considering finding an optimal orthogonal subspace. However, this approach is computationally expensive, since it could not exploit the closed-form of the one-dimensional Wasserstein distance. Another approach named the Projected Wasserstein distance (PWD), which was proposed in (Rowland et al., 2019), uses sliced decomposition to find multiple one-dimension optimal transport maps. Then, it computes the average cost of those maps equally in the original dimension.
|
| 26 |
+
|
| 27 |
+
Our contributions. Our paper also follows the slicing approach. However, we address key friction in this general line of work: how to obtain a relatively small number of slices simultaneously to maintain the computational efficiency, but at the same time, cover the major differences between two high-dimensional distributions. We take a probabilistic view of slicing by using a probability measure on the unit sphere to represent how important each direction is. From this viewpoint, SW uses the uniform distribution while Max-SW searches for the best delta-Dirac distribution over the projections, both can be considered as special cases. In this paper, we propose to search for an optimal distribution of important directions. We regularize this distribution such that it prefers directions that are far away from one another, hence encouraging an efficient exploration of the space of directions. In the case of no regularization, our proposed method recovers max-(generalized) SW as a special case. In summary, our main contributions are two-fold:
|
| 28 |
+
|
| 29 |
+
1. First, we introduce a novel distance, named Distributional Sliced-Wasserstein distance (DSW), to account for the issues of previous sliced distances. Our main idea is to search for not just a single most important projection, but an optimal distribution over projections that could balance between an expansion of the area around important projections and the informativeness of projections themselves, i.e., how well they can distinguish the two target probability measures. We show that DSW is a proper metric in the probability space and possesses appealing statistical and computational properties as the previous sliced distances.
|
| 30 |
+
|
| 31 |
+
2. Second, we apply the DSW distance to generative modeling tasks based on the generative adversarial framework. The extensive experiments on real and large-scale datasets show that DSW distance significantly outperforms the SW and Max-SW distances under similar computational time on these tasks. Furthermore, the DSW distance helps model distribution converge to the data distribution faster and provides more realistic generated images than the SW and Max-SW distances.
|
| 32 |
+
|
| 33 |
+
Organization. The remainder of the paper is organized as follows. In Section 2, we provide backgrounds for Wasserstein distance and its slice-based versions. In Section 3, we propose distributional (generalized) sliced-Wasserstein distance and analyze some of its theoretical properties. Section 4 includes extensive experiment results followed by discussions in Section 5. Finally, we defer the proofs of key results and extra materials in the Appendices.
|
| 34 |
+
|
| 35 |
+
Notation. For any $\theta , \theta ^ { \prime } \in \mathbb { R } ^ { d }$ , $\begin{array} { r } { \cos ( \theta , \theta ^ { \prime } ) = \frac { \theta ^ { \dagger } \overset { \star } { \theta ^ { \prime } } } { \| \theta \| \| \theta ^ { \prime } \| } } \end{array}$ θ>θ0kθkkθ0k , where k.k is \`2 norm. For any d ≥ 2, Sd−1 denotes the unit sphere in $d$ dimension in $\ell _ { 2 }$ norm . Furthermore, $\delta$ denotes the Dirac delta function, and $\langle \cdot , \cdot \rangle$ is the Euclidean inner-product. For any $p \geq 1$ , $\mathbb { L } ^ { p } ( \mathbb { R } ^ { d } )$ is the set of real-valued functions on $\mathbb { R } ^ { d }$ with finite $p$ -th moment.
|
| 36 |
+
|
| 37 |
+
# 2 BACKGROUND
|
| 38 |
+
|
| 39 |
+
In this section, we provide necessary backgrounds for the (generalized) Radon transform, the Wasserstein, and sliced-Wasserstein distances.
|
| 40 |
+
|
| 41 |
+
# 2.1 WASSERSTEIN DISTANCE
|
| 42 |
+
|
| 43 |
+
We start with a formal definition of Wasserstein distance. For any $p \geq 1$ , we define $\mathcal { P } _ { p } ( \mathbb { R } ^ { d } )$ as the set of Borel probability measures with finite $p$ -th moment defined on a given metric space $( \mathbb { R } ^ { d } , \lVert . \rVert )$ For any probability measures $\mu , \nu$ defined on $\boldsymbol { \mathcal { X } } , \boldsymbol { \mathcal { Y } } \subseteq \mathbb { R } ^ { d }$ , we denote their corresponding probability density functions as $I _ { \mu }$ and $I _ { \nu }$ . The Wasserstein distance of order $p$ between $\mu$ and $\nu$ is given by (Villani, 2008; Peyré & Cuturi, 2019):
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
W _ { p } ( \mu , \nu ) : = \Big ( \operatorname* { i n f } _ { \pi \in \Pi ( \mu , \nu ) } \int _ { \mathcal { X } \times \mathcal { Y } } \| x - y \| ^ { p } d \pi ( x , y ) \Big ) ^ { \frac { 1 } { p } } ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\Pi ( \mu , \nu )$ is a set of all transportation plans $\pi$ such that the marginal distributions of $\pi$ are $\mu$ and $\nu$ , respectively. In order to simplify the presentation, we abuse the notation by using both $W _ { p } ( \mu , \nu )$ and $W _ { p } ( I _ { \mu } , I _ { \nu } )$ interchangeably for the Wasserstein distance between $\mu$ and $\nu$ . When $\mu$ and $\nu$ are one-dimension measures, the Wasserstein distance between $\mu$ and $\nu$ has a closed-form expression $\begin{array} { l } { { W _ { p } ( \mu , \nu ) ~ = ~ ( \int _ { 0 } ^ { 1 } | F _ { \mu } ^ { - 1 } ( z ) - F _ { \nu } ^ { - 1 } ( z ) | ^ { p } d z ) ^ { 1 / p } } } \end{array}$ where $F _ { \mu }$ and $F _ { \nu }$ are the cumulative distribution function (CDF) of $I _ { \mu }$ and $I _ { \nu }$ , respectively.
|
| 50 |
+
|
| 51 |
+
# 2.2 (GENERALIZED) RADON TRANSFORMS
|
| 52 |
+
|
| 53 |
+
Now, we review (generalized) Radon transform maps, which are key to the notion of (generalized) sliced-Wasserstein distance and its variants. The Radon transform (RT) maps a function $\mathbf { \bar { \chi } } _ { I } \in \mathbb { L } ^ { 1 } ( \mathbb { R } ^ { d } )$ to the space of functions defined over space of lines in $\mathbb { R } ^ { d }$ . In particular, for any $t \in \mathbb { R }$ and direction $\theta \in \mathbb { S } ^ { d - 1 }$ , the RT is defined as follows (Helgason, $\begin{array} { r } { 2 0 1 0 ) : \mathcal { R } \bar { I } ( t , \theta ) : = \int _ { \mathbb { R } ^ { d } } I ( \bar { x } ) \delta ( t - \langle x , \theta \rangle ) d x } \end{array}$ .
|
| 54 |
+
|
| 55 |
+
The generalized Radon transform (GRT) (Beylkin, 1984) extends the original one from integration over hyperplanes of $\mathbb { R } ^ { d }$ to integration over hypersurfaces. In particular, it is defined as: $\mathcal { G } I ( t , { \boldsymbol { \theta } } ) : =$ $\textstyle \int _ { \mathbb { R } ^ { d } } I ( { \bar { x } } ) \delta ( { \bar { t } } - g ( x , \theta ) ) d x$ , where $t \in \mathbb R$ and $\theta \in \Omega _ { \theta }$ . Here, $\Omega _ { \theta }$ is a compact subset of $\mathbb { R } ^ { d }$ and $\boldsymbol { g } : \mathbb { R } ^ { d } \times \mathbb { S } ^ { d - 1 } \mapsto \mathbb { R }$ is a defining function (cf. Assumptions H1-H4 in (Kolouri et al., 2019) for the definition of defining function) inducing the hypersurfaces. When $g ( x , \theta ) = \langle x , \theta \rangle$ and $\Omega _ { \theta } = \mathbb { S } ^ { d - 1 }$ , the generalized Radon transform becomes the standard Radon transform.
|
| 56 |
+
|
| 57 |
+
# 2.3 (GENERALIZED) SLICED-WASSERSTEIN DISTANCES
|
| 58 |
+
|
| 59 |
+
The sliced-Wasserstein distance (SW) between two probability measures $\mu$ and $\nu$ is defined as (Bonneel et al., 2015): $\begin{array} { r } { S W _ { p } ( \mu , \nu ) : = ( \int _ { \mathbb { S } ^ { d - 1 } } W _ { p } ^ { p } \big ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) \big ) d \theta ) ^ { 1 / p } } \end{array}$ . Similarly, the generalized sliced-Wasserstein distance (Kolouri et al., 2019) (GSW) is given by $\mathrm { G S W } _ { p } ( \mu , \nu ) : =$ $\begin{array} { r } { ( \int _ { \Omega _ { \theta } } W _ { p } ^ { p } \bigl ( \mathcal { G } I _ { \mu } ( \cdot , \theta ) , \mathcal { G } I _ { \nu } ( \cdot , \theta ) \bigr ) d \theta ) ^ { 1 / p } } \end{array}$ , where $\Omega _ { \theta }$ is the compact set of feasible parameter. However, these integrals are usually intractable. Thus, they are often approximated by using Monte Carlo scheme to draw uniform samples $\{ \theta _ { i } \} _ { i = 1 } ^ { N }$ from $\bar { \mathbb { S } } ^ { d - 1 }$ and $\Omega _ { \theta }$ . In particular, $S W _ { p } ^ { p } ( \mu , \nu ) \approx$ $\begin{array} { r } { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } W _ { p _ { \cdot } } ^ { p } \big ( \mathscr { R } I _ { \mu } ( \cdot , \theta _ { i } ) , \mathscr { R } I _ { \nu } ( \cdot , \theta _ { i } ) \big ) } \end{array}$ and $\begin{array} { r } { \mathbf { G S W } _ { p } ^ { p } ( \mu , \nu ) \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } W _ { p } ^ { p } \big ( \mathcal { G } I _ { \mu } ( \cdot , \theta _ { i } ) , \mathcal { G } I _ { \nu } ( \cdot , \theta _ { i } ) \big ) } \end{array}$ . In order to obtain a good approximation of (generalized) SW distances, $N$ needs to be sufficiently large.
|
| 60 |
+
|
| 61 |
+
However, important directions are not distributed uniformly over the sphere. Thus, this approach will draw potentially many unimportant projections that are not only expensive but also greatly reduce the effect of the SW distance.
|
| 62 |
+
|
| 63 |
+
# 2.4 MAX (GENERALIZED) SLICED-WASSERSTEIN DISTANCES
|
| 64 |
+
|
| 65 |
+
An approach to using only informative directions is to simply take the best slice in discriminating two given probability distributions. That distance is max sliced-Wasserstein distance (Max-SW) (Deshpande et al., 2019), which is given by $\begin{array} { r l } & { \operatorname* { m a x } S W _ { p } ( \mu , \nu ) : = \operatorname* { m a x } _ { \theta \in \mathbb { S } ^ { d - 1 } } W _ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) } \end{array}$ . By combining this idea with non-linear projections from generalized Radon transform, we obtain max generalized sliced-Wasserstein distance (Max-GSW) (Kolouri et al., 2019). The formal definition of that distance is: $\begin{array} { r } { \operatorname* { m a x } G S W _ { p } ( \mu , \nu ) : = \operatorname* { m a x } _ { \theta \in \Omega _ { \theta } } W _ { p } ( \mathcal { G } I _ { \mu } ( \cdot , \theta ) , \mathcal { G } I _ { \nu } ( \cdot , \theta ) ) } \end{array}$ . The (generalized) MaxSW distances focus on finding only the most important direction. Meanwhile, other informative directions play no role in the distance. Therefore, (generalized) Max-SW distances can ignore useful information about the structure of high dimensional probability measures.
|
| 66 |
+
|
| 67 |
+
# 3 DISTRIBUTIONAL SLICED-WASSERSTEIN DISTANCE
|
| 68 |
+
|
| 69 |
+
With the aim of improving the limitations of the previous sliced distances, we propose a novel distance, named Distributional Sliced-Wasserstein distance (DSW), that can search for not just a single but a distribution of important directions on the unit sphere. We prove that it is a well-defined metric and discuss its connection to the existing sliced-based distances in Section 3.1. Then, we provide a procedure to approximate DSW based on its dual form in Section 3.2.
|
| 70 |
+
|
| 71 |
+
# 3.1 DEFINITION AND METRICITY
|
| 72 |
+
|
| 73 |
+
We first start with a definition of distributional sliced-Wasserstein distance. We say $C > 0$ admissible if the set $\mathbb { M } _ { C }$ of probability measures $\sigma$ on $\mathbb { S } ^ { d - 1 }$ satisfying $\begin{array} { r } { \mathbb { E } _ { \boldsymbol { \theta } , \boldsymbol { \theta } ^ { \prime } \sim \sigma } \left[ \vert \boldsymbol { \theta } ^ { \top } \boldsymbol { \theta } ^ { \prime } \vert \right] \le \dot { C } } \end{array}$ is not empty.
|
| 74 |
+
|
| 75 |
+
Definition 1. Given two probability measures $\mu$ and $\nu$ on $\mathbb { R } ^ { d }$ with finite $p$ -th moments where $p \geq 1$ and an admissible regularizing constant $C > 0$ . The distributional sliced-Wasserstein distance (DSW) of order $p$ between $\mu$ and $\nu$ is given by:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
{ D S W } _ { p } ( \mu , \nu ; C ) : = \operatorname* { s u p } _ { \sigma \in \mathbb { M } _ { C } } \bigg ( \mathbb { E } _ { \theta \sim \sigma } \bigg [ W _ { p } ^ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) \bigg ] \bigg ) ^ { \frac { 1 } { p } } ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\mathcal { R }$ is the Radon transform operator.
|
| 82 |
+
|
| 83 |
+
The DSW aims to find the optimal probability measure of slices on the unit sphere $\mathbb { S } ^ { d - 1 }$ . Note that, the Max-SW distance is equivalent to searching for the best Dirac measure on a single point in $\mathbb { S } ^ { d - 1 }$ , which puts all weights in only one direction. Meanwhile, the uniform measure in the formulation of SW distance distributes the same weights in all directions. Indeed, the uniform and Dirac measures are two special cases, because they view that either all directions are equally important or only one direction is important. That view is too restricted if the data actually lie on low dimensional space. Thus, we aim to find a probability measure which concentrates only on areas around important directions. Furthermore, we do not want these directions to lie in only one small area, because under the orthogonal projection of RT, their corresponding one-dimensional distributions will become similar. In order to achieve this, we search for an optimal measure $\sigma$ that satisfies the regularization constraint $\begin{array} { r } { \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } [ \left| \theta ^ { \top } \theta ^ { ' } \right| ] \leq C } \end{array}$ . By Cauchy-Schwarz inequality, $C$ is no greater than 1, thus $\mathbb { M } _ { 1 }$ contains all probability measures on the unit sphere. Optimizing over $\mathbb { M } _ { 1 }$ simply returns the best Dirac measure corresponding to the Max-SW distance. When $C$ is small, the constraint forces the measure $\sigma$ to distribute more weights to directions that are far from each other (in terms of their angles). Thus, a small appropriate value of $C$ will help to balance between the distinctiveness and informativeness of these targeted directions. For further discussion about $C$ , see Appendix B.1.
|
| 84 |
+
|
| 85 |
+
Next, we show that DSW is a well-defined metric on the probability space.
|
| 86 |
+
|
| 87 |
+
Theorem 1. For any $p \geq 1$ and admissible $C > 0$ , $D S W _ { p } ( \cdot , \cdot ; C )$ is a well-defined metric in the space of Borel probability measures with finite $p$ -th moment. In particular, it is non-negative, symmetric, identity, and satisfies the triangle inequality.
|
| 88 |
+
|
| 89 |
+
The proof of Theorem 1 is in Appendix A.1. Our next result establishes the topological equivalence between DSW distance and (max)-sliced Wasserstein and Wasserstein distances.
|
| 90 |
+
|
| 91 |
+
Theorem 2. For any $p \geq 1$ and admissible $C > 0 ;$ , the following holds
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
D S W _ { p } ( \mu , \nu ; C ) \leq m a x S W _ { p } ( \mu , \nu ) \leq W _ { p } ( \mu , \nu ) .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
(b) If $C \geq 1 / d ,$ , we have $\begin{array} { r } { D S W _ { p } ( \mu , \nu ; C ) \geq \left( \frac { 1 } { d } \right) ^ { 1 / p } m a x { S W _ { p } ( \mu , \nu ) } \geq \left( \frac { 1 } { d } \right) ^ { 1 / p } S W _ { p } ( \mu , \nu ) . } \end{array}$
|
| 98 |
+
|
| 99 |
+
As a consequence, when $p \geq 1$ and $C \geq 1 / d , D S W _ { p } ( \cdot , \cdot ; C ) , \cdot$ $S W _ { p }$ , max $S W _ { p }$ , and $W _ { p }$ are topologically equivalent, namely, the convergence of probability measures under $D \bar { S } W _ { p } ( \cdot , \cdot ; \mathbf { \bar { C } } )$ implies the convergence of these measures under other metrics and vice versa.
|
| 100 |
+
|
| 101 |
+
The proof of Theorem 2 is in Appendix A.2. As a consequence of Theorem 2, the statistical error of estimating the unknown distribution based on the empirical distribution of $n$ i.i.d data under DSW distance is $C _ { d } \cdot n ^ { - 1 / 2 }$ with high probability where $C _ { d }$ is some universal constant depending on dimension $d$ (see Appendix B.3). Therefore, as other sliced-based Wasserstein distances, the DSW distance does not suffer from the curse of dimensionality.
|
| 102 |
+
|
| 103 |
+
# 3.2 COMPUTATION OF DSW DISTANCE
|
| 104 |
+
|
| 105 |
+
Direct computation of DSW distance is challenging. Hence we consider a dual form of DSW distance and a reparametrization of $\sigma$ as follows.
|
| 106 |
+
|
| 107 |
+
Definition 2. For any $p \geq 1$ and admissible $C > 0$ , there exists a non-negative constant $\lambda _ { C }$ depending on $C$ such that the dual form of DSW distance takes the following form
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { { 2 } S W _ { p } ^ { * } ( \mu , \nu ; C ) = \underset { \sigma \in \mathbb { H } } { \operatorname* { s u p } } \left. \left( \mathbb { E } _ { \theta \sim \sigma } \left[ W _ { p } ^ { p } ( \mathcal { R } I _ { \mu } ( \cdot , \theta ) , \mathcal { R } I _ { \nu } ( \cdot , \theta ) ) \right] \right) ^ { \frac { 1 } { p } } - \lambda _ { C } \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \left[ | \theta ^ { \top } \theta ^ { \prime } | \right] \right. + \lambda _ { C } C , } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where M denotes the space of all probability measures on the unit sphere $\mathbb { S } ^ { d - 1 }$
|
| 114 |
+
|
| 115 |
+
By the Lagrangian duality theory, $\mathrm { D S W } _ { p } ( \mu , \nu ; C ) \geq \mathrm { D S W } _ { p } ^ { * } ( \mu , \nu ; C )$ for any $p \geq 1$ and admissible $C > 0$ . In Definition 2, the set $\mathbb { M } _ { C }$ disappears and $\lambda _ { C }$ plays the tuning role for the regularized term $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ . When $\lambda _ { C }$ is large, $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } ^ { \sim } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ needs to be small, meaning that $C$ is small. When $\lambda _ { C }$ is small, the value of $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ becomes less important, i.e., $C$ is large.
|
| 116 |
+
|
| 117 |
+
For reparametrizing the measure $\sigma$ , we use a pushforward of uniform measure on the unit sphere through some measurable function $f$ . In particular, let $f$ be a Borel measurable function from $\mathbb { S } ^ { d - 1 }$ to ${ \mathbb S } ^ { d - 1 }$ . For any Borel set $A \subset \mathbb { S } ^ { d - \mathrm { \ i } }$ , we define $\sigma ( A ) \stackrel { \circ } { = } \sigma ^ { d - 1 } ( f ^ { - 1 } ( A ) )$ , where $\sigma ^ { d - 1 }$ is the uniform probability measure on $\mathbb { S } ^ { d - 1 }$ . Then for any Borel measurable function $g : { \mathbb { S } } ^ { d - 1 } \mathbb { R }$ , we have $\begin{array} { r } { \int _ { \theta \sim \sigma } g ( \theta ) \dot { d } \sigma ( \theta ) = \int _ { \theta \sim \sigma ^ { d - 1 } } ( g \circ f ) ( \theta ) d \sigma ^ { d - \bar { 1 } } ( \theta ) } \end{array}$ . Therefore, we obtain the equivalent dual form of DSW as follows:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r l } & { \mathrm { D S W } _ { p } ^ { * } ( \mu , \nu ; C ) = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \Bigg \{ \Bigg ( \mathbb { E } _ { \theta \sim \sigma ^ { d - 1 } } \big [ W _ { p } ^ { p } \big ( \mathcal { R } I _ { \mu } ( \cdot , f ( \theta ) ) , \mathcal { R } I _ { \nu } ( \cdot , f ( \theta ) ) \big ) \big ] \Bigg ) ^ { 1 / p } } \\ & { \qquad - \lambda _ { C } \mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma ^ { d - 1 } } \Big [ \big | f ( \theta ) ^ { \top } f ( \theta ^ { \prime } ) \big | \Big ] \Bigg \} + \lambda _ { C } C : = \underset { f \in \mathcal { F } } { \operatorname* { s u p } } \mathrm { D S } ( f ) , } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $\mathcal { F }$ is a class of all Borel measurable functions from $\mathbb { S } ^ { d - 1 }$ to $\mathbb { S } ^ { d - 1 }$ .
|
| 124 |
+
|
| 125 |
+
Finding the optimal $f$ : We parameterize $f$ in the dual form (2) by using a deep neural network with parameter $\phi$ , defined as $f _ { \phi }$ . Then, we estimate the gradient of the objective function $\mathrm { D S } ( f _ { \phi } )$ in equation (2) with respect to $\phi$ and use stochastic gradient ascent algorithm to update $\phi$ . Since there are expectations over uniform distribution in the gradient of $\mathrm { D S } ( f _ { \phi } )$ , we use the Monte Carlo method to approximate these expectations. Note that, we can use the fixed point from the stochastic ascent algorithm to approximate the dual value of DSW in equation (2). A detailed argument for this point is in Appendix B.2. Finally, in generative model applications with DSW being the loss function, we only need to use the gradient of the function $\mathrm { D S } ( . )$ to update the parameters of interest. Therefore, we can treat $\lambda _ { C }$ as a regularized parameter and tune it to find suitable value in these applications.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 1: Empirical behavior of optimal measure $\sigma$ , approximated by 1000 samples, on a circle for different values of $\lambda _ { C }$ (the constant in the dual form of DSW in Definition 2) when $\mu$ and $\nu$ are bivariate Gaussian distributions sharing the same eigenvectors. When $\lambda _ { C } = 0$ , $C = 1$ . When $\lambda _ { C }$ increases, $C$ becomes small.
|
| 129 |
+
|
| 130 |
+
Illustration of the roles of $\lambda _ { C }$ and $C$ : To illustrate the roles of $\lambda _ { C }$ and $C$ in finding optimal distribution $\sigma$ , we conduct a simple experiment on two Gaussian distributions with zero means and covariance matrices given by $\left( \begin{array} { l l } { 2 } & { 0 } \\ { 0 } & { 2 } \end{array} \right)$ and $\left( \begin{array} { l l } { 5 } & { 0 } \\ { 0 } & { 1 } \end{array} \right)$ . The experiment optimizes the empirical form of Definition 2 with different choices of $\lambda _ { C }$ . The results are shown in Figure 1 with the reported value of $\lambda _ { C }$ and $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \big [ | \theta ^ { \top } \theta ^ { \prime } | \big ]$ . For $\lambda _ { C } = 0$ , the obtained distribution concentrates only on one direction. When $\lambda _ { C } = 5 0$ , optimal $\sigma$ distributes more weights to other directions on the circle. When $\lambda _ { C } = 1 0 0 0$ , optimal $\sigma$ is close to the discrete distribution concentrated on two eigenvectors of the covariance matrices, which are the main directions differentiating the two Gaussian distributions.
|
| 131 |
+
|
| 132 |
+
Extension of DSW and comparison of DSW to Max-GSW-NN: Similar to SW, we extend DSW to distributional generalized sliced Wasserstein (DGSW) by using the non-linear projecting operator via GRT. The definition of the DGSW and its properties are in Appendix C. Finally, in Appendix E.1, we show the distinction of the DSW to Max-GSW-NN (Kolouri et al., 2019) when the neural network defining function in Max-GSW-NN is $g ( x , \theta ) = \langle x , f ( \theta ) \rangle$ where $f : \mathbb { S } ^ { d - 1 } \to \mathbb { S } ^ { d - 1 }$ .
|
| 133 |
+
|
| 134 |
+
# 4 EXPERIMENTS
|
| 135 |
+
|
| 136 |
+
In this section, we conduct extensive experiments comparing the performance in both generative quality and computational speed of the proposed DSW distance with other sliced-based distances, namely the SW, Max-SW, Max-GSW-NN (Kolouri et al., 2019) and projected robust subspace Wasserstein (PRW) (Paty & Cuturi, 2019; Lin et al., 2020) using the minimum expected distance estimator (MEDE) (Bernton et al., 2019) on MNIST (LeCun et al., 1998), CIFAR10 (Krizhevsky, 2009), CelebA (Liu et al., 2015) and LSUN (Yu et al., 2015) datasets. The details of the MEDE framework are described in Appendix D. We would like to note that the wall-clock timing of different methods may be subject to the differences in the hyperparameter settings and software implementations of different methods. On MNIST dataset, we train generative models with different distances and then evaluate their performances by comparing Wasserstein-2 distances between 10000 random generated images and all images from the MNIST test set. Due to the very large size of other datasets, e.g., 3 million images in LSUN, it is expensive to compute empirical Wasserstein-2 distance as its complexity is of order ${ \mathcal { O } } ( k ^ { 2 } \log k )$ where $k$ is the number of support points. Therefore, after we train generative models, we use FID score (Heusel et al., 2017) to evaluate the generative quality of these generators. The FID score is calculated from 10000 random generated images and all training samples using precomputed statistics in (Heusel et al., 2017). Finally, for $\lambda _ { C }$ in DSW (see Definition 2), it is chosen in the set $\{ 1 , 1 0 , 1 0 0 , 1 0 0 0 \}$ such that its Wasserstein-2 (FID score) (between 10000 random generated images and all images from corresponding validation set) is the lowest among the four values. Detailed experiment settings are in Appendix G. Finally, we also apply the DSW into color transfer task (Rabin et al., 2010; 2014; Bonneel et al., 2015; Perrot et al., 2016) in Appendix F, where we find that DSW also performs better than SW and Max-SW in this task.
|
| 137 |
+
|
| 138 |
+
# 4.1 RESULTS ON MNIST
|
| 139 |
+
|
| 140 |
+
Generative quality and computational speed: We report the performance of the learned generative models for MNIST in Figure 2(a). To plot this figure, we vary the number of projections $N \in$ $\{ 1 , 1 0 , 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ for the SW, and $N \in \{ 1 , 1 0 , 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } \}$ for the DSW. Then we measure the computational time per minibatch and the Wasserstein-2 score of the learned generators for each $N$ . We plot the Wasserstein-2 score and computational time of Max-SW and Max-GSW-NN in their standard settings (Kolouri et al., 2019). Except for the regime with very fast but low-quality learned models, DSW is better than all the existing slice-based baselines in terms of both model quality and computational speed. Moreover, DSW can learn good models with very few projections, e.g., DSW-10 achieves better model quality than Max-GSW-NN and Max-SW and is one order-of-magnitude faster than these sliced distances. Finally, with a similar computational time, a learned generator by DSW has the Wasserstein-2 score that is roughly $1 0 \%$ lower than the one got from SW. For the qualitative comparison between these distances, we show random generated images from their generative models in Figure 7 in Appendix E.1. We observe that generated images from DSW are sharper and easier to classify into numbers than those from other baseline distances.
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 2: (a) Comparison between DSW, SW, Max-SW, Max-GSW-NN, PRW and WD based on execution time and performance. Here, each dot of SW and DSW corresponds to the number of projections chosen in $\{ 1 , 1 0 , 1 0 ^ { \cdot 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ . Each dot of PRW corresponds to the dimension of the subspace chosen in $\{ 2 , 5 , 1 0 , 5 0 \}$ ; (b) Comparison between SW, DSW, Max-SW and Max-GSW-NN based on Wasserstein-2 distance between distributions of learned model and test set over iterations; (c) Computation speed of distances based on the number of minibatch’s samples (log-log scale); (d) Effect of $\lambda _ { C }$ on the mean of absolute values of pairwise cosine similarity between 10 random directions from the found distribution $\sigma$ of DSW.
|
| 144 |
+
|
| 145 |
+
Comparison with projected robust subspace Wasserstein (PRW) and Wasserstein distance: In Figure 2(a), we plot the Wasserstein-2 score and computational time of Wasserstein distance (WD) and PRW, where the subspace dimension of PRW varies in the range $\{ 2 , 5 , 1 0 , 5 0 \}$ . PRW is able to improve upon the model quality of slice-based methods including DSW, however at the cost of being an order of magnitude slower than DSW with 10 projections (DSW-10). We observe that DSW-10 obtains a better Wasserstein-2 score than PRW with 5-dimensional subspace, while its corresponding computational time is 30 times faster than that of PRW-5. Using 50 dimension, PRW’s Wasserstein-2 score improves about $2 9 \%$ to that of DSW-10 but the computational cost is also around 40 times slower. The model trained by WD gives good Wasserstein-2 score; however, it is computational expensive (about 40 times slower than DSW-10). The main computational advantage of DSW comes from the exact calculation of Wasserstein distance in one-dimension. The visual comparison between PRW, WD and DSW based on their generated images is in Figure 12 in Appendix E.2.
|
| 146 |
+
|
| 147 |
+
Convergence behavior: Figure 2(b) shows that DSW learns better models at a faster speed of convergence than other baseline distances with a very small number of projections, e.g., DSW-10 is the second lowest curve compared to curves from other sliced-based distances.
|
| 148 |
+
|
| 149 |
+
Scalability over sample size of minibatch: Results in Figure 2(c) show that DSW has a computational complexity of the order ${ \mathcal { O } } ( k \log k )$ , which is similar to those of other sliced-based distances, where $k$ is the number of samples per batch.
|
| 150 |
+
|
| 151 |
+
Effect of the reguloptimal distribution ization paraof DSW with $\lambda _ { C }$ : For each value of projections, and the $\lambda _ { C } \in \{ 1 , 1 0 , 1 0 0 , 1 0 0 0 \}$ $\sigma$ $N = 1 0$ $\begin{array} { r } { A _ { N } = \frac { 1 } { N ^ { 2 } } \sum _ { i , j = 1 } ^ { N } | \boldsymbol { \theta } _ { i } ^ { \top } \boldsymbol { \theta } _ { j } | } \end{array}$ an approximation of the regularized term $\mathbb { E } _ { \theta , \theta ^ { \prime } \sim \sigma } \left[ \left| \theta ^ { \top } \theta ^ { \prime } \right| \right]$ in the dual form of DSW in equation (2), where $\{ \theta _ { i } \} _ { i = 1 } ^ { N } \sim \sigma$ . The results are shown in Figure 2(d). We observe that when $\lambda _ { C }$ increases, $A _ { N }$ goes down. When $\lambda _ { C } = 0$ , i.e., no regularization, $A _ { N }$ gets close to 1, meaning that all projected directions collapse to one direction. When $\lambda _ { C } = 1 0 0 0$ , $A _ { N }$ is close to 0.1, suggesting that all projected directions are nearly orthogonal.
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Comparison between DSW, SW, Max-SW and Max-GSW-NN in terms of execution time and performance. Here, each dot of SW and DSW corresponds to the number of projections chosen in $\{ 1 0 ^ { 2 } , 5 \times$ $\mathrm { \dot { 1 } 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } } \}$ . We set the minibatch size be 512 on CelebA and CIFAR, and be 4096 on LSUN.
|
| 155 |
+
|
| 156 |
+
Additional experiments: We also investigate how the number of gradient-steps used for updating distribution of directions $\sigma$ , and how the size of minibatches affects the quality of DSW (see Appendix E.1). The results show that an increasing number of gradient steps to update $\sigma$ leads to better performance of DSW but also slows down the computation speed. Furthermore, we carry out experiments with DGSW, an extension of DSW to non-linear projections, and test the new proposed distances in training encoder-generator models on MNIST using joint contrastive inference (JCI) in Appendices E.1 and E.3. The description of these models is in Appendix D.
|
| 157 |
+
|
| 158 |
+
# 4.2 RESULTS ON LARGE-SCALE DATASETS
|
| 159 |
+
|
| 160 |
+
Next, we conduct large-scale experiments on a range of more realistic image datasets. We train generative models using CIFAR10, CelebA, and LSUN datasets (all these datasets are rescaled to $6 4 \mathrm { x } 6 4$ resolution). When working with high dimensional distributions, Deshpande et al. (2018) proposed a trick to improve the quality of the generator by learning a feature function which maps data to a new feature space that is more manageable in size. When the feature function is fixed, the generator is trained to match the distribution of features. When the generator is fixed, the feature function tries to tease apart the data empirical features from the generated feature distribution. For the experiments in this section, we use the same technique with DSW and all other baseline distances.
|
| 161 |
+
|
| 162 |
+
We compare DSW with SW, Max-SW, and Max-GSW-NN in both generative quality (FID score) and computational time in Figure 3. We could not compare DSW with PRW on the large-scale datasets since PRW is computationally expensive to train to obtain good generated images. On CelebA and CIFAR10, we let $N$ , the number of projections of both DSW and SW, vary in the set $\{ 1 0 ^ { 2 } , 5 \times 1 0 ^ { 2 } , 1 0 ^ { 3 } , 5 \times 1 0 ^ { 3 } , 1 0 ^ { 4 } \}$ . For LSUN, since it takes considerably longer time to train each model, we only vary $N$ in the set $\{ 1 0 ^ { 2 } , 1 0 ^ { 4 } \}$ . On all these large datasets, DSW outperforms all the other baselines in both FID score of the learned model and computational efficiency. The gap of FID scores between DSW and other methods is especially large on CIFAR10 and LSUN. For example, on CIFAR10, with the same computational time, FID scores of DSW are always lower than those of SW about 20 units. On LSUN, with 100 projections, DSW can achieve an FID score of 46 while SW with 10000 projections still has a worse FID score of over 60. It is interesting to note that on these high-dimensional datasets, Max-SW performs rather poorly: it obtains the highest FID scores among all distances while requires heavy computation. Max-GSW-NN has better FID scores than (Max)-SW; however, it is still worse than DSW and while being slower. This is consistent with the intuition that as the number of dimension of the data grows, the use of a single important slice in Max-SW becomes a less efficient approximation. DSW, on the other hand, is able to make use of more important slices, and at the same time avoids SW’s inefficiency of uniform slice-sampling.
|
| 163 |
+
|
| 164 |
+
Generated images from CelebA, CIFAR10 and LSUN are deferred to Appendix E.1. Comparing to other sliced-based Wasserstein distances, generated samples obtained from the DSW’s generative model are also more visually realistic. Further experiments to compare DGSW with GSW, Max-GSW, and Max-GSW-NN are also given in the Appendix E.1. Based on these experiments, we can conclude that the distributional approach also improves the generative quality of non-linear slicing distances.
|
| 165 |
+
|
| 166 |
+
# 5 CONCLUSION
|
| 167 |
+
|
| 168 |
+
In this paper, we have presented the novel distributional sliced-Wasserstein (DSW) distances between two probability measures. Our main idea is to search for the best distribution of important directions while regularizing towards orthogonal directions. We prove that they are well-defined metrics and provide their theoretical and computational properties. We compare our proposed distances to other sliced-based distances in a variety of generative modeling tasks, including estimating generative models and jointly estimating both generators and inference models. Extensive experiments demonstrate that our new distances yield significantly better models and convergence behaviors during training than the previous sliced-based distances. One important future direction is to investigate theoretically the optimal choice of the regularization parameter $\lambda _ { C }$ such that the DSW distance can capture all the important directions that can distinguish two target probability measures well.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Jason Altschuler, Jonathan Niles-Weed, and Philippe Rigollet. Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration. In Advances in neural information processing systems, pp. 1964–1974, 2017.
|
| 173 |
+
|
| 174 |
+
Luca Ambrogioni, Umut Güçlü, Yagmur Güçlütürk, Max Hinne, Marcel AJ van Gerven, and Eric ˘ Maris. Wasserstein variational inference. In Advances in Neural Information Processing Systems, pp. 2473–2482, 2018.
|
| 175 |
+
|
| 176 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pp. 214–223, 2017.
|
| 177 |
+
|
| 178 |
+
Erhan Bayraktar and Gaoyue Guo. Strong equivalence between metrics of Wasserstein type. arXiv preprint arXiv:1912.08247, 2019.
|
| 179 |
+
|
| 180 |
+
Espen Bernton, Pierre E Jacob, Mathieu Gerber, and Christian P Robert. On parameter estimation with the Wasserstein distance. Information and Inference: A Journal of the IMA, 8(4):657–676, 2019.
|
| 181 |
+
|
| 182 |
+
Gregory Beylkin. The inversion problem and applications of the generalized Radon transform. Communications on pure and applied mathematics, 37(5):579–599, 1984.
|
| 183 |
+
|
| 184 |
+
Nicolas Bonneel and David Coeurjolly. Spot: sliced partial optimal transport. ACM Transactions on Graphics (TOG), 38(4):1–13, 2019.
|
| 185 |
+
|
| 186 |
+
Nicolas Bonneel, Julien Rabin, Gabriel Peyré, and Hanspeter Pfister. Sliced and Radon Wasserstein barycenters of measures. Journal of Mathematical Imaging and Vision, 1(51):22–45, 2015.
|
| 187 |
+
|
| 188 |
+
Nicolas Bonnotte. Unidimensional and evolution methods for optimal transportation. PhD thesis, Paris 11, 2013.
|
| 189 |
+
|
| 190 |
+
Charlotte Bunne, David Alvarez-Melis, Andreas Krause, and Stefanie Jegelka. Learning generative models across incomparable spaces. In International Conference on Machine Learning, 2019.
|
| 191 |
+
|
| 192 |
+
Xiongjie Chen, Yongxin Yang, and Yunpeng Li. Augmented sliced Wasserstein distances. arXiv preprint arXiv:2006.08812, 2020.
|
| 193 |
+
|
| 194 |
+
Lenaic Chizat, Gabriel Peyré, Bernhard Schmitzer, and François-Xavier Vialard. Scaling algorithms for unbalanced optimal transport problems. Mathematics of Computation, 87(314):2563–2609, 2018.
|
| 195 |
+
|
| 196 |
+
Nicolas Courty, Rémi Flamary, and Devis Tuia. Domain adaptation with regularized optimal transport. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 274–289. Springer, 2014.
|
| 197 |
+
|
| 198 |
+
Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In Advances in Neural Information Processing Systems, pp. 3730–3739, 2017.
|
| 199 |
+
|
| 200 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pp. 2292–2300, 2013.
|
| 201 |
+
|
| 202 |
+
Ishan Deshpande, Ziyu Zhang, and Alexander G Schwing. Generative modeling using the sliced Wasserstein distance. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3483–3491, 2018.
|
| 203 |
+
|
| 204 |
+
Ishan Deshpande, Yuan-Ting Hu, Ruoyu Sun, Ayis Pyrros, Nasir Siddiqui, Sanmi Koyejo, Zhizhen Zhao, David Forsyth, and Alexander G Schwing. Max-sliced Wasserstein distance and its use for GANs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10648–10656, 2019.
|
| 205 |
+
|
| 206 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
|
| 207 |
+
|
| 208 |
+
R’emi Flamary and Nicolas Courty. Pot python optimal transport library, 2017. URL https: //pythonot.github.io/.
|
| 209 |
+
|
| 210 |
+
Aude Genevay, Gabriel Peyre, and Marco Cuturi. Learning generative models with Sinkhorn divergences. In International Conference on Artificial Intelligence and Statistics, pp. 1608–1617, 2018.
|
| 211 |
+
|
| 212 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of Wasserstein Gans. In Advances in neural information processing systems, pp. 5767–5777, 2017.
|
| 213 |
+
|
| 214 |
+
Sigurdur Helgason. Integral geometry and Radon transforms. Springer Science & Business Media, 2010.
|
| 215 |
+
|
| 216 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
|
| 217 |
+
|
| 218 |
+
Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 219 |
+
|
| 220 |
+
Philip A Knight. The Sinkhorn–Knopp algorithm: convergence and applications. SIAM Journal on Matrix Analysis and Applications, 30(1):261–275, 2008.
|
| 221 |
+
|
| 222 |
+
Max Kochurov, Rasul Karimov, and Serge Kozlukov. Geoopt: Riemannian optimization in pytorch, 2020.
|
| 223 |
+
|
| 224 |
+
Soheil Kolouri, Phillip E Pope, Charles E Martin, and Gustavo K Rohde. Sliced Wasserstein auto-encoders. In International Conference on Learning Representations, 2018.
|
| 225 |
+
|
| 226 |
+
Soheil Kolouri, Kimia Nadjahi, Umut Simsekli, Roland Badeau, and Gustavo Rohde. Generalized sliced Wasserstein distances. In Advances in Neural Information Processing Systems, pp. 261–272, 2019.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 229 |
+
|
| 230 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 231 |
+
|
| 232 |
+
Bing Li, Shaoli Wang, et al. On directional regression for dimension reduction. Journal of the American Statistical Association, 102:997–1008, 2007.
|
| 233 |
+
|
| 234 |
+
Ker-Chau Li. Sliced inverse regression for dimension reduction. Journal of the American Statistical Association, 86(414):316–328, 1991.
|
| 235 |
+
|
| 236 |
+
Tianyi Lin, Nhat Ho, and Michael Jordan. On efficient optimal transport: An analysis of greedy and accelerated mirror descent algorithms. In International Conference on Machine Learning, pp. 3982–3991, 2019a.
|
| 237 |
+
|
| 238 |
+
Tianyi Lin, Nhat Ho, and Michael I Jordan. On the acceleration of the Sinkhorn and Greenkhorn algorithms for optimal transport. arXiv preprint arXiv:1906.01437, 2019b.
|
| 239 |
+
|
| 240 |
+
Tianyi Lin, Chenyou Fan, Nhat Ho, Marco Cuturi, and Michael I. Jordan. Projection robust Wasserstein distance and Riemannian optimization. arXiv preprint arXiv:2006.07458, 2020.
|
| 241 |
+
|
| 242 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 243 |
+
|
| 244 |
+
Antoine Liutkus, Umut Simsekli, Szymon Majewski, Alain Durmus, and Fabian-Robert Stöter. Sliced-Wasserstein flows: Nonparametric generative modeling via optimal transport and diffusions. In International Conference on Machine Learning, pp. 4104–4113, 2019.
|
| 245 |
+
|
| 246 |
+
Cheng Meng, Yuan Ke, Jingyi Zhang, Mengrui Zhang, Wenxuan Zhong, and Ping Ma. Large-scale optimal transport map estimation using projection pursuit. In Advances in Neural Information Processing Systems, pp. 8118–8129, 2019.
|
| 247 |
+
|
| 248 |
+
Boris Muzellec and Marco Cuturi. Subspace detours: Building transport plans that are optimal on subspace projections. In Advances in Neural Information Processing Systems, pp. 6917–6928, 2019.
|
| 249 |
+
|
| 250 |
+
Kimia Nadjahi, Alain Durmus, Umut Simsekli, and Roland Badeau. Asymptotic guarantees for learning generative models with the sliced-Wasserstein distance. In Advances in Neural Information Processing Systems, pp. 250–260, 2019.
|
| 251 |
+
|
| 252 |
+
François-Pierre Paty and Marco Cuturi. Subspace robust Wasserstein distances. In International Conference on Machine Learning, pp. 5072–5081, 2019.
|
| 253 |
+
|
| 254 |
+
Michaël Perrot, Nicolas Courty, Rémi Flamary, and Amaury Habrard. Mapping estimation for discrete optimal transport. Advances in Neural Information Processing Systems, 29:4197–4205, 2016.
|
| 255 |
+
|
| 256 |
+
Gabriel Peyré and Marco Cuturi. Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6):355–607, 2019.
|
| 257 |
+
|
| 258 |
+
Julien Rabin, Julie Delon, and Yann Gousseau. Regularization of transportation maps for color and contrast transfer. In 2010 IEEE International Conference on Image Processing, pp. 1933–1936. IEEE, 2010.
|
| 259 |
+
|
| 260 |
+
Julien Rabin, Sira Ferradans, and Nicolas Papadakis. Adaptive color transfer with relaxed optimal transport. In 2014 IEEE International Conference on Image Processing (ICIP), pp. 4852–4856. IEEE, 2014.
|
| 261 |
+
|
| 262 |
+
Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34–41, 2001.
|
| 263 |
+
|
| 264 |
+
Mark Rowland, Jiri Hron, Yunhao Tang, Krzysztof Choromanski, Tamas Sarlos, and Adrian Weller. Orthogonal estimation of Wasserstein distances. In The 22nd International Conference on Artificial Intelligence and Statistics, pp. 186–195, 2019.
|
| 265 |
+
|
| 266 |
+
Bernhard Schmitzer. Stabilized sparse scaling algorithms for entropy regularized transport problems. SIAM Journal on Scientific Computing, 41(3):A1443–A1481, 2019.
|
| 267 |
+
|
| 268 |
+
Richard Sinkhorn. Diagonal equivalence to matrices with prescribed row and column sums. The American Mathematical Monthly, 74(4):402–405, 1967.
|
| 269 |
+
|
| 270 |
+
Ilya Tolstikhin, Olivier Bousquet, Sylvain Gelly, and Bernhard Schoelkopf. Wasserstein auto-encoders. In International Conference on Learning Representations, 2018.
|
| 271 |
+
|
| 272 |
+
Cédric Villani. Optimal transport: Old and New. Springer, 2008.
|
| 273 |
+
|
| 274 |
+
Martin J Wainwright. High-dimensional statistics: A non-asymptotic viewpoint. Cambridge University Press, 2019.
|
| 275 |
+
|
| 276 |
+
Jiqing Wu, Zhiwu Huang, Dinesh Acharya, Wen Li, Janine Thoma, Danda Pani Paudel, and Luc Van Gool. Sliced Wasserstein generative models. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3713–3722, 2019.
|
| 277 |
+
|
| 278 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a largescale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
|
md/train/QkRbdiiEjM/QkRbdiiEjM.md
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADAGCN: ADABOOSTING GRAPH CONVOLUTIONAL NETWORKS INTO DEEP MODELS
|
| 2 |
+
|
| 3 |
+
Ke Sun
|
| 4 |
+
Zhejiang Lab
|
| 5 |
+
Key Lab. of Machine Perception (MoE), School of EECS, Peking University
|
| 6 |
+
ajksunke@pku.edu.cn
|
| 7 |
+
|
| 8 |
+
Zhanxing Zhu\* Beijing Institute of Big Data Research, Beijing, China zhanxing.zhu@pku.edu.cn
|
| 9 |
+
|
| 10 |
+
Zhouchen Lin∗
|
| 11 |
+
Key Lab. of Machine Perception (MoE), School of EECS, Peking University
|
| 12 |
+
Pazhou Lab, Guangzhou, China
|
| 13 |
+
zlin@pku.edu.cn
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
The design of deep graph models still remains to be investigated and the crucial part is how to explore and exploit the knowledge from different hops of neighbors in an efficient way. In this paper, we propose a novel RNN-like deep graph neural network architecture by incorporating AdaBoost into the computation of network; and the proposed graph convolutional network called AdaGCN (Adaboosting Graph Convolutional Network) has the ability to efficiently extract knowledge from high-order neighbors of current nodes and then integrates knowledge from different hops of neighbors into the network in an Adaboost way. Different from other graph neural networks that directly stack many graph convolution layers, AdaGCN shares the same base neural network architecture among all “layers” and is recursively optimized, which is similar to an RNN. Besides, We also theoretically established the connection between AdaGCN and existing graph convolutional methods, presenting the benefits of our proposal. Finally, extensive experiments demonstrate the consistent state-of-the-art prediction performance on graphs across different label rates and the computational advantage of our approach AdaGCN 1.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Recently, research related to learning on graph structural data has gained considerable attention in machine learning community. Graph neural networks (Gori et al., 2005; Hamilton et al., 2017; Velickovi ˇ c et al., 2018), particularly graph convolutional networks (Kipf & Welling, 2017; Deffer- ´ rard et al., 2016; Bruna et al., 2014) have demonstrated their remarkable ability on node classification (Kipf & Welling, 2017), link prediction (Zhu et al., 2016) and clustering tasks (Fortunato, 2010). Despite their enormous success, almost all of these models have shallow model architectures with only two or three layers. The shallow design of GCN appears counterintuitive as deep versions of these models, in principle, have access to more information, but perform worse. Oversmoothing (Li et al., 2018) has been proposed to explain why deep GCN fails, showing that by repeatedly applying Laplacian smoothing, GCN may mix the node features from different clusters and makes them indistinguishable. This also indicates that by stacking too many graph convolutional layers, the embedding of each node in GCN is inclined to converge to certain value (Li et al., 2018), making it harder for classification. These shallow model architectures restricted by oversmoothing issue limit their ability to extract the knowledge from high-order neighbors, i.e., features from remote hops of neighbors for current nodes. Therefore, it is crucial to design deep graph models such that high-order information can be aggregated in an effective way for better predictions.
|
| 22 |
+
|
| 23 |
+
There are some works (Xu et al., 2018b; Liao et al., 2019; Klicpera et al., 2018; Li et al., 2019; Liu et al., 2020) that tried to address this issue partially, and the discussion can refer to Appendix A.1. By contrast, we argue that a key direction of constructing deep graph models lies in the efficient exploration and effective combination of information from different orders of neighbors. Due to the apparent sequential relationship between different orders of neighbors, it is a natural choice to incorporate boosting algorithm into the design of deep graph models. As an important realization of boosting theory, AdaBoost (Freund et al., 1999) is extremely easy to implement and keeps competitive in terms of both practical performance and computational cost (Hastie et al., 2009). Moreover, boosting theory has been used to analyze the success of ResNets in computer vision (Huang et al., 2018) and AdaGAN (Tolstikhin et al., 2017) has already successfully incorporated boosting algorithm into the training of GAN (Goodfellow et al., 2014).
|
| 24 |
+
|
| 25 |
+
In this work, we focus on incorporating AdaBoost into the design of deep graph convolutional networks in a non-trivial way. Firstly, in pursuit of the introduction of AdaBoost framework, we refine the type of graph convolutions and thus obtain a novel RNN-like GCN architecture called AdaGCN. Our approach can efficiently extract knowledge from different orders of neighbors and then combine these information in an AdaBoost manner with iterative updating of the node weights. Also, we compare our AdaGCN with existing methods from the perspective of both architectural difference and feature representation power to show the benefits of our method. Finally, we conduct extensive experiments to demonstrate the consistent state-of-the-art performance of our approach across different label rates and computational advantage over other alternatives.
|
| 26 |
+
|
| 27 |
+
# 2 OUR APPROACH: ADAGCN
|
| 28 |
+
|
| 29 |
+
# 2.1 ESTABLISHMENT OF ADAGCN
|
| 30 |
+
|
| 31 |
+
Consider an undirected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $N$ nodes $v _ { i } \in \mathcal V$ , edges $( v _ { i } , v _ { j } ) \in \mathcal { E }$ . $A \in \mathbb { R } ^ { N \times N }$ is the adjacency matrix with corresponding degree matrix $\begin{array} { r } { D _ { i i } = \sum _ { j } \dot { A } _ { i j } } \end{array}$ . In the vanilla GCN model (Kipf & Welling, 2017) for semi-supervised node classification, the graph embedding of nodes with two convolutional layers is formulated as:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
Z = \hat { A } \mathrm { R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $Z \in \mathbb { R } ^ { N \times K }$ is the final embedding matrix (output logits) of nodes before softmax and $K$ is the number of classes. $X \in \mathbb { R } ^ { N \times C }$ denotes the feature matrix where $C$ is the input dimension. $\hat { A } = \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } }$ where ${ \tilde { A } } = A + I$ and $\tilde { D }$ is the degree matrix of $\tilde { A }$ . In addition, $W ^ { ( 0 ) } \in \mathbb { R } ^ { C \times H }$ is the input-to-hidden weight matrix for a hidden layer with $H$ feature maps and $W ^ { ( 1 ) } \in \mathbb { R } ^ { H \times K }$ is the hidden-to-output weight matrix.
|
| 38 |
+
|
| 39 |
+
Our key motivation of constructing deep graph models is to efficiently explore information of highorder neighbors and then combine these messages from different orders of neighbors in an AdaBoost way. Nevertheless, if we naively extract information from high-order neighbors based on GCN, we are faced with stacking $l$ layers’ parameter matrix $W ^ { ( i ) } , i = 0 , . . . , l - 1$ , which is definitely costly in computation. Besides, Multi-Scale Deep Graph Convolutional Networks (Luan et al., 2019) also theoretically demonstrated that the output can only contain the stationary information of graph structure and loses all the local information in nodes for being smoothed if we simply deepen GCN. Intuitively, the desirable representation of node features does not necessarily need too many nonlinear transformation $f$ applied on them. This is simply due to the fact that the feature of each node is normally one-dimensional sparse vector rather than multi-dimensional data structures, e.g., images, that intuitively need deep convolution network to extract high-level representation for vision tasks. This insight has been empirically demonstrated in many recent works (Wu et al., 2019; Klicpera et al., 2018; Xu et al., 2018a), showing that a two-layer fully-connected neural networks is a better choice in the implementation. Similarly, our AdaGCN also follows this direction by choosing an appropriate $f$ in each layer rather than directly deepen GCN layers.
|
| 40 |
+
|
| 41 |
+
Thus, we propose to remove ReLU to avoid the expensive joint optimization of multiple parameter matrices. Similarly, Simplified Graph Convolution (SGC) (Wu et al., 2019) also adopted this practice, arguing that nonlinearity between GCN layers is not crucial and the majority of the benefits arises from local weighting of neighboring features. Then the simplified graph convolution is:
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: The RNN-like architecture of AdaGCN with each base classifier $f _ { \theta } ^ { ( l ) }$ sharing the same neural network architecture $f _ { \theta }$ . $w ^ { l }$ and $\theta _ { l }$ denote node weights and parameters computed after the $l$ -th base classifier, respectively.
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
Z = \hat { A } ^ { l } X W ^ { ( 0 ) } W ^ { ( 1 ) } \cdots W ^ { ( l - 1 ) } = \hat { A } ^ { l } X \tilde { W } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where we collapse $W ^ { ( 0 ) } W ^ { ( 1 ) } \cdot \cdot \cdot W ^ { ( l - 1 ) }$ as $\tilde { W }$ and $\hat { A } ^ { l }$ denotes $\hat { A }$ to the $l$ -th power. In particular, one crucial impact of ReLU in GCN is to accelerate the convergence of matrix multiplication since the ReLU is a contraction mapping intuitively. Thus, the removal of ReLU operation could also alleviate the oversmoothing issue, i.e. slowering the convergence of node embedding to indistinguishable ones (Li et al., 2018). Additionally, without ReLU this simplified graph convolution is also able to avoid the aforementioned joint optimization over multiple parameter matrices, resulting in computational benefits. Nevertheless, we find that this type of stacked linear transformation from graph convolution has insufficient power in representing information of high-order neighbors, which is revealed in our experiment described in Appendix A.2. Therefore, we propose to utilize an appropriate nonlinear function $f _ { \theta }$ , e.g., a two-layer fully-connected neural network, to replace the linear transformation $\tilde { W }$ in Eq. 2 and enhance the representation ability of each base classifier in AdaGCN as follows:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
Z ^ { ( l ) } = f _ { \theta } ( \hat { A } ^ { l } X ) ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $Z ^ { ( l ) }$ represents the final embedding matrix (output logits before Softmax) after the $l$ -th base classifier in AdaGCN. This formulation also implies that the $l$ -th base classifier in AdaGCN is extracting knowledge from features of current nodes and their $l$ -th hop of neighbors. Due to the fact that the function of $l$ -th base classifier in AdaGCN is similar to that of the $l$ -th layer in other traditional GCN-based methods that directly stack many graph convolutional layers, we regard the whole part of l-th base classifier as the $l$ -th layers in AdaGCN. As for the realization of Multi-class AdaBoost, we apply SAMME (Stagewise Additive Modeling using a Multi-class Exponential loss function) algorithm (Hastie et al., 2009), a natural and clean multi-class extension of the two-class AdaBoost adaptively combining weak classifiers.
|
| 57 |
+
|
| 58 |
+
As illustrated in Figure 1, we apply base classifie r f (l) to extract knowledge from current node feature and $l$ -th hop of neighbors by minimizing current weighted loss. Then we directly compute the weighted error rate $e r r ^ { ( l ) }$ and corresponding weight $\alpha ^ { ( l ) }$ of current base classifier $f _ { \theta } ^ { ( l ) }$ as follows:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { c } { { e r r ^ { ( l ) } = \displaystyle \sum _ { i = 1 } ^ { n } w _ { i } \mathbb { I } \left( c _ { i } \neq f _ { \theta } ^ { ( l ) } \left( x _ { i } \right) \right) / \sum _ { i = 1 } ^ { n } w _ { i } } } \\ { { \displaystyle \alpha ^ { ( l ) } = \log \frac { 1 - e r r ^ { ( l ) } } { e r r ^ { ( l ) } } + \log ( K - 1 ) , } } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $w _ { i }$ denotes the weight of $i$ -th node and $c _ { i }$ represents the category of current $i$ -th node. To attain a positive $\alpha ^ { ( l ) }$ , we only need $( 1 - e r r ^ { ( l ) } ) > 1 / K$ , i.e., the accuracy of each weak classifier
|
| 65 |
+
|
| 66 |
+
should be better than random guess (Hastie et al., 2009). This can be met easily to guarantee the weights to be updated in the right direction. Then we adjust nodes’ weights by increasing weights on incorrectly classified ones:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
w _ { i } \gets w _ { i } \cdot \exp \left( \alpha ^ { ( l ) } \cdot \mathbb { I } \left( c _ { i } \neq f _ { \theta } ^ { ( l ) } \left( x _ { i } \right) \right) \right) , i = 1 , \dots , n
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
After re-normalizing the weights, we then compute $\hat { A } ^ { l + 1 } X = \hat { A } \cdot ( \hat { A } ^ { l } X )$ to sequentially extract knowledge from of AdaGCN is t $l { + } 1$ -th hop of neighbors in the following base classifier different from traditional AdaBoost, we only define $f _ { \theta } ^ { ( l + 1 ) }$ One crucial point, e.g. a two-layer $f _ { \theta }$ fully connected neural network, which in practice is recursively optimized in each base classifier just similar to a recurrent neural network. This also indicates that the parameters from last base classifier are leveraged as the initialization of next base classifier, which coincides with our intuition that $l + 1$ -th hop of neighbors are directly connected from $l$ -th hop of neighbors. The efficacy of this kind of layer-wise training has been similarly verified in (Belilovsky et al., 2018) recently. Further, we combine the predictions from different orders of neighbors in an Adaboost way to obtain the final prediction $C ( A , X )$ :
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
C ( A , X ) = \arg \operatorname* { m a x } _ { k } \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Finally, we obtain the concise form of AdaGCN in the following:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r l } & { \hat { A } ^ { l } X = \hat { A } \cdot ( \hat { A } ^ { l - 1 } X ) } \\ & { Z ^ { ( l ) } = f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X ) } \\ & { Z = \mathrm { A d a B o o s t } ( Z ^ { ( l ) } ) } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Note that $f _ { \theta }$ is non-linear, rather than linear in SGC (Wu et al., 2019), to guarantee the representation power. As shown in Figure 1, the architecture of AdaGCN is a variant of RNN with synchronous sequence input and output. Although the same classifier architecture is adopted for $f _ { \theta } ^ { ( \bar { l } ) }$ , their parameters are different, which is different from vanilla RNN. We provide a detailed description of the our algorithm in Section 3.
|
| 85 |
+
|
| 86 |
+
# 2.2 COMPARISON WITH EXISTING METHODS
|
| 87 |
+
|
| 88 |
+
Architectural Difference. As illustrated in Figure 1 and 2, there is an apparent difference among the architectures of GCN (Kipf & Welling, 2017), SGC (Wu et al., 2019), Jumping Knowledge (JK) (Xu et al., 2018b) and AdaGCN. Compared with these existing graph convolutional approaches that sequentially convey intermediate result $Z ^ { ( l ) }$ to compute final prediction, our AdaGCN transmits weights of nodes $w ^ { i }$ , aggregated features of different hops of neighbors ${ \hat { A } } ^ { l } X$ . More importantly, in AdaGCN the embedding $Z ^ { ( l ) }$ is independent of the flow of computation in the network and the sparse adjacent matrix $\hat { A }$ is also not directly involved in the computation of individual network because we compute
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Comparison of the graph model architectures. $f _ { a }$ in JK network denotes one aggregation layer with aggregation function such as concatenation or max pooling.
|
| 92 |
+
|
| 93 |
+
${ \hat { A } } ^ { ( l + 1 ) } X$ in advance and then feed it instead of $\hat { A }$ into the classifier $f _ { \theta } ^ { ( l + 1 ) }$ , thus yielding significant computation reduction, which will be discussed further in Section 3.
|
| 94 |
+
|
| 95 |
+
Connection with PPNP and APPNP. We also established a strong connection between AdaGCN and previous state-of-the-art Personalized Propagation of Neural Predictions (PPNP) and Approximate PPNP (APPNP) (Klicpera et al., 2018) method that leverages personalized pagerank to reconstruct graph convolutions in order to use information from a large and adjustable neighborhood. The analysis can be summarized in the following Proposition 1. Proof can refer to Appendix A.3.
|
| 96 |
+
|
| 97 |
+
Proposition 1. Suppose that $\gamma$ is the teleport factor. Let matrix sequence $\{ Z ^ { ( l ) } \}$ be from the output of each layer l in AdaGCN, then PPNP is equivalent to the Exponential Moving Average (EMA) with exponentially decreasing factor $\gamma$ on $\{ Z ^ { ( l ) } \}$ in a sharing parameters version, and its approximate version APPNP can be viewed as the approximated form of EMA with a limited number of terms.
|
| 98 |
+
|
| 99 |
+
Proposition 1 illustrates that AdaGCN can be viewed as an adaptive form of APPNP, formulated as:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Specifically, the first discrepancy between AdaGCN and APPNP lies in the adaptive coefficient $\alpha ^ { ( l ) }$ in AdaGCN determined by the error of $l$ -th base classifier $f _ { \theta } ^ { ( l ) }$ rather than fixed exponentially decreased weights in APPNP. In addition, AdaGCN employs classifier $f _ { \theta } ^ { ( l ) }$ with different parameters to learn the embedding of different orders of neighbors, while APPNP shares these parameters in its form. We verified this benefit of our approach in our experiments shown in Section 4.2.
|
| 106 |
+
|
| 107 |
+
Comparison with MixHop MixHop (Abu-El-Haija et al., 2019) applied the similar way of graph convolution by repeatedly mixing feature representations of neighbors at various distance. Proposition 2 proves that both AdaGCN and MixHop are able to represent feature differences among neighbors while previous GCNs-based methods cannot. Proof can refer to Appendix A.4. Recap the definition of general layer-wise Neighborhood Mixing (Abu-El-Haija et al., 2019) as follows:
|
| 108 |
+
|
| 109 |
+
Definition 1. General layer-wise Neighborhood Mixing: $A$ graph convolution network has the ability to represent the layer-wise neighborhood mixing if for any $b _ { 0 } , b _ { 1 } , . . . , b _ { L } ,$ , there exists an injective mapping $f$ with a setting of its parameters, such that the output of this graph convolution network can express the following formula:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
f \left( \sum _ { l = 0 } ^ { L } b _ { l } \sigma \left( \hat { A } ^ { l } X \right) \right)
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Proposition 2. AdaGCNs defined by our proposed approach (Eq. equation 7) are capable of representing general layer-wise neighborhood mixing, i.e., can meet the Definition $^ { l }$ .
|
| 116 |
+
|
| 117 |
+
Albeit the similarity, AdaGCN distinguishes from MixHop in many aspects. Firstly, MixHop concatenates all outputs from each order of neighbors while we combines these predictions in an Adaboost way, which has theoretical generalization guarantee based on boosting theory Hastie et al. (2009). Oono & Suzuki (2020) have recently derived the optimization and generalization guarantees of multi-scale GNNs, serving as the theoretical backbone of AdaGCN. Meantime, MixHop allows full linear mixing of different orders of neighboring features, while AdaGCN utilizes different nonlinear transformation $f _ { \theta } ^ { ( l ) }$ among all layers, enjoying stronger expressive power.
|
| 118 |
+
|
| 119 |
+
# 3 ALGORITHM
|
| 120 |
+
|
| 121 |
+
In practice, we employ SAMME.R (Hastie et al., 2009), the soft version of SAMME, in AdaGCN. SAMME.R (R for Real) algorithm (Hastie et al., 2009) leverages real-valued confidence-rated predictions, i.e., weighted probability estimates, rather than predicted hard labels in SAMME, in the prediction combination, which has demonstrated a better generalization and faster convergence than SAMME. We elaborate the final version of AdaGCN in Algorithm 1. We provide the analysis on the choice of model depth $L$ in Appendix A.7, and then we elaborate the computational advantage of AdaGCN in the following.
|
| 122 |
+
|
| 123 |
+
Analysis of Computational Advantage. Due to the similarity of graph convolution in MixHop (Abu-El-Haija et al., 2019), AdaGCN also requires no additional memory or computational complexity compared with previous GCN models. Meanwhile, our approach enjoys huge computational advantage compared with GCN-based models, e.g., PPNP and APPNP, stemming from excluding the additional computation involved in sparse tensors, such as the sparse tensor multiplication between $\hat { A }$ and other dense tensors, in the forward and backward propagation of the neural network. Specifically, there are only $L$ times sparse tensor operations for an AdaGCN model with $L$ layers, i.e., $\hat { A } ^ { l } X = \overset { \cdot } { A } \cdot ( \hat { A } ^ { l - 1 } X )$ for each layer $l$ . This operation in each layer yields a dense tensor
|
| 124 |
+
|
| 125 |
+
# Algorithm 1 AdaGCN based on SAMME.R Algorithm
|
| 126 |
+
|
| 127 |
+
Input: Features Matrix $X$ , normalized adjacent matrix $\hat { A }$ , a two-layer fully connected network $f _ { \theta }$ , number of layers $L$ and number of classes $K$ .
|
| 128 |
+
|
| 129 |
+
Output: Final combined prediction $C ( A , X )$
|
| 130 |
+
|
| 131 |
+
1: Initialize the node weights $w _ { i } = 1 / n , i = 1 , 2 , . . . , n$ on training set, neighbors feature matrix ${ \hat { X } } ^ { ( 0 ) } = X$ and classifier $f _ { \theta } ^ { ( - 1 ) }$ .
|
| 132 |
+
|
| 133 |
+
2: for $l = 0$ to do
|
| 134 |
+
|
| 135 |
+
3: Fit the graph convolutional classifier f (l) on neighbor feature matrix $\hat { X } ^ { ( l ) }$ based on $f _ { \theta } ^ { ( l - 1 ) }$ by minimizing current weighted loss.
|
| 136 |
+
|
| 137 |
+
4: Obtain the weighted probability estimates $p ^ { ( l ) } ( \hat { X } ^ { ( l ) } )$ for $f _ { \theta } ^ { ( l ) }$
|
| 138 |
+
|
| 139 |
+
5: Compute the individual prediction $h _ { k } ^ { ( l ) } ( x )$ for the current graph convolutional classifier $f _ { \theta } ^ { ( l ) }$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) \gets ( K - 1 ) \left( \log p _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) - \frac { 1 } { K } \sum _ { k ^ { \prime } } \log p _ { k ^ { \prime } } ^ { ( l ) } ( \hat { X } ^ { ( l ) } ) \right)
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $k = 1 , \ldots , K$
|
| 146 |
+
|
| 147 |
+
6: Adjust the node weights $w _ { i }$ for each node $x _ { i }$ with label $y _ { i }$ on training set:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
w _ { i } w _ { i } \cdot \exp ( - \frac { K - 1 } { K } y _ { i } ^ { \top } \log p ^ { ( l ) } ( x _ { i } ) ) , i = 1 , \ldots , n
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
7: Re-normalize all weights $w _ { i }$
|
| 154 |
+
|
| 155 |
+
8: Update $l { + } 1$ -hop neighbor feature matrix $\hat { X } ^ { ( l + 1 ) }$ :
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\hat { X } ^ { ( l + 1 ) } = \hat { A } \hat { X } ^ { ( l ) }
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
# 9: end for
|
| 162 |
+
|
| 163 |
+
10: Combine all predictions $h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } )$ for $l = 0 , . . . , L$
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
C ( A , X ) = \arg \operatorname* { m a x } _ { k } \sum _ { l = 0 } ^ { L } h _ { k } ^ { ( l ) } ( \hat { X } ^ { ( l ) } )
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
11: return Final combined prediction $C ( A , X )$ .
|
| 170 |
+
|
| 171 |
+
$B ^ { l } = \hat { A } ^ { l } X$ for the $l$ -th layer, which is then fed into the computation in a two-layer fully-connected network, i.e., $f _ { \theta } ^ { ( l ) } ( B ^ { l } ) = \mathrm { \bar { R e L U } } ( B ^ { l } W ^ { ( 0 ) } ) W ^ { ( 1 ) }$ . Due to the fact that dense tensor $B ^ { l }$ has been computed in advance, there is no other computation related to sparse tensors in the multiple forward and backward propagation procedures while training the neural network. By contrast, this multiple computation involved in sparse tensors in the GCN-based models, e.g., GCN: $\hat { A } \mathrm { R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }$ , is highly expensive. AdaGCN avoids these additional sparse tensor operations in the neural network and then attains huge computational efficiency. We demonstrate this viewpoint in the Section 4.3.
|
| 172 |
+
|
| 173 |
+
# 4 EXPERIMENTS
|
| 174 |
+
|
| 175 |
+
Experimental Setup. We select five commonly used graphs: CiteSeer, Cora-ML (Bojchevski & Gunnemann, 2018; McCallum et al., 2000), PubMed (Sen et al., 2008), MS-Academic (Shchur ¨ et al., 2018) and Reddit. Dateset statistics are summarized in Table 1. Recent graph neural networks suffer from overfitting to a single splitting of training, validation and test datasets (Klicpera et al., 2018). To address this problem, inspired by (Klicpera et al., 2018), we test all approaches on multiple random splits and initialization to conduct a rigorous study. Detailed dataset splittings are provided in Appendix A.6.
|
| 176 |
+
|
| 177 |
+
Table 1: Dateset statistics
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Dateset</td><td>Nodes</td><td>Edges</td><td>Classes</td><td>Features</td><td>LabelRate</td></tr><tr><td>CiteSeer</td><td>3,327</td><td>4,732</td><td>6</td><td>3,703</td><td>3.6%</td></tr><tr><td>Cora</td><td>2,708</td><td>5,429</td><td>7</td><td>1,433</td><td>5.2%</td></tr><tr><td>PubMed</td><td>19,717</td><td>44,338</td><td>3</td><td>500</td><td>0.3%</td></tr><tr><td>MS Academic</td><td>18,333</td><td>81,894</td><td>15</td><td>6,805</td><td>1.6%</td></tr><tr><td>Reddit</td><td>232,965</td><td>11,606,919</td><td>41</td><td>602</td><td>65.9%</td></tr></table>
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: Comparison of test accuracy of different models as the layer increases. We regard the $l$ -th base classifier as the $l$ -th layer in AdaGCN as both of them are leveraged to exploit the information from $l$ -th order of neighbors for current nodes.
|
| 183 |
+
|
| 184 |
+
Basic Setting of Baselines and AdaGCN. We compare AdaGCN with GCN (Kipf & Welling, 2017) and Simple Graph Convolution (SGC) (Wu et al., 2019) in Figure 3. In Table 2, we employ the same baselines as (Klicpera et al., 2018): V.GCN (vanilla GCN) (Kipf & Welling, 2017) and GCN with our early stopping, N-GCN (network of GCN) (Abu-El-Haija et al., 2018a), GAT (Graph Attention Networks) (Velickovi ˇ c et al., 2018), BT.FP (bootstrapped feature propagation) (Buchnik ´ & Cohen, 2018) and JK (jumping knowledge networks with concatenation) (Xu et al., 2018b). In the computation part, we additionally compare AdaGCN with FastGCN (Chen et al., 2018) and GraphSAGE (Hamilton et al., 2017). We refer to the result of baselines from (Klicpera et al., 2018) and the implementation of AdaGCN is adapted from APPNP. For AdaGCN, after the line search on hyper-parameters, we set $h = 5 0 0 0$ hidden units for the first four datasets except Ms-academic with $h = 3 0 0 0$ , and 15, 12, 20 and 5 layers respectively due to the different graph structures. In addition, we set dropout rate to 0 for Citeseer and Cora-ML datasets and 0.2 for the other datasets and $5 \times 1 0 ^ { - 3 } L _ { 2 }$ regularization on the first linear layer. We set weight decay as $1 \times 1 0 ^ { - 3 }$ for Citeseer while $1 \times 1 0 ^ { - 4 }$ for others. More detailed model parameters and analysis about our early stopping mechanism can be referred from Appendix A.6.
|
| 185 |
+
|
| 186 |
+
# 4.1 DESIGN OF DEEP GRAPH MODELS TO CIRCUMVENT OVERSMOOTHING EFFECT
|
| 187 |
+
|
| 188 |
+
It is well-known that GCN suffers from oversmoothing (Li et al., 2018) with the stacking of more graph convolutions. However, combination of knowledge from each layer to design deep graph models is a reasonable method to circumvent oversmoothing issue. In our experiment, we aim to explore the prediction performance of GCN, GCN with residual connection (Kipf & Welling, 2017), SGC and our AdaGCN with a growing number of layers.
|
| 189 |
+
|
| 190 |
+
Table 2: Average accuracy under 100 runs with uncertainties showing the $95 \%$ confidence level calculated by bootstrapping. OOM denotes “out of memory”. “(ours)” denotes the results based on our implementation, which are slight lower than numbers above from original literature (Klicpera et al., 2018). P values of paired t test between APPNP (ours) and AdaGCN are provided in the last row.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Model</td><td>Citeseer</td><td>Cora-ML</td><td>Pubmed</td><td>MSAcademic</td></tr><tr><td>V.GCN</td><td>73.51±0.48</td><td>82.30±0.34</td><td>77.65±0.40</td><td>91.65±0.09</td></tr><tr><td>GCN</td><td>75.40±0.30</td><td>83.41±0.39</td><td>78.68±0.38</td><td>92.10±0.08</td></tr><tr><td>N-GCN</td><td>74.25±0.40</td><td>82.25±0.30</td><td>77.43±0.42</td><td>92.86±0.11</td></tr><tr><td>GAT</td><td>75.39±0.27</td><td>84.37±0.24</td><td>77.76±0.44</td><td>91.22±0.07</td></tr><tr><td>JK</td><td>73.03±0.47</td><td>82.69±0.35</td><td>77.88±0.38</td><td>91.71±0.10</td></tr><tr><td>BT.FP</td><td>73.55±0.57</td><td>80.84±0.97</td><td>72.94±1.00</td><td>91.61±0.24</td></tr><tr><td>PPNP</td><td>75.83±0.27</td><td>85.29±0.25</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP</td><td>75.73±0.30</td><td>85.09±0.25</td><td>79.73±0.31</td><td>93.27±0.08</td></tr><tr><td>PPNP (ours)</td><td>75.53±0.32</td><td>84.39±0.28</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP (ours)</td><td>75.41±0.35</td><td>84.28±0.28</td><td>79.41±0.34</td><td>92.98±0.07</td></tr><tr><td>AdaGCN</td><td>76.68±0.20</td><td>85.97±0.20</td><td>79.95±0.21</td><td>93.17±0.07</td></tr><tr><td>P value</td><td>1.8×10-15</td><td>2.2×10-16</td><td>1.1×10-5</td><td>2.1×10-9</td></tr></table>
|
| 193 |
+
|
| 194 |
+
<table><tr><td></td><td>Citeseer</td><td>Cora-ML</td><td>Pubmed</td><td>MSAcademic</td></tr><tr><td>Label Rates</td><td>1.0% / 2.0%</td><td>2.0% / 4.0%</td><td>0.1% / 0.2%</td><td>0.6% / 1.2%</td></tr><tr><td>V.GCN</td><td>67.6±1.4/70.8±1.4</td><td>76.4±1.3/81.7±0.8</td><td>70.1±1.4/74.6±1.6</td><td>89.7±0.4/91.1±0.2</td></tr><tr><td>GCN</td><td>70.3±0.9/72.7±1.1</td><td>80.0±0.7/82.8±0.9</td><td>71.1±1.1/75.2±1.0</td><td>89.8±0.4/91.2±0.3</td></tr><tr><td>PPNP APPNP</td><td>72.5±0.9/74.7±0.7 72.2±1.3/74.2±1.1</td><td>80.1±0.7/83.0±0.6</td><td>OOM</td><td>OOM</td></tr><tr><td>AdaGCN</td><td></td><td>80.1±0.7/83.2±0.6</td><td>74.0±1.5/77.2±1.2</td><td>91.7±0.2/92.6±0.2</td></tr><tr><td></td><td>74.2±0.3/75.5±0.3</td><td>83.7±0.3/85.3±0.2</td><td>77.1±0.5/79.3±0.3</td><td>92.1±0.1/92.7±0.1</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Table 3: Average accuracy across different label rates with 20 splittings of datasets under 100 runs.
|
| 197 |
+
|
| 198 |
+
From Figure 3, it can be easily observed that oversmoothing leads to the rapid decreasing of accuracy for GCN (blue line) as the layer increases. In contrast, the speed of smoothing (green line) of SGC is much slower than GCN due to the lack of ReLU analyzed in Section 2.1. Similarly, GCN with residual connection (yellow line) partially mitigates the oversmoothing effect of original GCN but fails to take advantage of information from different orders of neighbors to improve the prediction performance constantly. Remarkably, AdaGCN (red line) is able to consistently enhance the performance with the increasing of layers across the three datasets. This implies that AdaGCN can efficiently incorporate knowledge from different orders of neighbors and circumvent oversmoothing of original GCN in the process of constructing deep graph models. In addition, the fluctuation of performance for AdaGCN is much lower than GCN especially when the number of layer is large.
|
| 199 |
+
|
| 200 |
+
# 4.2 PREDICTION PERFORMANCE
|
| 201 |
+
|
| 202 |
+
We conduct a rigorous study of AdaGCN on four datasets under multiple splittings of dataset. The results from Table 2 suggest the state-of-the-art performance of our approach and the improvement compared with APPNP validates the benefit of adaptive form for our AdaGCN. More rigorously, p values under paired t test demonstrate the significance of improvement for our method.
|
| 203 |
+
|
| 204 |
+
In the realistic setting, graphs usually have different labeled nodes and thus it is necessary to investigate the robust performance of methods on different number of labeled nodes. Here we utilize label rates to measure the different numbers of labeled nodes and then sample corresponding labeled nodes per class on graphs respectively. Table 3 presents the consistent state-of-the-art performance of AdaGCN under different label rates. An interesting manifestation from Table 3 is that AdaGCN yields more improvement on fewer label rates compared with APPNP, showing more efficiency on graphs with few labeled nodes. Inspired by the Layer Effect on graphs (Sun et al., 2019), we argue that the increase of layers in AdaGCN can result in more benefits on the efficient propagation of label signals especially on graphs with limited labeled nodes.
|
| 205 |
+
|
| 206 |
+
More rigorously, we additionally conduct the comparison on a larger dataset, i.e., Reddit. We choose the best layer as 4 due to the fact that AdaGCN with larger number of layers tends to suffer from overfitting on this relatively simple dataset (with high label rate $6 5 . 9 \%$ ). Table 4 suggests that AdaGCN can still outperform other typical baselines, including V.GCN, PPNP and APPNP. More experimental details can be referred from Appendix A.6.
|
| 207 |
+
|
| 208 |
+
Table 4: Average F1-scores and per-epoch training time of typical methods on Reddit dataset under 5 runs.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Reddit</td><td>F1-Score</td><td>Per-epoch training time</td></tr><tr><td>V.GCN</td><td>94.46±0.06</td><td>5627.46ms</td></tr><tr><td>PPNP</td><td>OOM</td><td>OOM</td></tr><tr><td>APPNP</td><td>95.04±0.07</td><td>29489.81ms</td></tr><tr><td>AdaGCN</td><td>95.39±0.13</td><td>32.29ms</td></tr></table>
|
| 211 |
+
|
| 212 |
+
# 4.3 COMPUTATIONAL EFFICIENCY
|
| 213 |
+
|
| 214 |
+
Without the additional computational cost involved in sparse tensors in the propagation of the neural network, AdaGCN presents huge computational efficiency. From the left part of Figure 4, it exhibits that AdaGCN has the fastest speed of per-epoch training time in comparison with other methods except the comparative performance with FastGCN in Pubmed. In addition, there is a somewhat inconsistency in computation of FastGCN, with fastest speed in Pubmed but slower than
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 4: Left: Per-epoch training time of AdaGCN vs other methods under 5 runs on four datasets. Right: Per-epoch training time of AdaGCN compared with GCN and SGC with the increasing of layers and the digit after $\mathbf { \bar { \Sigma } } ^ { 6 } = \mathbf { \bar { \Sigma } } ^ { 5 }$ denotes the slope in a fitted linear regression.
|
| 218 |
+
|
| 219 |
+
GCN on Cora-ML and MS-Academic datasets. Furthermore, with multiple power iterations involved in sparse tensors, APPNP unfortunately has relatively expensive computation cost. It should be noted that this computational advantage of AdaGCN is more significant when it comes to large datasets, e.g., Reddit. Table 4 demonstrates AdaGCN has the potential to perform much faster on larger datasets.
|
| 220 |
+
|
| 221 |
+
Besides, we explore the computational cost of ReLU and sparse adjacency tensor with respect to the number of layers in the right part of Figure 4. We focus on comparing AdaGCN with SGC and GCN as other GCN-based methods, such as GraphSAGE and APPNP, behave similarly with GCN. Particularly, we can easily observe that both SGC (green line) and GCN (red line) show a linear increasing tendency and GCN yields a larger slope arises from ReLU and more parameters. For SGC, stacking more layers directly is undesirable regarding the computation. Thus, a limited number of SGC layers is preferable with more advanced optimization techniques Wu et al. (2019). It also shows that the computational cost involved sparse matrices in neural networks plays a dominant role in all the cost especially when the layer is large enough. In contrast, our AdaGCN (pink line) displays an almost constant trend as the layer increases simply because it excludes the extra computation involved in sparse tensors $\hat { A }$ , such as $\cdot \cdot \cdot \hat { A } \mathrm { ~ R e L U } ( \hat { A } X W ^ { ( 0 ) } ) W ^ { ( 1 ) } \cdot \cdot \cdot ,$ , in the process of training neural networks. AdaGCN maintains the updating of parameters in the $f _ { \theta } ^ { ( l ) }$ with a fixed architecture in each layer while the layer-wise optimization, therefore displaying a nearly constant computation cost within each epoch although more epochs are normally needed in the entire layer-wise training. We leave the analysis of exact time and memory complexity of AdaGCN as future works, but boosting-based algorithms including AdaGCN is memory-efficient (Oono & Suzuki, 2020).
|
| 222 |
+
|
| 223 |
+
# 5 DISCUSSIONS AND CONCLUSION
|
| 224 |
+
|
| 225 |
+
One potential concern is that AdaBoost (Hastie et al., 2009; Freund et al., 1999) is established on i.i.d. hypothesis while graphs have inherent data-dependent property. Fortunately, the statistical convergence and consistency of boosting (Lugosi & Vayatis, 2001; Mannor et al., 2003) can still be preserved when the samples are weakly dependent (Lozano et al., 2013). More discussion can refer to Appendix A.5. In this paper, we propose a novel RNN-like deep graph neural network architecture called AdaGCNs. With the delicate architecture design, our approach AdaGCN can effectively explore and exploit knowledge from different orders of neighbors in an Adaboost way. Our work paves a way towards better combining different-order neighbors to design deep graph models rather than only stacking on specific type of graph convolution.
|
| 226 |
+
|
| 227 |
+
# ACKNOWLEDGMENTS
|
| 228 |
+
|
| 229 |
+
Z. Lin is supported by NSF China (grant no.s 61625301 and 61731018), Major Scientific Research Project of Zhejiang Lab (grant no.s 2019KB0AC01 and 2019KB0AB02), Beijing Academy of Artificial Intelligence, and Qualcomm.
|
| 230 |
+
|
| 231 |
+
# REFERENCES
|
| 232 |
+
|
| 233 |
+
Sami Abu-El-Haija, Amol Kapoor, Bryan Perozzi, and Joonseok Lee. N-gcn: Multi-scale graph convolution for semi-supervised node classification. International Workshop on Mining and Learning with Graphs (MLG), 2018a.
|
| 234 |
+
|
| 235 |
+
Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Hrayr Harutyunyan, Nazanin Alipourfard, Kristina Lerman, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolution architectures via sparsified neighborhood mixing. International Conference on Machine Learning (ICML), 2019.
|
| 236 |
+
|
| 237 |
+
Eugene Belilovsky, Michael Eickenberg, and Edouard Oyallon. Greedy layerwise learning can scale to imagenet. International Conference on Machine Learning (ICML), 2018.
|
| 238 |
+
|
| 239 |
+
Aleksandar Bojchevski and Stephan Gunnemann. Deep gaussian embedding of graphs: Unsu- ¨ pervised inductive learning via ranking. International Conference on Learning Representations (ICLR), 2018.
|
| 240 |
+
|
| 241 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. International Conference on Learning Representations (ICLR), 2014.
|
| 242 |
+
|
| 243 |
+
Eliav Buchnik and Edith Cohen. Bootstrapped graph diffusions: Exposing the power of nonlinearity. In Abstracts of the 2018 ACM International Conference on Measurement and Modeling of Computer Systems, pp. 8–10. ACM, 2018.
|
| 244 |
+
|
| 245 |
+
Peter Buhlmann and Bin Yu. Boosting with the l 2 loss: regression and classification. ¨ Journal of the American Statistical Association, 98(462):324–339, 2003.
|
| 246 |
+
|
| 247 |
+
Jie Chen, Tengfei Ma, and Cao Xiao. Fastgcn: fast learning with graph convolutional networks via importance sampling. International Conference on Learning Representations (ICLR), 2018.
|
| 248 |
+
|
| 249 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks ¨ on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3844–3852, 2016.
|
| 250 |
+
|
| 251 |
+
Santo Fortunato. Community detection in graphs. Physics reports, 486(3-5):75–174, 2010.
|
| 252 |
+
|
| 253 |
+
Yoav Freund, Robert Schapire, and Naoki Abe. A short introduction to boosting. Journal-Japanese Society For Artificial Intelligence, 14(771-780):1612, 1999.
|
| 254 |
+
|
| 255 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems (NeurIPS), pp. 2672–2680, 2014.
|
| 256 |
+
|
| 257 |
+
Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Proceedings. 2005 IEEE International Joint Conference on Neural Networks, 2005., volume 2, pp. 729–734. IEEE, 2005.
|
| 258 |
+
|
| 259 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1024–1034, 2017.
|
| 260 |
+
|
| 261 |
+
Trevor Hastie, Saharon Rosset, Ji Zhu, and Hui Zou. Multi-class adaboost. Statistics and Its Interface, 2(3):349–360, 2009.
|
| 262 |
+
|
| 263 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 264 |
+
|
| 265 |
+
Furong Huang, Jordan Ash, John Langford, and Robert Schapire. Learning deep resnet blocks sequentially using boosting theory. International Conference on Machine Learning (ICML), 2018.
|
| 266 |
+
|
| 267 |
+
Wenxin Jiang et al. Process consistency for adaboost. The Annals of Statistics, 32(1):13–29, 2004.
|
| 268 |
+
|
| 269 |
+
Ming Jin, Heng Chang, Wenwu Zhu, and Somayeh Sojoudi. Power up! robust graph convolutional network against evasion attacks based on graph powering. arXiv preprint arXiv:1905.10029, 2019.
|
| 270 |
+
|
| 271 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017.
|
| 272 |
+
|
| 273 |
+
Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: ¨ Graph neural networks meet personalized pagerank. International Conference on Learning Representations (ICLR), 2018.
|
| 274 |
+
|
| 275 |
+
Guohao Li, Matthias Muller, Ali Thabet, and Bernard Ghanem. Can gcns go as deep as cnns? ¨ ICCV, 2019.
|
| 276 |
+
|
| 277 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. Association for the Advancement of Artificial Intelligence (AAAI), 2018.
|
| 278 |
+
|
| 279 |
+
Renjie Liao, Zhizhen Zhao, Raquel Urtasun, and Richard S Zemel. Lanczosnet: Multi-scale deep graph convolutional networks. International Conference on Learning Representations (ICLR), 2019.
|
| 280 |
+
|
| 281 |
+
Meng Liu, Hongyang Gao, and Shuiwang Ji. Towards deeper graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 338–348, 2020.
|
| 282 |
+
|
| 283 |
+
Aurelie C Lozano, Sanjeev R Kulkarni, and Robert E Schapire. Convergence and consistency of regularized boosting with weakly dependent observations. IEEE Transactions on Information Theory, 60(1):651–660, 2013.
|
| 284 |
+
|
| 285 |
+
Sitao Luan, Mingde Zhao, Xiao-Wen Chang, and Doina Precup. Break the ceiling: Stronger multiscale deep graph convolutional networks. Advances in Neural Information Processing Systems (NeurIPS), 2019.
|
| 286 |
+
|
| 287 |
+
Gabor Lugosi and Nicolas Vayatis. On the bayes-risk consistency of boosting methods. 2001. ´
|
| 288 |
+
|
| 289 |
+
Shie Mannor, Ron Meir, and Tong Zhang. Greedy algorithms for classification–consistency, convergence rates, and adaptivity. Journal of Machine Learning Research, 4(Oct):713–742, 2003.
|
| 290 |
+
|
| 291 |
+
Andrew Kachites McCallum, Kamal Nigam, Jason Rennie, and Kristie Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127–163, 2000.
|
| 292 |
+
|
| 293 |
+
Kenta Oono and Taiji Suzuki. Optimization and generalization analysis of transduction through gradient boosting and application to multi-scale graph neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 294 |
+
|
| 295 |
+
Omri Puny, Heli Ben-Hamu, and Yaron Lipman. From graph low-rank global attention to 2-fwl approximation. ICML Workshop Graph Representation Learning and Beyond, 2020.
|
| 296 |
+
|
| 297 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93, 2008.
|
| 298 |
+
|
| 299 |
+
Oleksandr Shchur, Maximilian Mumme, Aleksandar Bojchevski, and Stephan Gunnemann. Pitfalls ¨ of graph neural network evaluation. In Relational Representation Learning Workshop (R2L 2018), NeurIPS, 2018.
|
| 300 |
+
|
| 301 |
+
Ke Sun, Zhanxing Zhu, and Zhouchen Lin. Multi-stage self-supervised learning for graph convolutional networks. Association for the Advancement of Artificial Intelligence (AAAI), 2019.
|
| 302 |
+
|
| 303 |
+
Ilya O Tolstikhin, Sylvain Gelly, Olivier Bousquet, Carl-Johann Simon-Gabriel, and Bernhard Scholkopf. Adagan: Boosting generative models. In ¨ Advances in Neural Information Processing Systems (NeurIPS), pp. 5424–5433, 2017.
|
| 304 |
+
|
| 305 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. International Conference on Learning Representations (ICLR), 2018.
|
| 306 |
+
|
| 307 |
+
Felix Wu, Tianyi Zhang, Amauri Holanda de Souza Jr, Christopher Fifty, Tao Yu, and Kilian Q Weinberger. Simplifying graph convolutional networks. International Conference on Machine Learning (ICML), 2019.
|
| 308 |
+
|
| 309 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? International Conference on Learning Representations (ICLR), 2018a.
|
| 310 |
+
|
| 311 |
+
Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. International Conference on Machine Learning (ICML), 2018b.
|
| 312 |
+
|
| 313 |
+
Hanqing Zeng, Hongkuan Zhou, Ajitesh Srivastava, Rajgopal Kannan, and Viktor Prasanna. Graphsaint: Graph sampling based inductive learning method. International Conference on Learning Representations (ICLR), 2019.
|
| 314 |
+
|
| 315 |
+
Tong Zhang, Bin Yu, et al. Boosting with early stopping: Convergence and consistency. The Annals of Statistics, 33(4):1538–1579, 2005.
|
| 316 |
+
|
| 317 |
+
Jun Zhu, Jiaming Song, and Bei Chen. Max-margin nonparametric latent feature models for link prediction. arXiv preprint arXiv:1602.07428, 2016.
|
| 318 |
+
|
| 319 |
+
# A APPENDIX
|
| 320 |
+
|
| 321 |
+
# A.1 RELATED WORKS ON DEEP GRAPH MODELS
|
| 322 |
+
|
| 323 |
+
A straightforward solution (Kipf & Welling, 2017; Xu et al., 2018b) inspired by ResNets (He et al., 2016) was by adding residual connections, but this practice was unsatisfactory both in prediction performance and computational efficiency towards building deep graph models, as shown in our experiments in Section 4.1 and 4.3. More recently, JK (Jumping Knowledge Networks (Xu et al., 2018b)) introduced jumping connections into final aggregation mechanism in order to extract knowledge from different layers of graph convolutions. However, this straightforward change of GCN architecture exhibited inconsistent empirical performance for different aggregation operators, which cannot demonstrate the successful construction of deep layers. In addition, Graph powering-based method (Jin et al., 2019) implicitly leveraged more spatial information by extending classical spectral graph theory to robust graph theory, but they concentrated on defending adversarial attacks rather than model depth. LanczosNet (Liao et al., 2019) utilized Lanczos algorithm to construct low rank approximations of the graph Laplacian and then can exploit multi-scale information. Moreover, APPNP (Approximate Personalized Propagation of Neural Predictions, (Klicpera et al., 2018)) leveraged the relationship between GCN and personalized PageRank to derive an improved global propagation scheme. Beyond these, DeepGCNs (Li et al., 2019) directly adapted residual, dense connection and dilated convolutions to GCN architecture, but it mainly focused on the task of point cloud semantic segmentation and has not demonstrated its effectiveness in typical graph tasks. Similar to our work, Deep Adaptive Graph Neural Network (DAGNN) (Liu et al., 2020) also focused on incorporating information from large receptive fields through the entanglement of representation transformation and propagation, while our work efficiently ensembles knowledge from large receptive fields in an Adaboost manner. Other related works based on global attention models (Puny et al., 2020) and sample-based methods (Zeng et al., 2019) are also helpful to construct deep graph models.
|
| 324 |
+
|
| 325 |
+
# A.2 INSUFFICIENT REPRESENTATION POWER OF ADASGC
|
| 326 |
+
|
| 327 |
+
As illustrated in Figure 5, with the increasing of layers, AdaSGC with only linear transformation has insufficient representation power both in extracting knowledge from high-order neighbors and combining information from different orders of neighbors while AdaGCN exhibits a consistent improvement of performance as the layer increases.
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 5: AdaSGC vs AdaGCN.
|
| 331 |
+
|
| 332 |
+
# A.3 PROOF OF PROPOSITION 1
|
| 333 |
+
|
| 334 |
+
Firstly, we further elaborate the Proposition 1 as follows, then we provide the proof.
|
| 335 |
+
|
| 336 |
+
Suppose that $\gamma$ is the teleport factor. Consider the output $Z _ { \mathrm { P P N P } } = \gamma ( \mathbb { I } - ( 1 - \gamma ) \hat { A } ) ^ { - 1 } f _ { \theta } ( X )$ in PPNP and $Z _ { \mathrm { A P P N P } }$ from its approxminated version APPNP. Let matrix sequence $\{ Z ^ { ( l ) } \}$ be from the output of each layer $l$ in AdaGCN, then PPNP is equivalent to the Exponential Moving Average (EMA) with exponentially decreasing factor In add $\gamma$ , a first-order infinite impulse response filter, on ion, APPNP, which we reformulate in Eq. 10, c $\{ Z ^ { ( l ) } \}$ in a sharing parameters version, i.e., iewed as the approximated form of E $f _ { \theta } ^ { ( l ) } \equiv f _ { \theta }$
|
| 337 |
+
|
| 338 |
+
limited number of terms.
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
Z _ { \mathrm { A P P N P } } = ( \gamma \sum _ { l = 0 } ^ { L - 1 } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } + ( 1 - \gamma ) ^ { L } \hat { A } ^ { L } ) f _ { \theta } ( X )
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
Proof. According to Neumann Theorem, $Z _ { \mathrm { P P N P } }$ can be expanded as a Neumann series:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\begin{array} { r l } { { Z _ { \mathrm { P P N P } } = \gamma ( \mathbb { I } - ( 1 - \gamma ) \hat { A } ) ^ { - 1 } f _ { \theta } ( X ) } } \\ & { = \gamma \sum _ { l = 0 } ^ { \infty } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } f _ { \theta } ( X ) , } \end{array}
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
where feature embedding matrix sequence $\{ Z ^ { ( l ) } \}$ for each order of neighbors share the same parameters $f _ { \theta }$ . If we relax this sharing nature to the adaptive form with respect to the layer and put $\hat { A } ^ { l }$ into $f _ { \theta }$ , then the output $Z$ can be approximately formulated as:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
Z _ { \mathrm { P P N P } } \approx \gamma \sum _ { l = 0 } ^ { \infty } ( 1 - \gamma ) ^ { l } f _ { \theta } ^ { ( l ) } ( \hat { A } ^ { l } X )
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
This relaxed version from PPNP is the Exponential Moving Average form of matrix sequence $\{ Z ^ { ( l ) } \}$ with exponential decreasing factor $\gamma$ . Moreover, if we approximate the EMA by truncating it after $L - 1$ items, then the weight omitted by stopping after $L - 1$ items is $( 1 - \gamma ) ^ { L }$ . Thus, the approximated EMA is exactly the APPNP form:
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
Z _ { \mathrm { A P P N P } } = ( \gamma \sum _ { l = 0 } ^ { L - 1 } ( 1 - \gamma ) ^ { l } \hat { A } ^ { l } + ( 1 - \gamma ) ^ { L } \hat { A } ^ { L } ) f _ { \theta } ( X )
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
# A.4 PROOF OF PROPOSITION 2
|
| 363 |
+
|
| 364 |
+
Proof. We consider a two layers fully-connected neural network as $f$ in Eq. 8, then the output of AdaGCN can be formulated as:
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X W ^ { ( 0 ) } ) W ^ { ( 1 ) }
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
Particularly, we set W (0) $\begin{array} { r } { W ^ { ( 0 ) } = \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathbb { I } } \end{array}$ blsign(b )α(l) I and W (1) = sign(bl)I where sign(bl) is the signed incidence scalar w.r.t $b _ { l }$ . Then the output of AdaGCN can be presented as:
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\begin{array} { l } { { \displaystyle Z = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathbb { I } ) \mathrm { s i g n } ( b _ { l } ) \mathbb { I } } } \\ { ~ } \\ { { \displaystyle ~ = \sum _ { l = 0 } ^ { L } \alpha ^ { ( l ) } \sigma ( \hat { A } ^ { l } X ) \frac { b _ { l } } { \mathrm { s i g n } ( b _ { l } ) \alpha ^ { ( l ) } } \mathrm { s i g n } ( b _ { l } ) } } \\ { { \displaystyle ~ = \sum _ { l = 0 } ^ { L } b _ { l } \sigma \left( \hat { A } ^ { l } X \right) } } \end{array}
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
The proof that GCNs-based methods are not capable of representing general layer-wise neighborhood mixing has been demonstrated in MixHop (Abu-El-Haija et al., 2019). Proposition 2 proved. □
|
| 377 |
+
|
| 378 |
+
# A.5 EXPLANATION ABOUT CONSISTENCY OF BOOSTING ON DEPENDENT DATA
|
| 379 |
+
|
| 380 |
+
Definition 2. ( $\beta$ -mixing sequences.) Let $\sigma _ { i } ^ { j } = \sigma ( W ) = \sigma ( W _ { i } , W _ { i + 1 } , . . . , W _ { j } )$ be the $\sigma$ -field generated by $a$ strictly stationary sequence of random variables $W = ( W _ { i } , W _ { i + 1 } , . . . , W _ { j } )$ . The $\beta$ -mixing coefficient is defined by:
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\beta _ { W } ( n ) = \operatorname* { s u p } _ { k } \mathbb { E } \operatorname* { s u p } \left\{ \left| \mathbb { P } \left( A | \sigma _ { 1 } ^ { k } \right) - \mathbb { P } ( A ) \right| : A \in \sigma _ { k + n } ^ { \infty } \right\}
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
Then a sequence $W$ is called $\beta$ -mixing if $l i m _ { n \infty } \beta _ { W } ( n ) = 0 .$ . Further, $i t$ is algebraically $\beta$ -mixing if there is a positive constant $r _ { \beta }$ such that $\beta _ { W } ( n ) = \mathcal { O } ( n ^ { - r _ { \beta } } )$ .
|
| 387 |
+
|
| 388 |
+
Definition 3. (Consistency) $A$ classification rule is consistent for a certain distribution $P$ if $E ( L ( h _ { n } ) ) =$ $P \{ h _ { n } ( X ) ~ = ~ Y \} ~ \to ~ a$ as $n \infty$ where $a$ is a constant. It is strongly Bayes-risk consistent $i f$ $l i m _ { n \infty } L ( h _ { n } ) = a$ almost surely.
|
| 389 |
+
|
| 390 |
+
Under these definitions, the convergence and consistence of regularized boosting method on stationary $\beta$ - mixing sequences can be proved under mild assumptions. More details can be referred from (Lozano et al., 2013).
|
| 391 |
+
|
| 392 |
+
# A.6 EXPERIMENTAL DETAILS
|
| 393 |
+
|
| 394 |
+
Early Stopping on AdaGCN. We apply the same early stopping mechanism across all the methods as (Klicpera et al., 2018) for fair comparison. Furthermore, boosting theory also has the capacity to perfectly incorporate early stopping and it has been shown that for several boosting algorithms including AdaBoost, this regularization via early stopping can provide guarantees of consistency (Zhang et al., 2005; Jiang et al., 2004; Buhlmann ¨ & Yu, 2003).
|
| 395 |
+
|
| 396 |
+
Dataset Splitting. We choose a training set of a fixed nodes per class, an early stopping set of 500 nodes and test set of remained nodes. Each experiment is run with 5 random initialization on each data split, leading to a total of 100 runs per experiment. On a standard setting, we randomly select 20 nodes per class. For the two different label rates on each graph, we select 6, 11 nodes per class on citeseer, 8, 16 nodes per class on Cora-ML, 7, 14 nodes per class on Pubmed and 8, 15 nodes per class on MS-Academic dataset.
|
| 397 |
+
|
| 398 |
+
Model parameters. For all GCN-based approaches, we use the same hyper-parameters in the original paper: learning rate of 0.01, 0.5 dropout rate, $5 \times \mathrm { \dot { 1 } 0 ^ { - 4 } ~ } L _ { 2 }$ regularization weight, and 16 hidden units. For FastGCN, we adopt the officially released code to conduct our experiments. PPNP and APPNP are adapted with best setting: $K = 1 0$ power iteration steps for APPNP, teleport probability $\gamma = 0 . 1$ on Cora-ML, Citeseer and Pubmed, $\gamma = 0 . 2$ on Ms-Academic. In addition, we use two layers with $h = 6 4$ hidden units and apply L2 regularization with $\lambda = 5 \times 1 0 ^ { - 3 }$ on the weights of the first layer and use dropout with dropout rate $d = 0 . 5$ on both layers and the adjacency matrix. The early stopping criterion uses a patience of $p = 1 0 0$ and an (unreachably high) maximum of $n = 1 0 0 0 0$ epochs.The implementation of AdaGCN is adapted from PPNP and APPNP. Corresponding patience $p = 3 0 0$ and $n = 5 0 0$ in the early stopping of AdaGCN. Moreover, SGC is re-implemented in a straightforward way without incorporating advanced optimization for better illustration and comparison. Other baselines are adopted the same parameters described in PPNP and APPNP.
|
| 399 |
+
|
| 400 |
+
Settings on Reddit dataset. By repeatedly tuning the parameters of these typical methods on Reddit, we finally choose weight decay rate as $1 \dot { 0 } ^ { - 4 }$ , hidden layer size 100 and epoch 20000 for AdaGCN. For APPNP, we opt weight decay rate as $1 0 ^ { - 5 }$ , dropout rate as 0 and epoch 500. V.GCN applies the same parameters in (Kipf & Welling, 2017) and we choose epoch as 500. All approaches have not deployed early stopping due to the expensive computational cost on the large Reddit dataset, which is also a fair comparison.
|
| 401 |
+
|
| 402 |
+
# A.7 CHOICE OF THE NUMBER OF LAYERS
|
| 403 |
+
|
| 404 |
+
Different from the “forcible” behaviors in CNNs that directly stack many convolution layers, in our AdaGCN there is a theoretical guidance on the choice of model depth $L$ , i.e., the number of base classifiers or layers, derived from boosting theory. Specifically, according to the boosting theory, the increasing of $L$ can exponentially decreases the empirical loss, however, from the perspective of VC-dimension, an overly large $L$ can yield overfitting of AdaGCN. It should be noted that the deeper graph convolution layers in AdaGCN are not always better, which indeed heavily depends on the the complexity of data. In practice, $L$ can be determined via cross-validation. Specifically, we start a VC-dimension-based analysis to illustrate that too large $L$ can yield overfitting of AdaGCN. For $L$ layers of AdaGCN, its hypothesis set is
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\mathcal { F } _ { L } = \left\{ \underset { k } { \arg \operatorname* { m a x } } \left( \sum _ { l = 1 } ^ { L } \alpha ^ { ( l ) } f _ { \theta } ^ { ( l ) } \right) : \alpha ^ { ( l ) } \in \mathbb { R } , l \in [ 1 , L ] \right\}
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
Then the VC-dimension of ${ \mathcal { F } } _ { T }$ can be bounded as follows in terms of the VC-dimension $d$ of the family of base hypothesis:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\begin{array} { r } { \mathrm { V C d i m } \left( \mathcal { F } _ { L } \right) \leq 2 ( d + 1 ) ( L + 1 ) \log _ { 2 } ( ( L + 1 ) e ) , } \end{array}
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
where $e$ is a constant and the upper bounds grows as $L$ increases. Combined with VC-dimension generalization bounds, these results imply that larger values of $L$ can lead to overfitting of AdaBoost. This situation also happens in AdaGCN, which inspires us that there is no need to stack too many layers on AdaGCN in order to avoid overfitting. In practice, $L$ is typically determined via cross-validation.
|
md/train/QpT9Q_NNfQL/QpT9Q_NNfQL.md
ADDED
|
@@ -0,0 +1,454 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURWIN: NEURAL WHITTLE INDEX NETWORK FOR RESTLESS BANDITS VIA DEEP RL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Whittle index policy is a powerful tool to obtain asymptotically optimal solutions for the notoriously intractable problem of restless bandits. However, finding the Whittle indices remains a difficult problem for many practical restless bandits with convoluted transition kernels. This paper proposes NeurWIN, a neural Whittle index network that seeks to learn the Whittle indices for any restless bandits by leveraging mathematical properties of the Whittle indices. We show that a neural network that produces the Whittle index is also one that produces the optimal control for a set of Markov decision problems. This property motivates using deep reinforcement learning for the training of NeurWIN. We demonstrate the utility of NeurWIN by evaluating its performance for three recently studied restless bandit problems. Our experiment results show that the performance of NeurWIN is either better than, or as good as, state-of-the-art policies for all three problems.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many sequential decision problems can be modeled as multi-armed bandit problems. A bandit problem models each potential decision as an arm. In each round, we play $M$ arms out of a total of $N$ arms by choosing the corresponding decisions. We then receive a reward from the played arms. The goal is to maximize the long-term total discounted reward. Consider, for example, displaying advertisements on an online platform with the goal to maximize the long-term discounted clickthrough rates. This can be modeled as a bandit problem where each arm is a piece of advertisement and we choose which advertisements to be displayed every time a particular user visits the platform. It should be noted that the reward, i.e., click-through rate, of an arm is not stationary, but depends on our actions in the past. For example, a user that just clicked on a particular advertisement may be much less likely to click on the same advertisement in the near future. Such a problem is a classic case of the restless bandit problem, where the reward distribution of an arm depends on its state, which changes over time based on our past actions.
|
| 12 |
+
|
| 13 |
+
The restless bandit problem is notoriously intractable (Papadimitriou & Tsitsiklis, 1999). Most recent efforts, such as recovering bandits (Pike-Burke & Grunewalder, 2019), rotting bandits (Seznec et al., 2020), and Brownian bandits (Slivkins & Upfal, 2008), only study some special instances of the restless bandit problem. The fundamental challenge of the restless bandit problem lies in the explosion of state space, as the state of the entire system is the Cartesian product of the states of individual arms. A powerful tool to address the explosion of state space is the Whittle index policy (Whittle, 1988). In a nutshell, the Whittle index policy calculates a Whittle index for each arm based on the arm’s current state, where the index loosely corresponds to the amount of cost that we are willing to pay to play the arm, and then plays the arm with the highest index. It has been shown that the Whittle index policy is either optimal or asymptotically optimal in many settings.
|
| 14 |
+
|
| 15 |
+
In this paper, we present Neural Whittle Index Network (NeurWIN), a principled machine learning approach that finds the Whittle indices for virtually all restless bandit problems. We note that the Whittle index is an artificial construct that cannot be directly measured. Finding the Whittle index is typically intractable. As a result, the Whittle indices of many practical problems remain unknown except for a few special cases.
|
| 16 |
+
|
| 17 |
+
We are able to circumvent the challenges of finding the Whittle indices by leveraging an important mathematical property of the Whittle index: Consider an alternative problem where there is only one arm and we decide whether to play the arm in each time instance. In this problem, we need to pay a constant cost of $\lambda$ every time we play the arm. The goal is to maximize the long-term discounted net reward, defined as the difference between the rewards we obtain from the arm and the costs we pay to play it. Then, the optimal policy is to play the arm whenever the Whittle index becomes larger than $\lambda$ . Based on this property, a neural network that produces the Whittle index can be viewed as one that finds the optimal policy for the alternative problem for any $\lambda$ .
|
| 18 |
+
|
| 19 |
+
Using this observation, we propose a deep reinforcement learning method to train NeurWIN. To demonstrate the power of NeurWIN, we employ NeurWIN for three recently studied restless bandit problems, namely, recovering bandit (Pike-Burke & Grunewalder, 2019), wireless scheduling (Aalto et al., 2015), and stochastic deadline scheduling (Yu et al., 2018). There is no known Whittle index for the first problem, and there is only an approximation of the Whittle index under some relaxations for the second problem. Only the third problem has a precise characterization of the Whittle index. For the first two problems, the index policy using our NeurWIN achieves better performance than existing studies. For the third problem, the index policy using our NeurWIN has virtually the same performance as the Whittle index policy.
|
| 20 |
+
|
| 21 |
+
The rest of the paper is organized as follows: Section 2 reviews related literature. Section 3 provides formal definitions of the Whittle index and our problem statement. Section 4 introduces our training algorithm for NeurWIN. Section 5 demonstrates the utility of NeurWIN by evaluating its performance under three recently studied restless bandit problems. Finally, Section 6 concludes the paper.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Restless bandit problems were first introduced in (Whittle, 1988). They are known to be intractable, and are in general PSPACE hard (Papadimitriou & Tsitsiklis, 1999). As a result, many studies focus on finding the Whittle index policy for restless bandit problems, such as in (Le Ny et al., 2008; Meshram et al., 2018; Tripathi & Modiano, 2019; Dance & Silander, 2015). However, these studies are only able to find the Whittle indices under various specific assumptions about the bandit problems.
|
| 26 |
+
|
| 27 |
+
There has been a lot of studies on applying RL methods for bandit problems. (Dann et al., 2017) proposed a tool called Uniform-PAC for contextual bandits. (Zanette & Brunskill, 2018) described a framework-agnostic approach towards guaranteeing RL algorithms’ performance. (Jiang et al., 2017) introduced contextual decision processes (CDPs) that encompass contextual bandits for RL exploration with function approximation. (Riquelme et al., 2018) compared deep neural networks with Bayesian linear regression against other posterior sampling methods. However, none of these studies are applicable to restless bandits, where the state of an arm can change over time.
|
| 28 |
+
|
| 29 |
+
Deep RL algorithms have been utilized in problems that resemble restless bandit problems, including HVAC control (Wei et al., 2017), cyber-physical systems (Leong et al., 2020), and dynamic multichannel access (Wang et al., 2018). In all these cases, a major limitation for deep RL is scalability. As the state spaces grows exponentially with the number of arms, these studies can only be applied to small-scale systems, and their evaluations are limited to cases when there are at most 5 zones, 6 sensors, and 8 channels, respectively.
|
| 30 |
+
|
| 31 |
+
An emerging research direction is applying machine learning algorithms to learn Whittle indices. (Borkar & Chadha, 2018) proposed employing the LSPE(0) algorithm (Yu & Bertsekas, 2009) coupled with a polynomial function approximator. The approach was applied in (Avrachenkov & Borkar, 2019) for scheduling web crawlers. However, this work can only be applied to restless bandits whose states can be represented by a single number, and it only uses a polynomial function approximator, which may have low representational power (Sutton & Barto, 2018). (Fu et al., 2019) proposed a Q-learning based heuristic to find Whittle indices. However, as shown in its experiment results, the heuristic may not produce Whittle indices even when the training converges.
|
| 32 |
+
|
| 33 |
+
# 3 PROBLEM SETTING
|
| 34 |
+
|
| 35 |
+
In this section, we provide a brief overview of restless bandit problems and the Whittle index. We then formally define the problem statement.
|
| 36 |
+
|
| 37 |
+
# 3.1 RESTLESS BANDIT PROBLEMS
|
| 38 |
+
|
| 39 |
+
A restless bandit problem consists of $N$ restless arms. In each round $t$ , a control policy observes the state of each arm $i$ , denoted by $s _ { i } [ t ]$ , and selects $M$ arms to activate. We call the selected arms as active and the others as passive. We use $a _ { i } [ t ]$ to denote the policy’s decision on each arm $i$ , where $a _ { i } [ t ] = 1$ if the arm is active and $a _ { i } [ t ] = 0$ if it is passive at round $t$ . Each arm $i$ generates a stochastic reward $r _ { i } [ t ]$ with distribution $R _ { i , a c t } ( s _ { i } [ t ] )$ if it is active, and with distribution $R _ { i , p a s s } ( s _ { i } [ t ] )$ if it is passive. The state of each arm $i$ in the next round evolves by the transition kernel of either $\bar { P _ { i , a c t } } ( s _ { i } [ t ] )$ or $P _ { i , p a s s } ( s _ { i } [ t ] )$ , depending on whether the arm is active. The goal of the control policy is to maximize the total discounted reward, which can be expressed as $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \sum _ { i = 1 } ^ { N } \beta ^ { t } r _ { i } [ t ] } \end{array}$ with $\beta$
|
| 40 |
+
|
| 41 |
+
A control policy is effectively a function that takes the vector $( s _ { 1 } [ t ] , s _ { 2 } [ t ] , \ldots , s _ { N } [ t ] )$ as the input and produces the vector $( a _ { 1 } [ t ] , a _ { 2 } [ t ] , \dotsc , a _ { N } [ t ] )$ as the output. It should be noted that the space of input is exponential in $N$ . If each arm can be in one of $K$ possible states, then the number of possible inputs is $\bar { K } ^ { N }$ . This feature, which is usually referred to as the curse of dimensionality, makes finding the optimal control policy intractable.
|
| 42 |
+
|
| 43 |
+
# 3.2 THE WHITTLE INDEX
|
| 44 |
+
|
| 45 |
+
An index policy seeks to address the curse of dimensionality through decomposition. In each round, it calculates an index, denoted by $W _ { i } ( s _ { i } [ t ] )$ , for each arm $i$ based on its current state. The index policy then selects the $M$ arms with the highest indices to activate. It should be noted that the index of an arm $i$ is independent from the states of any other arms.
|
| 46 |
+
|
| 47 |
+
Obviously, the performance of an index policy depends on the design of the index function $W _ { i } ( \cdot )$ . A popular index with solid theoretical foundation is the Whittle index, which is defined below. Since we only consider one arm at a time, we drop the subscript $i$ for the rest of the paper.
|
| 48 |
+
|
| 49 |
+
Consider a system with only one arm, and a control policy that determines whether to activate the arm in each round $t$ . Suppose that the policy needs to pay an activation cost of $\lambda$ every time it chooses to activate the arm. The goal of the control policy is to maximize the total discounted net reward, $\begin{array} { r } { \sum _ { t = 1 } ^ { \infty } \beta ^ { t } ( \boldsymbol { r } [ t ] - \lambda a [ t ] ) } \end{array}$ . The optimal control policy can be expressed by the set of states in which it would activate this arm for a particular $\lambda$ , and we denote this set by $\boldsymbol { \mathcal { A } } ( \boldsymbol { \lambda } )$ . Intuitively, the higher the cost, the less likely the optimal control policy would activate the arm in a given state, and hence the set $\boldsymbol { \mathcal { A } } ( \boldsymbol { \lambda } )$ should decrease monotonically. When an arm satisfies this intuition, we say that the arm is indexable.
|
| 50 |
+
|
| 51 |
+
Definition 1 (Indexability). An arm is said to be indexable if $\boldsymbol { \mathcal { A } } ( \lambda )$ decreases monotonically from the set of all states to the empty set as $\lambda$ increases from $- \infty$ to $\infty$ . A restless bandit problem is said to be indexable if all arms are indexable.
|
| 52 |
+
|
| 53 |
+
Definition 2 (The Whittle Index). If an arm is indexable, then its Whittle index of each state s is defined as $W ( s ) : = \operatorname* { s u p } _ { \lambda } \{ \lambda : s \in { \dot { A } } ( \lambda ) \}$ .
|
| 54 |
+
|
| 55 |
+
Even when an arm is indexable, finding its Whittle index can still be intractable, especially when the transition kernel of the arm is convoluted1. Our NeurWIN finds the Whittle index by leveraging the following property of the Whittle index: Consider the single-armed bandit problem. Suppose the initial state of an indexable arm is $s$ at round one. Consider two possibilities: The first is that the control policy activates the arm at round one, and then uses the optimal policy starting from round two; and the second is that the control policy does not activate the arm at round one, and then uses the optimal policy starting from round two. Let $Q _ { \lambda , a c t } ( s )$ and $Q _ { \lambda , p a s s } ( s )$ be the expected discounted net reward for these two possibilities, respectively, and let $D _ { s } ( \lambda ) : = \left( Q _ { \lambda , a c t } ( s ) - Q _ { \lambda , p a s s } ( s ) \right)$ be their difference. Clearly, the optimal policy should activate an arm under state $s$ and activation cost $\lambda$ if $D _ { s } ( \lambda ) \geq 0$ . We then have the following:
|
| 56 |
+
|
| 57 |
+
Theorem 1. (Zhao, 2019, Thm 3.14) If an arm is indexable, then, for every state $s _ { : }$ , $D _ { s } ( \lambda ) \geq 0 i f$ and only if $\lambda \leq W ( s )$ .
|
| 58 |
+
|
| 59 |
+
Our NeurWIN uses Thm. 1 to train neural networks that predict the Whittle index for any indexable arms. From Def. 1, a sufficient condition for indexability is when $D _ { s } ( \lambda )$ is a decreasing function. Thus, we define the concept of strong indexability as follows:
|
| 60 |
+
|
| 61 |
+
Definition 3 (Strong Indexability). An arm is said to be strongly indexable if $D _ { s } ( \lambda )$ is strictly decreasing in λ for every state s.
|
| 62 |
+
|
| 63 |
+
# 3.3 PROBLEM STATEMENT
|
| 64 |
+
|
| 65 |
+
We now formally describe the objective of this paper. We assume that we are given a simulator of one single restless arm as a black box. The simulator provides two functionalities: First, it allows us to set the initial state of the arm to any arbitrary state $s$ . Second, in each round $t$ , the simulator takes $a [ t ]$ , the indicator function that the arm is activated, as the input and produces the next state $s [ t + 1 ]$ and the reward $r [ t ]$ as the outputs.
|
| 66 |
+
|
| 67 |
+
Our goal is to derive low-complexity index algorithms for restless bandit problems by training a neural network that approximates the Whittle index of each restless arm using its simulator. A neural network takes the state $s$ as the input and produces a real number $f _ { \theta } ( s )$ as the output, where $\theta$ is the vector containing all weights and biases of the neural network. Recall that $W ( s )$ is the Whittle index of the arm. We aim to find appropriate $\theta$ that makes $| f _ { \theta } ( s ) - W ( s ) |$ small for all $s$ . Such a neural network is said to be Whittle-accurate.
|
| 68 |
+
|
| 69 |
+
Definition 4 (Whittle-accurate). A neural network with parameters $\theta$ is said to be $\gamma$ -Whittleaccurate $i f \vert f _ { \theta } ( s ) - W ( s ) \vert \leq \gamma ,$ , for all $s$ .
|
| 70 |
+
|
| 71 |
+
# 4 NEURWIN ALGORITHM: NEURAL WHITTLE INDEX NETWORK
|
| 72 |
+
|
| 73 |
+
In this section, we present NeurWIN, a deep-RL algorithms that trains neural networks to predict the Whittle indices. Since the Whittle index of an arm is independent from other arms, NeurWIN trains one neural network for each arm independently. In this section, we discuss how NeurWIN trains the Whittle index for one single arm.
|
| 74 |
+
|
| 75 |
+
# 4.1 CONDITIONS FOR WHITTLE-ACCURATE
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Figure 1: An illustrative motivation of NeurWIN.
|
| 79 |
+
|
| 80 |
+
Before presenting NeurWIN, we first discuss the conditions for a neural network to be $\gamma \cdot$ -Whittleaccurate.
|
| 81 |
+
|
| 82 |
+
Suppose we are given a simulator of an arm and a neural network with parameters $\theta$ . We can then construct an environment of the arm along with an activation cost $\lambda$ as shown in Fig. 1. In each round $t$ , the environment takes the real number $f _ { \theta } ( s [ t ] )$ as the input. The input is first fed into a step function to produce $a [ t ] = 1 \bigl ( f _ { \theta } ( s [ t ] ) \geq \lambda \bigr )$ , where $1 ( \cdot )$ is the indicator function. Then, $a ( t )$ is fed into the simulator of the arm to produce $r [ t ]$ and $s [ t + 1 ]$ . Finally, the environment outputs the net reward $r [ t ] - \lambda a [ t ]$ and the next state $s [ t + 1 ]$ . We call this environment $E n v ( \lambda )$ . Thus, the neural network can be viewed as a controller for $E n v ( \lambda )$ . The following corollary is a direct result from Thm. 1.
|
| 83 |
+
|
| 84 |
+
Corollary 1. If $f _ { \boldsymbol { \theta } } ( s ) = W ( s ) , \forall s$ , then the neural network with parameters $\theta$ is the optimal controller for $E n v ( \lambda )$ , for any $\lambda$ and initial state $s [ 1 ]$ . Moreover, given $\lambda$ and $s [ 1 ]$ , the optimal discounted net reward is $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s [ 1 ] ) , Q _ { \lambda , p a s s } ( \bar { s } [ 1 ] ) \}$ .
|
| 85 |
+
|
| 86 |
+
Corollary 1 can be viewed as a necessary condition for a neural network to be 0-Whittle-accurate.
|
| 87 |
+
Below, we establish a sufficient condition for $\gamma$ -Whittle-accuracy.
|
| 88 |
+
|
| 89 |
+
Theorem 2. If the arm is strongly indexable, then for any $\gamma > 0$ and an arbitrarily small positive constant $\delta$ , there exists a positive such that the following statement holds: $H ,$ for any states $s _ { 0 } , s _ { 1 }$ and any activation cost $\bar { \lambda ^ { \prime } } \in [ f _ { \theta } ( s _ { 0 } ) - \delta , f _ { \theta } ( s _ { 0 } ) + \delta ]$ , the discounted net reward of applying a neural network to $E n v ( \lambda )$ with initial state $s _ { 1 }$ is at least $\dot { \operatorname* { m a x } } \{ Q _ { \lambda , a c t } ( s _ { 1 } ) , Q _ { \lambda , p a s s } ( s _ { 1 } ) \} - \epsilon _ { \ i }$ , then the neural network is $\gamma$ -Whittle-accurate.
|
| 90 |
+
|
| 91 |
+
Proof. For a given $\gamma$ , let $\epsilon = \operatorname * { m i n } _ { s } \lbrace \operatorname * { m i n } \lbrace Q _ { W ( s ) + \gamma , p a s s } ( s ) - Q _ { W ( s ) + \gamma , a c t } ( s ) , Q _ { W ( s ) - \gamma , a c t } ( s ) -$ $Q _ { W ( s ) - \gamma , p a s s } ( s ) \} \} / 2$ . Since the arm is strongly indexable and $W ( s )$ is its Whittle index, we have $\epsilon > 0$ .
|
| 92 |
+
|
| 93 |
+
We prove the theorem by establishing the following equivalent statement: If the neural network is not $\gamma$ -Whittle-accurate, then there exists states $s _ { 0 } , s _ { 1 }$ , activation cost $\lambda \in [ f _ { \theta } ( s _ { 0 } ) - \delta , f _ { \theta } ( s _ { 0 } ) + \delta ]$ , such that the discounted net reward of applying a neural network to $E n v ( \lambda )$ with initial state $s _ { 1 }$ is strictly less than $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s _ { 1 } ) , Q _ { \lambda , p a s s } ( s _ { 1 } ) \} - \epsilon$ .
|
| 94 |
+
|
| 95 |
+
Suppose the neural network is not $\gamma$ -Whittle-accurate, then there exists a state $s ^ { \prime }$ such that $\left| f _ { \theta } ( s ^ { \prime } ) - \right.$ $W ( s ^ { \prime } ) | > \gamma$ . We set $s _ { 0 } = s _ { 1 } = s ^ { \prime }$ . For the case $f _ { \theta } ( s ^ { \prime } ) > W ( s ^ { \prime } ) + \gamma$ , we set $\lambda = f _ { \boldsymbol { \theta } } ( s ^ { \prime } ) + \delta$ . Since $\lambda > W ( s ^ { \prime } ) + \gamma$ , we have $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} = Q _ { \lambda , p a s s } ( s ^ { \prime } )$ and $Q _ { \lambda , p a s s } ( s ^ { \prime } ) \_$ $Q _ { \lambda , a c t } ( s ^ { \prime } ) \geq 2 \epsilon$ . On the other hand, since $f _ { \theta } ( s ^ { \prime } ) > \lambda$ , the neural network would activate the arm in the first round and its discounted reward is at most
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
Q _ { \lambda , a c t } ( s ^ { \prime } ) < Q _ { \lambda , p a s s } ( s ^ { \prime } ) - 2 \epsilon < \operatorname * { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} - \epsilon .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
For the case $f _ { \theta } ( s ^ { \prime } ) < W ( s ^ { \prime } ) - \gamma$ , a similar argument shows that the discounted reward for the neural network when $\lambda = f _ { \boldsymbol { \theta } } \big ( \boldsymbol { s } ^ { \prime } \big ) - \delta$ is smaller than $\operatorname* { m a x } \{ Q _ { \lambda , a c t } ( s ^ { \prime } ) , Q _ { \lambda , p a s s } ( s ^ { \prime } ) \} - \epsilon$ . This completes the proof. □
|
| 102 |
+
|
| 103 |
+
# 4.2 TRAINING PROCEDURES FOR NEURWIN
|
| 104 |
+
|
| 105 |
+
Thm. 2 states that a neural network that yields near-optimal net reward for any environments $E n v ( \lambda )$ is also Whittle-accurate. This observation motivates the usage of deep reinforcement learning to find Whittle-accurate neural networks. To make the output of the environments differentiable with respect to the input $f _ { \theta } ( s [ t ] )$ , we replace the step function in Fig. 1 with a sigmoid function $\sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda ) : = \left( 1 + e x p ( - m ( f _ { \theta } ( s [ t ] ) - \lambda ) ) \right) ^ { - 1 }$ , where $m$ is a sensitivity parameter. The environment then chooses $a [ t ] = 1$ with probability $\sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda )$ , and $a [ t ] = 0$ with probability $1 - \sigma _ { m } ( f _ { \theta } ( s [ t ] ) - \lambda )$ . We call this differentiable environment $E n v ^ { * } ( \lambda )$ .
|
| 106 |
+
|
| 107 |
+
Our training procedure consists of multiple mini-batches, where each mini-batch is composed of a fixed number of episodes. At the beginning of each mini-batch, we randomly select two states $s _ { 0 }$ and $s _ { 1 }$ . Motivated by the condition in Thm. 2, we consider the environment $\Dot { E n } v ^ { * } ( f _ { \theta } ( s _ { 0 } ) )$ with initial state $s _ { 1 }$ and aim to improve the empirical discounted net reward of applying the neural network to such an environment.
|
| 108 |
+
|
| 109 |
+
Our approach is based on the REINFORCE algorithm (Williams, 1992). In each episode $e$ , we set $\lambda = f _ { \theta } ( s _ { 0 } )$ and initial state to be $s _ { 1 }$ . We then apply the neural network with parameters $\theta$ to $E n v ^ { * } ( \lambda )$ and observe the sequences of actions $( a [ 1 ] , a [ 2 ] , \dots )$ and states $( s [ 1 ] , s [ 2 ] , \dots )$ . We can use these sequences to calculate their gradients with respect to $\theta$ through backward propagation, which we denote by $h _ { e }$ . We also observe the discounted net reward and denote it by $G _ { e }$ . After all episodes in the mini-batch finish, we calculate the average of all $G _ { e }$ as a bootstrapped baseline and denote it by $\bar { G } _ { b }$ . Finally, we do a weighted gradient ascent with the weight for episode $e$ being its offset net reward, $G _ { e } - \bar { G } _ { b }$ . When the step size is chosen appropriately, the neural network will be more likely to follow the sequences of actions of episodes with larger $G _ { e }$ after the weighted gradient ascent, and thus will have a better empirical discounted net reward. The complete algorithm is described in Alg. 1.
|
| 110 |
+
|
| 111 |
+
Obviously, the choice of $s _ { 0 }$ and $s _ { 1 }$ can have significant impact on the convergence speed of Alg. 1. In our implementation, we choose $s _ { 0 }$ uniformly at random in each mini-batch. The choice of $s _ { 1 }$ depends on the bandit problems. Some bandit problems naturally visit certain states far less frequently than other states. For such problems, we choose $s _ { 1 }$ to be those less-frequently-visited states with higher probabilities, so as to ensure that Alg. 1 is able to learn the optimal control for these states. For other problems, we simply choose $s _ { 1 } = s _ { 0 }$ .
|
| 112 |
+
|
| 113 |
+
# Algorithm 1: NeurWIN Training
|
| 114 |
+
|
| 115 |
+
<table><tr><td>Input: Parameters 0,discount factor β ∈ (O,1),learning rate L,sigmoid parameter m Output: Trained neural network parameters 0+ foreachmini-batchbdo Randomly choose so and s1,and set X ← fe(so) ; foreach episode ein themini-batch do Set the arm to state s1,and set he ←O ; foreach round t in the episode do Choose a[t] =1 w.p.δm(fe(s[t])-λ),and a[t]=O w.p.1-δm(fe(s[t])-λ); if a[t]=1then he←he+Vθln(om(fe(s[t])-λ));</td></tr><tr><td>else end Ge ← empirical discounted net reward in episode e;</td></tr><tr><td>end</td></tr><tr><td>he←he+Vθln(1-δm(fe(s[t])-λ)) ;</td></tr></table>
|
| 116 |
+
|
| 117 |
+
# 5 EXPERIMENTS
|
| 118 |
+
|
| 119 |
+
# 5.1 OVERVIEW
|
| 120 |
+
|
| 121 |
+
In this section, we demonstrate NeurWIN’s utility by evaluating it under three recently studied applications of restless bandit problems. In each application, we consider that there are $N$ arms and a controller can play $M$ of them in each round. We evaluate three different pairs of $( N , M )$ : $( 4 , 1 )$ , (100, 10), and (100, 25), and average the results of 200 independent runs when the problems are stochastic. Some applications consider that different arms can have different behaviors. For such scenarios, we consider that there are multiple types of arms and train a separate NeurWIN for each type. During testing, the controller calculates the index of each arm based on the arm’s state and schedules the $M$ arms with the highest indices.
|
| 122 |
+
|
| 123 |
+
The performance of NeurWIN is compared against the proposed policies in the respective recent studies. In addition, we also implement and evaluate the REINFORCE algorithm (Williams, 1992) and the QWIC algorithm $\mathrm { F u }$ et al., 2019). The REINFORCE algorithm aims to find the optimal control by viewing a restless bandit problem as a Markov decision problem. Under this view, the number of states is exponential in $N$ and the number of possible actions is $\textstyle { \binom { N } { M } }$ . Thus, we are only able to evaluate REINFORCE for the case $N = 4$ and $M = 1$ . The QWIC algorithm aims to find the Whittle index through Q-learning. It is a tabular method and does not scale well as the state space increases. Thus, we only evaluate QWIC when the size of the state space is small.
|
| 124 |
+
|
| 125 |
+
We use the same neural network architecture for NeurWIN in all three applications. The neural network is a fully connected one that consists of one input layer, one output layer, and two hidden layers. There are 16 and 32 neurons in the two hidden layers. The output layer has one neuron, and the input layer size is the same as the dimension of the state of one single arm. As for the REINFORCE algorithm, we choose the neural network architecture so that the total number of parameters is slightly more than $N$ times as the number of parameters in NeurWIN to make a fair comparison. ReLU activation function is used for the two hidden layers. An initial learning rate $L = 0 . 0 0 1$ is set for all cases, with the Adam optimizer (Kingma & Ba, 2015) employed for the gradient ascent step. The discount factor is $\beta = 0 . 9 9 9$ and each mini-batch consists of five episodes.
|
| 126 |
+
|
| 127 |
+
For all cases, we implement the NeurWIN algorithm using PyTorch (Paszke et al., 2019), and train the agent on a single arm modelled after OpenAI’s Gym API (Brockman et al., 2016). We provide a brief overview of each application and the experiment setting in the following sections. We refer readers to the appendices for detailed discussions on experiment settings.
|
| 128 |
+
|
| 129 |
+
# 5.2 RECOVERING BANDITS
|
| 130 |
+
|
| 131 |
+
The recovering bandits (Pike-Burke & Grunewalder, 2019) aim to model the time-varying behaviors of consumers. In particular, it considers that a consumer who has just bought a certain product, say, a television, would be much less interested in advertisements of the same product in the near future. However, the consumer’s interest in these advertisements may recover over time. Thus, the recovering bandit models the reward of playing an arm, i.e., displaying an advertisement, by a function $f ( \operatorname* { m i n } \{ z , z _ { m a x } \} )$ , where $z$ is the time since the arm was last played and $z _ { m a x }$ is a constant specified by the arm. There is no known Whittle index or optimal control policy for this problem.
|
| 132 |
+
|
| 133 |
+
The recent study (Pike-Burke & Grunewalder, 2019) on recovering bandit focuses on learning the function $f ( \cdot )$ for each arm. Once it obtains an estimate of $f ( \cdot )$ , it uses a heuristic called $d$ -lookahead to determine which arms to play. The $d$ -lookahead policy enumerates all possible actions in the next $d$ rounds, and then pick the sequence of actions that yield that highest reward. Since the controller can choose $M$ arms out of $N$ arms to activate, with $\mathbf { \bar { \rho } } _ { ( \mathcal { M } ) }$ different possibilities, in each round, the complexity of the heuristic is $O ( { \bigl ( } _ { M } ^ { N } ) ^ { d } )$ when $d > 1$ . Thus, we are only able to evaluate 1-lookahead when $N = 1 0 0$ . When $N = 4$ and $M = 1$ , we evaluate 1-lookahead and 3-lookahead.
|
| 134 |
+
|
| 135 |
+
In our experiment, we consider that there are four types of arms and there are $\textstyle { \frac { N } { 4 } }$ arms for each type. Different types of arms have different functions $f ( \cdot )$ . The state of each arm is its value of $\operatorname* { m i n } \{ z , z _ { m a x } \}$ and we set $z _ { m a x } = 2 0$ for all arms.
|
| 136 |
+
|
| 137 |
+
Experiment results are shown in Fig. 2. It can be observed that NeurWIN is able to outperform 1-lookahead in all settings with just a few thousands of training episodes. In contrast, for the case $N = 4$ and $M = 1$ , REINFORCE only sees slight performance improvement over 50,000 training episodes and remains far worse than NeurWIN. This may be due to the explosion of state space. Even though $N$ is only 4, the total number of possible states is $2 0 ^ { 4 } = 1 6 0 , \bar { 0 } 0 0$ , making it difficult for REINFORCE to learn the optimal control in just 50, 000 episodes. In contrast, since NeurWIN learns the Whittle index of each arm separately, its size of state space is only 20. QWIC performs poorly. This suggests that it does not learn a good approximation to the Whittle index.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 2: Experiment results for the recovering bandits.
|
| 141 |
+
|
| 142 |
+
# 5.3 WIRELESS SCHEDULING
|
| 143 |
+
|
| 144 |
+
A recent paper (Aalto et al., 2015) studies the problem of wireless scheduling over fading channels. In this problem, each arm corresponds to a wireless client. Each wireless client has some data to be transmitted and it suffers from a holding cost of 1 unit per round until it has finished transmitting all its data. The channel quality of a wireless client, which determines the amount of data can be transmitted if the wireless client is scheduled, changes over time. The goal is to minimize the sum of holding costs of all wireless clients. Equivalently, we view the reward of the system as the negative of the total holding cost.
|
| 145 |
+
|
| 146 |
+
Finding the Whittle index through theoretical analysis is difficult. Even for the simplified case when the channel quality is i.i.d. over time and can only be in one of two possible states, the recent paper (Aalto et al., 2015) can only derive the Whittle index under some approximations. It then proposes a size-aware index policy using its approximated index.
|
| 147 |
+
|
| 148 |
+
In the experiment, we adopt the settings of channel qualities of the recent paper. The channel of a wireless client can be in either a good state or a bad state. The amount of data that can be transmitted in a round is $3 3 . 6 \mathrm { k b }$ in a good state, and $8 . 4 \mathrm { k b }$ in a bad state. Initially, the amount of load is uniformly between 0 and 1Mb. The state of each arm is its channel state and the amount of remaining load. The size of state space is $2 \times 1 0 ^ { 6 }$ for each arm. We consider that there are two types of arms, and different types of arms have different probabilities of being in the good state. We train a NeurWIN for each type. During testing, there are $\begin{array} { l } { { \frac { N } { 2 } } } \end{array}$ arms of each type.
|
| 149 |
+
|
| 150 |
+
Experiment results are shown in Fig. 3. It can be observed that NeurWIN is able to outperform the size-aware index policy with about 100, 000 training episodes. This result is significant when one considers the fact that the size-aware index is itself an approximation to the Whittle index. The experiment results thus suggest that NeurWIN is able to find a more accurate approximation to the Whittle index than the best known theoretical result. It can also be observed that REINFORCE performs poorly.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 3: Average rewards and confidence bounds of different policies for wireless scheduling.
|
| 154 |
+
|
| 155 |
+
# 5.4 DEADLINE SCHEDULING
|
| 156 |
+
|
| 157 |
+
A recent study (Yu et al., 2018) proposes a deadline scheduling problem for the scheduling of electrical vehicle charging stations. In this problem, a charging station has $N$ charging spots and enough power to charge $M$ vehicles in each round. When a charging spot is available, a new vehicle may join the system and occupy the spot. Upon occupying the spot, the vehicle announces the time that it will leave the station and the amount of electricity that it needs to be charged. The charging station obtains a reward for each unit of electricity that it provides to a vehicle. However, if the station cannot fully charge the vehicle by the time it leaves, then the station needs to pay a penalty. The goal of the station is to maximize its net reward, defined as the difference between the amount of reward and the amount of penalty. Under an i.i.d. arrival assumption, the recent study has derived the precise characterization of the Whittle index, which we refer to as the deadline Whittle index. We further prove that this problem is strongly indexable in the appendix.
|
| 158 |
+
|
| 159 |
+
We use exactly the same setting as in the recent study (Yu et al., 2018) for our experiment. In this problem, the state of an arm is denoted by a pair of integers $( D , B )$ , where $B$ is the amount of electricity that the vehicle still needs and $D$ is the time until the vehicle leaves the station. When a charging spot is available, its state is $( 0 , 0 )$ . $B$ is upper-bounded by 9 and $D$ is upper-bounded by 12. Hence, the size of state space is 109 for each arm.
|
| 160 |
+
|
| 161 |
+
The experiment results are shown in Fig. 4. It can be observed that the performance of NeurWIN converges to that of the deadline Whittle index in less than 500 training episodes.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Average rewards and confidence bounds of different policies for deadline scheduling.
|
| 165 |
+
|
| 166 |
+
# 5.5 EXPERIMENT RESULTS WITH NOISY SIMULATORS
|
| 167 |
+
|
| 168 |
+
The training of NeurWIN requires a simulator for each arm. In this section, we evaluate the performance of NeurWIN when the simulator is not perfectly precise. In particular, let $R _ { a c t } ( s )$ and $R _ { p a s s } ( s )$ be the rewards of an arm in state $s$ when it is activated and not activated, respectively. Then, the simulator estimates that the rewards are $R _ { a c t } ^ { \prime } ( s ) = ( 1 + G _ { a c t , s } ) R _ { a c t } ( s )$ and $R _ { p a s s } ^ { \prime } ( s ) = ( 1 + G _ { p a s s , s } ) R _ { i , p a s s } ( s )$ , respectively, where $G _ { a c t , s }$ and $G _ { p a s s , s }$ are independent Gaussian random variables with mean 0 and variance 0.05. In other words, the simulator has an average $5 \%$ error in its reward estimation.
|
| 169 |
+
|
| 170 |
+
We train NeurWIN using the noisy simulators for the recovering bandits problem and the deadline scheduling problem. For each problem, we compare the performance of NeurWIN against the respective baseline policies. Unlike NeurWIN, the baseline policies make decisions based on the true reward functions rather than the estimated ones. The results for the case $N = 1 0 0$ and $M = 2 5$ are shown in Fig. 5. It can be observed that NeurWIN is still able to achieve superior performance.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 5: Experiment results for NeurWIN with noisy simulators.
|
| 174 |
+
|
| 175 |
+
# 6 CONCLUSION
|
| 176 |
+
|
| 177 |
+
This paper introduced NeurWIN: a deep RL method for estimating the Whittle index for restless bandit problems. The performance of NeurWIN is evaluated by three different restless bandit problems. In each of them, NeurWIN significantly outperforms state-of-the-art control policies in terms of the total discounted reward.
|
| 178 |
+
|
| 179 |
+
NeurWIN can have important implications for restless bandit problems. There are many problems where the environments are well-defined, but the optimal control is not known. NeurWIN can obviously be used for such problems. For problems where the environments are not known a priori, NeurWIN nicely compliments existing studies that aim to learn the environments through online learning but fail to find the optimal control policy.
|
| 180 |
+
|
| 181 |
+
# REFERENCES
|
| 182 |
+
|
| 183 |
+
Samuli Aalto, Pasi Lassila, and Prajwal Osti. Whittle index approach to size-aware scheduling with time-varying channels. In Proceedings of the 2015 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems, pp. 57–69, 2015.
|
| 184 |
+
|
| 185 |
+
K. Avrachenkov and V. S. Borkar. A learning algorithm for the whittle index policy for scheduling web crawlers. In 2019 57th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1001–1006, 2019.
|
| 186 |
+
|
| 187 |
+
V. S. Borkar and K. Chadha. A reinforcement learning algorithm for restless bandits. In 2018 Indian Control Conference (ICC), pp. 89–94, 2018.
|
| 188 |
+
|
| 189 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 190 |
+
|
| 191 |
+
Christopher R Dance and Tomi Silander. When are kalman-filter restless bandits indexable? In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 1711–1719. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/5922-when-are-kalman-filterrestless-bandits-indexable.pdf.
|
| 192 |
+
|
| 193 |
+
Christoph Dann, Tor Lattimore, and Emma Brunskill. Unifying pac and regret: Uniform pac bounds for episodic reinforcement learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, pp. 5717–5727, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
|
| 194 |
+
|
| 195 |
+
J. Fu, Y. Nazarathy, S. Moka, and P. G. Taylor. Towards q-learning the whittle index for restless bandits. In 2019 Australian New Zealand Control Conference (ANZCC), pp. 249–254, 2019.
|
| 196 |
+
|
| 197 |
+
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E. Schapire. Contextual decision processes with low Bellman rank are PAC-learnable. volume 70 of Proceedings of Machine Learning Research, pp. 1704–1713, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/ jiang17c.html.
|
| 198 |
+
|
| 199 |
+
Diederick P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 200 |
+
|
| 201 |
+
J. Le Ny, M. Dahleh, and E. Feron. Multi-uav dynamic routing with partial observations using restless bandit allocation indices. In 2008 American Control Conference, pp. 4220–4225, 2008.
|
| 202 |
+
|
| 203 |
+
Alex S. Leong, Arunselvan Ramaswamy, Daniel E. Quevedo, Holger Karl, and Ling Shi. Deep reinforcement learning for wireless sensor scheduling in cyber–physical systems. Automatica, 113:108759, 2020. ISSN 0005-1098. doi: https://doi.org/ 10.1016/j.automatica.2019.108759. URL http://www.sciencedirect.com/science/ article/pii/S0005109819306223.
|
| 204 |
+
|
| 205 |
+
R. Meshram, D. Manjunath, and A. Gopalan. On the whittle index for restless multiarmed hidden markov bandits. IEEE Transactions on Automatic Control, 63(9):3046–3053, 2018.
|
| 206 |
+
|
| 207 |
+
Jose Ni ´ no-Mora. Dynamic priority allocation via restless bandit marginal productivity indices. ˜ Top, 15(2):161–198, 2007.
|
| 208 |
+
|
| 209 |
+
Christos H. Papadimitriou and John N. Tsitsiklis. The complexity of optimal queuing network control. Mathematics of Operations Research, 24(2):293–305, 1999. ISSN 0364765X, 15265471. URL http://www.jstor.org/stable/3690486.
|
| 210 |
+
|
| 211 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alche-Buc, E. Fox, ´ and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8026–8037. Curran Associates, Inc., 2019. URL http://papers.nips.cc/paper/9015-pytorchan-imperative-style-high-performance-deep-learning-library.pdf.
|
| 212 |
+
|
| 213 |
+
Ciara Pike-Burke and Steffen Grunewalder. Recovering bandits. In Advances in Neural Information Processing Systems, pp. 14122–14131, 2019.
|
| 214 |
+
|
| 215 |
+
Carlos Riquelme, George Tucker, and Jasper Snoek. Deep bayesian bandits showdown: An empirical comparison of bayesian deep networks for thompson sampling. In International Conference on Learning Representations (ICLR), 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SyYe6k-CW.
|
| 216 |
+
|
| 217 |
+
Julien Seznec, Pierre Menard, Alessandro Lazaric, and Michal Valko. A single algorithm for both restless and rested rotting bandits. In International Conference on Artificial Intelligence and Statistics, pp. 3784–3794, 2020.
|
| 218 |
+
|
| 219 |
+
Aleksandrs Slivkins and Eli Upfal. Adapting to a changing environment: the brownian restless bandits. In COLT, pp. 343–354, 2008.
|
| 220 |
+
|
| 221 |
+
Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. The MIT Press, second edition, 2018. URL http://incompleteideas.net/book/the-book2nd.html.
|
| 222 |
+
|
| 223 |
+
V. Tripathi and E. Modiano. A whittle index approach to minimizing functions of age of information. In 2019 57th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1160–1167, 2019.
|
| 224 |
+
|
| 225 |
+
S. Wang, H. Liu, P. H. Gomes, and B. Krishnamachari. Deep reinforcement learning for dynamic multichannel access in wireless networks. IEEE Transactions on Cognitive Communications and Networking, 4(2):257–265, 2018.
|
| 226 |
+
|
| 227 |
+
T. Wei, Yanzhi Wang, and Q. Zhu. Deep reinforcement learning for building hvac control. In 2017 54th ACM/EDAC/IEEE Design Automation Conference (DAC), pp. 1–6, 2017.
|
| 228 |
+
|
| 229 |
+
Peter Whittle. Restless bandits: Activity allocation in a changing world. Journal of applied probability, pp. 287–298, 1988.
|
| 230 |
+
|
| 231 |
+
Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach. Learn., 8(3–4):229–256, May 1992. ISSN 0885-6125. doi: 10.1007/ BF00992696. URL https://doi.org/10.1007/BF00992696.
|
| 232 |
+
|
| 233 |
+
Huizhen Yu and Dimitri P Bertsekas. Convergence results for some temporal difference methods based on least squares. IEEE Transactions on Automatic Control, 54(7):1515–1531, 2009.
|
| 234 |
+
|
| 235 |
+
Z. Yu, Y. Xu, and L. Tong. Deadline scheduling as restless bandits. IEEE Transactions on Automatic Control, 63(8):2343–2358, 2018.
|
| 236 |
+
|
| 237 |
+
Andrea Zanette and Emma Brunskill. Problem dependent reinforcement learning bounds which can identify bandit structure in MDPs. volume 80 of Proceedings of Machine Learning Research, pp. 5747–5755, Stockholmsmassan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL ¨ http: //proceedings.mlr.press/v80/zanette18a.html.
|
| 238 |
+
|
| 239 |
+
Qing Zhao. Multi-armed bandits: Theory and applications to online learning in networks. Synthesis Lectures on Communication Networks, 12(1):1–165, 2019.
|
| 240 |
+
|
| 241 |
+
# A RECOVERING BANDITS’ TRAINING AND INFERENCE DETAILS
|
| 242 |
+
|
| 243 |
+
A.1 FORMULATED RESTLESS BANDIT FOR THE RECOVERING BANDITS’ CASE
|
| 244 |
+
|
| 245 |
+
We list here the terms that describes one restless arm in the recovering bandits’ case:
|
| 246 |
+
|
| 247 |
+
State $s [ t ]$ : The state is a single value $s [ t ] = z [ t ]$ called the waiting time. The waiting time $z [ t ]$ indicates the time since the arm was last played. The arm state space is determined by the maximum allowed waiting time $z _ { m a x }$ , giving a state space $\begin{array} { r } { \boldsymbol { S } : = [ 1 , \boldsymbol { z } _ { m a x } ] } \end{array}$ .
|
| 248 |
+
|
| 249 |
+
Action $a [ t ]$ : As with all other considered cases, the agent can either activate the arm $a [ t ] = 1$ , or not select it $a [ t ] = 0$ . The action space is then $\mathcal { A } : = \{ 0 , \bar { 1 } \}$ .
|
| 250 |
+
|
| 251 |
+
Reward $r [ t ]$ : The reward is provided by the recovering function $f ( z [ t ] )$ , where $z [ t ]$ is the time since the arm was last played at time $t$ . If the arm is activated, the function value at $z [ t ]$ is the earned reward. A reward of zero if given if the arm is left passive $a [ t ] = 0$ . Figure 6 shows the four recovering functions used in this work. The recovering functions are generated from,
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
f ( z [ t ] ) = \theta _ { 0 } ( 1 - e ^ { - \theta _ { 1 } \cdot z [ t ] } )
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
Where the $\Theta = [ \theta _ { 0 } , \theta _ { 1 } ]$ values specify the recovering function. The $\Theta$ values for each class are given in table 1.
|
| 258 |
+
|
| 259 |
+
Table 1: $\Theta$ values used in the recovering bandits’ case
|
| 260 |
+
|
| 261 |
+
<table><tr><td>Class</td><td>00Value</td><td>01 Value</td></tr><tr><td></td><td></td><td>0.2</td></tr><tr><td>A B</td><td>10</td><td>0.4</td></tr><tr><td>C</td><td>8.5</td><td></td></tr><tr><td></td><td>7</td><td>0.6</td></tr><tr><td>D</td><td>5.5</td><td>0.8</td></tr></table>
|
| 262 |
+
|
| 263 |
+
Next state $s [ t + 1 ]$ : The state evolves based on the selected action. If $a [ t ] = 1$ , the state is reset to $s [ t + 1 ] = 1$ , meaning that bandit’s reward decayed to the initial waiting time $z [ t + 1 ] = 1$ . If the arm is left passive $a [ t ] = 0$ , the next state becomes $s [ t + 1 ] = \operatorname* { m i n } \{ z [ t ] \stackrel { . } { + } 1 , z _ { m a x } \stackrel { . } { } \}$ .
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 6: The selected recovering functions for the recovering bandits’ case. For testing, we set each quarter of the instantiated $N$ arms to one of the shown $f ( z )$ functions.
|
| 267 |
+
|
| 268 |
+
# A.2 TRAINING SETTING
|
| 269 |
+
|
| 270 |
+
The general training procedure for the NeurWIN algorithm is outlined in its pseudo code in section 4. Here we discuss the parameter selection and details specific to the recovering bandits’ case. We train the neural network using NeurWIN for 50, 000 episode, and save the trained parameters at an episode interval of 100 episodes. The purpose of saving the parameters is to infer their control policies, and compare it with the 1-lookahead policy. In total, for 50, 000 training episodes, we end up with 500 models for inference. The selected neural network has 609 trainable parameters given as $\{ 1 , 1 6 , 3 2 , 1 \}$ layer neurons.
|
| 271 |
+
|
| 272 |
+
For training parameters, we select the sigmoid value $m = 5$ , the episode’s time horizon $T = 1 0 0$ timesteps, the mini-batch size to 5 episodes, and the discount factor $\beta = 0 . 9 9 9$ . As with all other cases, each mini-batch of episodes has the same initial state $s [ t = 1 ]$ which is provided by the arm. To ensure the agent experiences as many states in $[ 1 , z _ { m a x } ]$ as possible, we set an initial state sampling distribution given as P r{s[t = 1] = z} = 2z21+22+...+2zmax . H ence, the probability of selecting the initial state to be $s [ t = 1 ] = z _ { m a x }$ is 0.5. This initialization distribution allows the agent to experience the recovery function’s awards at higher $z$ values.
|
| 273 |
+
|
| 274 |
+
At the agent side, we set the activation cost $\lambda$ at the beginning of each mini-batch. $\lambda$ is chosen to be the estimate index value $f _ { \theta } ( s ^ { ' } )$ of a randomly selected state in $s ^ { ' } \in [ 1 , z _ { m a x } ]$ . The training continues as described in NeurWIN’s pseudo code: the agent receives the state, and selects an action $a [ t ]$ . If the agent activates the arm $a [ t ] = 1$ , it receives a reward equal to the recovery function’s value at $z$ , and subtracts $\lambda$ from it. Otherwise, the reward $r [ t ]$ is kept the same for $a [ t ] = 0$ . We note that no noise was added with the clean simulator, and the agent discounts the original reward value $\beta ^ { t } r [ t ] = \beta ^ { t } f ( z [ t ] )$ . The process continues for all timesteps in the episode up to $T = 1 0 0$ , and for remaining mini-batch episodes. A gradient ascent step is taken on the bootstrapped mini-batch return as described in section 4.
|
| 275 |
+
|
| 276 |
+
# A.3 INFERENCE SETTING
|
| 277 |
+
|
| 278 |
+
The inference setup measures NeurWIN’s control policy for several $\binom { N } { M }$ settings. We test, for a single run, the control policies of NeurWIN and 1-lookahead over a time horizon $T \ : = \ : 3 0 0 0$ timesteps. We set $N$ arms such that a quarter have one recovering function class from table 1. For example, when $N = 1 0 0$ , 25 arms would have recovering function A that generates their rewards.
|
| 279 |
+
|
| 280 |
+
At each timestep, the 1-lookahead policy ranks the recovering functions reward values, and selects the $M$ arms with the highest reward values for activation. The incurred discounted reward at time $t$ is the discounted sum of all activated arms’ rewards. The total discounted reward is then the discounted rewards over time horizon $T = 3 0 0 0$ . For inferring NeurWIN’s control policy, we record the total discounted reward for each of the 500 models. An example testing procedure is as follows: we instantiate $N$ arms each having a neural network trained to 10, 000 episodes. At each timestep $t$ , the neural networks provide the estimated index $f _ { i , \theta } ( s _ { i } [ t ] )$ for $i = 1 , 2 , \dots , N$ . The control policy activates the $M$ arms with the highest index values. The incurred discounted reward at time $t$ is the discounted sum of all activated arm’s rewards $\begin{array} { r } { \beta ^ { t } R [ t ] = \beta ^ { t } \sum _ { j = 1 } ^ { M } f _ { j } ( z [ t ] ) } \end{array}$ . The same process continues for all timesteps in the horizon $T = 3 0 0 0$ . We then load the model parameters trained on 10, 100 episodes, and repeat the aforementioned testing process using the same seed values.
|
| 281 |
+
|
| 282 |
+
# A.4 REINFORCE TRAINING AND INFERENCE SETTING ON RECOVERING BANDITS
|
| 283 |
+
|
| 284 |
+
The REINFORCE algorithm was applied only the $\textstyle { \binom { N } { M } }$ case where $N \ = \ 4$ , and $M \ = \ 1$ . For training, REINFORCE had four arms each with one of the recovery functions detailed in table 1. The training parameters are: initial learning rate $L = 0 . 0 0 1$ , mini-batch size is 5 episodes, and a training episode time horizon $T = 1 0 0$ timesteps. Training was done up to 50, 000 episodes, where the trained parameters were saved at an interval of 100 episodes. The selected neural network had 2504 trainable parameters. This neural network size is larger than $6 0 9 \times 4 = 2 4 3 6$ parameters of four NeurWIN neural networks.
|
| 285 |
+
|
| 286 |
+
For testing, the same procedure is followed as in A.3. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and deadline Whittle index policies. The testing was made for all 500 trained model (each being trained up to a different episode count). The final control policy result was plotted along with NeurWIN and the 1-lookahead policies for $\binom { 4 } { 1 }$ arms.
|
| 287 |
+
|
| 288 |
+
# A.5 QWIC TRAINING AND INFERENCE SETTING ON RECOVERING BANDITS
|
| 289 |
+
|
| 290 |
+
The Q-learning Whittle Index Controller (was trained in an offline setting using fixed WIC) pserestless a deth given in activatio $\mathrm { F u }$ et a(i.e. . $N$ $M$ ${ \binom { 4 } { 1 } } \ { \binom { 1 0 0 } { 1 0 } } \ { \binom { \bar { 1 } 0 0 } { 2 5 } } \ )$ $\lambda \in \Lambda$ as index for each state. The algorithm
|
| 291 |
+
learns $\mathrm { Q }$ function $Q \in \mathbb { R } ^ { \Lambda \times S \times \{ 0 , 1 \} }$ . The estimated index $\tilde { \lambda } [ s ]$ per state $s$ is determined during
|
| 292 |
+
training as,
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\tilde { \lambda } [ s ] = \operatorname * { a r g m i n } _ { \lambda \in \Lambda } \vert Q ( \lambda , s , 1 ) - Q ( \lambda , s , 0 ) \vert
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Hence, the converged index values and control performance depends on the initial set of candidate values $\Lambda$ . We select $\Lambda$ to be 100 values evenly spaced in the interval [0, 10]. We note the set selection was based on NeurWIN’s learned index values, which provides an advantage to QWIC training.
|
| 299 |
+
|
| 300 |
+
The exploration-exploitation trade-off is steered by parameter $\epsilon$ . $\epsilon$ is initialized to $\epsilon _ { m a x } = 1$ , and decays with factor $\alpha = 0 . 0 1$ to $\epsilon _ { m i n } = 0 . 0 1$ . $\epsilon$ is updated at each timestep during training until it settles at $\epsilon _ { m i n }$ .
|
| 301 |
+
|
| 302 |
+
Other training parameters were selected as: initial learning rate $L = 0 . 0 0 1$ , training episode time horizon of $T = 1 0 0$ timesteps, discount factor $\beta ~ = ~ 0 . 9 9 9$ , . Training was done up to 50, 000 episodes, where the Q-learned indices $\bar { \Lambda }$ were saved at an interval of 100 episodes.
|
| 303 |
+
|
| 304 |
+
For testing, we use the same testing setting as in NeurWIN and REINFORCE. The learned indices are loaded for each training interval. In total, 500 estimated index mappings were tested for 200 independent runs, each trained up to a certain episode limit.
|
| 305 |
+
|
| 306 |
+
# B WIRELESS SCHEDULING TRAINING AND INFERENCE DETAILS
|
| 307 |
+
|
| 308 |
+
B.1 RESTLESS ARM DEFINITION FOR THE WIRELESS SCHEDULING CASE
|
| 309 |
+
|
| 310 |
+
As with the recovering bandits’ case, we first list the state $s [ t ]$ , action $a [ t ]$ , reward $r [ t ]$ , and next state $s [ t + 1 ]$ that forms one restless arm:
|
| 311 |
+
|
| 312 |
+
State $s [ t ]$ : The state is a vector $( y [ t ] , v [ t ] )$ , where $y [ t ]$ is the arm’s remaining load in bits, and $v [ t ]$ is the wireless channel’s state indicator. $v [ t ] = 1$ means a good channel state and a higher transmission rate $r _ { 2 }$ , while $v [ t ] = 0$ is a bad channel state with a lower transmission rate $r _ { 1 }$ .
|
| 313 |
+
|
| 314 |
+
Action $a [ t ]$ : The agent either activates the arm $a [ t ] = 1$ , or keeps it passive $a [ t ] = 0$ . The reward and next state depend on the chosen action.
|
| 315 |
+
|
| 316 |
+
Reward $r [ t ]$ : The arm’s reward is the negative of holding cost $\psi$ , which is a cost incurred at each timestep for not completing the job. If the selected action $a [ t ] = 1$ , then the reward at time $t$ is $r [ t ] = \bar { - } \psi - \lambda$ . Otherwise, reward is just $r [ t ] = - \psi$ .
|
| 317 |
+
|
| 318 |
+
Next state $s [ t + 1 ]$ : The next state evolves differently as given below,
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
s [ t + 1 ] = \left\{ { \begin{array} { l l } { ( y [ t ] - r _ { 2 } , 1 ) \qquad } & { { \mathrm { i f ~ } } q ( v [ t ] ) = 1 , a [ t ] = 1 } \\ { \qquad } \\ { ( y [ t ] - r _ { 1 } , 0 ) \qquad } & { { \mathrm { i f ~ } } q ( v [ t ] ) = 0 , a [ t ] = 1 } \\ { \qquad } \\ { ( y [ t ] , q ( v [ t ] ) ) \qquad } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
Where $q ( v [ t ] )$ is the probability of a good channel state.
|
| 325 |
+
|
| 326 |
+
# B.2 TRAINING SETTING
|
| 327 |
+
|
| 328 |
+
We again emphasize that NeurWIN training happens only on one restless arm. The general training procedure was described in NeurWIN’s pseudo code. This discussion pertains only to the wireless scheduling case.
|
| 329 |
+
|
| 330 |
+
The neural network has 625 trainable parameters given as $\{ 2 , 1 6 , 3 2 , 1 \}$ neuron layers. The training happens for 1, 000, 000 episodes, and we save the model parameters at each 1000 episodes. Hence, the training results in 1000 models trained up to different episode limit.
|
| 331 |
+
|
| 332 |
+
For the wireless scheduling case, we set the sigmoid value $m = 0 . 0 1$ , mini-batch size to 5 episodes, and the discount factor to $\beta = 0 . 9 9 9$ . Episode time horizon is dependent on the remaining job size $y [ t ]$ . The episode terminates either if $y [ t ] = 0$ or $t = 3 0 0 0$ . The holding cost is set to $c = 1$ , which is incurred for each timestep the job is not completed. We also set the good transmission rate $r _ { 2 } = 3 3 . 6 \mathrm { k b }$ , and the bad channel transmission rate $r _ { 1 } = 8 . 4 \mathrm { k b }$ . During training, the good channel probability is $q ( v [ t ] ) = 0 . 5$ .
|
| 333 |
+
|
| 334 |
+
The episode defines one job size sampled uniformly from the range $y [ t = 1 ] \sim ( 0 , 1 \mathrm { M b } ]$ . All episodes in one mini-batch have the same initial state, as well as the same sequence of good channel states $[ v [ t = 1 ] , v [ t = 2 ] , \ldots , v [ t = T ] ]$ .
|
| 335 |
+
|
| 336 |
+
At the agent side, NeurWIN receives the initial state $s [ t = 1 ]$ , and sets the activation cost $\lambda =$ $f _ { \theta } ( s [ t = 1 ] )$ for all timesteps of all mini-batch episodes. As mentioned before, we save the trained model at an interval of 1000 episodes. For $1 , 0 0 0 , 0 0 0$ episodes, this results in 1000 models trained up to their respective episode limit.
|
| 337 |
+
|
| 338 |
+
# B.3 INFERENCE SETTING
|
| 339 |
+
|
| 340 |
+
For testing, the aim is to measure the trained models’ control performance against the size-aware index. We instantiate $N$ arms and activate $M$ arms at each timestep $t$ until all users’ jobs terminate. We average the total discounted reward for all control policies over 200 independent inference runs. Half of the arms have a good channel probability $q ( v [ \bar { t } ] ) = 0 . 7 5$ . The other half has a good channel probability $q ( v [ t ] ) = 0 . 1$ .
|
| 341 |
+
|
| 342 |
+
We compare NeurWIN’s control policy at different training episodes’ limits with the size-aware index policy. The size-aware index is defined as follows: at each timestep, the policy prioritizes arms in the good channel state, and calculates their secondary index. The secondary index $\hat { v } _ { i }$ of arm $i$ state $( y _ { i } [ t ] , v _ { i } [ t ] )$ is defined as,
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\hat { v } _ { i } ( y _ { i } [ t ] , v _ { i } [ t ] ) = \frac { c _ { i } r _ { i , 2 } } { y _ { i } [ t ] }
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
The size-aware policy then activates the highest $M$ indexed arms. In case the number of good channel arms is below $M$ , the policy also calculate the primary index of all remaining arms. The primary index $v _ { i }$ of arm $i$ state $( y _ { i } [ t ] , v _ { i } [ t ] )$ is defined as,
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
v _ { i } ( y _ { i } [ t ] , v _ { i } [ t ] ) = \frac { c _ { i } } { q _ { i } [ t ] ( r _ { i , 2 } / r _ { i , 1 } ) - 1 }
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
Rewards received from all arms are summed, and discounted using $\beta = 0 . 9 9 9$ . The inference phase proceeds until all jobs have been completed.
|
| 355 |
+
|
| 356 |
+
For NeurWIN’s control policy, we record the total discounted reward for the offline-trained models. For example, we set $N$ arms each coupled with a model trained on $1 0 , 0 0 0$ episodes. The models output their arms’ indices, and the top $M$ indexed arms are activated. In case the remaining arms are less than the sum $M$ , we activate all remaining arms at timestep ll arms’ rewards. Once testing for the curre $t$ . timestep reward t model is finishe $\begin{array} { r } { \beta ^ { t } R [ t ] = \beta ^ { t } \sum _ { i = 1 } ^ { N } r [ t ] } \end{array}$ isel 11, 000 for each arm, and repeat the process. We note that the arms’ initial loads are the same across runs, and that the sequence of good channel states is random.
|
| 357 |
+
|
| 358 |
+
# B.4 REINFORCE TRAINING AND INFERENCE SETTING ON WIRELESS SCHEDULING
|
| 359 |
+
|
| 360 |
+
The REINFORCE algorithm was applied only the $\binom { 4 } { 1 }$ case. The four arms have the same training setting as described in section B.2. The training parameters are: initial learning rate $L = 0 . 0 0 1$ mini-batch size is 5 episodes, and good channel probability for all four arms $q ( v [ t ] ) = 0 . 5$ . The episode time horizon has a hard limit of $\bar { T } = \dot { 3 0 0 0 }$ timesteps. However, an episode can terminate if all arms’ loads were fully processed (i.e. episodes, where the trained parameters were sav $\begin{array} { r } { \sum _ { i = 1 } ^ { 4 } y _ { i } [ t ] = 0 } \end{array}$ ). Training was done up to 100, 000of 1000 episodes. The selected neural network had 2532 trainable parameters so to have slightly more parameters than four NeurWIN neural networks.
|
| 361 |
+
|
| 362 |
+
For testing, the same procedure is followed as in B.3. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and size-aware index. The final control policy result was plotted along with NeurWIN and Whittle index policy for the $\binom { 4 } { 1 }$ testing setup.
|
| 363 |
+
|
| 364 |
+
# C DEADLINE SCHEDULING TRAINING AND INFERENCE DETAILS
|
| 365 |
+
|
| 366 |
+
C.1 FORMULATED RESTLESS BANDIT FOR THE DEADLINE SCHEDULING CASE
|
| 367 |
+
|
| 368 |
+
The state $s [ t ]$ , action $a [ t ]$ , reward $r [ t ]$ , and next state $s [ t + 1 ]$ of one arm are listed below:
|
| 369 |
+
|
| 370 |
+
State $s [ t ]$ : The state is a vector $( D , B )$ . $B$ denotes the job size (i.e. amount of electricity needed for an electric vehicle), and $D$ is the job’s time until the hard drop deadline $d$ is reached (i.e. time until an electric vehicle leaves).
|
| 371 |
+
|
| 372 |
+
Action $a [ t ]$ : The agent can either activate the arm $a [ t ] = 1$ , or leave it passive $a [ t ] = 0$ . The next state changes based on two different transition kernels depending on the selected action. The reward is also dependent on the action at time $t$ .
|
| 373 |
+
|
| 374 |
+
Reward $r [ t ]$ : The agent, at time $t$ , receives a reward $r [ t ]$ from the arm,
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
r [ t ] = \left\{ \begin{array} { l l } { ( 1 - c ) a [ t ] } & { \mathrm { ~ i f ~ } B [ t ] > 0 , D [ t ] > 1 } \\ { \qquad } \\ { ( 1 - c ) a [ t ] - F ( B [ t ] - a [ t ] ) } & { \mathrm { ~ i f ~ } B [ t ] > 0 , D [ t ] = 1 } \\ { \qquad } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
Where $c$ is a constant processing cost incurred when activating the arm, $F ( B [ t ] - a [ t ] )$ is the penalty function for failing to complete the job before $D = 1$ . The penalty function was chosen to be $F ( B [ t ] - a [ t ] ) = \bar { 0 } . 2 ( B [ t ] - a [ t ] ) ^ { 2 }$ .
|
| 381 |
+
|
| 382 |
+
Next state $s [ t + 1 ]$ : The next state $D [ t + 1 ]$ decreases by one, while the job size $B$ depends on the selected action as,
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
s [ t + 1 ] = \left\{ \begin{array} { l l } { ( D [ t ] - 1 , B [ t ] - a [ t ] ) \qquad } & { \mathrm { ~ i f ~ } D [ t ] > 1 } \\ { \qquad } \\ { ( D , B ) \mathrm { ~ w i t h ~ p r o b . ~ } Q ( D , B ) \qquad } & { \mathrm { ~ i f ~ } D [ t ] \leq 1 } \end{array} \right.
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Where $Q ( D , B )$ is the arrival probability of a new job (i.e. a new electric vehicle arriving at a charging station) if the position is empty. For training and inference, we set $Q ( D , B ) = 0 . 7$ .
|
| 389 |
+
|
| 390 |
+
C.2 STRONG INDEXABILITY PROOF FOR THE DEADLINE SCHEDULING CASE
|
| 391 |
+
|
| 392 |
+
It has been shown that the Whittle index for this problem is,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
v ( D , B ) : = \left\{ \begin{array} { l l } { 0 \qquad } & { \mathrm { i f } \ B = 0 } \\ { \qquad } \\ { 1 - c \qquad } & { \mathrm { i f } \ 1 \leq B \leq D - 1 } \\ { \qquad } \\ { \beta ^ { D - 1 } F ( B - D + 1 ) \qquad } \\ { - \beta ^ { D - 1 } F ( B - D ) + 1 - c \qquad } & { \mathrm { i f } \ D \leq B } \end{array} \right.
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
We further demonstrate that this problem is strongly indexable.
|
| 399 |
+
|
| 400 |
+
Theorem 3. The restless bandit for the deadline scheduling problem is strongly indexable.
|
| 401 |
+
|
| 402 |
+
Proof. Fix a state $s = ( D , B )$ , the function $D _ { s } ( \lambda ) : = ( Q _ { \lambda , a c t } ( s ) - Q _ { \lambda , p a s s } ( s ) )$ is a continuous and piece-wise linear function since the number of states is finite. Thus, it is sufficient to prove that $D _ { s } ( \lambda )$ is strictly decreasing at all points of $\lambda$ where $D _ { s } ( \lambda )$ is differentiable. Let $L _ { \lambda , a c t } ( s )$ be the sequence of actions taken by a policy that activates the arm at round 1, and then uses the optimal policy starting from round 2. Let $L _ { \lambda , p a s s } ( s )$ be the sequence of actions taken by a policy that does not activate the arm at round 1, and then uses the optimal policy starting from round 2. We prove this theorem by comparing $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ on every sample path. We consider the following two scenarios:
|
| 403 |
+
|
| 404 |
+
In the first scenario, $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are the same starting from round 2. Let $b$ be the remaining job size when the current deadline expires under $L _ { \lambda , a c t } ( s )$ . Since $L _ { \lambda , p a s s } ( s )$ is the same as $L _ { \lambda , a c t } ( s )$ starting from round 2, its remaining job size when the current deadline expires is $b + 1$ . Thus, $D _ { s } ( \lambda ) = 1 - c - \lambda + \beta ^ { D - 1 } ( F ( b + 1 ) - F ( b ) )$ , which is strictly decreasing in $\lambda$ whenever $D _ { s } ( \lambda )$ is differentiable.
|
| 405 |
+
|
| 406 |
+
In the second scenario, $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are not the same after round 2. Let $\tau$ be the first time after round 2 that they are different. Since they are the same between round 2 and round $\tau$ , the remaining job size under $L _ { \lambda , a c t } ( s )$ is no larger than that under $L _ { \lambda , p a s s } ( s )$ . Moreover, the Whittle index is increasing in job size. Hence, we can conclude that, on round $\tau$ , $L _ { \lambda , p a s s } ( s )$ activates the arm and $L _ { \lambda , a c t } ( s )$ does not activate the arm. After round $\tau$ , $L _ { \lambda , a c t } ( s )$ and $L _ { \lambda , p a s s } ( s )$ are in the same state and will choose the same actions for all following rounds. Thus, the two sequences only see different rewards on round 1 and round $\tau$ , and we have $D _ { s } ( \lambda ) = ( 1 - c - \lambda ) ( 1 - \bar { \beta } ^ { \tau - 1 } )$ , which is strictly decreasing in $\lambda$ whenever $D _ { s } ( \lambda )$ is differentiable.
|
| 407 |
+
|
| 408 |
+
Combining the two scenarios, the proof is complete.
|
| 409 |
+
|
| 410 |
+
# C.3 TRAINING SETTING
|
| 411 |
+
|
| 412 |
+
NeurWIN training is made for 1000 episodes on the deadline scheduling case. We save the trained model parameters at an interval of 5 episodes for inferring the control policy after training. Hence, the training produces 200 different set of parameters that output the estimated index given their respective training limit. The neural network had 625 trainable parameters given as $\{ 2 , 1 6 , 3 2 , 1 \}$ , where the input layer matches the state size.
|
| 413 |
+
|
| 414 |
+
For the deadline scheduling training, we set the sigmoid value $m = 1$ , episode’s time horizon $T =$ 3000 timesteps, mini-batch size to 5 episodes, and the discount factor $\beta = 0 . 9 9 9$ . The processing cost $c = 0 . 5$ , with the job arrival rate $Q ( D , B ) = 0 . 7 $ . Training procedure follows section 4.2 from the main text. The arm randomly picks an initial state $s [ t = 1 ] = ( D , B )$ , with a maximum $\bar { D } = 1 2$ , and maximum $\bar { B } = 9$ . The arm fixes the initial states across episodes in the same minibatch for proper return comparison. The sequence of job arrivals in an episode’s horizon is also fixed across a mini-batch. For example, one episode in mini-batch 1 would have the sequence $[ ( 1 1 , 5 ) , ( 6 , 2 ) , ( 8 , 4 ) , \dots , ( 3 , 5 ) ]$ , then all other episodes in the same mini-batch would pass the same sequence. This way, the actions taken by the agent would be the critical factor in comparing a mini-batch return, and ultimately in tuning the estimated index value $f _ { \theta } ( \cdot )$ .
|
| 415 |
+
|
| 416 |
+
At the agent side, NeurWIN receives the initial state $s [ t = 1 ]$ , sets the activation cost $\begin{array} { r } { \lambda = f _ { \theta } ( s [ t = } \end{array}$ 1]). This activation cost $\lambda$ selection method hence depends on the current network parameters $\theta$ , which are modified after every gradient ascent step. Training follows as described in NeurWIN’s pseudo code.
|
| 417 |
+
|
| 418 |
+
In figure 7, we plot the trained NeurWIN index for all possible state enumerations of $\bar { B } = 9$ and $D \in \{ 1 , 2 , 3 \}$ . The output index from the untrained neural network is also plotted for convergence comparison.
|
| 419 |
+
|
| 420 |
+
In figure 8, the trained restless bandit indices for noisy reward function is given. All possible states in $\bar { B } = 9$ for $D \in \{ 1 , 2 , 3 \}$ . For $\mathcal { N } ( 0 , 0 . 0 5 )$ added noise per timestep, the learned indices still match the state ordering found when trained with the true reward function.
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
Figure 7: Trained indices using the true reward function.
|
| 424 |
+
|
| 425 |
+

|
| 426 |
+
Figure 8: Trained indices using the noisy reward function.
|
| 427 |
+
|
| 428 |
+
# C.4 INFERENCE SETTING
|
| 429 |
+
|
| 430 |
+
In order to infer the resultant control policy, we are required to test the performance on models saved at different episodes’ intervals. In other words, the trained models’ parameters are tested at an interval of episodes, and their discounted rewards are plotted for comparison.
|
| 431 |
+
|
| 432 |
+
From the trained models described in C.3, we instantiate $N$ arms, and activate $M$ arms at each timestep. The inference step compares the resultant control policy with the deadline Whittle index $v ( D , B )$ .
|
| 433 |
+
|
| 434 |
+
The testing is done for a time horizon of $T = 3 0 0 0$ timesteps. The queue, modelled as $N$ restless arms, has $M$ positions activated at each timestep. Each arm has a unique sequence of job arrivals from other arms that differentiates its index value. For the deadline Whittle index, we calculate the indices according to 8, and activate the highest $M$ indices-associated arms. The accumulated reward from all arm (activated and passive) is then discounted with $\beta$ .
|
| 435 |
+
|
| 436 |
+
For NeurWIN control policy, we instantiate $N$ arms, and test the trained models up to a given episode. For example, we load a NeurWIN model trained for 100 episodes on one arm, and set $N$ arms each with its own trained agent on 100 episodes. Once the testing is complete, we load the next model trained at 105 episodes, and repeat the process for 105 episodes. The final result is NeurWIN’s control policy’s performance on $N$ arms given the models’ training.
|
| 437 |
+
|
| 438 |
+
We perform the testing over 200 independent runs up to 1000 episodes, where each run the arms are seeded differently. We stress that both the deadline Whittle index and NeurWIN policies were applied on identical seeded arms across the 200 runs. Meaning the sequence of arrivals and rewards experienced was fixed for each arm in each run. Results were provided in the main text for this setting.
|
| 439 |
+
|
| 440 |
+
# C.5 REINFORCE TRAINING AND INFERENCE SETTING ON DEADLINE SCHEDULING
|
| 441 |
+
|
| 442 |
+
The REINFORCE algorithm was applied on the $\binom { 4 } { 1 }$ testing case. For training, REINFORCE was trained on the same training setting as described in C.3 with the same parameters when appropriate.
|
| 443 |
+
|
| 444 |
+
The four restless arms were seeded differently to give unique job sequences. Training was made until 1000 episodes, where the trained parameters were saved at an interval of 5 episodes. The selected neural network had 2532 trainable parameters. The REINFORCE parameters’ count are purposefully slightly larger than $6 2 5 \times 4 = 2 5 0 0$ parameters of four NeurWIN neural networks.
|
| 445 |
+
|
| 446 |
+
For testing, the same procedure is followed as explained in C.4. The trained REINFORCE models were loaded, and each tested on the same arms as NeurWIN and deadline Whittle index policies. The testing was made for all 200 trained model (each being trained up to a different episode count). The final control policy result was plotted along with NeurWIN and Whittle index policy for $\binom { 4 } { 1 }$ arms.
|
| 447 |
+
|
| 448 |
+
C.6 QWIC TRAINING AND INFERENCE SETTING ON DEADLINE SCHEDULING
|
| 449 |
+
|
| 450 |
+
QWIC was trained in an offline setting for the sets ${ \binom { 4 } { 1 } } \ { \binom { 1 0 0 } { 1 0 } } \ { \binom { 1 0 0 } { 2 5 } }$ . We select the same candidate set $\Lambda$ as in the recovering bandits case, which is 100 values evenly spaced in the interval [0, 10]. $\epsilon$ was initialized to $\epsilon _ { m a x } = 1$ , and decays with factor $\alpha = 0 . 0 1$ to $\epsilon _ { m i n } = 0 . 0 1$ . $\epsilon$ is updated at each timestep during training until it decays to $\epsilon _ { m i n }$ .
|
| 451 |
+
|
| 452 |
+
Other training parameters: initial learning rate $L = 0 . 0 0 1$ , training episode time horizon of $T =$ 3000 timesteps, discount factor $\beta = 0 . 9 9 9$ , . Training was done up to $1 , 0 0 0$ episodes, where the select $\mathsf { q }$ -learned indices $\bar { \Lambda }$ were saved at an interval of 5 episodes. We test the Q-learning indices using the same setting as NeurWIN and REINFORCE. The estimated index mappings were tested for 200 independent runs.
|
| 453 |
+
|
| 454 |
+
We refer the reader to the code for further implementation details.
|
md/train/RHY_9ZVcTa_/RHY_9ZVcTa_.md
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON LINEAR IDENTIFIABILITY OF LEARNED REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Identifiability is a desirable property of a statistical model: it implies that the true model parameters may be estimated to any desired precision, given sufficient computational resources and data. We study identifiability in the context of representation learning: discovering nonlinear data representations that are optimal with respect to some downstream task. When parameterized as deep neural networks, such representation functions lack identifiability in parameter space, because they are overparameterized by design. In this paper, building on recent advances in nonlinear Independent Components Analysis, we aim to rehabilitate identifiability by showing that a large family of discriminative models are in fact identifiable in function space, up to a linear indeterminacy. Many models for representation learning in a wide variety of domains have been identifiable in this sense, including text, images and audio, state-of-the-art at time of publication. We derive sufficient conditions for linear identifiability and provide empirical support for the result on both simulated and real-world data.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
An increasingly common methodology in machine learning is to improve performance on a primary down-stream task by first learning a high-dimensional representation of the data on a related, proxy task. In this paradigm, training a model reduces to fine-tuning the learned representations for optimal performance on a particular sub-task (Erhan et al., 2010). Deep neural networks (DNNs), as flexible function approximators, have been surprisingly successful in discovering effective high-dimensional representations for use in downstream tasks such as image classification (Sharif Razavian et al., 2014), text generation (Radford et al., 2018; Devlin et al., 2018), and sequential decision making (Oord et al., 2018).
|
| 12 |
+
|
| 13 |
+
When learning representations for downstream tasks, it would be useful if the representations were reproducible, in the sense that every time a network relearns the representation function on the same data distribution, they were approximately the same, regardless of small deviations in the initialization of the parameters or the optimization procedure. In some applications, such as learning real-world causal relationships from data, such reproducible learned representations are crucial for accurate and robust inference (Johansson et al., 2016; Louizos et al., 2017). A rigorous way to achieve reproducibility is to choose a model whose representation function is identifiable in function space. Informally speaking, identifiability in function space is achieved when, in the limit of infinite data, there exists a single, global optimum in function space. Interestingly, Figure 1 exhibits learned representation functions that appear to be the same up to a linear transformation, even on finite data and optimized without convergence guarantees (see Appendix A.1 for training details).
|
| 14 |
+
|
| 15 |
+
In this paper, we account for Figure 1 by making precise the relationship it exemplifies. We prove that a large class of discriminative and autoregressive models are identifiable in function space, up to a linear transformation. Our results extend recent advances in the theory of nonlinear Independent Components Analysis (ICA), which have recently provided strong identifiability results for generative models of data (Hyvärinen et al., 2018; Khemakhem et al., 2019; 2020; Sorrenson et al., 2020). Our key contribution is to bridge the gap between these results and discriminative models, commonly used for representation learning (e.g., (Hénaff et al., 2019; Brown et al., 2020)).
|
| 16 |
+
|
| 17 |
+
The rest of the paper is organized as follows. In Section 2, we describe a general discriminative model family, defined by its canonical mathematical form, which generalizes many supervised, selfsupervised, and contrastive learning frameworks. In Section 3, we prove that learned representations in this family have an asymptotic property desirable for representation learning: equality up to a linear transformation. In Section 4, we show that this family includes a number of highly performant models, state-of-the-art at publication for their problem domains, including CPC (Oord et al., 2018), BERT (Devlin et al., 2018), and GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020). Section 5 investigates the actually realizable regime of finite data and partial optimization, showing that representations learned by members of the identifiable model family approach equality up to a linear transformation as a function of dataset size, neural network capacity, and optimization progress.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Left and Middle: Two learned DNN representation functions ${ \bf f } _ { \pmb { \theta } _ { 1 } } ( { \boldsymbol { B } } )$ , $\cdot$ visualized on held-out data $\boldsymbol { B }$ . The DNNs are word embedding models Mnih and Teh (2012) trained on the Billion Word Dataset (Chelba et al., 2013) (see Appendix A.1 for code release and training details). Right: $A \mathbf { f } _ { \pmb { \theta } _ { 1 } } ( B )$ and $\cdot$ , where $\pmb { A }$ is a linear transformation learned after training. The overlap exhibits linear identifiability (see Section 3): different representation functions, learned on the same data distribution, live within linear transformations of each other in function space.
|
| 21 |
+
|
| 22 |
+
# 2 MODEL FAMILY AND DATA DISTRIBUTION
|
| 23 |
+
|
| 24 |
+
The learned embeddings of a DNN are a function not only of the parameters, but also the network architecture and size of dataset (viewed as a sample from the underlying data distribution). This renders any analysis in full generality challenging. To make such an analysis tractable, in this section, we begin by specifying a set of assumptions about the underlying data distribution and model family that must hold for the learned representations to be similar up to a linear transformation. These assumptions are, in fact, satisfied by a number of already published, highly performant models. We establish definitions in this section, and discuss these existing approaches in depth in Section 4.
|
| 25 |
+
|
| 26 |
+
Data Distribution We assume the existence of a generalized dataset in the form of an empirical distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ over random variables $\mathbf { x }$ , y and S with the following properties:
|
| 27 |
+
|
| 28 |
+
• The random variable $\mathbf { x }$ is an input variable, typically high-dimensional, such as text or an image.
|
| 29 |
+
• The random variable y is a target variable whose value the model predicts. In case of object classification, this would be some semantically meaningful class label. However, in our model family, y may also be a high-dimensional context variable, such a text, image, or sentence fragment.
|
| 30 |
+
• S is a set containing the possible values of y given x, so $p _ { \mathcal { D } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) > 0 \iff \mathbf { y } \in \mathbf { S } .$
|
| 31 |
+
|
| 32 |
+
Note that the set of labels S is not fixed, but a random variable. This allows supervised, contrastive, and self-supervised learning frameworks to be analyzed together: the meaning of S encodes the task. For supervised classification, S is deterministic and contains class labels. For self-supervised pretraining, S contains randomly-sampled high-dimensional variables such as image embeddings. For deep metric learning (Hoffer and Ailon, 2015; Sohn, 2016), the set S contains one positive and $k$ negative samples of the class to which $\mathbf { x }$ belongs.
|
| 33 |
+
|
| 34 |
+
Canonical Discriminative Form Given a data distribution as above, a generalized discriminative model family may be defined by its parameterization of the probability of a target variable $\mathbf { y }$ conditioned on an observed variable x and a set S that contains not only the true target label $\mathbf { y }$ , but
|
| 35 |
+
|
| 36 |
+
also a collection of distractors $\mathbf { y } ^ { \prime }$ :
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
p _ { \theta } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } ) = \frac { \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ) ) } { \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) } ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
The codomain of the functions $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ and $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is $\mathbb { R } ^ { M }$ , and the domains vary according to modelling task. For notational convenience both are parameterized by $\pmb \theta \in \Theta$ , but f and $\mathbf { g }$ may use disjoint parts of $\pmb { \theta }$ , meaning that they do not necessarily share parameters.
|
| 43 |
+
|
| 44 |
+
With $\mathcal { F }$ and $\mathcal { G }$ we denote the function spaces of $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ respectively. Our primary domain of interest is when $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \theta }$ are highly flexible function approximators, such as DNNs. This brings certain analytical challenges. In neural networks, different choices of parameters $\pmb \theta$ can result in the same functions $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ , hence the map $\Theta \to { \mathcal { F } } \times { \mathcal { G } }$ is many-to-one. In the context of representation learning, the function $\mathbf { f } _ { \theta }$ is typically viewed as a nonlinear feature extractor, e.g., the learned representation of the input data. While other choices meet the membership conditions for the family defined by the canonical form of Equation (1), in the remainder, we will focus on DNNs in the remainder. We next present a definition of identifiability suitable for DNNs, and prove that members of the above family satisfy it under additional assumptions.
|
| 45 |
+
|
| 46 |
+
# 3 MODEL IDENTIFIABILITY
|
| 47 |
+
|
| 48 |
+
In this section, we derive identifiability conditions for models in the family defined in Section 2.
|
| 49 |
+
|
| 50 |
+
# 3.1 IDENTIFIABILITY IN PARAMETER SPACE
|
| 51 |
+
|
| 52 |
+
Identifiability analysis answers the question of whether it is theoretically possible to learn the parameters of a statistical model exactly. Specifically, given some estimator $\pmb { \theta } ^ { \prime }$ for model parameters $\pmb { \theta } ^ { * }$ , identifiability is the property that, for any $\{ \theta ^ { \prime } , \theta ^ { \ast } \} \subset \Theta$ ,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
p _ { \pmb { \theta } ^ { \prime } } = p _ { \pmb { \theta } ^ { * } } \quad \Longrightarrow \quad \pmb { \theta } ^ { \prime } = \pmb { \theta } ^ { * } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Models that do not have this property are said to be non-identifiable. This happens when different values $\{ \theta ^ { \prime } , \theta ^ { \ast } \} \subset \Theta$ can give rise to the same model distribution $p _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } | \mathbf { x } , \bar { \mathbf { S } } ) = p _ { \pmb { \theta } ^ { * } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ . In such a case, observing an empirical distribution $p _ { \pmb { \theta } ^ { * } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ , and fitting a model $p _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ to it perfectly does not guarantee that $\pmb { \theta } ^ { \prime } = \pmb { \theta } ^ { * }$ .
|
| 59 |
+
|
| 60 |
+
Neural networks exhibit various symmetries in parameter space such that there is almost always a many-to-one correspondence between a choice of $\pmb { \theta }$ and resulting probability function $p _ { \pmb { \theta } }$ . A simple example in neural networks is that one can swap the (incoming and outgoing) connections of two neurons in a hidden layer. This changes the value of the parameters, but does not change the network’s function. Thus, when representation functions $\mathbf { f } _ { \theta }$ or $\mathbf { g } _ { \pmb { \theta } }$ are parameterized as DNNs, equation 2 is not satisfiable.
|
| 61 |
+
|
| 62 |
+
# 3.2 IDENTIFIABILITY IN FUNCTION SPACE
|
| 63 |
+
|
| 64 |
+
For reliable and efficient representation learning, we want learned representations $\mathbf { f } _ { \theta }$ from two identifiable models to be sufficiently similar for interchangeable use in downstream tasks. The most general property we wish to preserve among learned representations is their ability to discriminate among statistical patterns corresponding to categorical groupings. In the model family defined in Section 2, the data and context functions $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ parameterize $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ , the probability of label assignment, through a normalized inner product. This induces a hyperplane boundary, for discrimination, in a joint space of learned representations for data $\mathbf { x }$ and context $\mathbf { y }$ . Therefore, in the following, we will derive identifiability conditions up to a linear transformation, using a notion of similarity in parameter space inspired by Hyvärinen et al. (2018).
|
| 65 |
+
|
| 66 |
+
Definition 1. Let $\overset { L } { \sim }$ be a pairwise relation on $\Theta$ defined as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\begin{array} { r } { \pmb { \theta } ^ { \prime } \stackrel { L } { \sim } \pmb { \theta } ^ { * } \iff \mathbf { f } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = A \mathbf { f } _ { \pmb { \theta } ^ { * } } ( \mathbf { x } ) } \\ { \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = B \mathbf { g } _ { \pmb { \theta } ^ { * } } ( \mathbf { y } ) } \end{array}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\pmb { A }$ and $\textbf { { B } }$ are invertible $M \times M$ matrices. See Appendix $\mathbf { B }$ for proof that $\stackrel { \mathrm { L } } { \sim }$ is an equivalence relation. In the remainder, we refer to identifiability up to the equivalence relation $\stackrel { \mathrm { L } } { \sim }$ as $\overset { L } { \sim }$ -identifiable or linearly identifiable.
|
| 73 |
+
|
| 74 |
+
# 3.3 LINEAR IDENTIFIABILITY OF LEARNED REPRESENTATIONS
|
| 75 |
+
|
| 76 |
+
We next present a simple derivation of the $\stackrel { \mathrm { L } } { \sim }$ -identifiability of members of the generalized discriminative family defined in Section 2. This result reveals sufficient conditions under which a discriminative probabilistic model $p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )$ has a useful property: the learned representations of the input $\mathbf { x }$ and target random variables $\mathbf { y }$ for any two pairs of parameters $( \theta ^ { \prime } , \theta ^ { * } )$ are related as $\theta ^ { \prime } \stackrel { \triangledown } { \sim } \theta ^ { * }$ , that is, $\mathbf { f } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = A \mathbf { f } _ { \pmb { \theta } ^ { * } } ( \mathbf { x } )$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = \mathbf { \bar { \phi } } B \mathbf { g } _ { \pmb { \theta } ^ { \ast } } ( \mathbf { \bar { y } } )$ .
|
| 77 |
+
|
| 78 |
+
We first review the notation for the proof, which is introduced in detail in Section 2. We then highlight an important requirement on the diversity of the data distribution, which must be satisfied for the proof statement to hold. We prove the result immediately after.
|
| 79 |
+
|
| 80 |
+
Notation. The target random variables $\mathbf { y }$ , associated with input random variables x, may be class labels (as in supervised classification), or they could be stochastically generated from datapoints x as, e.g., perturbed image patches (as in self-supervised learning). We account for this additional stochasticity as a set-valued random variable S, containing all possible values of $\mathbf { y }$ conditioned on some $\mathbf { x }$ . For brevity, we will use shorthands that drop the parameters $\pmb { \theta }$ : $p ^ { \prime } : = p _ { \pmb { \theta } ^ { \prime } } , p ^ { * } : = p _ { \pmb { \theta } ^ { * } }$ , $\mathbf { f } ^ { * } : = \mathbf { f } _ { \theta ^ { * } } , \mathbf { f } ^ { \prime } : = \mathbf { f } _ { \theta ^ { \prime } } , \mathbf { g } ^ { \prime } : = \mathbf { g } _ { \theta ^ { \prime } }$ .
|
| 81 |
+
|
| 82 |
+
Diversity condition. We assume that for any $( \theta ^ { \prime } , \theta ^ { * } )$ for which it holds that $p ^ { \prime } = p ^ { * }$ , and for any distinct tuples given $\mathbf { x }$ , by repeated sampling $\{ ( \mathbf { y } _ { A } ^ { ( i ) } , \mathbf { y } _ { B } ^ { ( i ) } ) \} _ { i = 1 } ^ { M }$ $\mathbf { S } \sim p _ { \mathcal { D } } ( \mathbf { S } | \mathbf { x } )$ such that the matrices and picking $\mathbf { L } ^ { \prime }$ $\mathbf { y } _ { A } , \mathbf { y } _ { B } \in \mathbf { S }$ and $\mathbf { L } ^ { \ast }$ are invertible, where , we can construct a set of $\mathbf { L } ^ { \prime }$ consists $M$ of columns $( \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ^ { ( i ) } ) - \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ^ { ( i ) } ) )$ , and $\mathbf { L } ^ { \ast }$ consists of columns $\mathbf { g } ^ { * } ( \mathbf { y } _ { A } ^ { ( i ) } ) - \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ^ { ( i ) } )$ , $i \in \{ 1 , \ldots , M \}$ . See Section 3.4 for detailed discussion.
|
| 83 |
+
|
| 84 |
+
Theorem 1. Under the diversity condition, models in the family defined by Equation (1) are linearly identifiable. That is, for any $\theta ^ { \prime } , \theta ^ { \ast } \in \Theta$ , and $\mathbf { f } ^ { * } , \mathbf { f } ^ { \prime } , \mathbf { g } ^ { * } , \mathbf { g } ^ { \prime } , p ^ { * } , \bar { p ^ { \prime } }$ defined as in Section 2,
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
p ^ { \prime } = p ^ { * } \implies \pmb { \theta } ^ { \prime } \stackrel { \perp } { \sim } \pmb { \theta } ^ { * } .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
To establish the result, we proceed by directly constructing an invertible linear transformation that satisfies Definition 1. Consider $\mathbf { y } _ { A } , \mathbf { y } _ { B } \in \mathbf { S }$ . The likelihood ratios for these points
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\frac { p ^ { \prime } ( \mathbf { y } _ { A } | \mathbf { x } , \mathbf { S } ) } { p ^ { \prime } ( \mathbf { y } _ { B } | \mathbf { x } , \mathbf { S } ) } = \frac { p ^ { * } ( \mathbf { y } _ { A } | \mathbf { x } , \mathbf { S } ) } { p ^ { * } ( \mathbf { y } _ { B } | \mathbf { x } , \mathbf { S } ) }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
are equal. Substituting our model definition from equation (1), we find:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\frac { \exp ( \mathbf { f } ^ { \prime } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ) ) } { \exp ( \mathbf { f } ^ { \prime } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ) ) } = \frac { \exp ( \mathbf { f } ^ { * } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { * } ( \mathbf { y } _ { A } ) ) } { \exp ( \mathbf { f } ^ { * } ( \mathbf { x } ) ^ { \top } \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ) ) } ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where the normalizing constants cancelled out on the left- and right-hand sides. Taking the logarithm, this simplifies to:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
( \mathbf { g } ^ { \prime } ( \mathbf { y } _ { A } ) - \mathbf { g } ^ { \prime } ( \mathbf { y } _ { B } ) ) ^ { \top } \mathbf { f } ^ { \prime } ( \mathbf { x } ) = ( \mathbf { g } ^ { * } ( \mathbf { y } _ { A } ) - \mathbf { g } ^ { * } ( \mathbf { y } _ { B } ) ) ^ { \top } \mathbf { f } ^ { * } ( \mathbf { x } ) .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
Note that this equation is true for any triple $\left( \mathbf { x } , \mathbf { y } _ { A } , \mathbf { y } _ { B } \right)$ for which $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } _ { B } , \mathbf { y } _ { B } ) > 0$ .
|
| 109 |
+
|
| 110 |
+
We next collect $M$ distinct tuples $( \mathbf { y } _ { A } ^ { ( i ) } , \mathbf { y } _ { B } ^ { ( i ) } )$ so that by repeating Equation (7) $M$ times and by the diversity condition noted above, the resulting difference vectors are linearly independent. We collect these vectors together as the columns of $( M \times M )$ -dimensional matrices $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ , forming the following system of $M$ linear equations:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { L ^ { \prime } } ^ { \top } \mathbf { f ^ { \prime } } ( \mathbf { x } ) = \mathbf { L ^ { * } } ^ { \top } \mathbf { f ^ { * } } ( \mathbf { x } ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
Since $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ are invertible, we rearrange:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf { f } ^ { \prime } ( \mathbf { x } ) = ( \mathbf { L } ^ { * } \mathbf { L } ^ { \prime - 1 } ) ^ { \top } \mathbf { f } ^ { * } ( \mathbf { x } ) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
Hence, $\mathbf { f } ^ { \prime } ( \mathbf { x } ) = \mathbf { A } \mathbf { f } ^ { * } ( \mathbf { x } )$ where $\mathbf { A } = ( \mathbf { L } ^ { * } \mathbf { L } ^ { \prime - 1 } )$ . This completes the first half of the proof. See Appendix $\textrm { C }$ for the second half of the proof, which is similar, and handles the function g.
|
| 123 |
+
|
| 124 |
+
# 3.4 DISCUSSION: WHEN DOES THE DIVERSITY CONDITION HOLD?
|
| 125 |
+
|
| 126 |
+
Theorem 1 is a constructive proof of existence that exhibits invertible $( M \times M )$ matrices $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ . We require the diversity condition to hold in order to guarantee invertibility. Such a requirement is similar to the conditions in earlier work on nonlinear ICA such as (Hyvärinen et al., 2018), as discussed in Section 6. Informally, this means that there needs to be a sufficient number of possible values $\mathbf { y } \in \mathbf { S }$ . In the case of supervised classification with $K$ classes, S is fixed and of size $K$ . Then, we need $K \ge M + 1$ in order to generate $M$ difference vectors $\mathbf { g } _ { \theta } ( \mathbf { y } ^ { ( 1 ) } ) - \mathbf { g } _ { \theta } ( \mathbf { y } ^ { ( j ) } )$ , $j = 2 , \ldots , M + 1$ . In case of self-supervised or deep metric learning, where $\mathbf { S }$ and y may be algorithmically generated from $\mathbf { x }$ , this requirement is easy to satisfy, as there will typically be a diversity of values of y. The same holds for language models with large vocabularies. However, for supervised classification with a small number of classes, this requirement on the size of S may be restrictive, as we discuss further in Section 4.
|
| 127 |
+
|
| 128 |
+
Note that by placing the diversity requirement on the number of classes $K$ , we implicitly assumed that the context representation function $\mathbf { g } _ { \theta }$ has the following property: the $M$ difference vectors span the range of $\mathbf { g } _ { \theta }$ . This is a mild assumption in the context of DNNs: for random initialization and iterative weight updates, this property follows from the stochasticity of the distribution used to initialize the network. Briefly, a set of $M + 1$ unique points $\mathbf { y } ^ { ( j ) }$ such that the $M$ vectors $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { ( 1 ) } ) - \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { ( j ) } ) , j = 2 , \dots , M + 1$ are not linearly independent has measure zero. For other choices of $\mathbf { g } _ { \pmb { \theta } }$ , care must be taken to ensure this condition is satisfied.
|
| 129 |
+
|
| 130 |
+
What can be said when $\mathbf { L } ^ { \prime }$ and $\mathbf { L } ^ { \ast }$ are ill-conditioned, that is, the ratio between maximum and minimum singular value $\frac { \sigma _ { \mathrm { m a x } } ( \mathbf { L } ) } { \sigma _ { \mathrm { m i n } } ( \mathbf { L } ) }$ (dropping superscripts when a statement apply to both) is large? In the context of a data representation matrix such as $\mathbf { L }$ , this implies that there exists at least one column $\ell _ { j }$ of $\mathbf { L }$ and constants $\lambda _ { k }$ for $k \neq j$ such that $\begin{array} { r } { \| \ell _ { j } - \sum _ { k \neq j } \bar { \lambda } _ { k } \ell _ { k } \| _ { 2 } < \varepsilon } \end{array}$ for small $\varepsilon$ . In other words, sometuple $( \mathbf { y } ^ { ( k ) } , \mathbf { y } ^ { ( i ) } )$ early a linear combination of the others. T such that the resulting difference vector $\ell _ { j } = \dot { \mathbf { g } } _ { \pmb { \theta } } ( \mathbf { y } _ { A } ^ { ( k ) } ) - \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } _ { B } ^ { ( i ) } )$ ere exists somecan nearly (in the sense above) be written as a linear combination of the other columns. Such near singularity is in this case a function of the choice of samples $\mathbf { y }$ that yield the difference vectors. The issue could be handled by resampling different data points until the condition number of the matrices is satisfactory. This amounts to strengthening the diversity condition. We leave more detailed analysis to future work, as the result will depend on the choice of architectures for f and $\mathbf { g }$ .
|
| 131 |
+
|
| 132 |
+
# 4 EXAMPLES OF LINEARLY IDENTIFIABLE MODELS
|
| 133 |
+
|
| 134 |
+
The form of Equation (1) is already used as a general approach for a variety of machine learning problems. We present a non-exhaustive sample of such publications, chosen to exhibit the range of applications. Many of these approaches were state-of-the-art at the time of their release: Contrastive Predictive Coding (Hénaff et al., 2019), BERT (Devlin et al., 2018), GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020), XLNET (Yang et al., 2019), and the triplet loss for deep metric learning (Sohn, 2016). In this section, we discuss how to interpret the functional components of these frameworks with respect to the generalized data distribution of Section 2 and canonical parameterization of Equation (1). See Appendix D for reductions to the canonical form of Equation (1).
|
| 135 |
+
|
| 136 |
+
Supervised Classification. Although the scope of this paper is identifiable representation learning, under certain conditions, standard supervised classifiers can learn identifiable representations as well. In this case, the number of classes must be strictly greater than the feature dimension, as noted in Section 3.4. We simulate such a model in Section 5.1 to show evidence of its linear identifiability. We stress that representation learning as pretraining for classification is a way to ensure that the conditions on label diversity are met, rather than relying on the supervised classifier itself to generate identifiable representations. This paradigm is discussed in the next subsection.
|
| 137 |
+
|
| 138 |
+
Representations learned during supervised classification can be linearly identifiable under the following model specification. The input random variables $\mathbf { x }$ represent some data domain to be classified, such as images or word embeddings. The target variables $\mathbf { y }$ represent label assignments for $\mathbf { x }$ typically semantically meaningful. These are often encoded these as the standard basis vectors $\mathbf { e _ { y } }$ a “one-hot encoding." The set $\mathbf { S }$ contains all $K$ possible values of $\mathbf { y }$ . In this case, notice that S is not stochastic: the empirical distribution $p _ { \mathcal { D } } ( \mathbf { S } | \mathbf { x } )$ is modelled as a Dirac measure with all probability mass on the set $\mathbf { S } = \{ 0 , \ldots , K - 1 \}$ (using integers, here, to represent distinct labels) . The representation function $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ of a classifier is often implemented as DNN that maps from the input layer to the layer just prior to the model logits. The context map $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is given by the weights in the final, linear projection layer, which outputs unnormalized logits. Concretely, $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ) = \mathbf { W } \mathbf { e } _ { \mathbf { y } }$ , where $\mathbf { W } \in \mathbb { R } ^ { M \times M }$ is a learnable weight matrix. In order satisfy the diversity condition, the dimension $M$ of the number of classes $K$ must be strictly greater than the dimension of the learned representation $M$ , that is, $| \mathbf { S } | \geq M + 1$ . Finally, the output of the final, linear projection layer is normalized through a Softmax function, yielding the parameterization of Equation (1).
|
| 139 |
+
|
| 140 |
+
Self-Supervised Pretraining for Image Classification. Self-supervised learning is a framework that first pretrains a DNN before deploying it on some other, related task. The pretraining task often takes the form of Equation (1) and meets the sufficient conditions to be linearly identifiable. A paradigmatic example is Contrastive Predictive Coding (CPC) (Oord et al., 2018). CPC is a general pretraining framework, but we focus for the sake of clarity on its use in image models here. CPC as applied to images involves: (1) preprocessing an image into augmented patches, (2) assigning labels according to which image the patch came from, and then (3) predicting the representations of the patches whether below, to the right, to the left, or above a certain level (Oord et al., 2018).
|
| 141 |
+
|
| 142 |
+
The context function of CPC, $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ , encodes a particular position in the sequence of patches, and the representation function, $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ , is an autoregressive function of the previous $k$ patches, according to some predefined patch ordering. Given some $\mathbf { x }$ , the collection of all patches from the sequence, from a given minibatch of images, is the set $\mathbf { S } \sim p _ { \mathit { D } } ( \mathbf { S } | \mathbf { x } )$ , where the randomness enters via the patch preprocessing algorithm. Since the preprocessing phase is part of the algorithm design, it is straightforward to make it sufficiently diverse (enough transformations of enough patches) so as to meet the requirements for the model to be linearly identifiable.
|
| 143 |
+
|
| 144 |
+
Multi-task Pretraining for Natural Language Generation. Autoregressive language models, such as (Mikolov et al., 2010; Dai and Le, 2015) and more recently GPT-2 and GPT-3 (Radford et al., 2018; 2019; Brown et al., 2020), are typically also instances of the model family of Equation 1. Data points $\mathbf { x }$ are the past tokens, $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ is a nonlinear representation of the past estimated by either an LSTM (Hochreiter and Schmidhuber, 1997) or an autoregressive Transformer model (Vaswani et al., 2017), y is the next token, and $\mathbf { w } _ { i } = \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } = i )$ is a learned representation of the next token, often implemented as a simple look-up table, as in supervised classification.
|
| 145 |
+
|
| 146 |
+
BERT (Devlin et al., 2018) is also a member of the linearly identifiable family. This model pretrains word embeddings through a denoising autoencoder-like (Vincent et al., 2008) architecture. For a given sequence of tokenized text, some fixed percentage of the symbols are extracted and set aside, and their original values set to a special null symbol, “corrupting" the original sequence. The pretraining task in BERT is to learn a continuous representation of the extracted symbols conditioned on the remainder of the text. A transformer (Vaswani et al., 2017) function approximator is used to map from the corrupted sequence into a continuous space. The transformer network is the $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ function of Equation 1. The context map $\mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } )$ is a lookup map into the learned basis vector for each token.
|
| 147 |
+
|
| 148 |
+
# 5 EXPERIMENTS
|
| 149 |
+
|
| 150 |
+
The derivation in Section 3 shows that, for models in the general discriminative family defined in Section 2, the functions $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \theta }$ are identifiable up to a linear transformation given unbounded data and assuming model convergence. The question remains as to how close a model trained on finite data and without convergence guarantees will approach this limit. One subtle issue is that poor architecture choices (such as too few hidden units, or inadequate inductive priors) or insufficient data samples when training can interfere with model estimation and thereby linear identifiability of the learned representations, due to underfitting. In this section, we study this issue over a range of models, from low-dimensional language embedding and supervised classification (Figures 1 and 2 respectively) to GPT-2 (Radford et al., 2019), an approximately $1 . 5 * 1 0 ^ { 9 }$ -parameter generative model of natural language (Figure 4). See Appendix A and the code release for details needed to reproduce.
|
| 151 |
+
|
| 152 |
+
Through these experiments, we show that (1) in the small dimensional, large data regime, linearly identifiable models yield learned representations that lie approximately within a linear transformation of each other (Figures 1 and 2) as predicted by Theorem 1; and (2) in the high dimensional, large data regime, linearly identifiable models yield learned representations that exhibit a strong trend towards linear identifiability. The learned representations approach a linear transformation of each other monotonically, as a function of dataset sample size, neural network capacity (number of hidden units), and optimization progress. In the case of GPT-2, which has benefited from substantial tuning by engineers to improve model estimation, we find strong evidence of linear identifiability.
|
| 153 |
+
|
| 154 |
+
Measuring linear similarity between learned representations. How can we measure whether pairs of learned representations live within a linear transformation of each other in function space? We adapt Canonical Correlation Analysis (CCA) (Hotelling, 1936) for this purpose, which finds the optimal linear transformations to maximize correlation among two random vectors. On a randomly selected held-out subset $B \subset D$ of the training data we compute $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ for two models with parameters $\pmb { \theta } _ { 1 }$ and $\pmb { \theta } _ { 2 }$ respectively. Assume without loss of generality that $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ are centered. CCA finds the optimal linear transformations $C$ and $_ { D }$ such that the pairwise correlations $\rho _ { i }$ between the $i ^ { t h }$ columns of $C ^ { \top } \mathbf { f } _ { \pmb { \theta } _ { 1 } } ( B )$ and $D ^ { \top } \mathbf { f } _ { \theta _ { 2 } } ( B )$ are maximized. We collect correlations together in $\rho$ . If after linear transformation the two matrices are aligned, the mean of $\rho$ will be 1; if they are instead uncorrelated, then the mean of $\rho$ will be 0. We use the mean of $\rho$ as a proxy for the existence of a linear transformation between $\mathbf { f } _ { \pmb { \theta } _ { 1 } } ( \pmb { \cal { B } } )$ and $\mathbf { f } _ { \pmb { \theta } _ { 2 } } ( { \pmb { \cal { B } } } )$ . For DNNs, it is a well known phenomenon that most of the variability in a learned representation tends to concentrate in a low-dimensional subspace, leaving many noisy, random dimensions (Morcos et al., 2018). Such random noise can result in spurious high correlations in CCA. A solution to this problem is to apply Principal Components Analysis (PCA) (Pearson, 1901) to each of the two matrices ${ \bf \dot { f } } _ { \pmb { \theta } _ { 2 } } ( B )$ and ${ \bf f } _ { \pmb { \theta } _ { 1 } } ( { \pmb { \cal { B } } } )$ , projecting onto their top- $k$ principal components, before applying CCA. This technique is known as SVCCA (Raghu et al., 2017).
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Deep Supervised Classification. (a) Data distribution for a linearly identifiable K-way classification problem. (b) Mean (centered) CCA between the learned representations over the course of training. After approx. 4000 iterations, CCA finds a linear transformation that rotate the learned representations into alignment, up to optimization error. (c) Learned representations after transformation via optimal linear transformation. The first dimension of the first model’s feature space is plotted against the first dimension of second. The learned representations have a nearly linear relationship, modulo estimation noise.
|
| 158 |
+
|
| 159 |
+
We report first on a simulation study of linearly identifiable $K$ -way classification, where all assumptions and sufficient conditions of Theorem 1 are guaranteed to be met. We generated a synthetic data distribution with the properties required by Section 2, and chose DNNs that had sufficient capacity to learn a specified nonlinear relationship between inputs $\mathbf { x }$ and targets y. In short, the data distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ consists of inputs $\mathbf { x }$ sampled from a 2-D Gaussian with $\sigma = 3$ . The targets $\mathbf { y }$ were assigned among $K = 1 8$ classes according to their radial position (angle swept out by a ray fixed at the origin). The number of classes $K$ was chosen to ensure $K \geq \mathrm { d i m } [ { \bf f } _ { \theta } ( { \bf \bar { x } } ) ] + 1$ , the diversity condition. See Appendix D.1 for more details.
|
| 160 |
+
|
| 161 |
+
To evaluate linear similarity, we trained two randomly initialized models of $p _ { \mathcal { D } } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } )$ . Plots show $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ , the data representation function, on random $\mathbf { x }$ . Figure 2b shows that the mean CCA increases to its maximum value over training, demonstrating that the feature spaces converge to the same solution up to a linear transformation modulo model estimation noise. Similarly, Figure 2c shows that the learned representations exhibit a strongly linear relationship.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3: Self-Supervised Representation Learning. Error bars are computed over 5 pairs of models. (a) Input data. Two patches are taken (one from top half, and one from the bottom half) of an image at random. Using a contrastive loss, we predict the identity of the bottom patch encoding from the top. (b) Linear similarity of learned representations at checkpoints (see legend). As models converge, linear similarity increases. (c) Linear similarity as we increase the amount of data for $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ . Error bars are computed over 5 pairs of models. (d) As we increase model size, linear similarity after convergence increases for both $\mathbf { f } _ { \theta }$ and $\mathbf { g } _ { \pmb { \theta } }$ .
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Text Embeddings by GPT-2. GPT-2 results. Representations of the last hidden layer (which is identifiable), in addition to three earlier layers (not necessarily identifiable) for four GPT-2 models. For each representation layer, SVCCA is computed over to all pairs of models, over which correlation coefficients were averaged. SVCCA was applied with 16, 64, 256 and 768 principal components. The learned representations in the last, identifiable layer more correlated than representations learned in preceding layers.
|
| 168 |
+
|
| 169 |
+
We next investigate high-dimensional, self-supervised representation learning on CIFAR-10 (Krizhevsky et al., 2009) using CPC (Oord et al., 2018; Hénaff et al., 2019). For a given input image, this model predicts the identity of a bottom image patch representation given a top patch representation (Figure 3a.) Here, S comprises the true patch with a set of distractor patches from across the current minibatch. For each model we define both $\mathbf { f } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ as a 3-layer MLP with 256 units per layer (except where noted otherwise) and fix output dimensionality of 64.
|
| 170 |
+
|
| 171 |
+
In Figure 3b, CCA coefficients are plotted over the course of training. As training progresses, alignment between the learned representations increases. In Figure 3c, we artificially limited the size of the dataset, and plot mean correlation after training and convergence. This shows that increasing availability of data correlates with closer alignment. In Figure 3d, we fix dataset size and artificially limit the model capacity (number hidden units) to investigate the effect of model size on the learned representations, varying the number of hidden units from 64 to 8192. This show that increasing model capacity correlates with increase in alignment of learned representations.
|
| 172 |
+
|
| 173 |
+
# 5.3 GPT-2
|
| 174 |
+
|
| 175 |
+
Finally, we report on a study of GPT-2 (Radford et al., 2019), a massive-scale language model. The identifiable representation is the set of features just before the last linear layer of the model. We use pretrained models from HuggingFace (Wolf et al., 2019). HuggingFace provides four different versions of the GPT-2: gpt2, gpt2-medium, gpt2-large and $\mathtt { g p t 2 - x 1 }$ , which differ mainly in the hyper-parameters that determine the width and depth of the neural network layers. For approximately 2000 input sentences, per timestep, for each model, we extracted representations at the last layer (which is identifiable) in addition to the representations per timestep given by three earlier layers in the model. Then, we performed SVCCA on each possible pair of models, on each of the four representations. SVCCA was performed with 16, 64, 256 and 768 principal components, computed by applying SVD separately for each representations of each model. We chose 768 as the largest number of principal components, since that is the representation size for the smallest model in the repository (gpt2). We then averaged the CCA correlation coefficients across the pairs of models. Figure 4 shows the results. The results align well with our theory, namely that the representations at the last layer are more linearly related than the representations at other layers of the model.
|
| 176 |
+
|
| 177 |
+
# 5.4 INTERPRETATION AND SUMMARY
|
| 178 |
+
|
| 179 |
+
Theorem 1 establishes linear identifiability as an asymptotic property of a model that holds in the limit of infinite data and exact estimation. The experiments of this section have shown that for linear identifiable models, when the dimensionality is small relative to dataset size (Figures 1 and 2), the learned embeddings are closely linearly related, up to noise. Problems of model estimation and sufficient dataset size are more pronounced in high dimensions. Nevertheless, in GPT2, representations among different trained models do in fact approach a mean correlation coefficient of 1.0 after training (Figure 4, blue line), providing strong evidence of linear identifiability.
|
| 180 |
+
|
| 181 |
+
# 6 RELATED WORKS
|
| 182 |
+
|
| 183 |
+
Prior to Hyvärinen and Morioka (2016), identifiability analysis was uncommon in deep learning. We build on advances in the theory of nonlinear ICA (Hyvärinen and Morioka, 2016; Hyvärinen et al., 2018; Khemakhem et al., 2019). In this section, we carefully distinguish our results from prior and concurrent works. Our diversity assumption is similar to diversity assumptions in these earlier works, while differing on certain conditions. The main difference is that their results apply to related but distinct families of models compared to the general discriminative family outlined in this paper. Arguably most related is Theorem 3 of Hyvärinen et al. (2018) and its proof, which shows that a class of contrastive discriminative models will estimate, up to an affine transformation, the true latent variables of a nonlinear ICA model. The main difference with our result is that they additionally assume: (1) that the mapping between observed variables and latent representations is invertible; and (2) that the discriminative model is binary logistic regression exhibiting universal approximation (Hornik et al., 1989), estimated with a contrastive objective. In addition, (Hyvärinen et al., 2018) does not present conditions for affine identifiability for their version of the context representation function g. It should be noted that Theorem 1 in (Hyvärinen et al., 2018) provides a potential avenue for further generalization of our theorem 1 to discriminative models with non-linear interaction between f and g.
|
| 184 |
+
|
| 185 |
+
Concurrent work (Khemakhem et al., 2020) has expanded the theory of identifiable nonlinear ICA to a class of conditional energy-based models (EBMs) with universal density approximation capability, therefore imposing milder assumptions than previous nonlinear ICA results. Their version of affine identifiability is similar to our result of linear identifiability in Section 3.2. The main differences are that Khemakhem et al. (2020) focus in both theory and experiment on EBMs. This allows for alternative versions of the diversity condition, assuming that the Jacobians of their versions of f or g are full rank. This is only possible if $\mathbf { x }$ or y are assumed continuous-valued; note that we do not make such an assumption. Khemakhem et al. (2020) also presents an architecture for which the conditions provably hold, in addition to sufficient conditions for identifiability up to element-wise scaling, which we did not explore in this work. While we build on these earlier results, we are, to the best of our knowledge, the first to apply identifiability analysis to state-of-the-art discriminative and autoregressive generative models.
|
| 186 |
+
|
| 187 |
+
# 7 CONCLUSION
|
| 188 |
+
|
| 189 |
+
We have shown that representations learned by a large family of discriminative models are identifiable up to a linear transformation, providing a novel perspective on representation learning using DNNs. Since identifiability is a property of a model class, and identification is realized in the asymptotic limit of data and compute, we perform experiments in the more realistic setting with finite datasets and finite compute. Our empirical results show that as the representational capacity of the model and dataset size increases, learned representations indeed tend towards solutions that are equal up to only a linear transformation.
|
| 190 |
+
|
| 191 |
+
REFERENCES
|
| 192 |
+
J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, and S. Wandermanmilne. Jax: Composable transformations of Python+NumPy programs, 2018. URL Http: //Github.Com/Google/Jax.
|
| 193 |
+
T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, and Others. Language Models are Few-Shot Learners. Arxiv Preprint Arxiv:2005.14165, 2020.
|
| 194 |
+
C. Chelba, T. Mikolov, M. Schuster, Q. Ge, T. Brants, P. Koehn, and t. Robinson. One Billion Word Benchmark for Measuring Progress in Statistical Language Modeling. Arxiv Preprint Arxiv:1312.3005, 2013.
|
| 195 |
+
A. M. Dai and Q. V. Le. Semi-Supervised Sequence Learning. In Advances in Neural information Processing Systems, pages 3079–3087, 2015.
|
| 196 |
+
J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Arxiv Preprint Arxiv:1810.04805, 2018.
|
| 197 |
+
D. Erhan, Y. Bengio, A. Courville, P.-A. Manzagol, P. Vincent, and S. Bengio. Why Does Unsupervised Pre-training Help Deep Learning? Journal of Machine Learning Research, 11(Feb):625–660, 2010.
|
| 198 |
+
O. J. Hénaff, A. Razavi, C. Doersch, S. Eslami, and A. V. D. Oord. Data-Efficient Image Recognition with Contrastive Predictive Coding. Arxiv Preprint Arxiv:1905.09272, 2019.
|
| 199 |
+
S. Hochreiter and J. Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735–1780, 1997.
|
| 200 |
+
E. Hoffer and N. Ailon. Deep Metric Learning Using Triplet Network. In International Workshop On Similarity-Based Pattern Recognition, pages 84–92. Springer, 2015.
|
| 201 |
+
K. Hornik, M. Stinchcombe, and H. White. Multilayer Feedforward Networks are Universal Approximators. Neural Networks, 2(5):359–366, 1989.
|
| 202 |
+
H. Hotelling. Relations Between Two Sets of Variates. Biometrika, 28(3/4):321–377, 1936.
|
| 203 |
+
A. Hyvärinen and H. Morioka. Unsupervised Feature Extraction by Time-Contrastive Learning and Nonlinear ICA. In Advances in Neural information Processing Systems, pages 3765–3773, 2016.
|
| 204 |
+
A. Hyvärinen, H. Sasaki, and R. E. Turner. Nonlinear ICA Using Auxiliary Variables and Generalized Contrastive Learning. Arxiv Preprint Arxiv:1805.08651, 2018.
|
| 205 |
+
F. Johansson, U. Shalit, and D. Sontag. Learning representations for counterfactual inference. In International conference on machine learning, pages 3020–3029, 2016.
|
| 206 |
+
I. Khemakhem, D. P. Kingma, and A. Hyvärinen. Variational Autoencoders and Nonlinear ICA: A Unifying Framework. Arxiv Preprint Arxiv:1907.04809, 2019.
|
| 207 |
+
I. Khemakhem, R. P. Monti, D. P. Kingma, and A. Hyvärinen. ICE-BeeM: Identifiable Conditional Energy-based Deep Models. Arxiv Preprint Arxiv:2002.11537, 2020.
|
| 208 |
+
D. P. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. Arxiv Preprint Arxiv:1412.6980, 2014.
|
| 209 |
+
A. Krizhevsky, G. Hinton, and Others. Learning Multiple Layers of Features from Tiny Images. 2009.
|
| 210 |
+
P. J. Liu, M. Saleh, E. Pot, B. Goodrich, R. Sepassi, L. Kaiser, and N. Shazeer. Generating Wikipedia by Summarizing Long Sequences. Arxiv Preprint Arxiv:1801.10198, 2018.
|
| 211 |
+
C. Louizos, U. Shalit, J. M. Mooij, D. Sontag, R. Zemel, and M. Welling. Causal effect inference with deep latent-variable models. In Advances in Neural Information Processing Systems, pages 6446–6456, 2017.
|
| 212 |
+
Under review as a conference paper at ICLR 2021
|
| 213 |
+
T. Mikolov, M. Karafiát, L. Burget, J. Cernock ˇ y, and S. Khudanpur. Recurrent Neural Network Based \` Language Model. In Eleventh Annual Conference of The international Speech Communication Association, 2010.
|
| 214 |
+
T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed Representations of Words and Phrases and their Compositionality. In Advances in Neural information Processing Systems, pages 3111–3119, 2013.
|
| 215 |
+
A. Mnih and G. E. Hinton. A Scalable Hierarchical Distributed Language Model. In Advances in Neural information Processing Systems, pages 1081–1088, 2009.
|
| 216 |
+
A. Mnih and Y. W. Teh. A Fast and Simple Algorithm for Training Neural Probabilistic Language Models. Arxiv Preprint Arxiv:1206.6426, 2012.
|
| 217 |
+
A. S. Morcos, M. Raghu, and S. Bengio. Insights on Representational Similarity in Neural Networks with Canonical Correlation, 2018.
|
| 218 |
+
A. V. D. Oord, Y. Li, and O. Vinyals. Representation Learning with Contrastive Predictive Coding. Arxiv Preprint Arxiv:1807.03748, 2018.
|
| 219 |
+
K. Pearson. LIII. On Lines and Planes of Closest Fit to Systems of Points in Space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559–572, 1901.
|
| 220 |
+
A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving Language Understanding by Generative Pre-training. 2018.
|
| 221 |
+
A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language Models are Unsupervised Multitask Learners. Openai Blog, 1(8), 2019.
|
| 222 |
+
M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein. SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and interpretability. In Advances in Neural information Processing Systems, pages 6076–6085, 2017.
|
| 223 |
+
A. Sharif Razavian, H. Azizpour, J. Sullivan, and S. Carlsson. CNN Features Off-the-Shelf: An Astounding Baseline for Recognition. In Proceedings of The Ieee Conference On Computer Vision and Pattern Recognition Workshops, pages 806–813, 2014.
|
| 224 |
+
K. Sohn. Improved Deep Metric Learning with Multi-class N-Pair Loss Objective. In Advances in Neural information Processing Systems, pages 1857–1865, 2016.
|
| 225 |
+
P. Sorrenson, C. Rother, and U. Köthe. Disentanglement by Nonlinear ICA with General Incompressible-flow Networks (Gin). Arxiv:2001.04872 [Cs, Stat], Jan. 2020.
|
| 226 |
+
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is All You Need. In Advances in Neural information Processing Systems, pages 5998– 6008, 2017.
|
| 227 |
+
P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and Composing Robust Features with Denoising Autoencoders. In Proceedings of The 25th international Conference On Machine Learning, pages 1096–1103, 2008.
|
| 228 |
+
T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, and J. Brew. Huggingface’s Transformers: State-of-the-art Natural Language Processing. Arxiv, Abs/1910.03771, 2019.
|
| 229 |
+
Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. Salakhutdinov, and Q. V. Le. XLNET: Generalized Autoregressive Pretraining for Language Understanding. Arxiv Preprint Arxiv:1906.08237, 2019.
|
| 230 |
+
|
| 231 |
+
# A REPRODUCING EXPERIMENTS AND FIGURES
|
| 232 |
+
|
| 233 |
+
In this section, we present training and optimization details needed to reproduce our empirical validation of Theorem 1. We also published notebooks and check-pointed weights for two crucial experiments that investigate the result in the small and massive scale regimes, for Figure 1 and GPT-2 (ANONYMIZED).
|
| 234 |
+
|
| 235 |
+
# A.1 FIGURE 1
|
| 236 |
+
|
| 237 |
+
We provide a Jupyter notebook and model checkpoints for reproducing Figure 1. Please refer to this for hyperparameter settings. In short, we implemented a model (Mnih and Teh, 2012) in the family of Section 2 and trained it on the Billion Word dataset (Chelba et al., 2013). This is illustrative of the property of Theorem 1 because the relatively modest size of the parameter space (see notebook) and massive dataset minimizes model convergence and data availability restrictions, e.g., approaches the asymptotic regime.
|
| 238 |
+
|
| 239 |
+
The word embedding space is 2-D for ease of visualization. We randomly selected a subset of words, mapped them into their learned embeddings, and visualized them as points in the left and middle panes. We then regress pane one onto pane two in order to learn the best linear transformation between them. Note that if the two are linear transformations of each other, regression will recover that transformation exactly.
|
| 240 |
+
|
| 241 |
+
# A.2 SIMULATION STUDY: CLASSIFICATION BY DNNS
|
| 242 |
+
|
| 243 |
+
For this experiment, we want to ensure that the chosen model can fit the data distribution exactly. Controlling this removes one possible factor that could prevent linear identifiability of learned representations despite the model formally having that property. We do this by making sure that the process that generates the dataset matches the model chosen to learn the relationships between inputs and labels.
|
| 244 |
+
|
| 245 |
+
This is achieved through the following algorithm. We first randomly assign initialization labels based on angular position, then fit two neural networks $f _ { \theta ^ { \star } }$ and $g _ { \pmb { \theta } ^ { \star } }$ to predict the final labels, using the discriminative model of Equation (1) and Appendix D.1. Both $f _ { \theta ^ { \star } }$ and $g _ { \pmb { \theta } ^ { \star } }$ 4-hidden-layer MLPs with two 64 unit layers and one 2-D bottle neck layer. After training these representation functions to convergence, generated new batch of points $\mathbf { x }$ , and used the trained networks to predict the ground truth labels y.
|
| 246 |
+
|
| 247 |
+
Finally, to conduct experiments, we chose $\mathbf { f } _ { \theta ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ to be the same architecture as $\mathbf { f } _ { \theta ^ { \star } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \star } }$ . This ensures that the supervised classifier we attempted to learn would using the function approximators $\mathbf { f } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ would be able to capture the true data generating process, e.g, would not fail due to too few hidden units, or too complex a relationship between targets and inputs.
|
| 248 |
+
|
| 249 |
+
Remaining training details are as follows. We optimize weights using Adam with a learning rate of $1 0 ^ { - 4 }$ for $5 * 1 0 ^ { 4 }$ iterations. To make the classification problem more challenging, we additionally add 20 input dimensions of random noise to the data. The Adam optimizer Kingma and Ba (2014) with a learning rate of $3 \cdot 1 0 ^ { - 4 }$ is used.
|
| 250 |
+
|
| 251 |
+
# A.3 SELF-SUPERVISED LEARNING FOR IMAGE CLASSIFICATION
|
| 252 |
+
|
| 253 |
+
To compute linear similarity between representations, we train two independent models in parallel. For each model we define both $\mathbf { f } _ { \pmb { \theta } }$ and $\mathbf { g } _ { \theta }$ as a 3-layer fully connected neural network with $\bar { 2 } ^ { 8 }$ units per layer and a fixed output dimensionality of $2 ^ { 6 }$ . We define our model following Equation (1), where $S$ is the set of the other image patches from the current minibatch and optimize the objective of (Hénaff et al., 2019). We augment both sampled patches independently with randomized brightness, saturation, hue, and contrast adjustments, following the recipe of (Hénaff et al., 2019). We train on the CIFAR10 dataset (Krizhevsky et al., 2009) with batchsize $2 ^ { 8 }$ , using the Adam optimizer with a learning rate of $1 0 ^ { - 4 }$ and the JAX (Bradbury et al., 2018) software package. For each model, we early stop based on a validation loss failing to improve further.
|
| 254 |
+
|
| 255 |
+
Additional details about the experiments that generated Figure 3:
|
| 256 |
+
|
| 257 |
+
Figure 3 a. Patches are sampled randomly from training images.
|
| 258 |
+
|
| 259 |
+
Figure 3 b. For each model, we train for at most $3 * 1 0 ^ { 4 }$ iterations, early stopping when necessary based on validation loss.
|
| 260 |
+
|
| 261 |
+
Figure $_ { 3 \mathrm { ~ c ~ } }$ . For each model, we train for at most $3 * 1 0 ^ { 4 }$ iterations, early stopping when necessary based on validation loss.
|
| 262 |
+
|
| 263 |
+
Figure 3 d. Error bars show standard error computed over 5 pairs of models after $1 . 5 * 1 0 ^ { 4 }$ training iterations.
|
| 264 |
+
|
| 265 |
+
# A.4 GPT-2
|
| 266 |
+
|
| 267 |
+
We include all details through a notebook in the code release. Pretrained GPT-2 weights as specified in the main text are publicly available from HuggingFace Wolf et al. (2019).
|
| 268 |
+
|
| 269 |
+
# A.5 REMARK ON EFFECT OF INITIALIZATION AND HYPERPARAMETERS OF MODELS
|
| 270 |
+
|
| 271 |
+
One question that may be of interest is whether initialization affects whether learned representations will be within a linear transformation of each other. This depends on whether the optimization routines (like Adam, AdaGrad, etc.) are robust to wider initialization within a certain range. If so, model convergence will be unaffected. However, this cannot make up for poor initialization or poor optimization: just as in any deep neural network, a poor initialization and inadequate optimizer will interfere with learning the model parameters. In the case of a linearly identifiable model, means that the learned representations would not live within a linear transformation of each other (up to noise from model fitting), since the models have failed to converge to a reasonable solution for the task at hand.
|
| 272 |
+
|
| 273 |
+
When the hyperparameters of a DNN are changed, this changes the class of functions that the network can represent (i.e., the size and stride of convolution filters will change which input pixels could be correlated in deeper layers). Typically, hyperparameters are carefully tuned using cross validation based on held-out data. We did so in our experiments also. We expect that such a tuning procedure would yield hyperparameters that are as good as possible for the model to be optimized, allowing sufficient optimization so that the linear identifiability of the learned representations is realized. If the hyperparameters are sufficiently bad and optimization suffers, this will interfere with model fitting, and with linear identifiability of the learned representations also.
|
| 274 |
+
|
| 275 |
+
# B PROOF THAT LINEAR SIMILARITY IS AN EQUIVALENCE RELATION
|
| 276 |
+
|
| 277 |
+
We claim that $\stackrel { \mathrm { L } } { \sim }$ is an equivalence relation. It suffices to show that it is reflexive, transitive, and symmetric.
|
| 278 |
+
|
| 279 |
+
Proof. Consider some function $\mathbf { g } _ { \pmb { \theta } }$ and some $\pmb { \theta } ^ { \prime } , \pmb { \theta } ^ { \star } , \pmb { \theta } ^ { \dagger } \subset \Theta$ . Suppose $\theta ^ { \prime } \stackrel { \scriptscriptstyle \perp } { \sim } \theta ^ { \star }$ . Then, there exists an invertible matrix $\mathbf { B }$ such that $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = \mathbf { B } \mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { x } )$ . Since ${ \bf g } _ { \pmb { \theta } ^ { \star } } ( { \bf x } ) = { \bf B } ^ { - 1 } { \bf g } _ { \pmb { \theta } ^ { \prime } } ( { \bf x } )$ , $\stackrel { \mathrm { L } } { \sim }$ is symmetric. Reflexivity follows from setting $\mathbf { g } _ { \pmb { \theta } ^ { \star } }$ to $\mathbf { g } _ { \pmb { \theta } ^ { \prime } }$ and $\mathbf { B }$ to the identity matrix. To show transitivity, suppose also that $\smash { \theta ^ { \star } \stackrel { \scriptscriptstyle \perp } { \sim } \theta ^ { \dagger } }$ . Then, there exists an invertible $\mathbf { C }$ such that $\mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { x } ) = \mathbf { C } \mathbf { g } _ { \pmb { \theta } ^ { \dagger } } ( \mathbf { x } )$ . Since $\mathbf { g } _ { \pmb { \theta } ^ { \prime } } \overset { \mathtt { L } } { \sim } \mathbf { g } _ { \pmb { \theta } ^ { \star } }$ , $\mathbf { B } ^ { - 1 } \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { x } ) = \mathbf { C } \mathbf { g } _ { \pmb { \theta } ^ { \dagger } } ( \mathbf { x } )$ . Rearranging terms, ${ \bf g } _ { \theta ^ { \prime } } ( { \bf x } ) = { \bf B } { \bf C } { \bf g } _ { \theta ^ { \dagger } } ( { \bf x } )$ , so that $\pmb { \theta } ^ { \prime } \sim \pmb { \theta } ^ { \dagger }$ as required.
|
| 280 |
+
|
| 281 |
+
# C SECTION 3.2 CONTINUED: CASE OF CONTEXT REPRESENTATION FUNCTION g
|
| 282 |
+
|
| 283 |
+
Our derivation of identifiability of $\mathbf { g } _ { \theta }$ is similar to the derivation of $\mathbf { f } _ { \pmb { \theta } }$ . The primary difference is that the normalizing constants in Equation (6) do not cancel out. First, note that we can rewrite Equation 1 as:
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
p _ { \pmb { \theta } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) = \exp ( \widetilde { \mathbf { f } _ { \pmb { \theta } } } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } _ { \pmb { \theta } } ( \mathbf { y } ) )
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
where:
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { r l } & { \displaystyle \widetilde { \mathbf { f } _ { \theta } } ( \mathbf { x } , \mathbf { S } ) = \left[ - Z ( \mathbf { x } , \mathbf { S } ) ; \mathbf { f } _ { \theta } ( \mathbf { x } ) \right] } \\ & { \quad \widetilde { \mathbf { g } _ { \theta } } ( \mathbf { y } ) = \left[ 1 ; \mathbf { g } _ { \theta } ( \mathbf { y } ) \right] } \\ & { \displaystyle Z ( \mathbf { x } , \mathbf { S } ) = \log \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) . } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
Below, we will show that for the model family defined in Section 2,
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\begin{array} { r } { p _ { \pmb { \theta } ^ { \prime } } = p _ { \pmb { \theta } ^ { * } } \quad \Longrightarrow \quad \mathbf { g } _ { \pmb { \theta } ^ { \prime } } ( \mathbf { y } ) = \mathbf { B } \mathbf { g } _ { \pmb { \theta } ^ { \star } } ( \mathbf { y } ) , } \end{array}
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
where $\mathbf { B }$ is an invertible $( M \times M )$ -dimensional matrix, concluding the proof of the linear identifiability of models in the family defined by Equation (1). We adopt the same shorthands as in the main text.
|
| 302 |
+
|
| 303 |
+
# C.1 DIVERSITY CONDITION
|
| 304 |
+
|
| 305 |
+
We assume that for any $( \theta ^ { \prime } , \theta ^ { \ast } ) \subset \Theta$ for which it holds that $p ^ { \prime } = p ^ { * }$ , and for any given $\mathbf { y }$ , there exist $M + 1$ tuples $\{ ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } ) \} _ { i = 0 } ^ { M }$ , such that $p _ { \mathcal { D } } ( \mathbf { x } ^ { ( i ) } , \mathbf { y } , \mathbf { S } ^ { ( i ) } ) > 0$ , and such that the $( ( M + 1 ) \times ( M + 1 ) )$ matrices $\mathbf { M } ^ { \prime }$ and $\mathbf { M } ^ { \ast }$ are invertible, where $\mathbf { M } ^ { \prime }$ consists of columns $\widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } )$ , and $\mathbf { M } ^ { * }$ consists of columns $\widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } ^ { ( i ) } , \mathbf { S } ^ { ( i ) } )$ .
|
| 306 |
+
|
| 307 |
+
This is similar to the diversity condition of Section 3.2 but milder, since a typical dataset will have multiple $\mathbf { x }$ for each $\mathbf { y }$ .
|
| 308 |
+
|
| 309 |
+
# C.2 PROOF
|
| 310 |
+
|
| 311 |
+
With the data distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ , for a given $\mathbf { y }$ , there exists a conditional distribution $p _ { \mathcal { D } } ( \mathbf { x } , \mathbf { S } | \mathbf { y } )$ Let $( \mathbf { x } , \mathbf { S } )$ be a sample from this distribution. From equation 1 and the statement to prove, it follows that:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
p ^ { \prime } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) = p ^ { * } ( \mathbf { y } | \mathbf { x } , \mathbf { S } )
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Substituting in the definition of our model from equation (9), we find:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\exp ( \widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) ) = \exp ( \widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) ) ,
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
which, evaluating logarithms, becomes
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\widetilde { \mathbf { f } } ^ { \prime } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \widetilde { \mathbf { f } } ^ { * } ( \mathbf { x } , \mathbf { S } ) ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) ,
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
which is true for any triple $( \mathbf { x } , \mathbf { y } , \mathbf { S } )$ where $p _ { \mathcal { D } } ( \mathbf { y } | \mathbf { x } , \mathbf { S } ) > 0$ .
|
| 330 |
+
|
| 331 |
+
From $\mathbf { M } ^ { \prime }$ and $\mathbf { M } ^ { * }$ (Section C.1) and equation 16 we form a linear system of equations, collecting the $M + 1$ relationships together:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r } { \mathbf { M ^ { \prime } } ^ { \top } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { M ^ { * } } ^ { \top } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) } \\ { \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { A } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) , \quad } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
where $\mathbf { A } = ( \mathbf { M } ^ { * } \mathbf { M } ^ { \prime - 1 } ) ^ { \top }$ , an invertible $( M + 1 ) \times ( M + 1 )$ matrix.
|
| 338 |
+
|
| 339 |
+
It remains to show the existence of an invertible $M \times M$ matrix $\mathbf { B }$ such that
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\mathbf { g } ^ { \prime } ( \mathbf { y } ) = \mathbf { B } \mathbf { g } ^ { * } ( \mathbf { y } ) .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
We proceed by constructing $\mathbf { B }$ from A. Since A is invertible, there exist $j$ elementary matrices $\{ \mathbf { E } _ { 1 } , \hdots , \mathbf { E } _ { j } \}$ such that their action $\mathbf { R } = \mathbf { E } _ { j } \mathbf { E } _ { j - 1 } \ldots \mathbf { E } _ { 1 }$ converts $\mathbf { A }$ to a (non-unique) row echelon form. Without loss of generality, we build $\mathbf { R }$ such that the $^ { a _ { 1 , 1 } }$ entry of $\mathbf { A }$ is the first pivot, leading to the particular row echelon form:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\mathbf { R A } = \left[ \begin{array} { c c c c c c } { a _ { 1 , 1 } } & { a _ { 1 , 2 } } & { a _ { 1 , 3 } } & { . . . } & { a _ { 1 , m \times 1 } } \\ { 0 } & { \tilde { a } _ { 2 , 2 } } & { \tilde { a } _ { 2 , 3 } } & { . . . } & { \tilde { a } _ { 2 , m \times 1 } } \\ { 0 } & { 0 } & { \tilde { a } _ { 3 , 3 } } & { . . . } & { \tilde { a } _ { 2 , m \times 1 } } \\ { \vdots } & { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { . . . } & { 0 } & { \tilde { a } _ { m \times 1 , m \times 1 } } \end{array} \right] ,
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
where $\tilde { a } _ { i , j }$ indicates that the corresponding entry in RA may differ from A due to the action of $\mathbf { R }$ Applying $\mathbf { R }$ to Equation (17), we have
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\mathbf { R } \widetilde { \mathbf { g } } ^ { \prime } ( \mathbf { y } ) = \mathbf { R } \mathbf { A } \widetilde { \mathbf { g } } ^ { * } ( \mathbf { y } ) .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
We now show that removing the first row and column of RA and $\mathbf { R }$ generates matrices of rank $M$ . Let $\overline { { \mathbf { R A } } }$ and $\overline { { \mathbf { R } } }$ denote the $( M \times M )$ submatrices formed by removing the first row and column of RA and $\mathbf { R }$ respectively.
|
| 358 |
+
|
| 359 |
+
Equation (20) shows that $\overline { { { \bf R } { \bf A } } }$ has a pivot in each column, and thus has rank $M$ . To show that $\overline { { \mathbf { R } } }$ is invertible, we must show that removing the first row and column reduces the rank of $\mathbf { R } = \mathbf { E } _ { j } \mathbf { E } _ { j - 1 } \ldots \mathbf { E } _ { 1 }$ by exactly 1. Clearly, each $\mathbf { E } _ { k }$ is invertible, and their composition is invertible. We must show the same for the composition of $\overline { { \mathbf { E } _ { k } } }$ .
|
| 360 |
+
|
| 361 |
+
There are three cases to consider, corresponding to the three unique types of elementary matrices. Each elementary matrix acts on A by either (1) swapping rows $i$ and $j$ , (2) replacing row $j$ by a multiple $m$ of itself, or (3) adding a multiple $m$ of row $i$ to row $j$ . We denote elementary matrix types by superscripts.
|
| 362 |
+
|
| 363 |
+
In Case (1), $\mathbf { E } _ { k } ^ { 1 }$ is an identity matrix with row $i$ and row $j$ swapped. For Case (2), $\mathbf { E } _ { l } ^ { 2 }$ is an identity matrix with the $j , j ^ { t h }$ entry replaced by some $m$ . For each $\mathbf { E } _ { k } ^ { 1 }$ and $\mathbf { E } _ { l } ^ { 2 }$ in $\mathbf { R }$ , where $1 \leq k , l \leq j$ , we know that the indices $i , j \geq 2$ , because we chose the first entry of the first row of $\mathbf { A }$ to be the pivot, and hence do not swap the first row, or replace the first row by itself multiplied by a constant. This implies that removing the first row and column of $\mathbf { E } _ { k } ^ { 1 }$ and $\mathbf { E } _ { l } ^ { \bar { 2 } }$ removes a pivot entry 1 in the $( 1 , 1 )$ position, and removes zeros elsewhere. Hence, the $( M \times M )$ submatrices $\overline { { \mathbf { E } _ { k } ^ { 1 } } }$ and $\overline { { \mathbf { E } _ { l } ^ { 2 } } }$ are elementary matrices with rank $M$ .
|
| 364 |
+
|
| 365 |
+
For Case (3), $\mathbf { E } _ { k } ^ { 3 }$ has some value $m \in \mathbb { R }$ in the $j , i ^ { t h }$ entry, and 1s along the diagonal. In this case, we may find a non-zero entry in some $\mathbf { E } _ { k } ^ { 3 }$ , so that, e.g., the second row has a pivot at position $( 2 , 2 )$ . Without loss of generality, suppose $i = 1$ , $j = 2$ and let $m$ be some nonzero constant. Removing the first row and column of ${ \bf E } _ { 1 } ^ { 3 }$ removes this $m$ also. Nevertheless, $\overline { { \mathbf { E } _ { 1 } ^ { 3 } } } = \mathbf { I } _ { M }$ , the rank $M$ identity matrix. For any other $\mathbf { E } _ { k } ^ { 3 } \ 1 < i \leq M + 1$ , $j \geq 2$ because we chose $^ { a _ { 1 , 1 } }$ as the first pivot, and hence do not swap the first row, or replace the first row by itself multiplied by a constant. In both cases, removing the first row and first column creates an $\overline { { \mathbf { E } _ { k } ^ { 3 } } }$ that is a rank $M$ elementary matrix.
|
| 366 |
+
|
| 367 |
+
We have shown by the above that $\overline { { \mathbf { R } } }$ is a composition of rank $M$ matrices. We now construct the matrix $\mathbf { B }$ by removing the first entries of $\widetilde { \mathbf { g } } ^ { \prime }$ and $\widetilde { \mathbf { g } } ^ { \star }$ , and removing the first row and first column of $\mathbf { R }$ e eand RA in Equation (equation 21). Then, we have
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\begin{array} { r l } & { \overline { { { \bf R } } } { \bf g } ^ { \prime } ( { \bf y } ) = \overline { { { \bf R } { \bf A } } } { \bf g } ^ { * } ( { \bf y } ) , } \\ & { { \bf g } ^ { \prime } ( { \bf y } ) = \overline { { { \bf R } } } ^ { - 1 } \overline { { { \bf R } { \bf A } } } { \bf g } ^ { * } ( { \bf y } ) . } \end{array}
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Choosing ${ \bf B } = \overline { { { \bf R } } } ^ { - 1 } \overline { { { \bf R } { \bf A } } }$ proves the result.
|
| 374 |
+
|
| 375 |
+
# D REDUCTIONS TO CANONICAL FORM OF EQUATION (1)
|
| 376 |
+
|
| 377 |
+
In the following, we show membership in the model family of Equation 1 using the mathematical notation of the papers under discussion in Section 4. Note that each subsection will change notation to match the papers under discussion, which varies quite widely. We employ the following colour-coding scheme to aid in clarity:
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\log p _ { \theta } ( \mathbf { y } \vert \mathbf { x } , \mathbf { S } ) = \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ) - \log \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \theta } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \theta } ( \mathbf { y } ^ { \prime } ) ) ,
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
where $\mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } )$ is generalized to a data representation function, $\mathbf { g } _ { \boldsymbol { \theta } } ( \mathbf { y } )$ is generalized to a context representation function, and $\begin{array} { r } { \sum _ { \mathbf { y } ^ { \prime } \in \mathbf { S } } \exp ( \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \mathbf { g } _ { \pmb { \theta } } ( \mathbf { y } ^ { \prime } ) ) } \end{array}$ is some constant.
|
| 384 |
+
|
| 385 |
+
# D.1 SUPERVISED CLASSIFICATION
|
| 386 |
+
|
| 387 |
+
Supervised classifiers commonly employ a neural network feature extractor followed by a linear projection of the output of this network into a space of unnormalized logits. All the layers prior to the logits are the representation function $\mathbf { f } _ { \theta }$ , and the final projection layer is the context map $\mathbf { g } _ { \pmb { \theta } } ( y = i ) = \mathbf { w } _ { i }$ , where $\mathbf { w } _ { i }$ is the $i$ -th column of a weight matrix W. The set S in this case contains human-chosen labels and has no stochasticity. The loss function is the negative log-likelihood of the data under a categorical distribution with a softmax parameterization:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\log p _ { \pmb { \theta } } ( y = i | \mathbf { x } ; \mathbf { S } ) = \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \pmb { w } _ { i } - \varinjlim \sum _ { j = 1 } ^ { | \mathbf { S } | } \exp ( \mathbf { f } _ { \pmb { \theta } } ( \mathbf { x } ) ^ { \top } \pmb { w } _ { j } )
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Supervised classification is thus an member of the family defined in Section 2. It exhibits the simplest functional form for the $\mathbf { g }$ function while allowing f to be arbitrarily complicated.
|
| 394 |
+
|
| 395 |
+
# D.2 CPC
|
| 396 |
+
|
| 397 |
+
Consider a sequence of points $\mathbf { x } _ { t }$ . We wish to learn the parameters $\phi$ to maximize the $k$ -step ahead predictive distribution $p ( \mathbf { x } _ { t + k } | \mathbf { x } _ { t } , \phi )$ . In the image patch example, each patch center $i , j$ is indexed by $t$ . Each $\mathbf { x } _ { t }$ is mapped to a sequence of feature vectors $z _ { t } = f _ { \theta } ( \mathbf { x } _ { t } )$ An autoregressive model, already updated with the previous latent representations $z _ { \leq t - 1 }$ , transforms the ${ \boldsymbol { z } } _ { t }$ into a “context" latent representation ${ \bf c } _ { t } = g _ { A R } ( z _ { \leq t } )$ . Instead of predicting future observations $k$ steps ahead, $\mathbf { x } _ { t + k }$ , directly through a generative model $\dot { p } _ { k } \big ( \mathbf { x } _ { t + k } | \mathbf { c } _ { t } \big )$ , Oord et al. (2018) model a density ratio in order to preserve the mutual information between $\mathbf { x } _ { t + k }$ and $\mathbf { c } _ { t }$ .
|
| 398 |
+
|
| 399 |
+
Objective Let $\mathbf { X } = \{ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { N } \}$ be a set of $N$ random samples containing one positive sample from $p ( \mathbf { x } _ { t + k } | \mathbf { c } _ { t } )$ and $N - 1$ samples from the proposal distribution $p ( \mathbf { x } _ { t + k } )$ . Oord et al. (2018) define the following link function: $l _ { k } ( \mathbf { x } _ { t + k } , \mathbf { c } _ { t } ) \triangleq \exp \left( \mathbf { z } _ { t + k } ^ { \intercal } \mathbf { W } _ { k } \mathbf { c } _ { t } \right)$ . Then, CPC optimizes
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
- \mathbb { E } _ { \mathbf { X } } \left[ \log \frac { l _ { k } ( \mathbf { x } _ { t + k } , \mathbf { c } _ { t } ) } { \sum _ { x _ { j } \in X } l _ { k } ( \mathbf { x } _ { j } , \mathbf { c } _ { t } ) } \right] = - \mathbb { E } _ { \mathbf { X } } \left[ \log \frac { \exp \left( \mathbf { z } _ { t + k } \mathbf { \Xi } ^ { \top } \mathbf { W } _ { k } \mathbf { c } _ { t } \right) } { \sum _ { \mathbf { x } _ { j } \in \mathbf { X } } \exp \left( \mathbf { z } _ { j } ^ { \top } \mathbf { W } _ { k } \mathbf { c } _ { t } \right) } \right] .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Substituting in the definition of $l _ { k }$ makes equation (24) identical to the model family (Equation 1).
|
| 406 |
+
|
| 407 |
+
D.3 AUTOREGRESSIVE LANGUAGE MODELS (E.G. GPT-2)
|
| 408 |
+
|
| 409 |
+
Let ${ \mathcal { U } } = \{ u _ { 1 } , \ldots , u _ { n } \}$ be a corpus of tokens. Autoregressive language models maximize a loglikelihood $\begin{array} { r } { \dot { L } ( \mathcal { U } ) = \sum _ { i = 1 } ^ { n } \log P ( u _ { i } | u _ { i - k } , \dots , u _ { i - 1 } ; \Theta ) } \end{array}$ , Concretely, the conditional density is modelled as
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
\begin{array} { r } { \log P ( u _ { i } | u _ { i - k : i - 1 } ; \Theta ) \qquad } \\ { = \mathbf { W } _ { i : } \mathbf { h } _ { i } - \log \displaystyle \sum _ { j } \exp ( \mathbf { W } _ { j : } \mathbf { h } _ { i } ) , } \end{array}
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
where $\mathbf { h } _ { i }$ is the $m \times 1$ output of a function approximator (e.g. a Transformer decoder (Liu et al., 2018)), and $\mathbf { W } _ { i }$ : is the $i$ ’th row of the $| \mathcal { U } | \times m$ token embedding matrix.
|
| 416 |
+
|
| 417 |
+
# D.4 BERT
|
| 418 |
+
|
| 419 |
+
Consider a sequence of text $\mathbf x = [ x _ { 1 } , \dots , x _ { T } ]$ . Some proportion of the symbols in $\mathbf { x }$ are extracted into a vector $\bar { \bf x }$ , and then set in $\mathbf { x }$ to a special null symbol, “corrupting" the original sequence. This operation generates the corrupted sequence $\mathbf { \underline { { x } } }$ . The representational learning task is to predict $\bar { \bf x }$ conditioned on $\mathbf { \underline { { x } } }$ , that is, to maximize w.r.t. $\pmb { \theta }$ ¯:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\log p _ { \theta } ( \bar { \mathbf { x } } | \mathbf { x } ) \approx \sum _ { t = 1 } ^ { T } m _ { t } \log p _ { \theta } ( x _ { t } | \mathbf { x } ) = \sum _ { t = 1 } ^ { T } m _ { t } \Biggl ( \overline { { H _ { \theta } ( \mathbf { x } ) _ { t } } } ^ { \top } e ( x _ { t } ) - \log \sum _ { x ^ { \prime } } \exp \left( H _ { \theta } ( \mathbf { x } ) _ { t } ^ { \top } e ( x ^ { \prime } ) \right) \Biggr ) ,
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
where $H$ is a transformer, $e$ is a lookup table, and $m _ { t } = 1$ if symbol $x _ { t }$ is masked. That is, corrupted symbols are “reconstructed" by the model, meaning that their index is predicted. As noted in Yang et al. (2019), BERT models the joint conditional probability $p ( { \bar { \mathbf { x } } } | \mathbf { x } )$ as factorized so that each masked token is separately reconstructed. This means that the log likelihood is approximate instead of exact.
|
| 426 |
+
|
| 427 |
+
# D.5 QUICKTHOUGHT VECTORS
|
| 428 |
+
|
| 429 |
+
Let f and $\mathbf { g }$ be functions that take a sentence as input and encode it into an fixed length vector. Let $s$ be a given sentence, and $S _ { c t x t }$ be the set of sentences appearing in the context of $s$ for a fixed context size. Let $S _ { c a n d }$ be the set of candidate sentences considered for a given context sentence $s _ { c t x t } \in S _ { c t x t }$ . Then, $S _ { c a n d }$ contains a valid context sentence $s _ { c t x t }$ as well as many other non-context sentences. $S _ { c a n d }$ is used for the classification objective. For any given sentence position in the context of $s$ (for example, the preceding sentence), the probability that a candidate sentence $s _ { c a n d } \in S _ { c a n d }$ is the correct sentence for that position is given by
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\log p ( s _ { c a n d } | s , S _ { c a n d } ) = f _ { \theta } ( s ) ^ { \top } \underline { { { g } _ { \theta } ( s _ { c a n d } ) ) } } - \log \sum _ { s ^ { \prime } \in S _ { c a n d } } \exp \left( f _ { \theta } ( s ) ^ { \top } g _ { \theta } ( s _ { c a n d } ^ { \prime } ) \right) .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
# D.6 DEEP METRIC LEARNING
|
| 436 |
+
|
| 437 |
+
The multi-class N-pair loss in Sohn (2016) is proportional to
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\log N - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( 1 + \sum _ { j \neq i } \exp \{ \mathbf { f } _ { \theta } ( { x _ { i } } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( { x _ { i } } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) ) \} \right) ,
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
which can be simplified as
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { l } { { \displaystyle - \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} \right) } } \\ { { \displaystyle = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { 1 } { \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) - \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} } \right) } } \\ { { \displaystyle = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \log \left( \frac { \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { i } ) \} } { \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp \{ \mathbf { f } _ { \theta } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \theta } ( y _ { j } ) \} } \right) . } } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
Setting $\mathbf { N }$ to 1 and evaluating the log gives
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\mathbf { f } _ { \pmb { \theta } } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \pmb { \theta } } ( y _ { i } ) - \frac { 1 } { K } \sum _ { j = 1 } ^ { K } \exp ( \mathbf { f } _ { \pmb { \theta } } ( x _ { i } ) ^ { \top } \mathbf { f } _ { \pmb { \theta } } ( y _ { j } ) ) ,
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
which is Equation 1 where $\mathbf { f } _ { \theta } = \mathbf { g } _ { \theta }$
|
| 456 |
+
|
| 457 |
+
# D.7 NEURAL PROBABILISTIC LANGUAGE MODELS (NPLMS)
|
| 458 |
+
|
| 459 |
+
Figure 1 shows results from a neural probabilistic language model as proposed in Mnih and Teh (2012). Mnih and Teh (2012) propose using a log-bilinear model (Mnih and Hinton, 2009) which, given some context $h$ , learns a context word vectors $r _ { w }$ and target word vectors $q _ { w }$ . Two different embedding matrices are maintained, in other words: one to capture the embedding of the word and the other the context. The representation for the context vectorlinear combination of the context words and a context weight matrix $\hat { q }$ , is thenso that . $C _ { i }$ $\begin{array} { r } { \hat { q } = \bar { \sum } _ { i = 1 } ^ { n - 1 } C _ { i } r _ { w _ { i } } } \end{array}$ The score for the match between the context and the next word is computed as a dot product, e.g., $s _ { \theta } ( w , h ) = \hat { q } ^ { \top } \tilde { q } _ { w } { } ^ { 1 }$ and substituting into the definition of $P _ { \theta } ^ { h } ( w )$ , we see that
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\log P _ { \theta } ^ { h } ( w ) = \boldsymbol { \hat { q } } ^ { \top } \boldsymbol { \tilde { q } } _ { w } - \log \sum _ { w ^ { \prime } } \exp \left( \boldsymbol { \hat { q } } ^ { \top } \boldsymbol { \tilde { q } } _ { w ^ { \prime } } \right)
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
shows that Mnih and Teh (2012) is a member of the model family.
|
| 466 |
+
|
| 467 |
+
Interestingly, a touchstone work in the area of NPLMs, Word2Vec (Mikolov et al., 2013), does not fall under the model family due to an additional nonlinearity applied to the score of Mnih and Teh (2012).
|
md/train/RYcgfqmAOHh/RYcgfqmAOHh.md
ADDED
|
Binary file (57.9 kB). View file
|
|
|
md/train/S1lyyANYwr/S1lyyANYwr.md
ADDED
|
@@ -0,0 +1,718 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONSTRAINED MARKOV DECISION PROCESSES VIA BACKWARD VALUE FUNCTIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Although Reinforcement Learning (RL) algorithms have found tremendous success in simulated domains, they often cannot directly be applied to physical systems, especially in cases where there are hard constraints to satisfy (e.g. on safety or resources). In standard RL, the agent is incentivized to explore any behavior as long as it maximizes rewards, but in the real world undesired behavior can damage either the system or the agent in a way that breaks the learning process itself. In this work, we model the problem of learning with constraints as a Constrained Markov Decision Process, and provide a new on-policy formulation for solving it. A key contribution of our approach is to translate cumulative cost constraints into state-based constraints. Through this, we define a safe policy improvement method which maximizes returns while ensuring that the constraints are satisfied at every step. We provide theoretical guarantees under which the agent converges while ensuring safety over the course of training. We also highlight computational advantages of this approach. The effectiveness of our approach is demonstrated on safe navigation tasks and in safety-constrained versions of MuJoCo environments, with deep neural networks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement Learning (RL) provides a sound decision-theoretic framework to optimize the behavior of learning agents in an interactive setting (Sutton & Barto, 2018). Recently, the field of RL has found success in many high-dimensional domains, like video games, Go, robot locomotion and navigation. However, most of the success of RL algorithms has been limited to simulators, where the learning algorithm has the ability to reset the simulator. In the physical world, an agent will need to avoid harmful behavior (e.g. damaging the environment or the agent’s hardware) while learning to explore behaviors that maximize the reward.
|
| 12 |
+
|
| 13 |
+
A few popular approaches for avoiding undesired behaviors for high-dimensional systems include reward-shaping (Moldovan & Abbeel, 2012), reachability-preserving algorithms (Mitchell, 2003; Eysenbach et al., 2017), state-level surrogate constraint satisfaction algorithms (Dalal et al., 2018), risk-sensitive algorithms (Tamar et al., 2013; Chow et al., 2015) and apprenticeship learning (Abbeel & Ng, 2004). There also exists model-based Bayesian approaches that are focused on imposing the constraints via the dynamics (such as classifying parts of state space as unsafe) and then using model predictive control to incorporate the constraints in the policy optimization and planning (Turchetta et al., 2016; Berkenkamp et al., 2017; Wachi et al., 2018; Koller et al., 2018). A natural way to model safety is via constraint satisfaction. A standard formulation for adding constraints to RL problems is the Constrained Markov Decision Process (CMDP) framework (Altman, 1999), wherein the environment is extended to also provide feedback on constraint costs. The agent must then attempt to maximize its expected return while also satisfying cumulative constraints.
|
| 14 |
+
|
| 15 |
+
A few algorithms have been proposed to solve CMDPs for high-dimensional domains with continuous action spaces - however they come with their own caveats. Reward Constrained Policy Optimization (Tessler et al., 2018) and Primal Dual Policy Optimization (Chow et al., 2015) do not guarantee constraint satisfaction during the learning procedure, only on the final policy. Constrained Policy Optimization (Achiam et al., 2017) provides monotonic policy improvement but is computationally expensive due to requiring a backtracking line-search procedure and conjugate gradient algorithm for approximating the Fisher Information Matrix. Lyapunov-based Safe Policy Optimization (Chow et al., 2019) requires solving a Linear Program (LP) at every step of policy evaluation, although they show that there exists heuristics which can be substituted for the LP at the expense of theoretical guarantees.
|
| 16 |
+
|
| 17 |
+
In this work, we propose an alternate formulation for solving CMDPs that transforms trajectory-level constraints into localized state-dependent constraints, through which a safe policy improvement step can be defined. In our approach, we define a notion of Backward Value Functions, which act as an estimator of the expected cost collected by the agent so far and can be learned via standard RL bootstrap techniques. We provide conditions under which this new formulation is able to solve CMDPs without violating the constraints during the learning process. Our formulation allows us to define state-level constraints without explicitly solving a LP or the Dual problem at every iteration. Our method is implemented as a reduction to any model-free on-policy bootstrap based RL algorithm, both for deterministic and stochastic policies, and discrete and continuous action spaces. We provide the empirical evidence of our approach with Deep RL methods on various safety benchmarks, including 2D navigation grid worlds (Leike et al., 2017; Chow et al., 2018), and MuJoCo tasks (Achiam et al., 2017; Chow et al., 2019).
|
| 18 |
+
|
| 19 |
+
# 2 CONSTRAINED MARKOV DECISION PROCESSES
|
| 20 |
+
|
| 21 |
+
We write ${ \mathcal { P } } ( Y )$ for the set of probability distributions on a space $Y$ . A Markov Decision Process (MDP) (Puterman, 2014) is a tuple $( \mathcal { X } , \mathcal { A } , \mathcal { P } , r , x _ { 0 } )$ , where $\mathcal { X }$ is a set of states, $\mathcal { A }$ is a set of actions, $r : \mathcal { X } \times \mathcal { A } [ 0 , R _ { M A X } ]$ is a reward function, $\mathcal { P } : \mathcal { X } \times \mathcal { A } \mathcal { P } ( \mathcal { X } )$ is a transition probability function, and $x _ { 0 }$ is a fixed starting state. For simplicity we assume a deterministic reward function and starting state, but our results generalize.
|
| 22 |
+
|
| 23 |
+
A Constrained Markov Decision Process (CMDP) (Altman, 1999) is a MDP with additional constraints that restrict the set of permissible policies for the MDP. Formally, a CMDP is a tuple $( \mathcal { X } , \mathcal { A } , \mathcal { P } , r , x _ { 0 } , d , d _ { 0 } )$ , where $d : \mathcal { X } [ 0 , D _ { M A X } ]$ is the cost function1 and $\mathbf { \Phi } _ { M _ { 0 } } \in \mathbb { R } ^ { \geq 0 }$ is the maximum allowed cumulative cost. The set of feasible policies that satisfy the CMDP is the subset of stationary policies $\begin{array} { r } { \Pi _ { \mathcal { D } } : = \{ \pi : \mathcal { X } \mathcal { P } ( \mathcal { A } ) \mid \mathbb { E } [ \sum _ { t = 0 } ^ { T } d ( x _ { t } ) \mid x _ { 0 } , \pi ] \leq d _ { 0 } \} } \end{array}$ . We consider a finite time horizon $T$ after which the episode terminates. The expected sum of rewards following a policy $\pi$ from an initial state $x$ is given by the value function $\begin{array} { r } { V ^ { \pi } ( x ) = \mathbb { E } [ \sum _ { t = 0 } ^ { T } r ( x _ { t } , a _ { t } ) \mid \pi , x ] } \end{array}$ . Analogously, the expected sum of costs is given by the cost value function $V _ { \mathcal { D } } ^ { \pi } ( x ) = \mathbb { E } [ \sum _ { t = 0 } ^ { T } d ( x _ { t } ) \mid \pi , x ]$ . The RL problem in the CMDP is to find the feasible policy which maximizes expected returns from the initial state $x _ { 0 }$ , i.e.
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\pi ^ { * } = \arg \operatorname* { m a x } _ { \pi \in \Pi _ { \mathcal { D } } } V ^ { \pi } ( x _ { 0 } )
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
An important point to note about CMDPs is that, in the original formulation, the cost function depends on immediate states but the constraint is cumulative and thus depends on the entire trajectory.
|
| 30 |
+
|
| 31 |
+
In the case of MDPs, where a model of the environment is not known or is not easily obtained, it is still possible for the agent to find the optimal policy using Temporal Difference (TD) methods (Sutton, 1988). Broadly, these methods update the estimates of the value functions via bootstraps of previous estimates on sampled transitions (we refer the reader to Sutton & Barto (2018) for more information). In the on-policy setting, we alternate between estimating the state-action value function $Q ^ { \pi }$ for a given $\pi$ and updating the policy to be greedy with respect to the value function.
|
| 32 |
+
|
| 33 |
+
# 3 SAFE POLICY ITERATION VIA BACKWARD VALUE FUNCTIONS
|
| 34 |
+
|
| 35 |
+
Our approach proposes to convert the trajectory-level constraints of the CMDP into single-step state-wise constraints in such a way that satisfying the state-wise formulation will entail satisfying the original trajectory-level problem. The advantages of this approach are twofold: i) working with single-step state-wise constraints allows us to obtain analytical solutions to the optimization problem, and ii) the state-wise constraints can be defined via value-function-like quantities and can thus be estimated with well-studied value-based methods. The state-wise constraints are defined via Backward Value Functions, in Section 3.2, and in Section 3.3 we provide a safe policy iteration procedure which satisfies said constraints (and thus the original problem).
|
| 36 |
+
|
| 37 |
+
# 3.1 BACKWARD MARKOV CHAIN
|
| 38 |
+
|
| 39 |
+
Unlike in traditional RL, in the CMDP setting the agent needs to take into account the constraints which it has accumulated so far in order to plan accordingly for the future. Intuitively, the accumulated cost so far can be estimated via the cost value function $V _ { \mathcal { D } }$ running “backward in time”. Before giving the details of our approach and formally introducing the Backward Value Functions, we review the main ideas, which are built upon the work of Morimura et al. (2010), who also considered time-reversed Markov chains but from the standpoint of estimating the gradient of the log stationary distribution; we extend these ideas to TD methods.
|
| 40 |
+
|
| 41 |
+
Assumption 3.1 (Stationarity). The MDP is ergodic for any policy $\pi$ , i.e., the Markov chain characterized by the transition probability $\begin{array} { r } { \mathcal { P } ^ { \pi } ( x _ { t + 1 } \vert \bar { x } _ { t } ) = \sum _ { a _ { t } \in \mathcal { A } } \mathcal { P } ( \bar { x } _ { t + 1 } \vert x _ { t } , a _ { t } ) \pi ( a _ { t } \vert x _ { t } ) } \end{array}$ is irreducible and aperiodic.
|
| 42 |
+
|
| 43 |
+
Let $\mathcal { M } ( \pi )$ denote the Markov chain characterized by transition probability $\mathcal { P } ^ { \pi } ( x _ { t + 1 } \vert x _ { t } )$ . The above assumption implies that there exists a unique stationary distribution $\eta ^ { \pi }$ associated with $\pi$ , such that it satisfies: $\begin{array} { r } { \bar { \eta } ^ { \pi } ( x _ { t + 1 } ) = \sum _ { x _ { t } \in \mathcal { X } } \mathcal { P } ^ { \pi } ( x _ { t + 1 } \vert x _ { t } ) \eta ^ { \pi } ( x _ { t } ) } \end{array}$ . We abuse the notation and denote $\mathcal { P } ^ { \pi } ( x _ { t + 1 } , a _ { t } | x _ { t } ) = \mathcal { P } ( x _ { t + 1 } | x _ { t } , a _ { t } ) \pi ( a _ { t } | \bar { x } _ { t } )$ .
|
| 44 |
+
|
| 45 |
+
According to Bayes’ rule, the probability $q ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } )$ of a previous state-action pair $( x _ { t - 1 } , a _ { t - 1 } )$ leading to the current state $x _ { t }$ is given by:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
q ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } ) = \frac { \mathcal { P } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) P r ( x _ { t - 1 } , a _ { t - 1 } ) } { \sum _ { x _ { t - 1 } \in \mathcal { X } } \sum _ { a _ { t - 1 } \in \mathcal { A } } \mathcal { P } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) P r ( x _ { t - 1 } , a _ { t - 1 } ) } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
From Assumption 3.1, we have that $\begin{array} { r l r } { P r ( x _ { t - 1 } , a _ { t - 1 } ) } & { { } = } & { \eta ^ { \pi } ( x _ { t - 1 } ) \pi ( a _ { t - 1 } | x _ { t - 1 } ) } \end{array}$ , and $\begin{array} { r l r } { \sum _ { x _ { t - 1 } \in \mathcal { X } } \sum _ { a _ { t - 1 } \in \mathcal { A } } \mathcal { P } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) P r ( x _ { t - 1 } , a _ { t - 1 } ) } & { = } & { \eta ^ { \pi } ( x _ { t } ) } \end{array}$ . We denote the posterior $q ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } )$ as backward (or time-reversed) probability $\mathbf { } \pi ^ { \pi } ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } )$ , and we have:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \overleftarrow { \boldsymbol { \mathcal { P } } } ^ { \pi } ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } ) = \frac { \mathcal { P } ( x _ { t } | x _ { t - 1 } , a _ { t - 1 } ) \eta ^ { \pi } ( x _ { t - 1 } ) \pi ( a _ { t - 1 } | x _ { t - 1 } ) } { \eta ^ { \pi } ( x _ { t } ) } } \\ & { \phantom { \quad \quad \ } = \frac { \mathcal { P } ^ { \pi } ( x _ { t } , a _ { t - 1 } | x _ { t - 1 } ) \eta ^ { \pi } ( x _ { t - 1 } ) } { \eta ^ { \pi } ( x _ { t } ) } . } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
The forward Markov chain, characterized by the transition matrix $\mathscr { P } ^ { \pi } ( x _ { t + 1 } | x _ { t } )$ , runs forward in time, i.e., it gives the probability of the next state in which the agent will end up. Analogously, a backward Markov chain is denoted by the transition matrix $\begin{array} { r } { \mathbf { et { } { ' } { \mathcal { P } } } ^ { \pi } ( x _ { t - 1 } \vert x _ { t } ) = \sum _ { a _ { t - 1 } \in A } \mathbf { et { } { ' } { \mathcal { P } } ^ { \pi } } ( x _ { t - 1 } , a _ { t - 1 } \vert x _ { t } ) . } \end{array}$ , and describes the state and action the agent took to reach the current state.
|
| 58 |
+
|
| 59 |
+
Definition 3.1 (Backward Markov Chain). A backward Markov chain associated with $\mathcal { M } ( \pi )$ is denoted by $\overleftarrow { B } ( \pi )$ and is characterized by the transition probability $\overleftarrow { \mathcal { P } } ^ { \pi } ( x _ { t - 1 } | x _ { t } )$ .
|
| 60 |
+
|
| 61 |
+
# 3.2 BACKWARD VALUE FUNCTION
|
| 62 |
+
|
| 63 |
+
We define the Backward Value Function (BVF) to be a value function running on the backward Markov chain $\overleftarrow { B } ( \pi )$ . A BVF is the expected sum of returns or costs collected by the agent so far. We are mainly interested in maintaining estimates of the cumulative cost incurred at a state in order to express the total constraint state-wise.
|
| 64 |
+
|
| 65 |
+
We note that, since every Markov chain $\mathcal { M } ( \pi )$ is ergodic by Assumption 3.1, the corresponding backward Markov chain $B ( \pi )$ is also ergodic (Morimura et al., 2010, Prop. B.1). In particular, every policy $\pi$ can reach the initial state via some path in the transition graph of the backward Markov chain. Thus, the backwards Markov chain are also finite-horizon for some $T _ { B }$ , with $x _ { 0 }$ corresponding to the terminal state. We define a finite-horizon Backward Value Function for cost as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) = \mathbb { E } _ { \overleftarrow { \mathcal { B } } ( \pi ) } \left[ \sum _ { k = 0 } ^ { T _ { \mathcal { B } } } d ( x _ { t - k } ) | x _ { t } \right] .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Proposition 3.1 (Sampling). Samples from the forward Markov chain $\mathcal { M } ( \pi )$ can be used directly to estimate the statistics of the backward Markov chain $\overleftarrow { B } ( \pi )$ (or the Backward Value Function). We
|
| 72 |
+
|
| 73 |
+
have:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r l r } { { \mathbb { E } _ { \overleftarrow { \mathcal { B } } ( \pi ) } [ \sum _ { k = 0 } ^ { K } d ( x _ { t - k } ) | x _ { t } ] = \mathbb { E } _ { \mathcal { M } ( \pi ) } [ \sum _ { k = 0 } ^ { K } d ( x _ { t - k } ) | x _ { t } , \eta ^ { \pi } ( x _ { t - K } ) ] , } } \\ & { } & { = \mathbb { E } _ { \mathcal { M } ( \pi ) } [ \sum _ { k = 0 } ^ { K } d ( x _ { t + k } ) | x _ { t + K } , \eta ^ { \pi } ( x _ { t } ) ] , } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where EM(π) and E #»B(π) are expectations over the forward and backward chains respectively. The Equation (3) holds true even in the limit $K \infty$ .
|
| 80 |
+
|
| 81 |
+
The proof is given in Appendix B.1. Using the above proposition, we get an interchangeability property that removes the need to sample from the backward chain. We can use the traditional RL setting and draw samples from the forward chain and still estimate the BVFs. Equation (2) can be written recursively as:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r } { \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) = \mathbb { E } _ { \overleftarrow { B } ( \pi ) } \left[ d ( x _ { t } ) + \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x _ { t - 1 } ) \right] . } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
In operator form, the above equation can also be written as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
( \overleftarrow { \boldsymbol { T } } ^ { \pi } \overleftarrow { \boldsymbol { V } } _ { \mathcal { D } } ^ { \pi } ) ( \boldsymbol { x } _ { t } ) = \mathbb { E } _ { \boldsymbol { x } _ { t - 1 } \sim \overleftarrow { \boldsymbol { P } } ^ { \pi } } \left[ d ( \boldsymbol { x } _ { t } ) + \overleftarrow { \boldsymbol { V } } _ { \mathcal { D } } ^ { \pi } ( \boldsymbol { x } _ { t - 1 } ) \right] .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Proposition 3.2 (Fixed point). For a policy $\pi$ , the associated Backward Value Function vector, $\overleftarrow { V } ^ { \pi }$ , satisfies $\begin{array} { r } { \operatorname* { l i m } _ { k \infty } ( \overleftarrow { T } ^ { \pi } ) ^ { k } \overleftarrow { V } = \overleftarrow { V } ^ { \pi } } \end{array}$ for every vector , and $\overleftarrow { V } ^ { \pi }$ is the unique solution of the equation $\overleftarrow { V } ^ { \pi } = \overleftarrow { T } ^ { \pi } \overleftarrow { V } ^ { \pi }$ .
|
| 94 |
+
|
| 95 |
+
The proof is given in Appendix B.2. The above proposition allows us to soundly extend the RL methods based on Bellman operators for the estimation of BVFs.
|
| 96 |
+
|
| 97 |
+
# 3.3 SAFE POLICY IMPROVEMENT VIA BVF-BASED CONSTRAINTS
|
| 98 |
+
|
| 99 |
+
With the Backward Value Function framework, the trajectory-level optimization problem associated with a CMDP can be rewritten in state-wise form. Recall that a feasible policy must satisfy the constraint:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathbb { E } _ { \mathcal { M } ( \pi ) } \left[ \sum _ { k = 0 } ^ { T } d ( x _ { k } ) \mid x _ { 0 } \right] \leq d _ { 0 } .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Alternatively, for each timestep $t \in [ 0 , T ]$ of a trajectory:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\mathbb { E } \left[ \sum _ { k = 0 } ^ { t } d ( x _ { k } ) \mid x _ { 0 } , \pi \right] + \mathbb { E } \left[ \sum _ { k = t } ^ { T } d ( x _ { k } ) \mid x _ { 0 } , \pi \right] - \mathbb { E } \left[ d ( x _ { t } ) \mid x _ { 0 } \right] \leq d _ { 0 } .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Via the identities $\begin{array} { r } { \mathbb { E } [ \sum _ { k = t } ^ { T } d ( x _ { k } ) \mid x _ { 0 } , \pi ] \leq \mathbb { E } _ { x _ { t } \sim \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } } [ V _ { D } ^ { \pi } ( x _ { t } ) ] } \end{array}$ and $\begin{array} { r } { \mathbb { E } [ \sum _ { k = 0 } ^ { t } d ( x _ { k } ) \mid x _ { 0 } , \pi ] \le } \end{array}$ $\mathbb { E } _ { \boldsymbol { x } _ { k } \sim \delta _ { \boldsymbol { x } _ { 0 } } ( \boldsymbol { P } ^ { \pi } ) ^ { t } } [ \overleftarrow { V } _ { \boldsymbol { D } } ^ { \pi } ( \boldsymbol { x } _ { t } ) ]$ (derived in Appendix $\mathrm { C } ) ^ { 2 }$ , we remark that the quantity on the LHS is less than the expectation over $k$ -step trajectories of $\overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) + V _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) - d ( x _ { t } )$ . In other words, for each $t \in [ 0 , T ]$ :
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathbb { E } _ { \mathcal { M } ( \pi ) } \left[ \sum _ { k = 0 } ^ { T } d ( x _ { k } ) \mid x _ { 0 } \right] \le \mathbb { E } _ { x _ { t } \sim \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } } \left[ \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) + V _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) - d ( x _ { t } ) \right] \le d _ { 0 } .
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
These are the state-wise constraints that should hold at each step in a given trajectory - we refer to them as the value-based constraints. Satisfying the value-based constraints will automatically satisfy the given CMDP constraints.
|
| 118 |
+
|
| 119 |
+
This formulation allows us to introduce a policy improvement step, which maintains a safe feasible policy at every iteration by using the previous estimates of the forward and backward value functions3. The policy improvement step is defined by a linear program, which performs a greedy update with respect to the current state-action value function subject to the value-based constraints:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r l } & { \pi _ { k + 1 } ( \cdot | x ) = \underset { \pi \in \Pi } { \arg \operatorname* { m a x } } \big \langle \pi ( \cdot | x ) , Q ^ { \pi _ { k } } ( x , \cdot ) \big \rangle , } \\ & { \quad s . t . \left. \pi ( \cdot | x ) , Q _ { \mathcal { D } } ^ { \pi _ { k } } ( x , \cdot ) \right. + \overleftarrow { V } _ { \mathcal { D } } ^ { \pi _ { k } } ( x ) - d ( x ) \leq d _ { 0 } , \quad \forall x \in \mathcal { X } . } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Our first result is that the policies obtained by the policy improvement step will satisfy the safety constraints. We write $\mathrm { T V } ( \cdot , \cdot )$ for the total variation metric between distributions.
|
| 126 |
+
|
| 127 |
+
Theorem 3.1 (Consistent Feasibility). Assume that successive policies are updated sufficiently slowly, i.e. $\begin{array} { r } { \mathrm { T V } \big ( \pi _ { k + 1 } \big ( \cdot | x \big ) , \pi _ { k } \big ( \cdot | x \big ) \big ) \leq \frac { d _ { 0 } - V _ { \mathcal { D } } ^ { \pi _ { k } } ( x _ { 0 } ) } { 2 D _ { \mathrm { M A X } } T ^ { 2 } } } \end{array}$ .4 Then the policy iteration step given by (SPI) is consistently feasible, i.e. if $\pi _ { k }$ Mis feasible at $x _ { 0 }$ then so is $\pi _ { k + 1 }$ .
|
| 128 |
+
|
| 129 |
+
It is also possible to consider larger neighbourhoods for updates of successive policies, but at the cost of everywhere-feasibility. For want of space, we present that result in Appendix D.
|
| 130 |
+
|
| 131 |
+
Next we show that the policy iteration step given by (SPI) leads to monotonic improvement.
|
| 132 |
+
|
| 133 |
+
Theorem 3.2 (Policy Improvement). Let $\pi _ { n }$ and $\pi _ { n + 1 }$ be successive policies generated by the policy iteration step of (SPI). Then $V ^ { \pi _ { n + 1 } } ( x ) \geq V ^ { \pi _ { n } } ( x ) \forall x \in \mathcal { X }$ . In particular, the sequence of value functions $\{ V ^ { \pi _ { n } } \} _ { n \geq 0 }$ given by (SPI) monotonically converges.
|
| 134 |
+
|
| 135 |
+
Proofs for Theorems 3.1 and 3.2 are given in Appendix D. Finding the sub-optimality gap (if any) remains an interesting question left for future work.
|
| 136 |
+
|
| 137 |
+
# 4 PRACTICAL IMPLEMENTATION CONSIDERATIONS
|
| 138 |
+
|
| 139 |
+
# 4.1 DISCRETE ACTION SPACE
|
| 140 |
+
|
| 141 |
+
In discrete action spaces, the problem in (SPI) can be solved exactly as a Linear Programming problem. It is possible to approximate its analytical solution by casting it into the corresponding entropy-regularized counterpart (Neu et al., 2017; Chow et al., 2018). The details of the closed form solution can be found in Appendix E.
|
| 142 |
+
|
| 143 |
+
Furthermore, if we restrict the set of policies to be deterministic, then it is possible to have an in-graph solution as well. The procedure then closely resembles the Action Elimination Procedure (Puterman, 2014, Chapter 6), where non-optimal actions are identified as being those which violate the constraints.
|
| 144 |
+
|
| 145 |
+
# 4.2 EXTENSION TO CONTINUOUS CONTROL
|
| 146 |
+
|
| 147 |
+
For MDPs with only state-dependent costs, Dalal et al. (2018) proposed the use of safety layers, a constraint projection approach, that enables action correction at each step. At any given state, an unconstrained action is selected and is passed to the safety layer, which projects the action to the nearest action (in Euclidean norm) satisfying the necessary constraints. We extend this approach to stochastic policies to handle the corrections for the actions generated by stochastic policies. When the policy is parameterized with a Gaussian distribution, then the safety-layer can still be used by projecting both the mean and standard-deviation vector to the constraint-satisfying hyper-plane5. In most cases, the standard-deviation vector is kept fixed or independent of the state (Kostrikov, 2018; Dhariwal et al., 2017), which allows us to formulate the problem as solving the following $L 2$ -projection of the mean of the Gaussian in Euclidean space. For $\mu _ { \pi } ( . ; \theta )$ , at any given state $x \in \mathcal { X }$ , the safety layer solves the following projection problem:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { l } { \displaystyle \arg \operatorname* { m i n } _ { \mu } [ \frac { 1 } { 2 } \| ( \mu - \mu _ { \pi } ( x ) \| ^ { 2 } ] , } \\ { \displaystyle \mathrm { s . t . } \quad Q _ { \mathcal { D } } ^ { \pi } ( x , \mu ) + \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x ) - d ( x ) \leq d _ { 0 } . } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
As shown in Dalal et al. (2018); Chow et al. (2019), if the constraints have linear nature then an analytical solution exists. In order to get a linearized version of the constraints (and simplify the projection), we can approximate the constraint with its first-order Taylor series at $\mu = \mu _ { \pi } ( x )$ :
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\begin{array} { r l } & { \underset { \mu } { \arg \operatorname* { m i n } } [ \frac { 1 } { 2 } \| ( \mu - \mu _ { \pi } ( x ) \| ^ { 2 } ] , } \\ & { \mathrm { s . t . } \quad \overset { } { V } _ { \mathcal { D } } ^ { \pi } ( x ) - d ( x ) + \underset { \mathrm { r e s . } \mu _ { \pi } ( x ) ) } { \underbrace { Q _ { \mathcal { D } } ^ { \pi } ( x , \mu _ { \pi } ( x ) ) + ( \mu - \mu _ { \pi } ( x ) ) ^ { T } ( \nabla Q _ { \mathcal { D } } ^ { \pi } ( x , \mu ) | _ { \mu = \mu _ { \pi } ( x ) } ) } } \leq d _ { 0 } . } \end{array}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
The above objective function is positive-definite and quadratic, and the constraints are linear. Though this problem can be solved by an in-graph QP solver, there exists an analytical solution (see Appendix G):
|
| 160 |
+
|
| 161 |
+
Proposition 4.1. At a given state $x \in \mathcal { X }$ , the solution to the Eq. (5), $\mu ^ { * }$ is:
|
| 162 |
+
|
| 163 |
+
where,
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array} { c } { { \mu ^ { * } = \mu _ { \pi } ( x ) - \lambda ^ { * } ( x ) \cdot g _ { \mu , D } ( x ) , } } \\ { { g _ { \mu , \mathcal { D } } ( x ) = \nabla Q _ { \mathcal { D } } ^ { \pi } ( x , \mu ) | _ { \mu = \mu _ { \pi } ( x ) } , } } \\ { { \lambda ^ { * } ( x ) = \left( \frac { - ( d _ { 0 } + d ( x ) - \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x ) - Q _ { \mathcal { D } } ^ { \pi } ( x , \mu _ { \pi } ( x ) ) ) } { g _ { \mu , \mathcal { D } } ( x ) ^ { T } g _ { \mu , \mathcal { D } } ( x ) } \right) ^ { + } . } } \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
# 5 RELATED WORK
|
| 170 |
+
|
| 171 |
+
Lagrangian-based methods: Initially introduced in Altman (1999), more scalable versions of the Lagrangian based methods have been proposed over the years (Moldovan & Abbeel, 2012; Tessler et al., 2018; Chow et al., 2015). The general form of the Lagrangian methods is to convert the problem to an unconstrained problem via Langrange multipliers. If the policy parameters are denoted by $\theta$ , then Lagrangian formulation becomes: $\begin{array} { r l } { \operatorname* { m i n } _ { \lambda \geq 0 } \operatorname* { m a x } _ { \theta } ( L ( \theta , \lambda ) } & { = } \end{array}$ $\begin{array} { r } { \operatorname* { m i n } _ { \lambda \geq 0 } \operatorname* { m a x } _ { \theta } \left[ V ^ { \pi _ { \theta } } ( x _ { 0 } ) \right. \stackrel { . } { - } \left. \lambda ( V _ { \mathcal { D } } ^ { \pi _ { \theta } } ( x _ { 0 } ) \right. \stackrel { . } { - } \left. \bar { d _ { 0 } } ) ) \right] } \end{array}$ , where $L$ is the Lagrangian and $\lambda$ is the Lagrange multiplier (penalty coefficient). The main problems of the Lagrangian methods are that the Lagrangian multiplier is either a hyper-parameter (without much intuition), or is solved on a lower time-scale. That makes the unconstrained RL problem a three time-scale 6 problem, which makes it very difficult to optimize in practice. Another problem is that during the optimization, this procedure can violate the constraints. Ideally, we want a method that can respect the constraint throughout the training and not just at the final optimal policy.
|
| 172 |
+
|
| 173 |
+
Lyapunov-based methods: In control theory, the stability of the system under a fixed policy is computed using Lyapunov functions (Khalil, 1996). A Lyapunov function is a type of scalar potential function that keeps track of the energy that a system continually dissipates. Recently, Chow et al. (2018; 2019) provide a method of constructing the Lyapunov functions to guarantee global safety of a behavior policy using a set of local linear constraints. Their method requires the knowledge of $T V ( \pi , \pi ^ { * } )$ to guarantee the theoretical claims. They substitute the ideally required Lyapunov function with an approximate solution that requires solving a LP problem at every iteration. For the practical scalable versions, they use a heuristic, a constant Lyapunov function for all states that only depends on the initial state and the horizon. While our methods also constructs state-wise constraints, there are two notable differences: a) our assumption only rely on the current policy candidate and the baseline policy, instead of the baseline and the optimal policy, b) our method does not require solving an LP at every update step to construct the constraint and as such the only approximation error that is introduced comes from the function approximation.
|
| 174 |
+
|
| 175 |
+
Conservative Policy Improvement: Constrained Policy Optimization (CPO) (Achiam et al., 2017) extends the trust-region policy optimization (Schulman et al., 2015) algorithm to satisfy constraints during training as well as after convergence. CPO is computationally expensive as it uses an approximation to the Fisher Information Matrix which requires many steps of conjugate gradient descent $\cdot n _ { c g }$ steps) followed by a backtracking line-search procedure ${ \bf \nabla } _ { n _ { l s } }$ steps) for each iteration, so it is more expensive by $\mathcal { O } ( n _ { c g } + n _ { l s } )$ per update. Furthermore, accurately estimating the curvature requires a large number of samples in each batch (Wu et al., 2017).
|
| 176 |
+
|
| 177 |
+
# 6 EXPERIMENTS
|
| 178 |
+
|
| 179 |
+
We empirically validate our approach on RL benchmarks to measure the performance of the agent with respect to the accumulated return and cost during training in the presence of neural-networks based function approximators. We compare our approach with the respective Unconstrained versions, and the Lyapunov-based approach (Chow et al., 2018; 2019) in each setting. Even though our formulation is based on the undiscounted case, we use discounting with $\gamma = 0 . 9 9$ for estimating the value functions in order to be consistent with the baselines.
|
| 180 |
+
|
| 181 |
+
# 6.1 STOCHASTIC GRID WORLD
|
| 182 |
+
|
| 183 |
+
Motivated by the safety in navigation tasks, we first consider a stochastic 2D grid world (Leike et al., 2017; Chow et al., 2018). The agent (green cell in Fig. 1a) starts in the bottom-right corner, the safe region, and the objective is to move to the goal on the other side of the grid (blue cell). The agent can only move in the adjoining cells in the cardinal directions. It gets a reward of $+ 1 0 0 0$ on reaching the goal, and a penalty of $- 1$ at every timestep. Thus, the task is to reach the goal in the shortest amount of time. There are a number of pits in the terrain (red cells) that represent the safety constraint and the agent gets a cost of 10 on passing through any pit cell. Occasionally, with probability $p = 0 . 0 5$ , a random action will be executed instead of the one selected by the agent. Thus, the task is to reach to the goal in the shortest amount of time, while passing through the red grids at most $d _ { 0 } / 1 0$ times. The size of the grid is $1 2 \times 1 2$ cells, and the pits are randomly generated for each grid with probability $\rho = 0 . 3$ . The agent starts at (12, 12) and the goal is selected uniformly on $( \alpha , 0 )$ , where $\alpha \sim U ( 0 , 1 2 )$ . The threshold $d _ { 0 } = 2 0$ implies the agent can pass at most two pits. The maximum horizon is 200 steps, after which the episode terminates.
|
| 184 |
+
|
| 185 |
+
We use the action elimination procedure described in Sec 4.1 in combination with $n$ -step SARSA (Rummery & Niranjan, 1994; Peng & Williams, 1994) using neural networks and multiple synchronous agents as in Mnih et al. (2016). We use $\epsilon$ -greedy exploration. The results are shown in Fig. 1 (more experimental details can be found in Appendix H). We observe that the agent is able to respect the safety constraints more adequately than the Lyapunov-based method, albeit at the expense of some decrease in return, which is the expected trade-off for satisfying the constraints.
|
| 186 |
+
|
| 187 |
+
# 6.2 MUJOCO BENCHMARKS
|
| 188 |
+
|
| 189 |
+
Based on the safety experiments in Achiam et al. (2017); Chow et al. (2019), we design three simulated robot locomotion continuous control tasks using the MuJoCo simulator (Todorov et al., 2012) and OpenAI Gym (Brockman et al., 2016): (1) Point-Gather: A point-mass agent $( S \subseteq \mathbb { R } ^ { 9 } , A \subseteq \mathbb { R } ^ { 2 } )$ is rewarded for collecting the green apples and constrained to avoid the red bombs; (2) Safe-Cheetah: A bi-pedal agent $( S \subseteq \mathbb { R } ^ { 1 8 } , A \subseteq \bar { \mathbb { R } } ^ { \bar { 6 } } )$ is rewarded for running at high speed, but at the same time constrained by a speed limit; (3) Point-Circle: The point-mass agent $( S \subseteq \mathbb { R } ^ { 9 } , A \subseteq \mathbb { R } ^ { 2 } )$ is rewarded for running along the circumference of a circle in counter-clockwise direction, but is constrained to stay within a safe region smaller than the radius of the circle.
|
| 190 |
+
|
| 191 |
+
We integrate our method on top of the A2C algorithms (Mnih et al., 2016) and PPO (Schulman et al., 2017), using the procedure described in Section 4.2. More details about the tasks and network architecture can be found in the Appendix I. Algorithmic details can be found in Appendix J. The results with A2C are shown in Fig. 2 and the results with PPO are shown in Fig. 3. We observe that our Safe method is able to respect the safety constraint throughout most of the learning, and with much greater degree of compliance than the Lyapunov-based method, especially when combined with A2C. The one case where the Safe method fails to respect the constraint is in Point-Circle with PPO (Fig. 3(c)). Upon further examination, we note that the training in this scenario has one of two outcomes: some runs end with the learner in an infeasible set of states from which it cannot recover; other runs end in a good policy that respects the constraint. We discuss solutions to overcome this in the final section.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 1: (a) Example of a gridworld environment. (b,c) Performance over the training for Unconstrained (red), Lyapunov-based (green), and our method (blue) all trained with n-step SARSA on 2D GridWorld task over 20 random seeds. The $\mathbf { X }$ -axis is the number of episodes in thousands. The dotted black line in (c) denotes the constraint threshold, $d _ { 0 }$ . The bold line represents mean, and the shaded region denotes $80 \%$ confidence-intervals.
|
| 195 |
+
|
| 196 |
+
# 7 DISCUSSION
|
| 197 |
+
|
| 198 |
+
We present a method for solving constrained MDPs that respects trajectory-level constraints by converting them into state dependent value-based constraints, and show how the method can be used to handle safety limitations in both discrete and continuous spaces. The main advantage of our approach is that the optimization problem is more easily solved with value-based constraints, while providing similar guarantees and requiring less approximations. The empirical results presented show that our approach is able to solve the tasks with good performance while maintaining safety throughout training. It is important to note that there is a fundamental trade-off between exploration and safety. It is impossible to be $100 \%$ safe without some knowledge; in cases where that knowledge is not provided a priori, it must be acquired through exploration. We see this in some of our results (Gridworld, Point-Circle) where our safe policy goes above the constraint in the very early phases of training (all our experiments started from a random policy). We note that the other methods also suffer from this shortcoming. An open question is how to provide initial conditions or a priori knowledge, to avoid this burn-in phase. Another complementary strategy to explore is for cases where an agent is stuck in an unsafe or infeasible policy space, where a recovery method (trained by purely minimizing the constraints) could be useful to help the agent recover (Achiam et al., 2017; Chow et al., 2019).
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Figure 2: A2C Performance over the training for Unconstrained (red), Lyapunov-based (green), and our method (blue) all trained with A2C on MuJoCo tasks over 10 random seeds. The $\mathbf { X }$ -axis is the number of episodes in thousands. The dotted black line denotes $d _ { 0 }$ . The bold line represents the mean, and the shaded region denotes the $80 \%$ confidence-intervals.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 3: PPO Performance over the training for Unconstrained (red), Lyapunov-based (green), and our method (blue) all trained with PPO on MuJoCo tasks over 10 random seeds. The $\mathbf { X }$ -axis is the number of episodes in thousands, and y-axis denotes the undiscounted accumulated returns. The dotted black line denotes $d _ { 0 }$ . The bold line represents the mean, and the shaded region denotes the $80 \%$ confidence-intervals.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Pieter Abbeel and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Apprenticeship learning via inverse reinforcement learning. In Proceedings of the twenty-first international conference on Machine learning, pp. 1. ACM, 2004.
|
| 209 |
+
|
| 210 |
+
Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. arXiv preprint arXiv:1705.10528, 2017.
|
| 211 |
+
|
| 212 |
+
Eitan Altman. Constrained Markov decision processes, volume 7. CRC Press, 1999.
|
| 213 |
+
|
| 214 |
+
Felix Berkenkamp, Matteo Turchetta, Angela Schoellig, and Andreas Krause. Safe model-based reinforcement learning with stability guarantees. In Advances in Neural Information Processing Systems, pp. 908–919, 2017.
|
| 215 |
+
|
| 216 |
+
Dimitri P Bertsekas, Dimitri P Bertsekas, Dimitri P Bertsekas, and Dimitri P Bertsekas. Dynamic programming and optimal control, volume 1. Athena scientific Belmont, MA, 1995.
|
| 217 |
+
|
| 218 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 219 |
+
|
| 220 |
+
Yinlam Chow, Mohammad Ghavamzadeh, Lucas Janson, and Marco Pavone. Risk-constrained reinforcement learning with percentile risk criteria. arXiv preprint arXiv:1512.01629, 2015.
|
| 221 |
+
|
| 222 |
+
Yinlam Chow, Ofir Nachum, Edgar Duenez-Guzman, and Mohammad Ghavamzadeh. A lyapunovbased approach to safe reinforcement learning. arXiv preprint arXiv:1805.07708, 2018.
|
| 223 |
+
|
| 224 |
+
Yinlam Chow, Ofir Nachum, Aleksandra Faust, Mohammad Ghavamzadeh, and Edgar DuenezGuzman. Lyapunov-based safe policy optimization for continuous control. arXiv preprint arXiv:1901.10031, 2019.
|
| 225 |
+
|
| 226 |
+
Gal Dalal, Krishnamurthy Dvijotham, Matej Vecerik, Todd Hester, Cosmin Paduraru, and Yuval Tassa. Safe exploration in continuous action spaces. arXiv preprint arXiv:1801.08757, 2018.
|
| 227 |
+
|
| 228 |
+
Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https: //github.com/openai/baselines, 2017.
|
| 229 |
+
|
| 230 |
+
Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pp. 1329–1338, 2016.
|
| 231 |
+
|
| 232 |
+
Benjamin Eysenbach, Shixiang Gu, Julian Ibarz, and Sergey Levine. Leave no trace: Learning to reset for safe and autonomous reinforcement learning. arXiv preprint arXiv:1711.06782, 2017.
|
| 233 |
+
|
| 234 |
+
Hassan K Khalil. Nonlinear systems. 1996.
|
| 235 |
+
|
| 236 |
+
Torsten Koller, Felix Berkenkamp, Matteo Turchetta, and Andreas Krause. Learning-based model predictive control for safe exploration and reinforcement learning. arXiv preprint arXiv:1803.08287, 2018.
|
| 237 |
+
|
| 238 |
+
Vijay R Konda and John N Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pp. 1008–1014, 2000.
|
| 239 |
+
|
| 240 |
+
Ilya Kostrikov. Pytorch implementations of reinforcement learning algorithms. https://github. com/ikostrikov/pytorch-a2c-ppo-acktr-gail, 2018.
|
| 241 |
+
|
| 242 |
+
Jan Leike, Miljan Martic, Victoria Krakovna, Pedro A Ortega, Tom Everitt, Andrew Lefrancq, Laurent Orseau, and Shane Legg. Ai safety gridworlds. arXiv preprint arXiv:1711.09883, 2017.
|
| 243 |
+
|
| 244 |
+
Ian Michael Mitchell. Application of level set methods to control and reachability problems in continuous and hybrid systems. 2003.
|
| 245 |
+
|
| 246 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pp. 1928–1937, 2016.
|
| 247 |
+
|
| 248 |
+
Teodor Mihai Moldovan and Pieter Abbeel. Safe exploration in markov decision processes. arXiv preprint arXiv:1205.4810, 2012.
|
| 249 |
+
|
| 250 |
+
Tetsuro Morimura, Eiji Uchibe, Junichiro Yoshimoto, Jan Peters, and Kenji Doya. Derivatives of logarithmic stationary distributions for policy gradient reinforcement learning. Neural Computation, 22(2):342–376, 2010. doi: 10.1162/neco.2009.12-08-922. URL https://doi.org/10. 1162/neco.2009.12-08-922. PMID: 19842990.
|
| 251 |
+
|
| 252 |
+
Gergely Neu, Anders Jonsson, and Vicenç Gómez. A unified view of entropy-regularized markov decision processes. arXiv preprint arXiv:1705.07798, 2017.
|
| 253 |
+
|
| 254 |
+
Jing Peng and Ronald J Williams. Incremental multi-step q-learning. In Machine Learning Proceedings 1994, pp. 226–232. Elsevier, 1994.
|
| 255 |
+
|
| 256 |
+
Joelle Pineau. The machine learning reproducibility checklist. https://www.cs.mcgill.ca/ \~jpineau/ReproducibilityChecklist.pdf, 2018.
|
| 257 |
+
|
| 258 |
+
Martin L Puterman. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
|
| 259 |
+
|
| 260 |
+
Gavin A Rummery and Mahesan Niranjan. On-line Q-learning using connectionist systems, volume 37. University of Cambridge, Department of Engineering Cambridge, England, 1994.
|
| 261 |
+
|
| 262 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015.
|
| 263 |
+
|
| 264 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 265 |
+
|
| 266 |
+
Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3 (1):9–44, 1988.
|
| 267 |
+
|
| 268 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 269 |
+
|
| 270 |
+
Aviv Tamar, Dotan Di Castro, and Shie Mannor. Policy evaluation with variance related risk criteria in markov decision processes. arXiv preprint arXiv:1301.0104, 2013.
|
| 271 |
+
|
| 272 |
+
Chen Tessler, Daniel J Mankowitz, and Shie Mannor. Reward constrained policy optimization. arXiv preprint arXiv:1805.11074, 2018.
|
| 273 |
+
|
| 274 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 275 |
+
|
| 276 |
+
Matteo Turchetta, Felix Berkenkamp, and Andreas Krause. Safe exploration in finite markov decision processes with gaussian processes. In Advances in Neural Information Processing Systems, pp. 4312–4320, 2016.
|
| 277 |
+
|
| 278 |
+
Akifumi Wachi, Yanan Sui, Yisong Yue, and Masahiro Ono. Safe exploration and optimization of constrained mdps using gaussian processes. In AAAI Conference on Artificial Intelligence (AAAI), 2018.
|
| 279 |
+
|
| 280 |
+
Yuhuai Wu, Elman Mansimov, Roger B Grosse, Shun Liao, and Jimmy Ba. Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation. In Advances in neural information processing systems, pp. 5279–5288, 2017.
|
| 281 |
+
|
| 282 |
+
# A REPRODUCIBILITY CHECKLIST
|
| 283 |
+
|
| 284 |
+
We follow the reproducibility checklist (Pineau, 2018) and point to relevant sections explaining them here. For all algorithms presented, check if you include:
|
| 285 |
+
|
| 286 |
+
• A clear description of the algorithm. The algorithms are explained in Sec. J. Any additional details for Discrete methods are provided in Sec. 4.1, and for continuous Sec. 4.2.
|
| 287 |
+
• An analysis of the complexity (time, space, sample size) of the algorithm. The analytical solution in Eq. (5) consists of a few vector arithmetic and relu operator and as such has the same complexity as the baselines. For the discrete case, with deterministic policies the solution again can be implemented as part of the computation graph, consisting of basic vector arithmetic operations, and has very little additional overhead. For discrete actions with stochastic policies, one needs to sovle the LP problem in (SPI). In that case the complexity is same as the baseline safe-methods (Lyapunov), and is higher than the unconstrained versions. In terms of computation time (for Deep-RL experiments) the newly proposed algorithms are almost identical to the baselines due to its parallelizable nature. We do not make any claims about the sample complexity.
|
| 288 |
+
• A link to a downloadable source code, including all dependencies. The code will be made available after the acceptance of the paper.
|
| 289 |
+
|
| 290 |
+
For any theoretical claim, check if you include:
|
| 291 |
+
|
| 292 |
+
• A statement of the result. See the main paper for all the claims we make. Additional details are provided in the Appendix.
|
| 293 |
+
• A clear explanation of any assumptions. See the main paper for all the assumptions.
|
| 294 |
+
• A complete proof of the claim. See the main paper. The cross references to the proofs in the Appendix have been included in the main paper.
|
| 295 |
+
|
| 296 |
+
For all figures and tables that present empirical results, check if you include:
|
| 297 |
+
|
| 298 |
+
• A complete description of the data collection process, including sample size. For the base agent we standard benchmarks provided in OpenAI Gym (Brockman et al., 2016), and rllab (Duan et al., 2016). We use the code from Achiam et al. (2017) for building the Point-Circle and Point-Gather environments.
|
| 299 |
+
|
| 300 |
+
• A link to downloadable version of the dataset or simulation environment. See: github.com/openai/gym for OpenAI Gym benchmarks, github.com/jachiam/cpo for rllab based Circle and Gather environments.
|
| 301 |
+
|
| 302 |
+
• An explanation of how samples were allocated for training / validation / testing. We do not use a split as we run multiple runs over random seeds to examine the optimization performance.
|
| 303 |
+
|
| 304 |
+
• An explanation of any data that were excluded. NA • The range of hyper-parameters considered, method to select the best hyper-parameter configuration, and specification of all hyper-parameters used to generate results. The default hyper-parameters for the MuJoCo baselines are taken from Kostrikov (2018). The ranges and parameters for Grid experiments are described in Sec. H, and for MuJoCo are described in Sec. I.
|
| 305 |
+
|
| 306 |
+
• The exact number of evaluation runs. The number of evaluation runs is mentioned in the caption corresponding to each result.
|
| 307 |
+
|
| 308 |
+
• A description of how experiments were run. See Experiments Sec. 6 in the main paper and in the Appendix Sec. H and Sec. I.
|
| 309 |
+
|
| 310 |
+
• A clear definition of the specific measure or statistics used to report results. Undiscounted return and cost using the current policy over the horizon are plotted after every 1000 episodes are plotted. We use a linear-filter with 0.7 weight for smoothing. We use the smooting algorithm provided by TensorBoard (https://github.com/tensorflow/ tensorboard).
|
| 311 |
+
|
| 312 |
+
• Clearly defined error bars. Standard error used in all cases.
|
| 313 |
+
• A description of results with central tendency (e.g. mean) and variation (e.g. stddev). The bold lines in the figure represent the mean, and the shaded region denotes the $8 0 \%$ confidence interval.
|
| 314 |
+
• A description of the computing infrastructure used. We distribute all runs across 10 CPU nodes (Intel(R) Xeon(R) CPU E5-2650 v4) and 1 GPU (GP 100) per run for experiments.
|
| 315 |
+
|
| 316 |
+
# B BACKWARD VALUE FUNCTIONS
|
| 317 |
+
|
| 318 |
+
We have the following result from Proposition 1 from Morimura et al. (2010). We give the proof too for the sake of completeness.
|
| 319 |
+
|
| 320 |
+
Proposition B.1. Let the forward Markov chain $\mathcal { M } ( \pi )$ be irreducible and ergodic, i.e., has a stationary distribution. Then the associated backward Markov chain $\overleftarrow { B } ( \pi )$ is also ergodic and has the same unique stationary distribution as $\mathcal { M } ( \pi )$ :
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\eta ^ { \pi } ( x ) = \overleftarrow { \eta } ^ { \pi } ( x ) ,
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
( \forall x \in { \mathcal { X } } )
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
where $\eta ^ { \pi } ( x )$ and $\overleftarrow { \eta } ^ { \pi } ( x )$ are the stationary distributions of $\mathcal { M } ( \pi )$ and $\overleftarrow { B } ( \pi )$ .
|
| 331 |
+
|
| 332 |
+
Proof. Multiply both sides of Eq. (1) by $\eta ^ { \pi } ( x _ { t } )$ and sum over all actions $a _ { t - 1 } \in { \mathcal { A } }$ we obtain detailed balance like equations (with respect to time):
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\begin{array} { r } { \overleftarrow { \mathcal { P } } ^ { \pi } ( x _ { t - 1 } | x _ { t } ) \eta ^ { \pi } ( x _ { t } ) = \mathcal { P } ^ { \pi } ( x _ { t } , a _ { t - 1 } | x _ { t - 1 } ) \eta ^ { \pi } ( x _ { t - 1 } ) . \qquad ( \forall x _ { t - 1 } \in \mathcal { X } , x _ { t } \in \mathcal { X } ) } \end{array}
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Sum over all possible $x _ { t }$ we have:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\sum _ { x _ { t } \in \mathcal { X } } \overleftarrow { \mathcal { P } } ^ { \pi } ( x _ { t - 1 } | x _ { t } ) \eta ^ { \pi } ( x _ { t } ) = \eta ^ { \pi } ( x _ { t - 1 } ) .
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
The above equation indicates that $\overleftarrow { B } ( \pi )$ has same stationary distribution as $\mathcal { M } ( \pi )$ . In the matrix form the above equation can be written as $\eta \overleftarrow { P } ^ { \pi } = \eta$ , that implies that $\eta$ is stationary distribution with $\scriptstyle \overleftarrow { P } ^ { \pi }$ transition matrix.
|
| 345 |
+
|
| 346 |
+
# B.1 RELATION BETWEEN FORWARD AND BACKWARD MARKOV CHAINS AND BACKWARD VALUE FUNCTIONS
|
| 347 |
+
|
| 348 |
+
Proof. We use the technique of Proposition 2 of Morimura et al. (2010) to prove this. Using the Markov property and then substituting Eq. (1) for each term we have:
|
| 349 |
+
|
| 350 |
+
$$
|
| 351 |
+
\begin{array} { r l } & { \overline { { \mathfrak { p } } } ^ { \pi } ( x _ { t - 1 } , a _ { t - 1 } , \dots , x _ { t - K } , a _ { t - K } | x _ { t } ) = \overline { { \mathcal { P } } } ^ { \pi } ( x _ { t - 1 } , a _ { t - 1 } | x _ { t } ) \dots \overleftarrow { \mathcal { P } } ^ { \pi } ( x _ { t - K } , a _ { t - K } | x _ { t - K + 1 } ) , } \\ & { \qquad = \frac { \mathcal { P } ^ { \pi } ( x _ { t } , a _ { t - 1 } | x _ { t - 1 } ) \dots \mathcal { P } ^ { \pi } ( x _ { t - K + 1 } , a _ { t - K } | x _ { t - K } ) \eta ^ { \pi } ( x _ { t - K } ) } { \eta ^ { \pi } ( x _ { t } ) } , } \\ & { \qquad \propto \mathcal { P } ^ { \pi } ( x _ { t } , a _ { t - 1 } | x _ { t - 1 } ) \dots \mathcal { P } ^ { \pi } ( x _ { t - K + 1 } , a _ { t - K } | x _ { t - K } ) \eta ^ { \pi } ( x _ { t - K } ) . } \end{array}
|
| 352 |
+
$$
|
| 353 |
+
|
| 354 |
+
This proves the proposition for finite $K$ . Using the Prop. B.1, $K \infty$ case is proven too:
|
| 355 |
+
|
| 356 |
+
$$
|
| 357 |
+
\begin{array} { l } { \displaystyle \underset { K \to \infty } { \operatorname* { l i m } } \mathbb { E } _ { \overleftarrow { \mathcal { B } } ( \pi ) } \left[ \displaystyle \sum _ { k = 0 } ^ { K } d ( x _ { t - k } ) | x _ { t } \right] = \displaystyle \operatorname* { l i m } _ { K \to \infty } \mathbb { E } _ { \mathcal { M } ( \pi ) } \left[ \displaystyle \sum _ { k = 0 } ^ { K } d ( x _ { t - k } ) | x _ { t } , \eta ^ { \pi } ( x _ { t - K } ) \right] , \medskip } \\ { \displaystyle = \displaystyle \sum _ { x \in \mathcal { X } } \sum _ { a \in \mathcal { A } } \pi ( a | x ) \eta ^ { \pi } ( x ) d ( x ) . } \end{array}
|
| 358 |
+
$$
|
| 359 |
+
|
| 360 |
+
# B.2 TD FOR BVF
|
| 361 |
+
|
| 362 |
+
Proof. We use the same technique from Stochastic Shortest Path dynamic programming (Bertsekas et al., 1995, Vol 2, Proposition 1.1) to prove the above proposition. The general outline of the proof is given below, for more details we refer the reader to the textbook.
|
| 363 |
+
|
| 364 |
+
We have,
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
{ \mathrm { } } ^ { \pi } { } ^ { } { \mathrm { } } V = d + { \overleftarrow { P } } ^ { \pi } { \overleftarrow { V } } .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
(Eq. (4) in matrix notation)
|
| 371 |
+
|
| 372 |
+
Using induction argument, we have for all $\mathbf { \overline { { V } } } \in \mathbb { R } ^ { n }$ and $k \geq 1$ , we have:
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\left( \overleftarrow { \boldsymbol { \mathcal { T } } } ^ { \pi } \right) ^ { k } \overleftarrow { \boldsymbol { V } } = \left( \overleftarrow { \boldsymbol { P } } ^ { \pi } \right) ^ { k } \overleftarrow { \boldsymbol { V } } + \sum _ { m = 0 } ^ { k - 1 } { \left( \overleftarrow { \boldsymbol { P } } ^ { \pi } \right) ^ { m } } d ,
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
Taking the limit, and using the result, $\begin{array} { r } { \operatorname* { l i m } _ { k \to \infty } \left( \overleftarrow { P } ^ { \pi } \right) ^ { k } \overleftarrow { V } = 0 } \end{array}$ , regarding proper policies from Bertsekas et al. (1995, Vol 2, Equation 1.2), we have:
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\operatorname* { l i m } _ { k \to \infty } \left( { \overleftarrow { \mathcal { T } } } ^ { \pi } \right) ^ { k } { \overleftarrow { V } } = \operatorname* { l i m } _ { k \to \infty } \sum _ { m = 0 } ^ { k - 1 } { \left( { \overleftarrow { P } } ^ { \pi } \right) } ^ { m } d = { \overleftarrow { V } } ^ { \pi } ,
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
Also we have by definition:
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\left( \overleftarrow { T } ^ { \pi } \right) ^ { k + 1 } \overleftarrow { V } = d + \overleftarrow { P } ^ { \pi } \left( \overleftarrow { T } ^ { \pi } \right) ^ { k } \overleftarrow { V } ,
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
and by taking the limit $k \to \infty$ , we have:
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r } { \overleftarrow { V } ^ { \pi } = d + \overleftarrow { P } ^ { \pi } \overleftarrow { V } ^ { \pi } , } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
which is equivalent to,
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\mathbf { \Sigma } ^ { \pi } = \mathbf { \Sigma } ^ { \pi } \mathbf { \Sigma } ^ { \pi } .
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
To show uniqueness, note that if $\mathbf { \Sigma } _ { \overline { { V } } } ^ { } = \mathbf { \Sigma } ^ { \pi } \mathbf { \Sigma } _ { \overline { { V } } } ^ { }$ , then $\overleftarrow { V } = \left( \overleftarrow { \mathcal { T } } ^ { \pi } \right) ^ { k } \overleftarrow { V }$ for all $k$ and letting $k \to \infty$ we get $\overleftarrow { V } = \overleftarrow { V } ^ { \pi }$ .
|
| 403 |
+
|
| 404 |
+
# C VALUE-BASED CONSTRAINT LEMMA
|
| 405 |
+
|
| 406 |
+
Lemma C.1. $\begin{array} { r } { \mathbb { E } \left[ \sum _ { k = t } ^ { T } d ( x _ { k } ) \mid x _ { 0 } , \pi \right] \leq \mathbb { E } _ { x _ { t } \sim \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } } \left[ V _ { D } ^ { \pi } ( x _ { t } ) \right] \mathrm { a n d } \mathbb { E } \left[ \sum _ { k = 0 } ^ { t } d ( x _ { k } ) \mid \operatorname { c o r s c o s } ( x _ { k } ) \mid \operatorname { c o r s c o s } ( x _ { k } ) \mid \operatorname { c o r s c o s } ( x _ { k } ) \right] } \end{array}$ $\begin{array} { r } { \mathbb { E } \left[ \sum _ { k = 0 } ^ { t } d ( x _ { k } ) \mid x _ { 0 } , \pi \right] \leq } \end{array}$ $\mathbb { E } _ { \boldsymbol { x } _ { k } \sim \delta _ { \boldsymbol { x } _ { 0 } } ( { P } ^ { \pi } ) ^ { t } } \left[ \overleftarrow { V } _ { \mathcal { D } } ^ { \bar { \pi } } ( \boldsymbol { x } _ { k } ) \right]$
|
| 407 |
+
|
| 408 |
+
Proof. Follows since adding more steps to the trajectory (from $T \mathrm { ~ - ~ } t$ steps to $T$ ) can only increase the expected total cost. $\begin{array} { r c l } { \mathbb { E } \left[ \sum _ { k = t } ^ { T } d ( x _ { k } ) \mid x _ { 0 } , \pi \right] } & { = } & { \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } \left( \sum _ { k = t } ^ { T } ( P ^ { \pi } ) ^ { k } \right) d } \end{array} \leq$ $\begin{array} { r } { \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } \left( \sum _ { k = t } ^ { T + t } ( P ^ { \pi } ) ^ { k } \right) d = \mathbb { E } _ { x _ { t } \sim \delta _ { x _ { 0 } } ( P ^ { \pi } ) ^ { t } } \left[ V _ { \mathcal { D } } ^ { \pi } ( x _ { t } ) \right] . } \end{array}$ . The backward case is analogous. □
|
| 409 |
+
|
| 410 |
+
# D PROPERTIES OF THE POLICY ITERATION (SPI)
|
| 411 |
+
|
| 412 |
+
Theorem D.1. Let $\begin{array} { r } { \sigma ( x ) : = \mathrm { T V } ( \pi _ { k + 1 } ( \cdot | x ) , \pi _ { k } ( \cdot | x ) ) = ( 1 / 2 ) \sum _ { a } \left| \pi _ { k + 1 } ( a | x ) - \pi _ { k } ( a | x ) \right| } \end{array}$ denote the total variation between policies $\pi _ { k } ( \cdot | x )$ and $\pi _ { k + 1 } ( \cdot | x )$ . If the policies are updated sufficiently slowly and $\pi _ { k }$ is feasible, then so is $\pi _ { k + 1 }$ . More specifically:
|
| 413 |
+
|
| 414 |
+
(I) If $\pi _ { k }$ is feasible at $x _ { 0 }$ and $\begin{array} { r } { \sigma ( x ) \leq \frac { d _ { 0 } - V _ { \mathcal { D } } ^ { \pi _ { k } } ( x _ { 0 } ) } { 2 T ^ { 2 } D _ { \mathrm { M A X } } } \forall x } \end{array}$ ) ∀x then πk+1 is feasible at x0.
|
| 415 |
+
|
| 416 |
+
$\mathbf { \Pi } ^ { ( \mathbf { I I } ) }$ If $\pi _ { k }$ is feasible everywhere (i.e. $\begin{array} { r l r } { V _ { \mathcal { D } } ^ { \pi _ { k } } ( x ) } & { { } \le } & { d _ { 0 } \forall x ) } \end{array}$ and $\sigma ( x )$ ≤ $\frac { d _ { 0 } - V _ { \mathcal { D } } ^ { \pi _ { k } } \left( x \right) } { 2 T \operatorname* { m a x } _ { x ^ { \prime } } \left\{ d _ { 0 } - \overline { { V } } _ { \mathcal { D } } ^ { \pi _ { k } } \left( x ^ { \prime } \right) - d ( x ^ { \prime } ) \right\} } \forall x$ then $\pi _ { k + 1 }$ is feasible everywhere.
|
| 417 |
+
|
| 418 |
+
We note that the second case allows the policies to be updated in a larger neighborhood but requires $\pi _ { k }$ to be feasible everywhere. By contrast the first item updates policies in a smaller neighbourhood but only requires feasibility at the starting state.
|
| 419 |
+
|
| 420 |
+
Proof. Similar to the analysis in Chow et al. (2018). We aim to show that $V _ { \mathcal { D } } ^ { \pi _ { k + 1 } } ( x _ { 0 } ) \leq d _ { 0 }$ . For simplicity we consider $k = 0$ , and by induction the other cases will follow. We write $P _ { 0 } =$ $P ^ { \pi _ { 0 } } , P _ { 1 } = P ^ { \pi _ { 1 } }$ , $\Delta ( a | x ) = \pi _ { 1 } ( a | x ) - \pi _ { 0 } ( a | x )$ , and $\begin{array} { r } { P _ { \Delta } = \left[ \sum _ { a \in A } \Delta ( a | x ) P ( x ^ { \prime } | x , a ) \right] _ { \{ x ^ { \prime } , x \} } } \end{array}$ . Note that $( I - P _ { 0 } ) = ( I - P _ { 1 } + P _ { \Delta } )$ , and therefore $( I - P _ { 1 } + P _ { \Delta } ) ( I - P _ { 0 } ) ^ { - 1 } = I _ { | \mathcal { X } | \times | \mathcal { X } | }$ . Thus, we find
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
( I - P _ { 0 } ) ^ { - 1 } = ( I - P _ { 1 } ) ^ { - 1 } ( I _ { | \mathcal { X } | \times | \mathcal { X } | } + P _ { \Delta } ( I - P _ { 0 } ) ^ { - 1 } ) .
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
Multiplying both sides by the cost vector $d$ one has
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ) = \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } d ( x _ { t } ) + \varepsilon ( x _ { t } ) \mid \pi _ { 1 } , x \right] ,
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
for each $x$ , where $\begin{array} { r } { \varepsilon ( x ) = \sum _ { a \in A } \Delta ( a | x ) \sum _ { x ^ { \prime } \in \mathcal { X } } P ( x ^ { \prime } | x , a ) V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ^ { \prime } ) } \end{array}$ . Splitting the expectation, we have
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
V _ { \mathcal { D } } ^ { \pi _ { 1 } } ( x ) = V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ) - \mathbb { E } \left[ \sum _ { t = 0 } ^ { T } \varepsilon ( x _ { t } ) \mid \pi _ { 1 } , x \right]
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
For case (I) we note that $V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ^ { \prime } ) \le D _ { \mathrm { M A X } } T$ and so $- 2 \sigma ( x _ { t } ) D _ { \mathrm { M A X } } T \le \varepsilon ( x _ { t } ) \forall x _ { t }$ . Using $\sigma ( x _ { t } ) \leq$ $( d _ { 0 } - V _ { \mathcal { D } } ^ { \pi _ { k } } ) / 2 D _ { \mathrm { M A X } } T ^ { 2 }$ gives $V _ { \mathcal { D } } ^ { \pi _ { 1 } } ( x _ { 0 } ) \leq V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x _ { 0 } ) - 2 D _ { \mathrm { M A X } } T ^ { 2 } ( d _ { 0 } - V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x _ { 0 } ) ) / ( 2 D _ { \mathrm { M A X } } T ^ { 2 } ) = d _ { 0 }$ , i.e. $\pi _ { 0 }$ is feasible at $x _ { 0 }$ .
|
| 439 |
+
|
| 440 |
+
For case ${ \bf ( I I ) }$ we note that $V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ) \leq \operatorname* { m a x } _ { x ^ { \prime } } \{ d _ { 0 } - \overleftarrow { V } _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ^ { \prime } ) - d ( x ^ { \prime } ) \} = : \Theta$ since $\pi _ { 0 }$ is feasible at every $x$ . As before, we have $- 2 \sigma ( x _ { t } ) \Theta \le \varepsilon ( x _ { t } ) \ \forall x _ { t }$ and so $V _ { \mathcal { D } } ^ { \pi _ { 1 } } ( x ) \le V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ) - 2 \Theta T ( d _ { 0 } -$ $V _ { \mathcal { D } } ^ { \pi _ { 0 } } ( x ) ) / ( 2 \Theta T ) = d _ { 0 } \forall x$ , i.e. $\pi _ { 1 }$ is feasible everywhere.
|
| 441 |
+
|
| 442 |
+
Theorem D.2. Let $\pi _ { n }$ and $\pi _ { n + 1 }$ be successive policies generated be the policy iteration algorithm of (SPI). Then $V ^ { \pi _ { n + 1 } } \geq V ^ { \pi _ { n } }$ .
|
| 443 |
+
|
| 444 |
+
Proof. Note that $\pi _ { n + 1 }$ and $\pi _ { n }$ are both feasible solutions of the LP (SPI). Since $\pi _ { n + 1 }$ maximizes $V ^ { \pi }$ over all feasible solutions, the result follows.
|
| 445 |
+
|
| 446 |
+
# E ANALYTICAL SOLUTION OF THE UPDATE - DISCRETE CASE
|
| 447 |
+
|
| 448 |
+
We follow the same procedure as (Chow et al., 2018, Section E.1) to convert the problem to its Shannon entropy regularized version:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\begin{array} { r l } { \underset { \pi \in \Delta } { \operatorname* { m a x } } } & { \pi ( . | x ) ^ { T } ( Q ( x , . ) + \tau \log \pi ( . | x ) ) , } \\ { \mathrm { s . t . } } & { \pi ( . | x ) ^ { T } Q _ { \mathcal { D } } ( x , . ) + \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x ) - d ( x ) \leq d _ { 0 } , } \end{array}
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
where $\tau > 0$ is a regularization constant. Consider the Lagrangian problem for optimization:
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
\operatorname* { m a x } _ { \lambda \geq 0 } \operatorname* { m a x } _ { \pi \in \Delta } \Gamma _ { x } ( \pi , \lambda ) = \pi ( . | x ) ^ { T } ( Q ( x , . ) + \lambda Q _ { \mathcal { D } } ( x , . ) + \tau \log \pi ( . | x ) ) + \lambda ( d _ { 0 } + d ( x ) - \overleftarrow { V } ( x ) )
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
From entropy-regularized literature (Neu et al., 2017), the inner $\lambda$ -solution policy has the form:
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
\pi _ { \Gamma , \lambda } ^ { * } ( . | x ) \propto \exp { \left( - \frac { Q ( x , . ) + \lambda Q _ { \mathcal { D } } ( x , . ) } { \tau } \right) }
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
We now need to solve for the optimal lagrange multiplier $\lambda ^ { * }$ at $x$ .
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\operatorname* { m a x } _ { \lambda \geq 0 } - \tau \log - \mathrm { s u m - e x p } \left( - \frac { Q ( x , . ) + \lambda Q _ { \mathcal { D } } ( x , . ) } { \tau } \right) + \lambda ( d _ { 0 } + d ( x ) - \overleftarrow { V } _ { \mathcal { D } } ( x ) ) ,
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
where log-sum- $\begin{array} { r } { \exp ( y ) = \log \sum _ { a } e x p ( y _ { a } ) } \end{array}$ is a convex function in $y$ , and objective is a concave function of $\lambda$ . Using KKT conditions, the $\nabla _ { \lambda }$ gives the solution:
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\left( d _ { 0 } + d ( x ) - \overleftarrow { V } _ { \mathcal { D } } ( x ) \right) - \frac { \sum _ { a } Q _ { \mathcal { D } } ( x , a ) \exp ( \left( - \frac { Q ( x , a ) + \lambda Q _ { \mathcal { D } } ( x , a ) } { \tau } \right) ) } { \sum _ { a } \exp ( \left( - \frac { Q ( x , a ) + \lambda Q _ { \mathcal { D } } ( x , a ) } { \tau } \right) ) } = 0
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
Using parameterization of $z = \exp ( - \lambda )$ , the above condition can be written as polynomial equation in $z$ :
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\sum _ { a } \left( d _ { 0 } + d ( x ) - \overleftarrow { V } _ { \mathcal { D } } ( x ) - Q _ { \mathcal { D } } ( x , a ) \right) \cdot \left( \exp ( - \frac { Q ( x , a ) } { \tau } ) \right) z ^ { \frac { Q _ { \mathcal { D } } ( x , a ) } { \tau } } = 0
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
The roots to this polynomial will give $0 ~ \leq ~ z ^ { * } ( x ) ~ \leq ~ 1$ , using which one can find $\lambda ^ { * } ( x ) \ =$ $- \log ( z ^ { * } ( x ) )$ . The roots can be found using the Newton’s method. The final optimal policy of the entropy-regularized process is then:
|
| 485 |
+
|
| 486 |
+
$$
|
| 487 |
+
\pi _ { \Gamma } ^ { * } \propto \exp \left( - \frac { Q ( x , \cdot ) + \lambda ^ { * } Q _ { \mathcal { D } } ( x , \cdot ) } { \tau } \right)
|
| 488 |
+
$$
|
| 489 |
+
|
| 490 |
+
# F EXTENSION OF SAFETY LAYER TO STOCHASTIC POLICIES WITH GAUSSIAN PARAMTERIZATION
|
| 491 |
+
|
| 492 |
+
Consider stochastic gaussian policies parameterized by mean $\mu ( x ; \theta )$ and standard-deviation $\sigma ( x ; \phi )$ , and the actions sampled have the form $\mu ( x ; \theta ) + \sigma ( x ; \phi ) \epsilon$ , where $\epsilon \sim \mathcal { N } ( 0 , I )$ is the noise. Here, $< \mu ( x ; \theta ) , \sigma ( x ; \phi ) >$ are both deterministic w.r.t. the parameters $\theta , \phi$ and $x$ , and as such both of them together can be treated in the same way as deterministic policy $( \pi ( x ) = < \mu ( x ) , \sigma ( x ) > )$ . The actual action sampled and executed in the environment is still stochastic, but we have moved the stochasticity fron the policy to the environment. This allows us to define and work with action-value functions $Q _ { \mathcal { D } } ( x , \mu _ { \pi } ( x ) , \sigma _ { \pi } ( x ) )$ . In this case, the corresponding projected actions have the form $\mu ^ { \prime } + \sigma ^ { \prime } \epsilon$ . The main objective of the safety layer (without the constraints) can be further simplified as:
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array} { r l } & { \quad \mathrm { c r r o n s i n } \ : \sum _ { k = 0 } ^ { \infty } \operatorname* { m i n } _ { \rho \to \infty } \rho _ { k \to \infty , \infty , 0 \leq n \leq n } \left. \frac { 1 } { 2 } \left\| \left( \rho ^ { \prime } \right. - \rho ( k _ { \star } ( \sigma ) ) - ( \rho _ { \star \star } ( \sigma ) ) \right. \sigma _ { \star } ( \sigma ) \mathrm { c l } \rho \right. \right\| ^ { 2 } } \\ & { \quad \times \quad \mathrm { c r o n s i n } \ : \sum _ { k = 0 } ^ { \infty } \operatorname* { s u p } _ { \rho \to \infty , 0 \leq n \leq t _ { \star } } \left. \frac { 1 } { 2 } \left\| \left( \rho ^ { \prime } - \rho _ { \star \star } ( \sigma ) \right) + ( ( \sigma ^ { \prime } - \sigma _ { \star } ( \sigma ) ) ) \zeta \right\| ^ { 2 } \right. } \\ & { \quad \times \quad \mathrm { c r o n s i n } \ : \frac { 1 } { 2 } \sum _ { k = 0 } ^ { \infty } \operatorname* { c r o n s i n } _ { \rho \to \infty , 0 \leq n \leq t _ { \star } } \left. \frac { 1 } { 2 } \left\| \left( \rho ^ { \prime } - \rho _ { \star \star } ( \sigma ) \right) \right\| ^ { 2 } + \left\| ( \sigma ^ { \prime } - \sigma _ { \star } ( \sigma ) ) \right\| \mathrm { c r o s i n } \ : \rho ^ { \prime } + \frac { 2 } { \lambda } \leq \rho ^ { \prime } - \rho _ { \star \star } ( \sigma ) \mathrm { c r o s i n } \ : \rho ^ { \prime } \right. \leq \sigma _ { \star } ^ { \prime } } \\ & { \quad \times \frac { \mathrm { c r o n s i n } } { \rho ^ { \prime } \rho ^ { \prime } \rho ^ { \prime } } \frac { 1 } { 2 } \left( \left\| \partial ^ { 2 } - \mu ( \sigma ) \right\| ^ { 2 } + \Xi _ { \infty < \infty , \infty , 0 \leq n } \left. \left. ( \sigma ^ { \prime } - \sigma _ { \star } ( \sigma ) ) \right. \right\| ^ { 2 } \right) } \\ & \quad \times \frac { \mathrm { c r o s i n } } { \rho ^ { \prime } \rho ^ { \prime } } \frac { 1 } { 2 } \left( \left\| \partial ^ { 2 } - \mu _ { \star } ( \sigma ) \right\| ^ { 2 } + \left\| ( \sigma ^ { \prime } - \sigma _ { \star } ( \sigma ) ) \right\| ^ { 2 } \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
As both $\mu _ { \pi } ( . ; \theta )$ and $\sigma _ { \pi } ( . ; \phi )$ are modelled by independent set of parameters (different neural networks, usually) we can solve each of the safety layer problem independently, w.r.t. only those parameters.
|
| 499 |
+
|
| 500 |
+
# G ANALYTICAL SOLUTION IN SAFETY LAYER
|
| 501 |
+
|
| 502 |
+
The proof is similar to the proof of the Proposition 1 of Dalal et al. (2018). We have the following optimization problem:
|
| 503 |
+
|
| 504 |
+
$$
|
| 505 |
+
\begin{array} { r l } & { \displaystyle \arg \operatorname* { m i n } _ { \mu } [ \frac { 1 } { 2 } \| ( \mu - \mu _ { \pi } ( x ) \| ^ { 2 } ] , } \\ & { \displaystyle s . \mathrm { ~ t ~ . ~ } \quad \mathbf { \Sigma } _ { V } ^ { \pi } ( x ) - d ( x ) + Q _ { D } ^ { \pi } ( x , \mu _ { \pi } ( x ) ) + ( \mu - \mu _ { \pi } ( x ) ) ^ { T } ( \nabla Q _ { D } ^ { \pi } ( x , \mu ) | _ { \mu = \mu _ { \pi } ( x ) } ) \leq d _ { 0 } } \end{array}
|
| 506 |
+
$$
|
| 507 |
+
|
| 508 |
+
As the objective function and constraints are convex, and the feasible solution, $\mu ^ { * } , \lambda ^ { * }$ , should satisfy the KKT conditions. We define $\epsilon ( x ) = ( d _ { 0 } + d ( x ) - \overleftarrow { V } _ { \mathcal { D } } ^ { \pi } ( x ) - Q _ { \mathcal { D } } ^ { \pi } ( x , \mu _ { \pi } ( \overleftarrow { \lambda } ) ) )$ , and $g _ { \mu , \mathcal { D } } ( x ) =$ $\nabla Q _ { \mathcal { D } } ^ { \pi } ( x , u ) | _ { u = \mu _ { \pi } ( x ) }$ . Thus, we can write the Lagrangian as:
|
| 509 |
+
|
| 510 |
+
$$
|
| 511 |
+
L ( \mu , \lambda ) = \frac { 1 } { 2 } \left\| ( \mu - \mu _ { \pi } ( x ) \| ^ { 2 } + \lambda ( ( \mu - \mu _ { \pi } ( x ) ) ^ { T } g _ { \mu , \mathcal { D } } ( x ) - \epsilon ( x ) ) \right.
|
| 512 |
+
$$
|
| 513 |
+
|
| 514 |
+
From the KKT conditions, we get:
|
| 515 |
+
|
| 516 |
+
$$
|
| 517 |
+
\begin{array} { r } { \nabla _ { \mu } L = \mu - \mu _ { \pi } ( x ) + \lambda g _ { \mu , \mathcal { D } } ( x ) = 0 } \\ { ( \mu - \mu _ { \pi } ( x ) ) ^ { T } g _ { \mu , \mathcal { D } } ( x ) - \epsilon ( x ) = 0 } \end{array}
|
| 518 |
+
$$
|
| 519 |
+
|
| 520 |
+
From Eq. (7), we have:
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
\mu ^ { * } = \mu _ { \pi } ( x ) - \lambda ^ { * } ( x ) \cdot g _ { \mu , D } ( x )
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
Substituting Eq. (9) in Eq. (8), we get:
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\begin{array} { r } { - \lambda ^ { * } ( x ) \cdot g _ { \mu , D } ( x ) ^ { T } g _ { \mu , D } ( x ) - \epsilon ( x ) = 0 } \\ { \lambda ^ { * } = \frac { - \epsilon ( x ) } { g _ { \mu , D } ( x ) ^ { T } g _ { \mu , D } ( x ) } } \end{array}
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
When the constraints are satisfied $( \epsilon ( x ) > 0 )$ , the $\lambda$ should be inactive, and hence we have $( ) ^ { + }$ operator, that is 0 for negative values.
|
| 533 |
+
|
| 534 |
+
# H DETAILS OF GRID-WORLD EXPERIMENTS
|
| 535 |
+
|
| 536 |
+
# H.1 ARCHITECTURE AND TRAINING DETAILS
|
| 537 |
+
|
| 538 |
+
We use one-hot encoding of the agent’s location in the grid as the observation, i.e. $x$ is a binary vector of dimension $\mathbb { R } ^ { 1 2 \times 1 2 }$ . The agent is trained for $2 0 0 \mathrm { k }$ episodes, and the current policy’s performance is evaluated after every 1k episodes.
|
| 539 |
+
|
| 540 |
+
The same three layer neural network with the architecture is used for state encoding for all the different the estimators. The feed-forward neural network has hidden layers of size 64, 64, 64, and relu activations. For the state-action value based estimators, the last layer is a linear layer with 4 outputs, for each action. For value function based estimators the last layer is linear layer with a single output.
|
| 541 |
+
|
| 542 |
+
We use Adam Optimizer for training all the estimators. A learning rate of 1e-3 was selected for all the reward based estimators and a learning rate of 5e-4 was selected for all the cost based estimators. The same range of learning rate parameters for considered for all estimators i.e. {1e-5, 5e-5, 1e-4, 5e-4, 1e-3, 5e-3, 1e-2, 5e-2, 1e-1}.
|
| 543 |
+
|
| 544 |
+
We use $\mathbf { n }$ -step trajectory length in A2C with $n = 4$ , i.e., trajectories of length $n$ were collected and the estimators were updated to used via the td-errors based on that. We use the number of parallel agents 20 in all the experiments. The range of parameters considered was $n \in \{ 1 , 4 , 2 0 \}$ . The same value of $n$ was used for all the baselines.
|
| 545 |
+
|
| 546 |
+

|
| 547 |
+
Figure 4: MuJoCo Safety Environments
|
| 548 |
+
|
| 549 |
+
# I DETAILS OF THE MUJOCO EXPERIMENTS
|
| 550 |
+
|
| 551 |
+
# I.1 ENVIRONMENTS DESCRIPTION
|
| 552 |
+
|
| 553 |
+
• Point-Gather: The environment (Fig.4c) is taken from Achiam et al. (2017), where the point mass agent gets a reward of $+ 1 0 . 0$ for collecting a green apple, and a cost of 1 for collecting a red bomb. Two apples and eight bombs are spawned randomly at the start of each episode. The constraints are defined over the nmber of bombs collected over the episode. Episode horizon is 15 and threshold $d _ { 0 } = 4$ .
|
| 554 |
+
|
| 555 |
+
• Safe-Cheetah: This environment (Fig.4b) is taken from Chow et al. (2019). A bi-pedal agent (HalfCheetah-v0) is augmented with speed safety constraints. The agent gets the reward based on the speed with which it runs, and the constrain is define on the speed to be less than 1, i.e., it gets a constraint cost based on $\mathbb { 1 } [ | v | > 1 ]$ , where $v$ is the velocity at the state. The maximum length of the episode is 200 and the constraint threshold is $d 0 = 5 0$ .
|
| 556 |
+
|
| 557 |
+
• Point-Circle: This environment (Fig.4a) is taken from Achiam et al. (2017). The pointmass agent is rewarded for running along the circumference of a circle of radius 15 in counter-clockwise direction, with the reward and cost function:
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
\begin{array} { l } { \displaystyle { R ( s ) = \frac { v ^ { T } [ - y , x ] } { 1 + | \| [ x , y ] \| _ { 2 } - 1 5 | } , } } \\ { \displaystyle { C ( s ) = \mathbb { 1 } [ | x | > 2 . 5 ] , } } \end{array}
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
where $x , y$ are coordinates in the plane and $v$ is the velocity. The length of the episode is 65 and the constraint threshold $d _ { 0 } = 1 0 . 0$ .
|
| 564 |
+
|
| 565 |
+
# I.2 NETWORK ARCHITECTURE AND TRAINING DETAILS
|
| 566 |
+
|
| 567 |
+
The architecture and the training procedure is based on the open-source implementations (Kostrikov, 2018). All the value based estimators use a network architecture of 2 hidden layers of size 200, 50 hidden units with tanh non-linearity, followed by a linear layer with single output. For the actor, we model mean using a network architecture of 2 hidden layers of size 100, 50 hidden units with tanh non-linearity, followed by a linear layer with dimensions of the action-space and tanh non-linearity. For the $Q ( x , \mu )$ we also a 2 layer neural network with 200, ( $5 0 +$ action-dimension) hidden units and tanh non-linearity. We concatenate the mean in the second layer, and add a linear layer with single output in the end.
|
| 568 |
+
|
| 569 |
+
Entropy regularization with $\beta = 0 . 0 0 1$ was used for all the experiments and the baselines. The trajectory length for different environments. For PPO GAE with $\lambda = 0 . 9 5$ was used for every algorithm. 20 parallel actors were used for every algorithm for each experiment. We searched the trajectory length hyper-parameter in the range 5,20,100 for every environment. We used the trajectory length of 1000 over which the samples are collected for PPO, for all environments. For the A2C experiments, for SafeCheetah trajectory length of 5 is used and for the rest 20 is used.
|
| 570 |
+
|
| 571 |
+
We use Adam Optimizer for training all the estimators. The learning rate of the critic is always 0.5 the learning rate of the actor. For the cost estimators, the same learning rate was used for forward and backward estimators. The same range of learning rate parameters for considered for all estimators i.e. {1e-5, 5e-5, 1e-4, 5e-4, 1e-3, 5e-3, 1e-2, 5e-2, 1e-1}.
|
| 572 |
+
|
| 573 |
+
# I.3 OTHER DETAILS
|
| 574 |
+
|
| 575 |
+
As we mentioned in Sec. 7, due to exploration the agent can potentially end up being in an infeasible policy space. To prevent that from happening a recovery policy (or safe-guard policy) (Achiam et al., 2017; Chow et al., 2019) is used to recover back to the feasible policy space. We run the experiments with and without the use of recovery policies (in the same procedure as the baselines), and chose the run that performs the best. We noticed that, empirically, for our approach recovery policies are only required for Point-Circle environments, as the agent has much more probability of being stuck in the constraint space.
|
| 576 |
+
|
| 577 |
+
In order to take error due to function approximation into account, Achiam et al. (2017) use costshaping to smooth out the sparse constraint, and Chow et al. (2019) use a relaxed threshold, i.e. $d _ { 0 } \cdot ( 1 ^ { - } \delta )$ , instead of $d _ { 0 }$ , where $\delta \in ( 0 , 1 )$ . We run experiments with $\delta = \{ 0 . 0 , 0 . 2 \}$ for each algorithms, and use the best among them. We found that empirically, only for Safe-Cheetah $\delta = 0 . 2$ works better compared to $\delta = 0 . 0$ .
|
| 578 |
+
|
| 579 |
+
# J ALGORITHM DETAILS
|
| 580 |
+
|
| 581 |
+
# J.1 N-STEP SYNCHRONOUS SARSA
|
| 582 |
+
|
| 583 |
+
The algorithm for n-step Synchronous SARSA is similar to the n-step Asynchronous Q-learning of Mnih et al. (2016), except that it uses SARSA instead of Q-learning, is synchronous, and instead of greedy maximization step of $\epsilon$ -greedy we use (SPI). When working with discrete actions and deterministic policies, this can be solved as part of the computation-graph itself. The algorithm is presented in Alg. 1.
|
| 584 |
+
|
| 585 |
+
# J.2 A2C
|
| 586 |
+
|
| 587 |
+
In Actor Critic (Konda & Tsitsiklis, 2000) algorithms, the parameterized policy (actor) is denoted by $\pi ( a | x ; \theta )$ , and is updated to minimizing the following loss:
|
| 588 |
+
|
| 589 |
+
$$
|
| 590 |
+
L ( \theta ) = \mathbb { E } [ - \log \pi ( a _ { t } | x _ { t } ; \theta ) ( r _ { t } + \gamma V ^ { \pi } ( x _ { t + 1 } - V _ { x _ { t } } ) ) ]
|
| 591 |
+
$$
|
| 592 |
+
|
| 593 |
+
The algorithm for A2C with Safety Layer given by Eq. (5) is similar to the Synchronous version of Actor-Critic (Mnih et al., 2016), except that it has estimates for the costs and safety-layer. Note that due to the projection property of the safety layer, it is possible to sample directly from the projected mean. Also, as the projection is a result of vector products and max, it is differentiable and and computed in-graph (via relu). The algorithm is presented in Alg. 2.
|
| 594 |
+
|
| 595 |
+
# J.3 PPO
|
| 596 |
+
|
| 597 |
+
The PPO algorithm build on top of the Actor-Critic algorithm and is very similar to Algorithm 2. The main difference is how the PPO loss for the actor is defined as:
|
| 598 |
+
|
| 599 |
+
$$
|
| 600 |
+
L ^ { C L I P } ( \boldsymbol { \theta } ) = \mathbb { E } [ \operatorname* { m i n } ( \rho _ { t } ( \boldsymbol { \theta } ) A _ { t } , c l i p ( \rho _ { t } ( \boldsymbol { \theta } ) , 1 - \epsilon , 1 + \epsilon ) A _ { t } ) ] ,
|
| 601 |
+
$$
|
| 602 |
+
|
| 603 |
+
where the likelihood ration is $\begin{array} { r } { \rho _ { t } ( \theta ) = \frac { \pi _ { \theta } \left( a _ { t } \vert x _ { t } \right) } { \pi _ { \theta _ { o l d } } \left( a _ { t } \vert x _ { t } \right) } } \end{array}$ πθ(at|xt)πθ (at|xt) , with πold being the policy parameters before the update, $\epsilon < 1$ is a hyper-parameters that controls the clipping and $A _ { t }$ is the generalized advantage estimator:
|
| 604 |
+
|
| 605 |
+
$$
|
| 606 |
+
A _ { t } ^ { G A E ( \lambda , \gamma ) } = \sum _ { k = 0 } ^ { T - 1 } ( \lambda \gamma ) ^ { k } \delta _ { t + k } ^ { V ^ { \pi } } ,
|
| 607 |
+
$$
|
| 608 |
+
|
| 609 |
+
# Algorithm 1 Synchronous n-step SARSA
|
| 610 |
+
|
| 611 |
+
Input: $\theta$ parameters for $Q ( x , . ; \theta ) , \theta _ { \mathcal { D } }$ parameters for $Q _ { \mathcal { D } } ( x , . ; \theta _ { \mathcal { D } } ) , \phi _ { \mathcal { D } }$ parameters for $ _ { } ( x ; \phi _ { \mathcal { D } } )$ $\pi _ { 0 }$ initial feasible policy.
|
| 612 |
+
|
| 613 |
+
for episode $e \in { 1 , . . . , M }$ do
|
| 614 |
+
|
| 615 |
+
Add the initial state to the trajectory buffer $\tau \{ x _ { 0 } \}$
|
| 616 |
+
$t \gets 1$
|
| 617 |
+
while $t < T$ do: $t _ { s t a r t } \gets t$ while $t < t + n$ or $t = = T$ do Select $a _ { t }$ using (SPI), execute $a _ { t }$ , observe $x _ { t + 1 }$ and reward $r _ { t }$ and cost $d _ { t }$ . Add experiences to a buffer, i.e., $\tau \gets ( a _ { t } , r _ { t } , d _ { t } , x _ { t + 1 } )$ . $t \gets t + 1$
|
| 618 |
+
|
| 619 |
+
# end while
|
| 620 |
+
|
| 621 |
+
Calculate the next action for $x _ { t + 1 }$ using the current policy estimates, $a _ { t + 1 }$ Bootstrap the targets:
|
| 622 |
+
|
| 623 |
+
$$
|
| 624 |
+
\begin{array} { r l } & { R \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = T } \\ { Q ( x _ { t + 1 } , a _ { t + 1 } ; \theta ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ & { R _ { \mathcal { D } } \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = T } \\ { Q _ { \mathcal { D } } ( x _ { t + 1 } , a _ { t + 1 } ; \theta _ { \mathcal { D } } ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ & { \overleftarrow { R } _ { \mathcal { D } } \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = 0 } \\ { \overleftarrow { V } ( x _ { t _ { s t a r t - 1 } ; \phi _ { \mathcal { D } } } ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 625 |
+
$$
|
| 626 |
+
|
| 627 |
+
$\triangleright$ Calculate the targets for the transitions in buffer for $i \in \{ t - 1 , \ldots , t _ { s t a r t } \}$ do $R r _ { i } + \gamma R$ $R _ { \mathcal { D } } d _ { i } + \gamma R _ { \mathcal { D } }$ Accumulate the gradients wrt $\theta , \theta _ { \mathcal { D } }$ :
|
| 628 |
+
|
| 629 |
+
$$
|
| 630 |
+
\begin{array} { c } { { d \theta d \theta + \frac { \partial ( R - Q ( x _ { i } , a _ { i } ; \theta ) ) ^ { 2 } } { \partial \theta } } } \\ { { d \theta _ { \mathcal { D } } d \theta _ { \mathcal { D } } + \frac { \partial ( R _ { \mathcal { D } } - Q _ { \mathcal { D } } ( x _ { i } , a _ { i } ; \theta _ { \mathcal { D } } ) ) ^ { 2 } } { \partial \theta _ { \mathcal { D } } } } } \end{array}
|
| 631 |
+
$$
|
| 632 |
+
|
| 633 |
+
end for
|
| 634 |
+
|
| 635 |
+
for $i \in \{ t _ { s t a r t } , . . . , t \}$ do $\mathbf { \overleftarrow { R } } _ { \mathcal { D } } \gets d _ { i } + \gamma \mathbf { \overleftarrow { R } } _ { \mathcal { D } }$ Accumulate the gradients wrt $\phi _ { \mathcal { D } }$ :
|
| 636 |
+
|
| 637 |
+
$$
|
| 638 |
+
d \phi _ { \mathcal { D } } \gets d \phi _ { \mathcal { D } } + \frac { \partial ( \overleftarrow { R } _ { \mathcal { D } } - \overleftarrow { V } _ { \mathcal { D } } ( x _ { i } ; \phi _ { \mathcal { D } } ) ) ^ { 2 } } { \partial \phi _ { \mathcal { D } } }
|
| 639 |
+
$$
|
| 640 |
+
|
| 641 |
+
# end for
|
| 642 |
+
|
| 643 |
+
Do synchronous batch update with the accumulated gradients to update $\theta , \theta _ { \mathcal { D } } , \phi _ { \mathcal { D } }$ using $d \theta , d \theta _ { \mathcal { D } } , d \phi _ { \mathcal { D } }$ .
|
| 644 |
+
|
| 645 |
+
# end while
|
| 646 |
+
|
| 647 |
+
Empty the trajectory buffer, $\tau$
|
| 648 |
+
|
| 649 |
+
end for
|
| 650 |
+
|
| 651 |
+
# Algorithm 2 Synchronous A2C with Safety Layer
|
| 652 |
+
|
| 653 |
+
Input: $\theta$ parameters for $\pi ( x ; \theta )$ , $\phi$ the parameters for $V ( x ; \phi )$ , $\theta _ { \mathcal { D } }$ parameters for $Q _ { \mathcal { D } } ( x , \mu ; \theta _ { \mathcal { D } } )$ ,
|
| 654 |
+
$\phi _ { \mathcal { D } }$ parameters for $ _ { \overline { { \cal V } } _ { \mathcal { D } } ( x ; \phi _ { \mathcal { D } } ) }$ ;
|
| 655 |
+
for episode $e \in { 1 , . . . , M }$ do Add the initial state to the trajectory buffer $\tau \{ x _ { 0 } \}$ $t \gets 1$ while $t < T$ do: $t _ { s t a r t } \gets t$ while $t < t + n$ or $t = = T$ do Select $a _ { t }$ using sampling from the projected mean $\mu _ { t }$ via the safety layer Eq.(5), execute
|
| 656 |
+
$a _ { t }$ , observe $x _ { t + 1 }$ and reward $r _ { t }$ and cost $d _ { t }$ . Add experiences to a buffer, i.e., $\tau \gets ( a _ { t } , \mu _ { t } , r _ { t } , d _ { t } , x _ { t + 1 } )$ . $t \gets t + 1$
|
| 657 |
+
|
| 658 |
+
# end while
|
| 659 |
+
|
| 660 |
+
Calculate the next mean for xt+1 using the current policy estimates, µt+1 Bootstrap the targets:
|
| 661 |
+
|
| 662 |
+
$$
|
| 663 |
+
\begin{array} { r l } & { R \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = T } \\ { V ( x _ { t + 1 } , a _ { t + 1 } ; \phi ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ & { R _ { \mathcal { D } } \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = T } \\ { Q _ { \mathcal { D } } ( x _ { t + 1 } , \mu _ { t + 1 } ; \theta _ { \mathcal { D } } ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \\ & { \overleftarrow { R } _ { \mathcal { D } } \gets \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } t = = 0 } \\ { \overleftarrow { V } ( x _ { t _ { s t a r t - 1 } ; \phi _ { \mathcal { D } } } ) } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
|
| 664 |
+
$$
|
| 665 |
+
|
| 666 |
+
$\triangleright$ Calculate the targets for the transitions in buffer
|
| 667 |
+
|
| 668 |
+
for $i \in \{ t - 1 , \ldots , t _ { s t a r t } \}$ do $R \gets r _ { i } + \gamma R$ $R _ { \mathcal { D } } d _ { i } + \gamma R _ { \mathcal { D } }$
|
| 669 |
+
|
| 670 |
+
Accumulate the gradients w.r.t. $\theta , \phi , \theta _ { \mathcal { D } }$ :
|
| 671 |
+
|
| 672 |
+
$$
|
| 673 |
+
\begin{array} { r l } & { \quad d \theta d \theta + \nabla _ { \theta } \log \pi ( a _ { i } \mid x _ { i } ; \theta ) ( R - V ( x _ { i } ; \phi ) ) } \\ & { \quad d \phi d \phi + \frac { \partial ( R - V ( x _ { i } \phi ) ) ^ { 2 } } { \partial \phi } } \\ & { \quad d \theta _ { \mathcal { D } } d \theta _ { \mathcal { D } } + \frac { \partial ( R _ { \mathcal { D } } - Q _ { \mathcal { D } } ( x _ { i } , \mu _ { i } ; \theta _ { \mathcal { D } } ) ) ^ { 2 } } { \partial \theta _ { \mathcal { D } } } } \end{array}
|
| 674 |
+
$$
|
| 675 |
+
|
| 676 |
+
end for
|
| 677 |
+
|
| 678 |
+
for $i \in \{ t _ { s t a r t } , . . . , t \}$ do $\mathbf { \overleftarrow { R } } _ { \mathcal { D } } \gets d _ { i } + \gamma \mathbf { \overleftarrow { R } } _ { \mathcal { D } }$ Accumulate the gradients wrt $\phi _ { \mathcal { D } }$ :
|
| 679 |
+
|
| 680 |
+
$$
|
| 681 |
+
d \phi _ { \mathcal { D } } \gets d \phi _ { \mathcal { D } } + \frac { \partial ( \overleftarrow { R } _ { \mathcal { D } } - \overleftarrow { V } _ { \mathcal { D } } ( x _ { i } ; \phi _ { \mathcal { D } } ) ) ^ { 2 } } { \partial \phi _ { \mathcal { D } } }
|
| 682 |
+
$$
|
| 683 |
+
|
| 684 |
+
# end for
|
| 685 |
+
|
| 686 |
+
Do synchronous batch update with the accumulated gradients to update $\theta , \phi , \theta _ { \mathcal { D } } , \phi _ { \mathcal { D } }$ using $d \theta , d \phi , d \theta _ { \mathcal { D } } , d \phi _ { \mathcal { D } }$ .
|
| 687 |
+
|
| 688 |
+
# end while
|
| 689 |
+
|
| 690 |
+
Empty the trajectory buffer, $\tau$
|
| 691 |
+
|
| 692 |
+
# end for
|
| 693 |
+
|
| 694 |
+
where $T$ is the maxmimum number of timestamps in an episode trajectory, and $\delta _ { j }$ denotes the TD error at $j$ . The value function is updated using the $\gamma \lambda$ -returns from the GAE:
|
| 695 |
+
|
| 696 |
+
$$
|
| 697 |
+
L ( \phi ) = \mathbb { E } [ ( V ^ { \pi } ( x ; \phi ) - ( V ^ { \pi } ( x ; \phi _ { o l d } ) + A _ { t } ) ) ^ { 2 } ] .
|
| 698 |
+
$$
|
| 699 |
+
|
| 700 |
+
Similar to the the forward value estimates the backward value estimates are defined in the similar sense. One way to think of it is to assume the trajectories are reversed and we are doing the regular GAE estimation for the value functions.
|
| 701 |
+
|
| 702 |
+
The GAE updates for the regular value function can be seen in the $\lambda$ -operator form as:
|
| 703 |
+
|
| 704 |
+
$$
|
| 705 |
+
\begin{array} { r } { \mathcal { T } _ { \lambda } ^ { \pi } \boldsymbol { v } ^ { \pi } = ( I - \gamma \lambda P ^ { \pi } ) ^ { - 1 } ( \boldsymbol { r } ^ { \pi } + \gamma P ^ { \pi } \boldsymbol { v } ^ { \pi } - \boldsymbol { v } ^ { \pi } ) + \boldsymbol { v } ^ { \pi } . } \end{array}
|
| 706 |
+
$$
|
| 707 |
+
|
| 708 |
+
In similar spirit it can be shown that the $\lambda$ -operator for SARSA has the form:
|
| 709 |
+
|
| 710 |
+
$$
|
| 711 |
+
\begin{array} { r } { \mathcal { T } _ { \lambda } ^ { \pi } q ^ { \pi } = ( I - \lambda \gamma P ^ { \pi } ) ^ { - 1 } ( \mathcal { T } ^ { \pi } q ^ { \pi } - q ^ { \pi } ) + q ^ { \pi } , } \end{array}
|
| 712 |
+
$$
|
| 713 |
+
|
| 714 |
+
where $( T ^ { \pi } q ^ { \pi } - q ^ { \pi } )$ denotes the TD error. Thus, the GAE estimates can be applied for the Q-functions in the similar form, i.e.
|
| 715 |
+
|
| 716 |
+
$$
|
| 717 |
+
\begin{array} { r l r } { { B _ { t } ^ { G A E ( \lambda , \gamma ) } = \sum _ { k = 0 } ^ { T - 1 } ( \lambda \gamma ) ^ { k } \delta _ { t + k } ^ { Q _ { D } ^ { \pi } } , } } \\ & { } & { L ( \theta _ { \mathcal { D } } ) = \mathbb { E } [ ( Q _ { \mathcal { D } } ^ { \pi } ( x , a ; \theta _ { \mathcal { D } } ) - ( Q _ { \mathcal { D } } ^ { \theta _ { \mathcal { D } } } ( x , a ; \theta _ { \mathcal { D } _ { o l d } } ) + B _ { t } ) ) ^ { 2 } ] . } \end{array}
|
| 718 |
+
$$
|
md/train/S1x1IkHtPr/S1x1IkHtPr.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A GENERATIVE MODEL FOR MOLECULAR DISTANCE GEOMETRY
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Computing equilibrium states for many-body systems, such as molecules, is a long-standing challenge. In the absence of methods for generating statistically independent samples, great computational effort is invested in simulating these systems using, for example, Markov chain Monte Carlo. We present a probabilistic model that generates such samples for molecules from their graph representations. Our model learns a low-dimensional manifold that preserves the geometry of local atomic neighborhoods through a principled learning representation that is based on Euclidean distance geometry. In a new benchmark for molecular conformation generation, we show experimentally that our generative model achieves state-ofthe-art accuracy. Finally, we show how to use our model as a proposal distribution in an importance sampling scheme to compute molecular properties.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Over the last few years, many highly-effective deep learning methods generating small molecules with desired properties (e.g., novel drugs) have emerged (Gomez-Bombarelli et al., 2018; Segler ´ et al., 2018; Dai et al., 2018; Jin et al., 2018; Bradshaw et al., 2019a; Liu et al., 2018; You et al., 2018; Bradshaw et al., 2019b). These methods operate using graph representations of molecules in which nodes and edges represent atoms and bonds, respectively. A representation that is closer to the physical system is one in which a molecule is described by its geometry or conformation. A conformation $\mathbf { x }$ of a molecule is defined by a set of atoms $\{ ( \boldsymbol { \epsilon } _ { i } , \mathbf { r } _ { i } ) \bar \} _ { i = 1 } ^ { N _ { v } }$ , where $N _ { v }$ is the number of atoms in the molecule, $\epsilon _ { i } \in \{ \mathrm { H } , \mathrm { C } , \mathrm { O } , \dots \}$ is the chemical element of the atom $i$ , and $\mathbf { r } _ { i } \in \mathbb { R } ^ { 3 }$ is its position in Cartesian coordinates. Importantly, the relative positions of the atoms are restricted by the bonds in the molecule and the angles between them. Due to thermal fluctuations resulting in stretching of and rotations around bonds, there exist infinitely many conformations of a molecule. A molecule’s graph representation and a set of its conformations are shown in Fig. 1. Under a wide range of conditions, the probability $p ( \mathbf { x } )$ of a conformation $\mathbf { x }$ , is governed by the Boltzmann distribution and is proportional to $\exp \{ - E ( \mathbf { x } ) / k _ { B } T \}$ , where $E ( \mathbf { x } ) \in \mathbb { R }$ is the conformation’s energy, $k _ { B }$ is the Boltzmann constant, and $T$ is the temperature.
|
| 12 |
+
|
| 13 |
+
To compute a molecular property for a molecule, one must sample from $p ( \mathbf { x } )$ . The main approach is to start with one conformation and make small changes to it over time, e.g., by using Markov chain Monte Carlo (MCMC) or molecular dynamics (MD). These methods can be used to accurately sample equilibrium states of molecules, but they become computationally expensive for larger ones (Shim & MacKerell, 2011; Ballard et al., 2015; De Vivo et al., 2016). Other heuristic approaches exist in which distances between atoms are set to fixed idealized values (Havel, 2002; Blaney & Dixon, 2007). Several methods based on statistical learning have also recently been developed to tackle the issue of conformation generation. However, they are mainly geared towards studying proteins and their folding dynamics (AlQuraishi, 2019). Some of these models are not targeting a distribution over conformations but the most stable folded configuration (Evans et al., 2018; Ingraham et al., 2019), while others are not transferable between different molecules (Lemke & Peter, 2019; Noe´ et al., 2019).
|
| 14 |
+
|
| 15 |
+
This work includes the following key contributions:
|
| 16 |
+
|
| 17 |
+
• We introduce a novel probabilistic model for learning conformational distributions of molecules with graph neural networks.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Standard graph representation of a molecule (left) with a set of possible conformations $\{ { \bf { x } } _ { i } \}$ (right). Hydrogen (H), carbon (C), and oxygen (O) atoms are colored white, gray, and red, respectively. Conformations feature the same atom types and bonds but the atoms are arranged differently in space. These differences arise from rotations around and stretching of bonds in the molecule.
|
| 21 |
+
|
| 22 |
+
• We create a new, challenging benchmark for conformation generation, which is made publicly available. To the best of our knowledge, this is the first benchmark of this kind.
|
| 23 |
+
• By combining a conditional variational autoencoder (CVAE) with an Euclidean distance geometry (EDG) algorithm we present a state-of-the-art approach for generating one-shot samples of molecular conformations for unseen molecules that is independent of their size and shape.
|
| 24 |
+
• We develop a rigorous experimental approach for evaluating and comparing the accuracy of conformation generation methods based on the mean maximum deviation distance metric.
|
| 25 |
+
• We show how this generative model can be used as a proposal distribution in an importance sampling (IS) scheme to estimate molecular properties.
|
| 26 |
+
|
| 27 |
+
# 2 METHOD
|
| 28 |
+
|
| 29 |
+
Our goal is to build a statistical model that generates molecular conformations in a one-shot fashion from a molecule’s graph representation. First, we describe how a molecule’s conformation can be represented by a set of pairwise distances between atoms and why this presentation is advantageous over one in Cartesian coordinates (Section 2.1). Second, we present a generative model in Section 2.2 that will generate sets of atomic distances for a given molecular graph. Third, we explain in Section 2.3 how a set of predicted distances can be transformed into a molecular conformation and why this transformation is necessary. Finally, we detail in Section 2.4 how our generative model can be used as a proposal distribution in an IS scheme to estimate molecular properties.
|
| 30 |
+
|
| 31 |
+
# 2.1 EXTENDED MOLECULAR GRAPHS AND DISTANCE GEOMETRY
|
| 32 |
+
|
| 33 |
+
In this study, a molecule is represented by an undirected graph which is defined as a tuple $\mathcal { G } =$ $( V , E )$ . $V \stackrel { \cdot } { = } \{ v _ { i } \} _ { i = 1 } ^ { N _ { v } }$ is the set of nodes representing atoms, where each $v _ { i } \in \mathbb { R } ^ { F _ { v } }$ holds atomic attributes (e.g., the element type $\epsilon _ { i }$ ). $E = \{ ( e _ { k } , r _ { k } , s _ { k } ) \} _ { k = 1 } ^ { N _ { e } }$ is the set of edges, where each $e _ { k } \in \mathbb { R } ^ { F _ { e } }$ holds an edge’s attributes (e.g., the bond type), and $r _ { k }$ and $s _ { k }$ are the nodes an edge is connecting. Here, $E$ represents the molecular bonds (and the auxiliary edges which are explained below) in the molecule.
|
| 34 |
+
|
| 35 |
+
We assume that, givof atomic distances r graph , where $\mathcal { G }$ ent one of its conformations is the Euclidean distance b $\mathbf { x }$ by a setween the $\mathbf { d } = \{ d _ { k } \} _ { k = 1 } ^ { N _ { e } }$ $d _ { k } = | \mathbf { r } _ { r _ { k } } - \mathbf { r } _ { s _ { k } } |$
|
| 36 |
+
$r _ { k }$ $s _ { k }$
|
| 37 |
+
$( E _ { \mathrm { b o n d } } )$ alone would not suffice to describe a conformation, we expand the traditional graph representation of a molecule by adding auxiliary edges. Auxiliary edges between atoms that are second neighbors in the original graph fix angles between atoms, and those between third neighbors fix dihedral angles (denoted $E _ { \mathrm { a n g l e } }$ and $E _ { \mathrm { d i h e d r a l } }$ , respectively). In this work, $E _ { \mathrm { a n g l e } }$ consists of edges between all second neighbors in the original graph. Edges between third neighbors are added according to a heuristic (see Appendix A.1). From now on we are always referring to this extended molecular graph when talking about molecular graphs. In Fig. 2, the process of extending the molecular graph and the extraction of $\mathbf { d }$ from $\mathbf { x }$ and $\mathcal { G }$ are illustrated.
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 2: A) The structural formula of a molecule is converted to an extended molecular graph $\mathcal { G }$ consisting of nodes representing atoms (circles, e.g., $v _ { 1 }$ ) and edges representing molecular bonds (solid lines, e.g., $e _ { 1 } \in E _ { \mathrm { b o n d } } )$ ) and auxiliary edges (dotted lines, e.g., $e _ { 2 } \in E _ { \mathrm { a n g l e } }$ and $e _ { 3 } \in E _ { \mathrm { d i h e d r a l } } )$ . B) The distances $\mathbf { d }$ are extracted from a conformation $\mathbf { x }$ based on the edges $E$ . C) Graphical model of the variational autoencoder: generative model $p _ { \theta } ( \mathbf { d } | \mathbf { z } , \mathcal { G } ) p _ { \theta } ( \mathbf { z } | \mathcal { G } )$ (solid lines) and variational approximation $q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } )$ (dashed lines).
|
| 41 |
+
|
| 42 |
+
A key advantage of a representation in terms of distances is its invariance to rotation and translation; by contrast, Cartesian coordinates depend on the (arbitrary) choice of origin, for example. In addition, it reflects pair-wise physical interactions and their generally local nature. Auxiliary edges can be placed between higher-order neighbors depending on how far the physical interactions dominating the potential energy of the system reach.
|
| 43 |
+
|
| 44 |
+
samples We have a set of $\{ \mathbf { x } _ { l , j } \} _ { j = 1 } ^ { S _ { l } }$ $N _ { \mathcal { G } }$ l=1from the ground-truth distribution resulting in molecular graphs $\{ \mathcal { G } _ { l } \} _ { l = 1 } ^ { N _ { g } }$ . Further, for each $S _ { l }$ $\mathcal { G } _ { l }$ , we have sets of distances $S _ { l }$ conformational $\{ \mathbf { d } _ { l , j } \} _ { j = 1 } ^ { S _ { l } }$ With this data, we will train a generative model which we detail in the following section.
|
| 45 |
+
|
| 46 |
+
# 2.2 GENERATIVE MODEL
|
| 47 |
+
|
| 48 |
+
We employ a CVAE (Kingma & Welling, 2014; Pagnoni et al., 2018) to model the distribution over distances d given a molecular graph $\mathcal { G }$ . A CVAE first encodes $\mathcal { G }$ together with d into a latent space $\mathbf { z } ~ \in ~ \mathbb { R } ^ { k N _ { v } }$ , where $k \in \mathbb { N } ^ { + }$ , with an encoder $q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } )$ . Subsequently, the decoder $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ decodes $\mathbf { z }$ back into a set of distances. A graphical model is shown in Fig. 2 C).
|
| 49 |
+
|
| 50 |
+
A conformation has, in general, $3 N _ { v } - 6$ spatial degrees of freedom (dofs): one dof per spacial dimension per atom minus three translational and three rotational dofs. Therefore, the latent space should be proportional to the number of atoms in the molecule. In addition, the latent space should be smaller than $3 N _ { v }$ as it is the role of the encoder to project the conformation into a lower-dimensional space. As a result, we set $k = 1$ to avoid overfitting.
|
| 51 |
+
|
| 52 |
+
Here, $q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } )$ and $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ are Gaussian distributions, the mean and variance of which are modeled by two artificial neural networks. At the center of this model are message-passing neural networks (MPNNs) (Gilmer et al., 2017) with multi-head attention (Velickovi ˇ c et al., 2018). In short, ´ an MPNN is a convolutional neural network that allows end-to-end learning of prediction pipelines whose inputs are graphs of arbitrary size and shape. In a convolution, neighboring nodes exchange so-called messages between neighbors to update their attributes. Edges update their attributes with the features of the nodes they are connecting. The MPNN is a well-studied technique that achieves state-of-the-art performance in representation learning for molecules (Kipf & Welling, 2017; Duvenaud et al., 2015; Kearnes et al., 2016; Schutt et al., 2017b; Gilmer et al., 2017; Kusner et al., 2017; ¨ Bradshaw et al., 2019a).
|
| 53 |
+
|
| 54 |
+
In the following, we describe the details of the model.2 In Fig. 3, an illustration of the model is shown. In the encoder $q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } )$ , each $d _ { k }$ is concatenated with the respective edge feature $e _ { k }$ to give $e _ { k } ^ { \prime } \in \mathbb { R } ^ { F _ { e } + 1 }$ . Then, each $v _ { i }$ and each $\boldsymbol { e } _ { k } ^ { \prime }$ are passed to $F _ { \mathrm { e n c , } v }$ and $F _ { \mathrm { e n c } , e }$ (two multilayer perceptrons,
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 3: The molecular graph $\mathcal { G }$ together with the distances $\mathbf { d }$ are passed through the model consisting of an encoder $q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } )$ and a decoder $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ . See the main text for details.
|
| 58 |
+
|
| 59 |
+
MLPs), respectively, to give $\mathcal { G } _ { \mathrm { e n c } } ^ { ( 0 ) }$ , where $\mathcal { G } _ { \mathrm { e n c } } ^ { ( t ) } = ( \{ v _ { i , \mathrm { e n c } } ^ { ( t ) } \} _ { i = 1 } ^ { N _ { v } } , \{ ( e _ { k , \mathrm { e n c } } ^ { ( t ) } , r _ { k } , s _ { k } ) \} _ { k = 1 } ^ { N _ { e } } ) , v _ { i } ^ { ( }$ $v _ { i , \mathrm { e n c } } ^ { ( t ) } \in \mathbb { R } ^ { L _ { v } }$ and $e _ { k , \mathrm { e n c } } ^ { ( t ) } \in \mathbb { R } ^ { L _ { \mathrm { c } } }$ . Then, $T$ MPNNs of depth 1, $\{ \mathbf { M P } _ { \mathrm { e n c } } ^ { ( t ) } \} _ { t = 1 } ^ { T }$ , are consecutively applied to obtain $\mathcal { G } _ { \mathrm { e n c } } ^ { ( T ) }$ . Finally, the read-out function $R _ { \mathrm { e n c } }$ (an MLP) takes each $v _ { \mathrm { i , e n c } } ^ { ( T ) }$ to predict the mean $\mu _ { z _ { i } } \in \mathbb { R }$ and the variance $\sigma _ { z _ { i } } ^ { 2 } \in \mathbb { R }$ of the Gaussian distribution for $z _ { i }$ . The so-called reparametrization trick is employed to draw a sample for $z _ { i }$ . In summary,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r l } { v _ { i , \mathrm { e n c } } ^ { ( 0 ) } = F _ { \mathrm { e n c } , v } ( v _ { i } ) , } & { e _ { k , \mathrm { e n c } } ^ { ( 0 ) } = F _ { \mathrm { e n c } , e } ( e _ { i } ^ { \prime } ) , } \\ { \mathcal { G } _ { \mathrm { e n c } } ^ { ( 1 ) } = \mathsf { M P } _ { \mathrm { e n c } } ^ { ( 0 ) } ( \mathcal { G } _ { \mathrm { e n c } } ^ { ( 0 ) } ) , } & { \mathcal { G } _ { \mathrm { e n c } } ^ { ( t + 1 ) } = \mathsf { M P } _ { \mathrm { e n c } } ^ { ( t ) } ( \mathcal { G } _ { \mathrm { e n c } } ^ { ( t ) } ) , \quad \mathcal { G } _ { \mathrm { e n c } } ^ { ( T ) } = \mathsf { M P } _ { \mathrm { e n c } } ^ { ( T - 1 ) } ( \mathcal { G } _ { \mathrm { e n c } } ^ { ( T - 1 ) } ) , } \\ { \mu _ { z _ { i } } , \sigma _ { z _ { i } } ^ { 2 } = R _ { \mathrm { e n c } } ( v _ { i , \mathrm { e n c } } ^ { ( T ) } ) . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
decode. Each $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ ach are $z _ { i }$ is concassed to d wand respective node feature (two MLPs), respective $v _ { i }$ to give to give $v _ { i } ^ { \prime } \in$
|
| 66 |
+
where $\mathbb { R } ^ { F _ { v } + 1 }$ $\mathcal { G } _ { \mathrm { d e c } } ^ { ( t ) } = ( \{ v _ { i , \mathrm { d e c } } ^ { ( t ) } \} _ { i = 1 } ^ { N _ { v } } , \{ ( e _ { k , \mathrm { d e c } } ^ { ( t ) } , r _ { k } , s _ { k } ) \} _ { k = 1 } ^ { N _ { e } } )$ $\boldsymbol { v } _ { i } ^ { \prime }$ $e _ { k }$ $F _ { \mathrm { d e c } , v }$ , $v _ { i , \mathrm { d e c } } ^ { ( t ) } \in \mathbb { R } ^ { L _ { v } }$ $F _ { \mathrm { d e c } , e }$ , and $e _ { k , \mathrm { d e c } } ^ { ( t ) } \in \mathbb { R } ^ { L _ { \mathrm { e } } }$ . Then, dec MPNNs
|
| 67 |
+
of depth 1, {MP(t)dec}Tt= , are consecutively applied to obtain $\mathcal { G } _ { \mathrm { d e c } } ^ { ( T ) }$ . Finally, the read-out function
|
| 68 |
+
(an MLP) takes ch $e _ { \mathbf { k } , \mathrm { d e c } } ^ { ( T ) }$ to predict the mean $\mu _ { d _ { k } } \in \mathbb { R }$ dec and the variance $\sigma _ { d _ { k } } ^ { 2 } \in \mathbb { R }$ decof the Gaussian $d _ { k }$ . In summary,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\begin{array} { r l } & { v _ { i , \mathrm { d e c } } ^ { ( 0 ) } = F _ { \mathrm { d e c } , v } ( v _ { i } ^ { \prime } ) , \quad e _ { k , \mathrm { d e c } } ^ { ( 0 ) } = F _ { \mathrm { d e c } , e } ( e _ { i } ) , } \\ & { \mathcal { G } _ { \mathrm { d e c } } ^ { ( 1 ) } = \mathbf { M } \mathbf { P } _ { \mathrm { d e c } } ^ { ( 0 ) } ( \mathcal { G } _ { \mathrm { d e c } } ^ { ( 0 ) } ) , \quad \mathcal { G } _ { \mathrm { d e c } } ^ { ( t + 1 ) } = \mathbf { M } \mathbf { P } _ { \mathrm { d e c } } ^ { ( t ) } ( \mathcal { G } _ { \mathrm { d e c } } ^ { ( t ) } ) , \quad \mathcal { G } _ { \mathrm { d e c } } ^ { ( T ) } = \mathbf { M } \mathbf { P } _ { \mathrm { d e c } } ^ { ( T - 1 ) } ( \mathcal { G } _ { \mathrm { d e c } } ^ { ( T - 1 ) } ) , } \\ & { \qquad \mu _ { d _ { k } } , \sigma _ { d _ { k } } ^ { 2 } = R _ { \mathrm { d e c } } ( e _ { k , \mathrm { d e c } } ^ { ( T ) } ) . } \end{array}
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
The sets of parameters in the encoder and decoder, $\phi$ and $\theta$ (i.e., parameters in $F _ { \mathrm { e n c } , v } , \ F _ { \mathrm { e n c } , e }$ , $\{ \mathbf { M P } _ { \mathrm { e n c } } ^ { ( t ) } \} _ { t = 1 } ^ { T }$ , $R _ { \mathrm { e n c } }$ , $F _ { \mathrm { d e c } , v }$ , $F _ { \mathrm { d e c } , e }$ , $\{ \mathbf { M P } _ { \mathrm { d e c } } ^ { ( t ) } \} _ { t = 1 } ^ { T } , R _ { \mathrm { d e c } } )$ , respectively, are optimized by maximizing the evidence lower bound (ELBO):
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
L = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } ) } [ \log p _ { \theta } ( \mathbf { d } | \mathbf { z } , \mathcal { G } ) ] - D _ { \mathrm { K L } } [ q _ { \phi } ( \mathbf { z } | \mathbf { d } , \mathcal { G } ) | | p _ { \theta } ( \mathbf { z } | \mathcal { G } ) ] ,
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where the prior $p _ { \boldsymbol { \theta } } ( \mathbf { z } | \mathcal { G } )$ consists of factorized Gaussians. The optimal values for the hyperparameters for the network dimensions, number of message passes, batch size, and learning rate of the Adam optimizer (Kingma & Ba, 2014) were tuned by maximizing the validation performance (ELBO) with a Bayesian optimizer and are reported in Appendix A.1.3.
|
| 81 |
+
|
| 82 |
+
# 2.3 CONFORMATION GENERATION THROUGH EUCLIDEAN DISTANCE GEOMETRY
|
| 83 |
+
|
| 84 |
+
To compute molecular properties, quantum-chemical methods need to be employed which require the input, i.e., the molecule, to be in Cartesian coordinates.3 Therefore, we use an EDG algorithm to translate the set of distances $\{ d _ { k } \} _ { k = 1 } ^ { N _ { e } }$ to a set of atomic coordinates $\{ \mathbf { r } _ { i } \} _ { i = 1 } ^ { N _ { v } }$ . 4
|
| 85 |
+
|
| 86 |
+
EDG is the mathematical basis for a geometric theory of molecular conformation. In the field of machine learning, Weinberger & Saul (2006) used it for learning image manifolds, Tenenbaum et al. (2000) for image understanding and handwriting recognition, Jain & Saul (2004) for speech and music, and Demaine et al. (2009) for music and musical rhythms. An EDG description of a molecular system consists of a list of lower and upper bounds on the distances between pairs of atoms $\{ ( d _ { k , \operatorname* { m i n } } , d _ { k , \operatorname* { m a x } } ) \} _ { k = 1 } ^ { N _ { e } }$ . Here, $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ is used to model these bounds, namely, we set the bounds to $\{ ( \mu _ { d _ { k } } - \sigma _ { d _ { k } } , \mu _ { d _ { k } } + \sigma _ { d _ { k } } ) \}$ , where $\mu _ { d _ { k } }$ and $\sigma _ { d _ { k } }$ are the mean and standard deviation for each distance $d _ { k }$ given by the CVAE. Then, an EDG algorithm determines a set of Cartesian coordinates $\{ \mathbf { r } _ { i } \} _ { i = 1 } ^ { N _ { v } }$ so that these bounds are fulfilled (see Appendix A.2 for details).5 Together with the corresponding chemical elements $\{ \epsilon _ { i } \} _ { i = 1 } ^ { N _ { v } }$ , we obtain a conformation $\mathbf { x }$ .
|
| 87 |
+
|
| 88 |
+
# 2.4 CALCULATION OF MOLECULAR PROPERTIES
|
| 89 |
+
|
| 90 |
+
We can get an MC estimate of the expectation $\mathbb { E } _ { \mathcal { G } } [ \mathcal { O } ]$ of a property $\mathcal { O }$ (e.g., the dipole moment) for a molecule represented by $\mathcal { G }$ by drawing conformational samples $\mathbf { x } _ { i } \sim p ( \mathbf { x } | \mathcal { G } )$ and computing $\mathcal { O } ( \mathbf { x } _ { i } ) \in \mathbb { R }$ with a quantum-chemical method (e.g., density functional theory). Since we cannot draw samples from $p ( \mathbf { x } | \mathcal { G } )$ directly, we employ an IS integration scheme (Bishop, 2009) with our CVAE as the proposal distribution. We assume that we can readily evaluate the unnormalized probability of a conformation $\tilde { p } ( \mathbf { x } | \mathcal { G } ) = \exp \{ - E ( \mathbf { x } ) / k _ { B } T \}$ , where $\mathbf { x }$ must be a conformation of the molecule and the energy $E ( \mathbf { x } )$ is determined with a quantum-chemical method. Since the EDG algorithm is mapping the distribution $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } , \mathcal { G } )$ to a point mass in $ { \mathbb { R } } ^ { 3 N _ { v } }$ , the MC estimate for the resulting distribution $p _ { \mathrm { p r o p } } ( \mathbf { x } | \mathcal { G } )$ is given by a mixture of delta functions, each of which is centered at the $\mathbf { x } _ { i }$ resulting from mapping $p _ { \boldsymbol { \theta } } ( \mathbf { d } | \mathbf { z } _ { i } , \mathcal { G } )$ to $\mathbb { R } ^ { 3 N _ { v } }$ , where $\mathbf { z } _ { i } \sim p _ { \theta } ( \mathbf { z } | \mathcal { G } )$ , that is, $\begin{array} { r } { p _ { \mathrm { p r o p } } ( \mathbf { x } | \mathcal { G } ) \approx \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \delta ( \mathbf { x } - \mathbf { x } _ { i } ) } \end{array}$ . The IS estimator for the expectation of $\mathcal { O }$ w. r. t. $\tilde { p } ( \mathbf { x } | \mathcal { G } )$ then reads
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\hat { \mathbb { E } } _ { \mathcal { G } } [ \mathcal { O } ] \overset { \mathrm { M C } } { \approx } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { O } ( \mathbf { x } _ { i } ) \overset { \mathrm { I S } } { = } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \mathcal { O } ( \mathbf { x } _ { i } ^ { \prime } ) \frac { \tilde { p } ( \mathbf { x } _ { i } ^ { \prime } | \mathcal { G } ) } { p _ { \mathrm { p r o p } } ( \mathbf { x } _ { i } ^ { \prime } | \mathcal { G } ) } ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $\mathbf { x } _ { i } \sim \tilde { p } ( \mathbf { x } _ { i } | \mathcal { G } )$ and $\mathbf { x } _ { i } ^ { \prime } \sim p _ { \mathrm { p r o p } } ( \mathbf { x } _ { i } ^ { \prime } | \mathcal { G } )$ , so that the expectation of $\mathcal { O }$ w. r. t. the normalized version of $\tilde { p } ( { \bf x } )$ is then
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\mathbb { E } _ { \mathcal { G } } [ \mathcal { O } ] = \frac { \hat { \mathbb { E } } _ { \mathcal { G } } [ \mathcal { O } ] } { \hat { \mathbb { E } } _ { \mathcal { G } } [ 1 ] } \approx \frac { 1 } { Z } \sum _ { i = 1 } ^ { N } \mathcal { O } ( \mathbf { x } _ { i } ) \tilde { p } ( \mathbf { x } _ { i } ^ { \prime } | \mathcal { G } ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where have a $\begin{array} { r } { Z \approx \sum _ { i = 1 } ^ { N } \tilde { p } ( \mathbf { x } _ { i } ^ { \prime } ) } \end{array}$ and ake s $N$ is the number of samples. When dividing two delta functions wee arbitrarily large finite value.
|
| 103 |
+
|
| 104 |
+
# 3 RELATED WORKS
|
| 105 |
+
|
| 106 |
+
The standard approach for generating molecular conformations is to start with one, and make small changes to it over time, e.g., by using MCMC or MD. These methods are considered the gold standard for sampling equilibrium states, but they are computationally expensive, especially if the molecule is large and the Hamiltonian is based on quantum-mechanical principles (Shim & MacKerell, 2011; Ballard et al., 2015; De Vivo et al., 2016).
|
| 107 |
+
|
| 108 |
+
A much faster but more approximate approach for conformation generation is EDG (Havel, 2002; Blaney & Dixon, 2007; Lagorce et al., 2009; Riniker & Landrum, 2015). Lower and upper distance bounds for pairs of atoms in a molecule are fixed values based on ideal bond lengths, bond angles, and torsional angles. These values are often extracted from crystal structure databases (Allen, 2002). These methods aim to generate a low-energy conformation, not to generate unbiased samples from the underlying distribution at a certain temperature.
|
| 109 |
+
|
| 110 |
+
There exist several machine learning approaches as well, however, they are mostly tailored towards studying protein dynamics. For example, Noe et al. (2019) trained Boltzmann generators on the ´ energy function of proteins to provide unbiased, one-shot samples from their equilibrium states. This is achieved by training an invertible neural network to learn a coordinate transformation from a system’s configurations to a latent space representation. Further, Lemke & Peter (2019) proposed a dimensionality reduction algorithm that is based on a neural network autoencoder in combination with a nonlinear distance metric to generate samples for protein structures. Both models learn protein-specific coordinate transformations that cannot be transferred to other molecules.
|
| 111 |
+
|
| 112 |
+
AlQuraishi (2019) introduced an end-to-end differentiable recurrent geometric network for protein structure learning based on amino acid sequences. Also, Ingraham et al. (2019) proposed a neural energy simulator model for protein structure that makes use of protein sequence information. In contrast to amino acid sequences, molecular graphs are, in general, not linear but highly branched and often contain cycles. This makes them unsuitable for recurrent networks.
|
| 113 |
+
|
| 114 |
+
Finally, Mansimov et al. (2019) presented a conditional deep generative graph neural network to generate molecular conformations given a molecular graph. Their goal is to predict the most likely conformation and not a distribution over conformations. Instead of encoding molecular environments in atomic distances, they work directly in Cartesian coordinates. As a result, the generated conformations showed significant structural differences compared to the ground-truth and required refinement through a force field, which is often employed in MD simulations.
|
| 115 |
+
|
| 116 |
+
We argue that our model has several advantages over the approaches reviewed above:
|
| 117 |
+
|
| 118 |
+
• It is a fast alternative to resource-intensive approaches based on MCMC or MD.
|
| 119 |
+
• Our principled representation based on pair-wise distances does not restrict our approach to any particular molecular structure.
|
| 120 |
+
• Since our model employs message-passing neural networks, it is transferable – it can extrapolate from only a few graphs to unseen ones.
|
| 121 |
+
|
| 122 |
+
# 4 THE CONF17 BENCHMARK
|
| 123 |
+
|
| 124 |
+
The CONF17 benchmark is the first benchmark for molecular conformation sampling.6 It is based on the ISO17 dataset (Schutt et al., 2017a) which consists of conformations of various molecules ¨ with the atomic composition $\mathrm { C _ { 7 } H _ { 1 0 } O _ { 2 } }$ drawn from the QM9 dataset (Ramakrishnan et al., 2014). These conformations were generated by ab initio molecular dynamics simulations at 500 Kelvin which generates trajectories of a single molecule covering a large variety of conformations. The CONF17 benchmark consists of 127 distinct molecular graphs each with 3380 conformations on average. We split this dataset into multiple training and test splits, each consisting of 107 and 20 graphs, respectively (see Appendix A.1 for more details).7
|
| 125 |
+
|
| 126 |
+
In Fig. 4, (A), the structural formulae of a random selection of molecules from this benchmark are shown. Most molecules feature highly-strained, complex 3D structures such as rings which are typical of drug-like molecules. It is thus the structural complexity of the molecules, not their number of degrees of freedom, that makes this benchmark challenging. In Fig. 4, (B), the frequency of distances (in $\mathring \mathrm { A }$ ) in the conformations are shown for each edge type. It can be seen that the marginal distributions of the edge distances are multimodal and highly context dependent.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 4: Overview of the CONF17 benchmark. (A) Structural formulae of a random selection of molecules. (B) Distribution of distances (in $\mathrm { \AA }$ ) grouped by edge (from left to right: $E _ { \mathrm { b o n d } }$ , $E _ { \mathrm { a n g l e } }$ , and $E _ { \mathrm { d i h e d r a l } } ,$ ) and vertex type (chemical element).
|
| 130 |
+
|
| 131 |
+
# 5 EXPERIMENTS
|
| 132 |
+
|
| 133 |
+
We assess the performance of our method, named Graph Distance Geometry (GRAPHDG), by comparing it with two state-of-the-art methods for molecular conformation generation: RDKIT (Riniker & Landrum, 2015), a classical EDG approach, and DL4CHEM (Mansimov et al., 2019), a machine learning approach. We trained GRAPHDG and DL4CHEM on three different training and test splits of the CONF17 benchmark using Adam (Kingma & Ba, 2014). We generated 3000 conformations with each method for molecular graphs in a test set.
|
| 134 |
+
|
| 135 |
+
# 5.1 DISTRIBUTIONS OVER DISTANCES
|
| 136 |
+
|
| 137 |
+
We assessed the accuracy of the distance distributions of RDKIT, DL4CHEM, and GRAPHDG by calculating the maximum mean discrepancy (MMD) (Gretton et al., 2012) to the ground-truth distribution. We compute the MMD using a Gaussian kernel, where we set the standard deviation to be the median distance between distances $\mathbf { d }$ in the aggregate sample. For this, we determined the distances in the conformations from the ground-truth and those generated by RDKIT and DL4CHEM. For each train-test split and each $\mathcal { G }$ in a test set, we compute the MMD of the joint distribution of distances between C and $\mathrm { o }$ atoms (H atoms are usually ignored), the MMDs of pair-wise distances $p ( d _ { i } , d _ { j } | \mathcal { G } )$ , and the MMDs between the marginals of individual distances $p ( d _ { i } | \mathcal { G } )$ . We aggregate the results of three train-test splits, and, finally, compute the median MMDs and average rankings. The results are summarized in Table 1. It can be seen that the samples from GRAPHDG are significantly closer to the ground-truth distribution than the other methods. RDKIT is slightly worse than GRAPHDG while DL4CHEM seems to struggle with the complexity of the molecules and the small number of graphs in the training set.
|
| 138 |
+
|
| 139 |
+
In Fig. 5, we showcase the accuracy of our model by plotting the marginal distributions $p ( d _ { i } | \mathcal { G } )$ for distances between C and O atoms given a molecular graph from a test set. It can be seen that RDKIT consistently underestimates the marginal variances. This is because this method aims to predict the most stable conformation, i.e., the distribution’s mode. In contrast, DL4CHEM often fails to predict the correct mean. For this molecule, GRAPHDG is the most accurate, predicting the right mean and variance in most cases. Additional figures can be found in the Appendix A.4, where we also show plots for the marginal distributions $p ( d _ { i } , d _ { j } | \mathcal { G } )$ .
|
| 140 |
+
|
| 141 |
+
Table 1: Assessment of the accuracy of the distributions over conformations generated by three models compared to the ground-truth. We compare the distributions with respect to the marginals $p ( d _ { k } | \mathcal { G } )$ , $p ( d _ { k } , d _ { l } | \mathcal { G } )$ , and the distribution over all edges between C and $\mathrm { o }$ atoms $p ( \{ d _ { k } \} | \mathcal { G } )$ . Two different metrics are used: median MMD between ground-truth conformations and generated ones, and mean ranking (1 to 3) based on the MMD. Reported are the results for molecular graphs in a test set from three train-test splits. Standard errors are given in brackets.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan="2"></td><td colspan="3">Median MMD</td><td colspan="3">Mean Ranking</td></tr><tr><td>RDKIT</td><td>DL4CHEM</td><td>GRAPHDG</td><td>RDKIT</td><td>DL4CHEM</td><td>GRAPHDG</td></tr><tr><td>p(dk|9)</td><td>0.55 (0.01)</td><td>1.11 (0.01)</td><td>0.38 (0.02)</td><td>1.71 (0.03)</td><td>2.74 (0.02)</td><td>1.51 (0.03)</td></tr><tr><td>p(dk,di/9)</td><td>0.53 (0.01)</td><td>1.09 ( (0.01)</td><td>0.34 (0.01)</td><td>1.66 (0.02)</td><td>2.92 (0.01)</td><td>1.43 ( (0.02)</td></tr><tr><td>p({d}9)</td><td>0.60 (0.01)</td><td>1.07 (0.03)</td><td>0.44 (0.05)</td><td>1.58 (0.05)</td><td>2.90 (0.05)</td><td>1.45 (0.02)</td></tr></table>
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 5: Marginal distributions $p ( d _ { k } | \mathcal { G } )$ of ground-truth and predicted bond distances (in $\textrm { \AA }$ ) between C and O atoms given a molecular graph from the test set. The atoms connected by each edge $d _ { k }$ are indicated in each subplot $\left( \boldsymbol { s } _ { k } \mathrm { - } \boldsymbol { r } _ { k } \right)$ . In the 3D structure of the molecule, carbon and oxygen atoms are colored gray and red, respectively. $_ \mathrm { H }$ atoms are omitted for clarity.
|
| 147 |
+
|
| 148 |
+
# 5.2 GENERATION OF CONFORMATIONS
|
| 149 |
+
|
| 150 |
+
We passed the distances from our generative model to an EDG algorithm to obtain conformations. For $9 9 . 9 \%$ of the sets of distances, all triangle inequalities held. For $94 \%$ of the molecular graphs, the algorithm succeeded which is 8 pp higher than the success rate we observed for RDKIT. For each molecular graph in a test set, we generated 50 conformations with each method. This took DL4CHEM, RDKIT, and GRAPHDG on average around hundreds of milliseconds per molecule.8 In contrast, a single conformation in the ISO17 dataset takes around a minute to compute. In Fig. 6, an overlay of these conformations of six molecules generated by the different methods is shown. It can be seen that RDKIT’s conformations show too little variance, while DL4CHEM’s structures are mostly invalid, which is due in part to its failure to predict the correct interatomic angles. Our method slightly overestimates the structural variance (see, for example, Fig. 6, top row, second column), but produces conformations that are the closest to the ground-truth.
|
| 151 |
+
|
| 152 |
+
# 5.3 CALCULATION OF MOLECULAR PROPERTIES
|
| 153 |
+
|
| 154 |
+
We estimate expected molecular properties for molecular graphs from the test set with $N = 5 0$ conformational samples each. Due to their poor quality, we could not compute properties $\mathcal { O } ( \mathbf { x } )$ , including the energy $E ( \mathbf { x } )$ , for conformations generated with DL4CHEM, and thus, this method is excluded from this analysis. In Table 2, it can be seen that RDKIT and GRAPHDG perform
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 6: Overlay of 50 conformations from the ground-truth and three models based on six random molecular graphs from the test set. C, O, and H atoms are colored gray, red, and white, respectively.
|
| 158 |
+
|
| 159 |
+
Table 2: Median difference in average properties between ground-truth and RDKIT and GRAPHDG: total electronic energy $E _ { \mathrm { e l e c } }$ (in kJ/mol), the energy of the HOMO and the LUMO LUMO and LUMO, respectively (in eV), and the dipole moment $\mu$ (in debye). Reported are the results for molecular graphs from the test set, averaged over three train-test splits. Standard errors are given in brackets.
|
| 160 |
+
|
| 161 |
+
<table><tr><td></td><td>RDKIT</td><td>GRAPHDG</td></tr><tr><td>Eelec</td><td>42.7 (4.3)</td><td>58.0 (21.0)</td></tr><tr><td>€HOMO</td><td>0.08 (0.04)</td><td>0.10 (0.05)</td></tr><tr><td>ELUMO</td><td>0.15 (0.03)</td><td>0.09 (0.05)</td></tr><tr><td>从</td><td>0.29 (0.05)</td><td>0.33 (0.09)</td></tr></table>
|
| 162 |
+
|
| 163 |
+
similarly well (see Appendix A.2 for computational details). However, both methods are still highly inaccurate for $E _ { \mathrm { e l e c } }$ (in practice, an accuracy of less than $5 \ \mathrm { k J / m o l }$ is required). Close inspection of the conformations shows that, even though GRAPHDG predicts the most accurate distances overall, the variances of certain strongly constrained distances (e.g., triple bonds) are overestimated so that the energies of the conformations increase drastically.
|
| 164 |
+
|
| 165 |
+
# 6 LIMITATIONS
|
| 166 |
+
|
| 167 |
+
The first limitation of this work is that the CVAE can sample (with low probability) invalid sets of distances for which there exists no 3D structure. Second, the CONF17 benchmark covers only a small portion of chemical space. Finally, a large set of auxiliary edges would be required to capture long-range correlations (e.g., in proteins). Future work will address these points.
|
| 168 |
+
|
| 169 |
+
# 7 CONCLUSIONS
|
| 170 |
+
|
| 171 |
+
We presented GRAPHDG, a transferable, generative model that allows sampling from a distribution over molecular conformations. We developed a principled learning representation of conformations that is based on distances between atoms. Then, we proposed a challenging benchmark for comparing molecular conformation generators. With this benchmark, we show experimentally that conformations generated by GRAPHDG are closer to the ground-truth than those generated by other methods. Finally, we employ our model as a proposal distribution in an IS integration scheme to estimate molecular properties. While orbital energies and the dipole moments were predicted well, a larger and more diverse dataset will be necessary for meaningful estimates of electronic energies. Further, methods have to be devised to estimate how many conformations need to be generated to ensure all important conformations have been sampled. Finally, our model could be trained on conformational distributions at different temperatures in a transfer learning-type setting.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
F. H. Allen. The Cambridge Structural Database: A quarter of a million crystal structures and rising. Acta Crystallogr., Sect. B: Struct. Sci, 58(3):380–388, 2002. doi: 10.1107/S0108768102003890.
|
| 176 |
+
|
| 177 |
+
Mohammed AlQuraishi. End-to-End Differentiable Learning of Protein Structure. Cell Systems, 8 (4):292–301.e3, 2019. doi: 10.1016/j.cels.2019.03.006.
|
| 178 |
+
|
| 179 |
+
Andrew J. Ballard, Stefano Martiniani, Jacob D. Stevenson, Sandeep Somani, and David J. Wales. Exploiting the potential energy landscape to sample free energy. WIREs Comput. Mol. Sci., 5(3): 273–289, 2015. doi: 10.1002/wcms.1217.
|
| 180 |
+
|
| 181 |
+
Christopher M. Bishop. Pattern Recognition and Machine Learning. Information Science and Statistics. Springer, New York, 8 edition, 2009. ISBN 978-0-387-31073-2.
|
| 182 |
+
|
| 183 |
+
Jeffrey M. Blaney and J. Scott Dixon. Distance Geometry in Molecular Modeling. In Reviews in Computational Chemistry, pp. 299–335. John Wiley & Sons, Ltd, 2007. ISBN 978-0-470-12582- 3. doi: 10.1002/9780470125823.ch6.
|
| 184 |
+
|
| 185 |
+
John Bradshaw, Matt J. Kusner, Brooks Paige, Marwin H. S. Segler, and Jose Miguel Hern ´ andez- ´ Lobato. A generative model for electron paths. In International Conference on Learning Representations, 2019a.
|
| 186 |
+
|
| 187 |
+
John Bradshaw, Brooks Paige, Matt J. Kusner, Marwin H. S. Segler, and Jose Miguel Hern ´ andez- ´ Lobato. A Model to Search for Synthesizable Molecules. arXiv:1906.05221, 2019b.
|
| 188 |
+
|
| 189 |
+
Hanjun Dai, Yingtao Tian, Bo Dai, Steven Skiena, and Le Song. Syntax-directed variational autoencoder for structured data. In International Conference on Learning Representations, 2018.
|
| 190 |
+
|
| 191 |
+
Marco De Vivo, Matteo Masetti, Giovanni Bottegoni, and Andrea Cavalli. Role of Molecular Dynamics and Related Methods in Drug Discovery. J. Med. Chem., 59(9):4035–4061, 2016. doi: 10.1021/acs.jmedchem.5b01684.
|
| 192 |
+
|
| 193 |
+
Erik D. Demaine, Francisco Gomez-Martin, Henk Meijer, David Rappaport, Perouz Taslakian, Godfried T. Toussaint, Terry Winograd, and David R. Wood. The distance geometry of music. Computational Geometry, 42(5):429–454, 2009. doi: 10.1016/j.comgeo.2008.04.005.
|
| 194 |
+
|
| 195 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan Aspuru-Guzik, and Ryan P Adams. Convolutional Networks on Graphs for Learning Molecular Fingerprints. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 2224–2232. Curran Associates, Inc., 2015.
|
| 196 |
+
|
| 197 |
+
R. Evans, J. Jumper, J. Kirkpatrick, L. Sifre, T. F. G. Green, C. Qin, A. Zidek, A. Nelson, A. Bridgland, H. Penedones, S. Petersen, K. Simonyan, S. Crossan, D. T. Jones, D. Silver, K. Kavukcuoglu, D. Hassabis, and A. W. Senior. De novo structure prediction with deep-learning based scoring. In Thirteenth Critical Assessment of Techniques for Protein Structure Prediction, 2018.
|
| 198 |
+
|
| 199 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 1263–1272, 2017.
|
| 200 |
+
|
| 201 |
+
Rafael Gomez-Bombarelli, Jennifer N. Wei, David Duvenaud, Jos ´ e Miguel Hern ´ andez-Lobato, ´ Benjam´ın Sanchez-Lengeling, Dennis Sheberla, Jorge Aguilera-Iparraguirre, Timothy D. Hirzel, ´ Ryan P. Adams, and Alan Aspuru-Guzik. Automatic Chemical Design Using a Data-Driven ´ Continuous Representation of Molecules. ACS Cent. Sci., 4(2):268–276, 2018. doi: 10.1021/ acscentsci.7b00572.
|
| 202 |
+
|
| 203 |
+
Arthur Gretton, Karsten M. Borgwardt, Malte J. Rasch, Bernhard Scholkopf, and Alexander Smola. ¨ A Kernel Two-Sample Test. J. Mach. Learn. Res., 13:723–773, 2012.
|
| 204 |
+
|
| 205 |
+
Wolfgang Guba, Agnes Meyder, Matthias Rarey, and Jer´ ome Hert. Torsion Library Reloaded: ˆ A New Version of Expert-Derived SMARTS Rules for Assessing Conformations of Small Molecules. J. Chem. Inf. Model., 56(1):1–5, 2016. doi: 10.1021/acs.jcim.5b00522.
|
| 206 |
+
|
| 207 |
+
Timothy F. Havel. Distance Geometry: Theory, Algorithms, and Chemical Applications. In Encyclopedia of Computational Chemistry. American Cancer Society, 2002. ISBN 978-0-470-84501-1. doi: 10.1002/0470845015.cda018.
|
| 208 |
+
|
| 209 |
+
John Ingraham, Adam Riesselman, Chris Sander, and Debora Marks. Learning Protein Structure with a Differentiable Simulator. In International Conference on Learning Representations, 2019.
|
| 210 |
+
|
| 211 |
+
V. Jain and L. K. Saul. Exploratory analysis and visualization of speech and music by locally linear embedding. In 2004 IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 3, pp. iii–984, 2004. doi: 10.1109/ICASSP.2004.1326712.
|
| 212 |
+
|
| 213 |
+
Jan Jensen. XYZ2Mol. https://github.com/jensengroup/xyz2mol, 2019.
|
| 214 |
+
|
| 215 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2323–2332, Stockholm, Sweden, 2018. PMLR.
|
| 216 |
+
|
| 217 |
+
Ilana Y. Kanal, John A. Keith, and Geoffrey R. Hutchison. A sobering assessment of small-molecule force field methods for low energy conformer predictions. Int. J. Quantum Chem., 118(5):e25512, 2018. doi: 10.1002/qua.25512.
|
| 218 |
+
|
| 219 |
+
Steven Kearnes, Kevin McCloskey, Marc Berndl, Vijay Pande, and Patrick Riley. Molecular graph convolutions: Moving beyond fingerprints. J. Comput.-Aided Mol. Des., 30(8):595–608, 2016. doi: 10.1007/s10822-016-9938-8.
|
| 220 |
+
|
| 221 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv:1412.6980, 2014.
|
| 222 |
+
|
| 223 |
+
Diederik P. Kingma and Max Welling. Auto-Encoding Variational Bayes. In International Conference on Learning Representations, 2014.
|
| 224 |
+
|
| 225 |
+
Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. International Conference on Learning Representations, 2017.
|
| 226 |
+
|
| 227 |
+
Matt J. Kusner, Brooks Paige, and Jose Miguel Hern ´ andez-Lobato. Grammar Variational Autoen- ´ coder. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 1945–1954, International Convention Centre, Sydney, Australia, 2017. PMLR.
|
| 228 |
+
|
| 229 |
+
David Lagorce, Tania Pencheva, Bruno O. Villoutreix, and Maria A. Miteva. DG-AMMOS: A New tool to generate 3D conformation of small molecules using Distance Geometry and Automated Molecular Mechanics Optimization for in silico Screening. BMC Chem. Biol., 9:6, 2009. doi: 10.1186/1472-6769-9-6.
|
| 230 |
+
|
| 231 |
+
Tobias Lemke and Christine Peter. EncoderMap: Dimensionality Reduction and Generation of Molecule Conformations. J. Chem. Theory Comput., 2019. doi: 10.1021/acs.jctc.8b00975.
|
| 232 |
+
|
| 233 |
+
Qi Liu, Miltiadis Allamanis, Marc Brockschmidt, and Alexander Gaunt. Constrained Graph Variational Autoencoders for Molecule Design. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 7795–7804. Curran Associates, Inc., 2018.
|
| 234 |
+
|
| 235 |
+
Elman Mansimov, Omar Mahmood, Seokho Kang, and Kyunghyun Cho. Molecular geometry prediction using a deep generative graph neural network. arXiv:1904.00314 [physics, stat], 2019.
|
| 236 |
+
|
| 237 |
+
Frank Noe, Simon Olsson, Jonas K ´ ohler, and Hao Wu. Boltzmann generators: Sampling equilibrium ¨ states of many-body systems with deep learning. Science, 365(6457):eaaw1147, 2019. doi: 10.1126/science.aaw1147.
|
| 238 |
+
|
| 239 |
+
Artidoro Pagnoni, Kevin Liu, and Shangyan Li. Conditional Variational Autoencoder for Neural Machine Translation. arXiv:1812.04405, 2018.
|
| 240 |
+
|
| 241 |
+
John P. Perdew, Matthias Ernzerhof, and Kieron Burke. Rationale for mixing exact exchange with density functional approximations. J. Chem. Phys., 105(22):9982–9985, 1996. doi: 10.1063/1. 472933.
|
| 242 |
+
|
| 243 |
+
Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Sci. Data, 1:140022, 2014. doi: 10.1038/sdata.2014.22.
|
| 244 |
+
|
| 245 |
+
Sereina Riniker and Gregory A. Landrum. Better Informed Distance Geometry: Using What We Know To Improve Conformation Generation. J. Chem. Inf. Model., 55(12):2562–2574, 2015. doi: 10.1021/acs.jcim.5b00654.
|
| 246 |
+
|
| 247 |
+
Kristof Schutt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre ¨ Tkatchenko, and Klaus-Robert Muller. SchNet: A continuous-filter convolutional neural net- ¨ work for modeling quantum interactions. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 991–1001. Curran Associates, Inc., 2017a.
|
| 248 |
+
|
| 249 |
+
Kristof T. Schutt, Farhad Arbabzadah, Stefan Chmiela, Klaus R. M ¨ uller, and Alexandre Tkatchenko.¨ Quantum-chemical insights from deep tensor neural networks. Nat. Commun., 8:13890, 2017b. doi: 10.1038/ncomms13890.
|
| 250 |
+
|
| 251 |
+
Marwin H. S. Segler, Thierry Kogej, Christian Tyrchan, and Mark P. Waller. Generating Focused Molecule Libraries for Drug Discovery with Recurrent Neural Networks. ACS Cent. Sci., 4(1): 120–131, 2018. doi: 10.1021/acscentsci.7b00512.
|
| 252 |
+
|
| 253 |
+
Jihyun Shim and Alexander D. MacKerell, Jr. Computational ligand-based rational design: Role of conformational sampling and force fields in model development. Med. Chem. Commun., 2(5): 356–370, 2011. doi: 10.1039/C1MD00044F.
|
| 254 |
+
|
| 255 |
+
Qiming Sun, Timothy C. Berkelbach, Nick S. Blunt, George H. Booth, Sheng Guo, Zhendong Li, Junzi Liu, James D. McClain, Elvira R. Sayfutyarova, Sandeep Sharma, Sebastian Wouters, and Garnet Kin-Lic Chan. PySCF: The Python-based simulations of chemistry framework. WIREs Comput. Mol. Sci., 8(1), 2018. doi: 10.1002/wcms.1340.
|
| 256 |
+
|
| 257 |
+
Joshua B. Tenenbaum, Vin de Silva, and John C. Langford. A Global Geometric Framework for Nonlinear Dimensionality Reduction. Science, 290(5500):2319–2323, 2000. doi: 10.1126/science.290.5500.2319.
|
| 258 |
+
|
| 259 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. In International Conference on Learning Representations, 2018.
|
| 260 |
+
|
| 261 |
+
Florian Weigend. Accurate Coulomb-fitting basis sets for H to Rn. Phys. Chem. Chem. Phys., 8(9): 1057–1065, 2006. doi: 10.1039/B515623H.
|
| 262 |
+
|
| 263 |
+
Florian Weigend and Reinhart Ahlrichs. Balanced basis sets of split valence, triple zeta valence and quadruple zeta valence quality for H to Rn: Design and assessment of accuracy. Phys. Chem. Chem. Phys., 7(18):3297–3305, 2005. doi: 10.1039/B508541A.
|
| 264 |
+
|
| 265 |
+
Kilian Q. Weinberger and Lawrence K. Saul. Unsupervised Learning of Image Manifolds by Semidefinite Programming. Int. J. Comput. Vision, 70(1):77–90, 2006. doi: 10.1007/ s11263-005-4939-z.
|
| 266 |
+
|
| 267 |
+
Jiaxuan You, Bowen Liu, Zhitao Ying, Vijay Pande, and Jure Leskovec. Graph Convolutional Policy Network for Goal-Directed Molecular Graph Generation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 6410–6421. Curran Associates, Inc., 2018.
|
| 268 |
+
|
| 269 |
+
# A APPENDIX
|
| 270 |
+
|
| 271 |
+
# A.1 CONF17 BENCHMARK
|
| 272 |
+
|
| 273 |
+
# A.1.1 DATA GENERATION
|
| 274 |
+
|
| 275 |
+
The ISO17 dataset (Schutt et al., 2017a) was processed in the following way. First, conformations ¨ in which the molecular connectivity was modified (i.e., bonds were broken or new ones are formed) were discarded. For this, the tool XYZ2MOL (Jensen, 2019) was employed. Second, the molecular graphs were augmented by adding auxiliary edges for reasons described in Section 2.1. Auxiliary edges between all second neighbors were added. This can lead to a slight over-specification of the system’s geometry, however, this did not pose a problem in our experiments. In addition, auxiliary edges between third neighbors were added to fix dihedral angles. Since there are potentially many ways of specifying a dihedral angle in a molecular system, we resorted to the works of Riniker & Landrum (2015) and Guba et al. (2016) to decide where to place edges between third neighbors.
|
| 276 |
+
|
| 277 |
+
# A.1.2 INPUT FEATURES
|
| 278 |
+
|
| 279 |
+
Below we list the node and edges features in the CONF17 benchmark.
|
| 280 |
+
|
| 281 |
+
Table 3: Node features.
|
| 282 |
+
|
| 283 |
+
<table><tr><td>Feature</td><td>Data Type</td><td>Dimension</td></tr><tr><td>atomic number</td><td>integer</td><td>1</td></tr><tr><td>chiral tag</td><td>one-hot (R, S,and N/A)</td><td>3</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 4: Edge features.
|
| 286 |
+
|
| 287 |
+
<table><tr><td>Feature</td><td>Data Type</td><td>Dimension</td></tr><tr><td>kind</td><td>one-hot (indicating whether e is in Ebond,Eangle,or Edihedral)</td><td>3</td></tr><tr><td>stereo chemistry</td><td>one-hot (E,Z,Any,None, and N/A)</td><td>5</td></tr><tr><td>type</td><td>integer (single, double, triple or N/A)</td><td>1</td></tr><tr><td>is aromatic</td><td>binary</td><td>1</td></tr><tr><td>is conjugated</td><td>binary</td><td>1</td></tr><tr><td>is in ring of size</td><td>one-hot (3,4,...,9) and N/A</td><td>8</td></tr></table>
|
| 288 |
+
|
| 289 |
+
# A.1.3 MODEL ARCHITECTURE
|
| 290 |
+
|
| 291 |
+
The full model is available online https://figshare.com/s/1b42bf865bd78c457354. In following, the hyperparameters of our model are specified:
|
| 292 |
+
|
| 293 |
+
Activations throughout this paper: ReLU; $L _ { v }$ , $L _ { e }$ : 10; $F _ { \mathrm { e n c } , v }$ : neural network with depth 2, width 20; $F _ { \mathrm { e n c } , e }$ : neural network with depth 3, width 60; $F _ { \mathrm { d e c } , v }$ , $F _ { \mathrm { d e c } , e }$ : neural networks with depth 2, width 70; {MP(t) }T , {MP(t) }T dec t=1: MPNN width depth 1 and three multi-head attention heads, T = 3, for node and edge updates neural networks with depth 2, and width 70 were used. $R _ { \mathrm { e n c } }$ , $R _ { \mathrm { d e c } }$ : neural networks with depth 2, width 70. Batch size: 16 (conformations);
|
| 294 |
+
|
| 295 |
+
# A.2 COMPUTATIONAL DETAILS
|
| 296 |
+
|
| 297 |
+
# A.2.1 QUANTUM-CHEMICAL CALCULATIONS
|
| 298 |
+
|
| 299 |
+
All quantum-chemical calculations were carried out with the PySCF program package (version 1.5) (Sun et al., 2018) employing the exchange-correlation density functional PBE (Perdew et al., 1996), and the def2-SVP (Weigend & Ahlrichs, 2005; Weigend, 2006) basis set.
|
| 300 |
+
|
| 301 |
+
Conformations generated by DL4CHEM did not succeed as some atoms were too close to each other. Self-consistent field algorithms in quantum-chemical software such as $\operatorname { P y } \operatorname { S C F }$ do not converge for such molecular structures.
|
| 302 |
+
|
| 303 |
+
With quantum-chemical methods, we calculate several properties that concern the states of the electrons in the conformation. These are the total electronic energy $E _ { \mathrm { e l e c } }$ , the energy of the electron in the highest occupied molecular orbital (HOMO in eV) HOMO, the energy of the lowest unoccupied molecular orbital (LUMO in eV) LUMO, and the norm of the dipole moment $\mu$ (in debye).
|
| 304 |
+
|
| 305 |
+
# A.2.2 EUCLIDEAN DISTANCE GEOMETRY
|
| 306 |
+
|
| 307 |
+
We refer the reader to Havel (2002) for theory on EDG, algorithms, and chemical applications. In summary, the EDG procedure consists of the following three steps:
|
| 308 |
+
|
| 309 |
+
1. Bound smoothing: extrapolating a complete set of lower and upper limits on all the distances from the sparse set of lower and upper bounds.
|
| 310 |
+
2. Embedding: choosing a random distance matrix from within these limits, and computing coordinates that are a certain best-fit to the distances.
|
| 311 |
+
3. Optimization: optimizing these coordinates versus an error function which measures the total violation of the distance (and chirality) constraints.
|
| 312 |
+
|
| 313 |
+
We use the EDG implementation found in RDKIT (Riniker & Landrum, 2015) with default settings.
|
| 314 |
+
|
| 315 |
+
A.3 GENERATION OF CONFORMATIONS
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 7: Overlay of 50 conformations from the ground-truth, RDKIT, DL4CHEM, and GRAPHDG based on two random molecular graphs from the test set. C, O, and H atoms are colored gray, red, and white, respectively.
|
| 319 |
+
|
| 320 |
+
# A.4 DISTRIBUTIONS OVER DISTANCES
|
| 321 |
+
|
| 322 |
+
Below, the marginal distributions of the distances for a variety of molecular graphs are shown.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 8: Marginal distributions $p ( d _ { k } | \mathcal { G } )$ of ground-truth and predicted distances (in A) between C ˚ and O atoms given a molecular graph from the test set. The atoms connected by each edge $d _ { k }$ are indicated in each subplot $\left( \boldsymbol { s } _ { k } \mathrm { - } \boldsymbol { r } _ { k } \right)$ . In the 3D structure of the molecule, carbon and oxygen atoms are colored gray and red, respectively. $_ \mathrm { H }$ atoms are omitted for clarity.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 9: Marginal distributions $p ( d _ { i } , d _ { j } | \mathcal { G } )$ of ground-truth and predicted distances for a molecular graph from the test set (in $\mathring \mathrm { A }$ ). Here, $d _ { i }$ and $d _ { j }$ are restricted to edges representing bonds between C and O atoms. In the 3D structure of the molecule, carbon and oxygen atoms are colored gray and red, respectively. H atoms are omitted for clarity.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 10: See caption of Fig. 8
|
| 332 |
+
|
| 333 |
+

|
| 334 |
+
Figure 11: See caption of Fig. 9
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 12: See caption of Fig. 8
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 13: See caption of Fig. 9
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 14: See caption of Fig. 8
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 15: See caption of Fig. 9
|
md/train/SJDJNzWAZ/SJDJNzWAZ.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TIME-DEPENDENT REPRESENTATION FOR NEURALEVENT SEQUENCE PREDICTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Existing sequence prediction methods are mostly concerned with time-independent sequences, in which the actual time span between events is irrelevant and the distance between events is simply the difference between their order positions in the sequence. While this time-independent view of sequences is applicable for data such as natural languages, e.g., dealing with words in a sentence, it is inappropriate and inefficient for many real world events that are observed and collected at unequally spaced points of time as they naturally arise, e.g., when a person goes to a grocery store or makes a phone call. The time span between events can carry important information about the sequence dependence of human behaviors. In this work, we propose a set of methods for using time in sequence prediction. Because neural sequence models such as RNN are more amenable for handling token-like input, we propose two methods for time-dependent event representation, based on the intuition on how time is tokenized in everyday life and previous work on embedding contextualization. We also introduce two methods for using next event duration as regularization for training a sequence prediction model. We discuss these methods based on recurrent neural nets. We evaluate these methods as well as baseline models on five datasets that resemble a variety of sequence prediction tasks. The experiments revealed that the proposed methods offer accuracy gain over baseline models in a range of settings.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Event sequence prediction is a task to predict the next event1 based on a sequence of previously occurred events. Event sequence prediction has a broad range of applications, e.g., next word prediction in language modeling (Józefowicz et al., 2016), next place prediction based on the previously visited places, or next app to launch given the usage history. Depending on how the temporal information is modeled, event sequence prediction often decomposes into the following two categories: discrete-time event sequence prediction and continuous-time event sequence prediction.
|
| 12 |
+
|
| 13 |
+
Discrete-time event sequence prediction primarily deals with sequences that consist of a series of tokens (events) where each token can be indexed by its order position in the sequence. Thus such a sequence evolves synchronously in natural unit-time steps. These sequences are either inherently time-independent, e.g, each word in a sentence, or resulted from sampling a sequential behavior at an equally-spaced point in time, e.g., busy or not busy for an hourly traffic update. In a discrete-time event sequence, the distance between events is measured as the difference of their order positions. As a consequence, for discrete-time event sequence modeling, the primary goal is to predict what event will happen next.
|
| 14 |
+
|
| 15 |
+
Continuous-time event sequence prediction mainly attends to the sequences where the events occur asynchronously. For example, the time interval between consecutive clinical visits of a patient may potentially vary largely. The duration between consecutive log-in events into an online service can change from time to time. Therefore, one primary goal of continuous-time event sequence prediction is to predict when the next event will happen in the near future.
|
| 16 |
+
|
| 17 |
+
Although these two tasks focus on different aspects of a future event, how to learn a proper representation for the temporal information in the past is crucial to both of them. More specifically, even though for a few discrete-time event sequence prediction tasks (e.g., neural machine translation), they do not involve an explicit temporal information for each event (token), a proper representation of the position in the sequence is still of great importance, not to mention the more general cases where each event is particularly associated with a timestamp. For example, the next destination people want to go to often depends on what other places they have gone to and how long they have stayed in each place in the past. When the next clinical visit (Choi et al., 2016a) will occur for a patient depends on the time of the most recent visits and the respective duration between them. Therefore, the temporal information of events and the interval between them are crucial to the event sequence prediction in general. However, how to effectively use and represent time in sequence prediction still largely remains under explored.
|
| 18 |
+
|
| 19 |
+
A natural and straightforward solution is to bring time as an additional input into an existing sequence model (e.g., recurrent neural networks). However, it is notoriously challenging for recurrent neural networks to directly handle continuous input that has a wide value range, as what is shown in our experiments. Alternatively, we are inspired by the fact that humans are very good at characterizing time span as high-level concepts. For example, we would say "watching TV for a little while" instead of using the exact minutes and seconds to describe the duration. We also notice that these high-level descriptions about time are event dependent. For example, watching movies for 30 minutes might feel much shorter than waiting in the line for the same amount of time. Thus, it is desirable to learn and incorporate these time-dependent event representations in general. Our paper offers the following contributions:
|
| 20 |
+
|
| 21 |
+
• We propose two methods for time-dependent event representation in a neural sequence prediction model: time masking of event embedding and event-time joint embedding. We use the time span associated with an event to better characterize the event by manipulating its embedding to give a recurrent model additional resolving power for sequence prediction. We propose to use next event duration as a regularizer for training a recurrent sequence prediction model. Specifically, we define two flavors of duration-based regularization: one is based on the negative log likelihood of duration prediction error and the other measures the cross entropy loss of duration prediction in a projected categorical space. We evaluated these proposed methods as well as several baseline methods on five datasets (four are public). These datasets span a diverse range of sequence behaviors, including mobile app usage, song listening pattern, and medical history. The baseline methods include vanilla RNN models and those found in the recent literature. These experiments offer valuable findings about how these methods improve prediction accuracy in a variety of settings.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND
|
| 24 |
+
|
| 25 |
+
In recent years, recurrent neural networks (RNN) especially with Long-Short Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) have become popular in solving a variety of discretetime event sequence prediction problems, including neural machine translation (Bahdanau et al., 2014), image captioning $\mathrm { { X u } }$ et al., 2015) and speech recognition (Soltau et al., 2016). In a nutshell, given the sequence of previously occurred events, $\{ e _ { 1 } , e _ { 2 } , . . . , e _ { t } \}$ , the conditional probability $\bar { P ( e _ { t + 1 } | \{ e _ { 1 } , e _ { 2 } , . . . , \bar { e } _ { t } \} ) } = \bar { P ( e _ { t + 1 } | h _ { t } , \theta ) }$ of the next event $e _ { t + 1 }$ is estimated by using a recurrent neural network with parameters $\theta$ and the hidden state vector $\boldsymbol { \dot { h } _ { t } } = f ( h _ { t - 1 } , e _ { t } , \boldsymbol { \dot { \theta } } )$ which is assumed to encode the information of the past events.
|
| 26 |
+
|
| 27 |
+
To feed an event into a recurrent neural network, the event, often described as a categorical variable, needs to be represented in a continuous vector space. A common way to achieve this is to use embedding (Bengio et al., 2003) $x _ { t } = 1 ( e _ { t } ) E ^ { x }$ where $1 ( e _ { t } )$ is a one-hot vector. For the $j$ th event in the vocabulary $V , e ^ { j }$ , its one-hot vector has 0s for all the entries except the $j$ th entry being 1. $E ^ { x } \in R ^ { | V | \times E }$ is the embedding matrix, where $| V |$ is the number of unique events (the vocabulary size) and $E$ is the embedding dimension. The use of embedding provides a dense representation for an event that improves learning (Turian et al., 2010). Through training, the embedding vector of an event encodes its meaning relative to other events. Events that are similar tend to have embedding vectors closer to each other in the embedding space than those that are not.
|
| 28 |
+
|
| 29 |
+
On the other hand, temporal point processes are mathematical abstractions for the continuous-time event sequence prediction task by explicitly modeling the inter-event interval as a continuous random variable. Since the occurrence of an event may be triggered by what happened in the past, we can essentially specify different models for the timing of the next event given what we have already known so far. Very recently, (Du et al., 2016; Mei & Eisner, 2017; Xiao et al., 2017a;b) focus on expanding the flexibility of temporal point processes using recurrent neural networks where the prediction of the next event time is based on the current hidden state $h _ { t }$ of RNN. However, all of these work use the direct concatenation between the inter-event interval and the respective event embedding as the input to the recurrent layer where the representation of the temporal information is limited.
|
| 30 |
+
|
| 31 |
+
Because it is not clear how to properly represent time as input, in this work, we intend to let the model learn a proper representation for encoding temporal information in a sequence, similar to learning embeddings for words. Rather than proposing a new model, our approach should be considered an "embedding" approach for time that can be used by general event sequence prediction models, including models proposed previously (Du et al., 2016; Mei & Eisner, 2017).
|
| 32 |
+
|
| 33 |
+
# 3 TIME-DEPENDENT EVENT REPRESENTATION
|
| 34 |
+
|
| 35 |
+
There are two notions about time spans in a sequential behavior: duration and intervals. Duration is how long an event lasts, e.g., listening to music for an half hour, and an interval is the time span between two adjacent events. To unify both types of time spans, we treat the idle period when no event is occurring (e.g., the person is not using any app for an app usage sequence) as a special event. Thus, duration becomes an inherent property of an event–the interval between two events is the duration of an idle event (see Figure 1).
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: An interval is treated as the "duration" of an idle event.
|
| 39 |
+
|
| 40 |
+
With this, $h _ { t } ~ = ~ f ( h _ { t - 1 } , e _ { t } , d _ { t } ; \theta )$ where $d _ { t }$ is the duration of event $e _ { t }$ . We here propose two methods to bring continuous time, $d _ { t }$ , into a neural sequence prediction model. Both achieve timedependent event representation by manipulating event embedding vectors using time. Our methods are schematically illustrated in Figure 2.
|
| 41 |
+
|
| 42 |
+
# 3.1 CONTEXTUALIZING EVENT EMBEDDING WITH TIME MASK
|
| 43 |
+
|
| 44 |
+
Recent work by (Choi et al., 2016b) revealed that in neural machine translation the embedding vector of a word encodes multiple meanings of the word. As a result, it requires a recurrent layer to sacrifice its capacity to disambiguate a word based on its context, instead of focusing on its main task for learning the higher-level compositional structure of a sentence. To address this problem, they used a mask computed based on all the words in a sentence to contextualize the embedding of a target word.
|
| 45 |
+
|
| 46 |
+
Based on this recent work, we propose a method to learn a time mask to "contextualize" event embedding, by which we hope a time-dependent embedding would give the recurrent layer additional resolving power. Similar to the word mask proposed by Choi et al. (Choi et al., 2016b), we first compute a time context vector for duration, $c ^ { d }$ .
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
c ^ { d } = \phi ( \log ( d _ { t } ) ; \theta )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
$\phi$ is a nonlinear transformation of $d _ { t }$ and is implemented as a feedforward neural network parameterized by $\theta$ . $d _ { t }$ is log transformed before it is fed to $\phi$ to effectively cover the wide numerical range of duration values, e.g., it can range from seconds to hours for app usage events.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: A time-dependent RNN for event sequence prediction. $d _ { t }$ is used to generate time-dependent event embedding. Next event duration can be used as a regularizer, which can be applied to the recurrent layer and/or any post recurrent layer.
|
| 56 |
+
|
| 57 |
+
We compute a time mask by linearly transforming $c ^ { d }$ with weights $W _ { d } \in \mathbb { R } ^ { C \times E }$ and bias $b _ { d } \in \mathbb { R } ^ { E }$ , which is followed by a sigmoid nonlinear activation, $\sigma$ , to generate a mask $m _ { d } \in \mathbb { R } ^ { E }$ and $\mathbb { R } ^ { E } \to [ 0 , 1 ]$ . $C$ is the size of the time context vector, and $E$ is the event embedding dimension.
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
m _ { d } = \sigma ( c ^ { d } W _ { d } + b _ { d } )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We then apply the mask to an event embedding by performing an element-wise multiplication, $\odot$ , between the embedding vector and the mask. Finally, the product is fed to the recurrent layer.
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
x _ { t } \gets x _ { t } \odot m _ { d }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
# 3.2 EVENT-TIME JOINT EMBEDDING
|
| 70 |
+
|
| 71 |
+
Humans developed many ways to tokenize continuous time in everyday life. For example, we would say "talk to someone briefly" instead of using exact minutes and seconds to characterize the length of the conversation. Such a kind of tokenization is extensively used in natural languages. In addition, our perception about the duration also depends on the specific event that we are experiencing. Based on these intuitions, we propose a method to first encode the duration of an event using soft one-hot encoding and then use the encoding to form the joint embedding with the event.
|
| 72 |
+
|
| 73 |
+
To do so, we first project the scalar duration value onto a vector space, where $W _ { d } \in \mathbb { R } ^ { 1 \times P }$ is the weight matrix, $b _ { d } \in \bar { \mathbb { R } ^ { P } }$ is the bias vector, and $P$ is the projection size.
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
p ^ { d } = d _ { t } W _ { d } + b _ { d }
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
We then compute the soft one-hot encoding, $s ^ { d }$ , of a duration value by applying a softmax function to the projection vector, $p ^ { d }$ . Softmax has been typically used in the output layer (Graves, 2012) and in
|
| 80 |
+
|
| 81 |
+
the attention mechanisms (Bahdanau et al., 2014; $\mathrm { X u }$ et al., 2015) for selecting one out of many. The ith entry of the encoding vector is calculated as the following and $p _ { i } ^ { d }$ is the ith entry in $p ^ { d }$ .
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
s _ { i } ^ { d } = \frac { \exp ( p _ { i } ^ { d } ) } { \sum _ { k = 1 } ^ { P } \exp ( p _ { k } ^ { d } ) }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
All the entries in the soft one-hot encoding are positive. Similar to a regular one-hot encoding, $\textstyle \sum _ { i = 1 } ^ { P } s _ { i } ^ { d } = 1$ . We then project the soft one-hot encoding onto a time embedding space, $g _ { d }$ . It has the same dimension as the event embedding. $E ^ { s } \in R ^ { P \times E }$ is the embedding matrix.
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
g _ { d } = s ^ { d } E ^ { s }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Embedding for a regular one-hot encoding essentially takes a single row of the embedding matrix that is corresponding to the non-zero entry as the embedding vector. In contrast, embedding for a soft one-hot encoding computes a weighted sum over all the rows in the embedding matrix. Finally, we form the joint embedding of an event and its duration by taking the mean of their embedding vectors, which is then fed to the recurrent layer.
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
x _ { t } \gets \frac { x _ { t } + g _ { d } } { 2 }
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
# 4 NEXT EVENT DURATION AS A REGULARIZER
|
| 100 |
+
|
| 101 |
+
While our goal here is to predict next event, it can help learning by introducing an additional loss component based on the prediction of the next event duration (see Figure 2). The duration prediction of the next event at step $t$ , $d _ { t + 1 } ^ { \prime }$ , is computed from a linear transformation of the recurrent layer. A loss defined on the prediction error of $d _ { t + 1 } ^ { \prime }$ provides additional information during back propagation, acting like a regularizer. Optionally, one can use the concatenation of the recurrent layer output and a hidden layer on the path for event prediction to regularize more layers. We discuss two alternatives for the loss function over d0t+1.
|
| 102 |
+
|
| 103 |
+
# 4.1 NEGATIVE LOG LIKELIHOOD OF TIME PREDICTION ERROR
|
| 104 |
+
|
| 105 |
+
A common way for the loss over a continuous value is to use the squared error. Here, it is $( d _ { t + 1 } ^ { \prime } -$ $d _ { t + 1 } ) ^ { 2 }$ where $d _ { t + 1 }$ is the observed duration of the next event. However, such a loss needs to be at the same scale as that of of event prediction, which is typically a log likelihood of some form. Hinton and Van Camp (Hinton & van Camp, 1993) have shown that minimizing the squared error can be in fact formulated as maximizing the probability density of a zero-mean Gaussian distribution. Note that this does not require duration to obey a Gaussian distribution but rather the prediction error. We define our regularizer, $R _ { t } ^ { N }$ , as the negative log likelihood of duration prediction error at step $t$ .
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
R _ { t } ^ { N } = \frac { ( d _ { t + 1 } ^ { \prime } - d _ { t + 1 } ) ^ { 2 } } { 2 \sigma _ { i } ^ { 2 } }
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
The variance, $\sigma _ { i }$ , is seeded with an initial value (e.g., the variance of duration values in the training data) and updated iteratively during training based on the duration prediction error distribution of the learned model at each update $i$ .
|
| 112 |
+
|
| 113 |
+
# 4.2 CROSS ENTROPY LOSS ON TIME PROJECTION
|
| 114 |
+
|
| 115 |
+
In Section 3.2, we proposed to use softmax to project a continuous duration value onto a categorical space. Using the same technique, by projecting both $d _ { t + 1 } ^ { \prime }$ and $d _ { t + 1 }$ onto a categorical space, we can then compute a cross entropy loss based on the two projections as another regularizer $R _ { t } ^ { X }$ .
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
R _ { t } ^ { X } = - \sum _ { k = 1 } ^ { P } P r o j _ { k } ( d _ { t + 1 } ) \log P r o j _ { k } ( d _ { t + 1 } ^ { \prime } )
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
P roj is the softmax projection process we defined in Equation 4 and 5, $P r o j _ { k }$ is the $k$ th entry in the projection vector. When event-time joint embedding and $R _ { t } ^ { X }$ are both used, the embedding and the regularizer can use the same projection function, i.e., sharing the same projection weights (Equation 4).
|
| 122 |
+
|
| 123 |
+
# 5 EXPERIMENTS
|
| 124 |
+
|
| 125 |
+
In this section, we evaluate the effectiveness of our proposed approaches on the following five real-world datasets across a diverse range of domains.
|
| 126 |
+
|
| 127 |
+
• Electrical Medical Records. MIMIC II medical dataset is a collection of de-identified clinical visit records of Intensive Care Unit patients for seven years. The filtered dataset released by (Du et al., 2016) include 650 patients and 204 diseases. The goal is to predict which major disease will happen to a given patient. Stack Overflow Dataset. The Stack Overflow dataset includes two years of user awards on a question-answering website. The awarded badges are treated as the events. (Du et al., 2016) collected 6,000 users with a total of 480,000 events. The goal is to predict the next badge a user will receive.
|
| 128 |
+
• Financial Transaction Dataset. (Du et al., 2016) collected a long stream of high frequency transactions for a single stock from NYSE where the events correspond to the "buy" and "sell" actions. The task is to predict the next action a user might take.
|
| 129 |
+
• App Usage Dataset. Mobile users often use a large number of apps, ranging from tens to hundreds. It is time consuming to find a target app on mobile devices. One promising way to address this problem is to predict the next app a user will use based on their app usage history. Being able to predict next apps also allows the mobile platform to preload an app in memory to speed up its startup. We have collected 5,891 app usage sequences comprising of 2.8 million app usage events. The task is to predict the next app that will be used for a given user. Music Recommendation. The music dataset represents the longitudinal listening habits of 992 users (Last.FM, 2009; Celma, 2010) involving millions of listening events. The goal is to predict the next five unique songs that the user has not listened given the user’s listen history.
|
| 130 |
+
|
| 131 |
+
# 5.1 DATA PREPARATION
|
| 132 |
+
|
| 133 |
+
For the MIMIC II, Stack Overflow, and Financial data, we follow (Du et al., 2016) to pre-process the data and seek to predict every single held-out event from the history. We evaluate the prediction accuracy with the binary 0-1 loss.
|
| 134 |
+
|
| 135 |
+
For the app usage data, to avoid users who participated in the data collection only briefly, we exclude sequences that have fewer than 50 app launches or if the time span of the sequence is shorter than a week. This resulted in 5,891 app usage sequences, one from each unique user. These sequences include 2,863,095 app usage events and the longest sequence spanned 551 days. We split the dataset on users into the training $( 8 0 \% )$ , validation $( 1 0 \% )$ and test $( 1 0 \% )$ such that each user is only in one of these partitions. Hence there is no intersection of users between training, validation and test sets. For an event that has fewer than 5 occurrences in the training dataset, we assign it the OOV id for out of vocabulary. In total, there are 7,327 events in the vocabulary, including 7,325 unique apps, the idle event and the OOV (out of vocabulary). In practice, predicting the next 5 apps is often desired so we use Precision $@ \mathrm { K }$ to evaluate the performance.
|
| 136 |
+
|
| 137 |
+
For the music recommendation, each listen event has a timestamp. We removed sequences that are shorter than 50 and songs that have fewer than 50 listens. We thus generate a collection of examples where each example consists of a listen history and a set of 5 unique songs to recommend. To do so, we split each original listen sequence into segments. We first take the 40 events out in order from the beginning of the sequence as the listen history, and then take more events out from the beginning of the sequence until we find 5 unique songs that have not occurred in the listen history. We do so repeatedly to extract each example until we exhaust all the original sequences. This data processing resulted in 221,920 sequence examples with 71,619 unique songs (the vocabulary size). We then allocate these sequence examples for the training $( 8 0 \% )$ , validation $( 1 0 \% )$ and test $( 1 0 \% )$ . Because the original dataset does not have the duration information for each listen event, we did not inject the additional idle event in the sequence to differentiate duration versus intervals. Because in practice, the ranking order of the recommended music often matters, we further use $\mathbf { M A P @ K }$ and Prevision $@ \mathrm { K }$ to evaluate the performance.
|
| 138 |
+
|
| 139 |
+
# 5.2 MODEL CONFIGURATIONS
|
| 140 |
+
|
| 141 |
+
We compare with the following five models: NoTime in which a simple LSTM sequence model is used; TimeConcat in which we feed time (log transformed) directly into the recurrent layer along the event embedding; TimeMask (Section 3.1) and TimeJoint (Section 3.2) for generating time-dependent event embedding as input to the recurrent layer; and RMTPP for the model introduced previously by (Du et al., 2016). Moreover, we also include four regularized models based on $R _ { t } ^ { X }$ and $R _ { t } ^ { N }$ defined earlier. For TimeMask, the size of the time context vector is $C = 3 2$ , and we use ReLu for the activation function in $\phi$ in Equation 2. For TimeJoint, we chose the projection size, $P = 3 0$ (Equation 4). For the App Usage and Music Recommendation experiments, we use a two-layer hierarchical softmax (Morin & Bengio, 2005) for the output layer due to the large vocabulary size, while we use a full sofmax for the rest experiments.
|
| 142 |
+
|
| 143 |
+
For the MIMIC II, Stack Overflow, and Financial data, we follow (Du et al., 2016) for RMTPP’s model parameters. For the app usage data, we determined the parameters of each model based on the training and the validation datasets on a distributed parallel tuning infrastructure. We used LSTM units (Hochreiter & Schmidhuber, 1997) for the recurrent layer, and Rectified Linear Units (ReLu) (Nair & Hinton, 2010) for the activation function in the nonlinear projection layer. The event embedding dimension, the number of LSTM units, and the nonlinear projection layer size are all set to 128. For the music recommendation data, we use a setting similar to the app prediction experiment where we chose the embedding size as 128 and LSTM size as 256. We did not use the nonlinear projection layer after the LSTM layer for this task because it does not seem to help. We implemented all the models in TensorFlow (TensorFlow, 2017).
|
| 144 |
+
|
| 145 |
+
# 5.3 TRAINING AND TESTING
|
| 146 |
+
|
| 147 |
+
For the experiments based on MIMIC II, Stack Overflow and Financial Transaction datasets, we use the same training and testing strategy of (Du et al., 2016). For App Usage and Music Recommendation tasks, we selected the model architecture and hyper parameters with early stopping based on the validation dataset of each task, and report the performance of each model based on the test dataset.
|
| 148 |
+
|
| 149 |
+
For the App Usage experiment, we used truncated back-propagation through time with the number of unroll to be 30. We used an adaptive gradient descent optimizer (Zeiler, 2012), using a learning rate of 0.024 with a threshold for gradient clipping of 1.0, and a batch size of 32. We decided not to use dropout as it did not seem to improve accuracy on this task.
|
| 150 |
+
|
| 151 |
+
For the Music Recommendation experiment, we used the full sequence back-propagation through time with $2 \%$ dropout ratio on the recurrent layer for better generalization. We used the Adam optimizer by (Kingma & Ba, 2014) for adaptive learning with a learning rate of 0.00005 and a gradient clipping threshold at 1.0. The mini-batch size is 256.
|
| 152 |
+
|
| 153 |
+
We trained the models by minimizing the cross-entropy loss, plus the regularization loss if the duration regularizer is used, over all the sequences in the training dataset. The training for App Usage and Music Recommendation was conducted on a distributed learning infrastructure (Dean et al., 2012) with 50 GPU cores where updates are applied asynchronously across multiple replicas.
|
| 154 |
+
|
| 155 |
+
# 5.4 EXPERIMENTAL RESULTS
|
| 156 |
+
|
| 157 |
+
Effectiveness of Temporal Representation. Figure 3 presents the comparisons between all the models on three released public datasets. We can observe a consistent performance gain with using the proposed methods for time-dependent event embedding compared to the NoTime baseline and the simple TimeConcat approach. TimeJoint significantly outperformed all other methods on both the Stack Overflow and the Financial dataset, with $\mathrm { p { < } 0 . 0 5 }$ using Paired T-test. But none of the methods for using time is able to improve accuracy on the MIMIC II dataset. This indicates that using time might not always help. However, when it does, our methods such as TimeJoint enable more efficient representation of time than simply using the scalar value of time in RNN models.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 3: Prediction accuracy on (a) MIMIC II, (b) Stack Overflow, and (c) Financial Data.
|
| 161 |
+
|
| 162 |
+
Table 1: Prediction accuracy on test dataset for next app prediction in percentages.
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Model</td><td>Precision@1</td><td>Precision@5</td></tr><tr><td>NoTime</td><td>30.29</td><td>13.07</td></tr><tr><td>TimeConcat</td><td>31.03</td><td>12.98</td></tr><tr><td>RMTPP</td><td>31.31</td><td>12.9</td></tr><tr><td>TimeMask</td><td>31.29</td><td>13.13</td></tr><tr><td></td><td>31.3</td><td>13.15</td></tr><tr><td>TimeMask + RN</td><td>31.41</td><td>13.1</td></tr><tr><td>TimeJoint</td><td>31.3</td><td>13.07</td></tr><tr><td></td><td>31.53</td><td>13.09</td></tr><tr><td>TimeJoint + RN</td><td>31.45</td><td>13.13</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 2: Prediction accuracy on test dataset for music recommendation. The numbers are percentages.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Model</td><td>MAP5</td><td>MAP10</td><td>MAP20</td><td>Precision@5</td><td>Precision @10</td><td>Precision @20</td></tr><tr><td>NoTime</td><td>11.59</td><td>13.18</td><td>13.83</td><td>13.82</td><td>8.75</td><td>5.25</td></tr><tr><td>TimeConcat</td><td>11.41</td><td>12.85</td><td>13.51</td><td>13.53</td><td>8.63</td><td>5.19</td></tr><tr><td>RMTPP</td><td>11.51</td><td>12.93</td><td>13.59</td><td>13.62</td><td>8.66</td><td>5.19</td></tr><tr><td>TimeMask</td><td>11.74</td><td>13.18</td><td>13.83</td><td>13.79</td><td>8.81</td><td>5.28</td></tr><tr><td></td><td>11.71</td><td>13.17</td><td>13.82</td><td>13.81</td><td>8.76</td><td>5.25</td></tr><tr><td></td><td>11.69</td><td>13.16</td><td>13.8</td><td>13.81</td><td>8.76</td><td>5.30</td></tr><tr><td>TimeJoint</td><td>11.82</td><td>13.37</td><td>14.06</td><td>13.95</td><td>8.97</td><td>5.40</td></tr><tr><td>TimeJoint + Rx</td><td>12.02</td><td>13.51</td><td>14.2</td><td>14.12</td><td>9.01</td><td>5.43</td></tr><tr><td>TimeJoint + RN</td><td>11.9</td><td>13.41</td><td>14.11</td><td>14.05</td><td>8.98</td><td>5.40</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Our methods also outperformed RMTPP for event prediction. The performance gain of our models are more pronounced on the App Usage and Music Recommendation datasets as shown in Table 1 and 2. TimeJoint seems to outperform the rest on most measures and TimeMask also performs well compared to other previous methods. We also notice that using time directly without representing them appropriately in RNN, i.e., TimeConcat, can sometime hurt the performance.
|
| 171 |
+
|
| 172 |
+
Effectiveness of Event Duration Regularization. We demonstrate the performance boosting gained from our proposed temporal regularization in Table 1 and 2, respectively. We can observe that our proposed regularizers can bring additional performance gain on many cases. In particular, the crossentropy regularizer, $R _ { t } ^ { X }$ , is able to give consistent performance gain with the temporal embedding approaches.
|
| 173 |
+
|
| 174 |
+
Learned Time Representation. Our motivation in this work is to let the model learn a proper representation of time from data. We here briefly discuss what the TimeJoint approach learns about how to project a scalar value of time into a soft one-hot encoding 4. It seems that for small time periods, e.g., shorter than 20 seconds for the Next App prediction task, more dimensions are needed to express the differences of continuous time values. As the time period grows, we need less dimensions for representing time, e.g., two of the curves have converged to the same small values.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 4: The projection of time learned by TimeJoint with $P = 5$ . The $\mathrm { X }$ axis is in seconds and the Y axis is the projection of a time in each dimension defined in Equation 5.
|
| 178 |
+
|
| 179 |
+
# 6 CONCLUSIONS
|
| 180 |
+
|
| 181 |
+
We proposed a set of methods for leveraging the temporal information for event sequence prediction. Based on our intuition about how humans tokenize time spans as well as previous work on contextual representation of words, we proposed two methods for time-dependent event representation. They transform a regular event embedding with learned time masking and form time-event joint embedding based on learned soft one-hot encoding. We also introduced two methods for using next duration as a way of regularization for training a sequence prediction model. Experiments on a diverse range of real data demonstrate consistent performance gain by blending time into the event representation before it is fed to a recurrent neural network.
|
| 182 |
+
|
| 183 |
+
# REFERENCES
|
| 184 |
+
|
| 185 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. URL http://arxiv.org/abs/ 1409.0473.
|
| 186 |
+
|
| 187 |
+
Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Janvin. A neural probabilistic language model. J. Mach. Learn. Res., 3:1137–1155, March 2003. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id $\equiv$ 944919.944966.
|
| 188 |
+
|
| 189 |
+
O. Celma. Music Recommendation and Discovery in the Long Tail. Springer, 2010.
|
| 190 |
+
|
| 191 |
+
Edward Choi, Mohammad Taha Bahadori, Andy Schuetz, Walter F. Stewart, and Jimeng Sun. Doctor ai: Predicting clinical events via recurrent neural networks. In Proceedings of the 1st Machine Learning for Healthcare Conference, pp. 301–318, 2016a.
|
| 192 |
+
|
| 193 |
+
Heeyoul Choi, Kyunghyun Cho, and Yoshua Bengio. Context-dependent word representation for neural machine translation. CoRR, abs/1607.00578, 2016b. URL http://arxiv.org/abs/ 1607.00578.
|
| 194 |
+
|
| 195 |
+
Jeffrey Dean, Greg S. Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc V. Le, Mark Z. Mao, Marc’Aurelio Ranzato, Andrew Senior, Paul Tucker, Ke Yang, and Andrew Y. Ng. Large scale distributed deep networks. In Proceedings of the 25th International Conference on Neural Information Processing Systems, NIPS’12, pp. 1223–1231, USA, 2012. Curran Associates Inc. URL http://dl.acm.org/citation.cfm?id=2999134.2999271.
|
| 196 |
+
|
| 197 |
+
Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez-Rodriguez, and Le Song. Recurrent marked temporal point processes: Embedding event history to vector. In Proceedings of the 22Nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 1555–1564, New York, NY, USA, 2016. ACM. ISBN 978-1-4503-4232-2. doi: 10.1145/2939672.2939875. URL http://doi.acm.org/10.1145/2939672.2939875.
|
| 198 |
+
|
| 199 |
+
Alex Graves. Supervised sequence labelling. In Supervised Sequence Labelling with Recurrent Neural Networks, pp. 5–13. Springer Berlin Heidelberg, 2012.
|
| 200 |
+
|
| 201 |
+
Geoffrey E. Hinton and Drew van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the Sixth Annual Conference on Computational Learning Theory, COLT ’93, pp. 5–13, New York, NY, USA, 1993. ACM. ISBN 0-89791-611-5. doi: 10.1145/168304.168306. URL http://doi.acm.org/10.1145/168304.168306.
|
| 202 |
+
|
| 203 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735– 1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL http://dx. doi.org/10.1162/neco.1997.9.8.1735.
|
| 204 |
+
|
| 205 |
+
Rafal Józefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. CoRR, abs/1602.02410, 2016. URL http://arxiv.org/abs/ 1602.02410.
|
| 206 |
+
|
| 207 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 208 |
+
|
| 209 |
+
Last.FM. Music. https://www.last.fm/, 2009.
|
| 210 |
+
|
| 211 |
+
Hongyuan Mei and Jason Eisner. The neural hawkes process: A neurally self-modulating multivariate point process. In NIPS, 2017.
|
| 212 |
+
|
| 213 |
+
Frederic Morin and Yoshua Bengio. Hierarchical probabilistic neural network language model. In AISTATS’05, pp. 246–252, 2005.
|
| 214 |
+
|
| 215 |
+
Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Johannes Fürnkranz and Thorsten Joachims (eds.), Proceedings of the 27th International Conference on Machine Learning (ICML-10), pp. 807–814. Omnipress, 2010. URL http: //www.icml2010.org/papers/432.pdf.
|
| 216 |
+
|
| 217 |
+
Hagen Soltau, Hank Liao, and Hasim Sak. Neural speech recognizer: Acoustic-to-word LSTM model for large vocabulary speech recognition. CoRR, abs/1610.09975, 2016. URL http: //arxiv.org/abs/1610.09975.
|
| 218 |
+
|
| 219 |
+
TensorFlow. An open-source software library for Machine Intelligence. https://www. tensorflow.org/, 2017.
|
| 220 |
+
|
| 221 |
+
Joseph Turian, Lev Ratinov, and Yoshua Bengio. Word representations: A simple and general method for semi-supervised learning. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics, ACL ’10, pp. 384–394, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 1858681. 1858721.
|
| 222 |
+
|
| 223 |
+
Shuai Xiao, Junchi Yan, Stephen Chu, Xiaokang Yang, and Hongyuan Zha. Modeling the intensity function of point process via recurrent neural networks. In AAAI, 2017a.
|
| 224 |
+
|
| 225 |
+
Shuai Xiao, Junchi Yan, Mehrdad Farajtabar, Le Song, Xiaokang Yang, and Hongyuan Zha. Joint modeling of event sequence and time series with attentional twin recurrent neural networks. 2017b. URL https://arxiv.org/abs/1703.08524.
|
| 226 |
+
|
| 227 |
+
Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C. Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. CoRR, abs/1502.03044, 2015. URL http://arxiv.org/abs/1502. 03044.
|
| 228 |
+
|
| 229 |
+
Matthew D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. URL http://arxiv.org/abs/1212.5701.
|
md/train/SJTQLdqlg/SJTQLdqlg.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO REMEMBER RARE EVENTS
|
| 2 |
+
|
| 3 |
+
Łukasz Kaiser∗
|
| 4 |
+
Google Brain
|
| 5 |
+
lukaszkaiser@google.com
|
| 6 |
+
Ofir Nachum∗†
|
| 7 |
+
Google Brain
|
| 8 |
+
ofirnachum@google.com
|
| 9 |
+
Aurko Roy‡
|
| 10 |
+
Georgia Tech
|
| 11 |
+
aurko@gatech.edu
|
| 12 |
+
Samy Bengio
|
| 13 |
+
Google Brain
|
| 14 |
+
bengio@google.com
|
| 15 |
+
|
| 16 |
+
# ABSTRACT
|
| 17 |
+
|
| 18 |
+
Despite recent advances, memory-augmented deep neural networks are still limited when it comes to life-long and one-shot learning, especially in remembering rare events. We present a large-scale life-long memory module for use in deep learning. The module exploits fast nearest-neighbor algorithms for efficiency and thus scales to large memory sizes. Except for the nearest-neighbor query, the module is fully differentiable and trained end-to-end with no extra supervision. It operates in a life-long manner, i.e., without the need to reset it during training.
|
| 19 |
+
|
| 20 |
+
Our memory module can be easily added to any part of a supervised neural network. To show its versatility we add it to a number of networks, from simple convolutional ones tested on image classification to deep sequence-to-sequence and recurrent-convolutional models. In all cases, the enhanced network gains the ability to remember and do life-long one-shot learning. Our module remembers training examples shown many thousands of steps in the past and it can successfully generalize from them. We set new state-of-the-art for one-shot learning on the Omniglot dataset and demonstrate, for the first time, life-long one-shot learning in recurrent neural networks on a large-scale machine translation task.
|
| 21 |
+
|
| 22 |
+
# 1 INTRODUCTION
|
| 23 |
+
|
| 24 |
+
Machine learning systems have been successful in many domains, from computer vision (Krizhevsky et al., 2012) to speech recognition (Hinton et al., 2012) and machine translation (Sutskever et al., 2014; Bahdanau et al., 2014; Cho et al., 2014). Neural machine translation (NMT) is so successful that for some language pairs it approaches, on average, the quality of human translators (Wu et al., 2016). The words on average are crucial though. When a sentence resembles one from the abundant training data, the translation will be accurate. However, when encountering a rare word such as Dostoevsky (in German, Dostojewski), many models will fail. The correct German translation of Dostoevsky does not appear enough times in the training data for the model to sufficiently learn its translation.
|
| 25 |
+
|
| 26 |
+
While more example sentences concerning the famous Russian author might eventually be added to the training data, there are many other rare words or rare events of other kinds. This illustrates a general problem with current deep learning models: it is necessary to extend the training data and re-train them to handle such rare or new events. Humans, on the other hand, learn in a life-long fashion, often from single examples.
|
| 27 |
+
|
| 28 |
+
We present a life-long memory module that enables one-shot learning in a variety of neural networks. Our memory module consists of key-value pairs. Keys are activations of a chosen layer of a neural network, and values are the ground-truth targets for the given example. This way, as the network is trained, its memory increases and becomes more useful. Eventually it can give predictions that leverage on knowledge from past data with similar activations. Given a new example, the network writes it to memory and is able to use it afterwards, even if the example was presented just once.
|
| 29 |
+
|
| 30 |
+
There are many advantages of having a long-term memory. One-shot learning is a desirable property in its own right, and some tasks, as we will show below, are simply not solvable without it. Even real-world tasks where we have large training sets, such as translation, can benefit from long-term memory. Finally, since the memory can be traced back to training examples, it might help explain the decisions that the model is making and thus improve understandability of the model.
|
| 31 |
+
|
| 32 |
+
It is not immediately clear how to measure the performance of a life-long one-shot learning model, since most deep learning evaluations focus on the average performance and do not have a one-shot component. We therefore evaluate in a few ways, to show that our memory module indeed works:
|
| 33 |
+
|
| 34 |
+
(1) We evaluate on the well-known one-shot learning task Omniglot, which is the only dataset with explicit one-shot learning evaluation. This dataset is small and does not benefit from life-long learning capability of our module, but we still exceed the best previous results and set new state-of-the-art.
|
| 35 |
+
(2) We devise a synthetic task that requires life-long one-shot learning. On this task, standard models fare poorly while our model can solve it well, demonstrating its strengths.
|
| 36 |
+
(3) Finally, we train an English-German translation model that has our life-long one-shot learning module. It retains very good performance on average and is also capable of one-shot learning. On the qualitative side, we find that it can translate rarely-occurring words like Dostoevsky. On the quantitative side, we see that the BLEU score for the generated translations can be significantly increased by showing it related translations before evaluating.
|
| 37 |
+
|
| 38 |
+
# 2 MEMORY MODULE
|
| 39 |
+
|
| 40 |
+
Our memory consists of a matrix $K$ of memory keys, a vector $V$ of memory values, and an additional vector $A$ that tracks the age of items stored in memory. Keys can be arbitrary vectors of size ${ \mathrm { k e y } } - s { \mathrm { i } } z { \mathrm { e } }$ , and we assume that the memory values are single integers representing a class or token ID. We define a memory of size memory-size as a triple:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathcal { M } = ( K _ { \mathrm { m e m o r y - s i z e } \times \mathrm { k e y - s i z e } } , ~ V _ { \mathrm { m e m o r y - s i z e } } , ~ A _ { \mathrm { m e m o r y - s i z e } } ) .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
A memory query is a vector of size key-size which we assume to be normalized, i.e., $\| q \| = 1$ . Given a query $q$ , we define the nearest neighbor of $q$ in $\mathcal { M }$ as any of the keys that maximize the dot product with $q$ :
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname { N N } ( q , \mathcal { M } ) = \operatorname { a r g m a x } _ { i } q \cdot K [ i ] .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Since the keys are normalized, the above notion corresponds to the nearest neighbor with respect to cosine similarity. We will also use the natural extension of it to $k$ nearest neighbors, which we denote $\mathrm { N N } _ { k } ( q , \mathcal { M } )$ . In our experiments we always used the set of $k = 2 5 6$ nearest neighbors.
|
| 53 |
+
|
| 54 |
+
When given a query $q$ , the memory $\mathcal { M } = ( K , V , A )$ will compute $k$ nearest neighbors (sorted by decreasing cosine similarity):
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
( n _ { 1 } , \dots , n _ { k } ) = \Nu \Nu _ { k } ( q , { \mathcal { M } } )
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
and return, as the main result, the value $V [ n _ { 1 } ]$ . Additionally, we will compute the cosine similarities $d _ { i } = \boldsymbol { q } \cdot \boldsymbol { K } [ n _ { i } ]$ and return softmax $( d _ { 1 } \cdot t , \ldots , d _ { k } \cdot t )$ . The parameter $t$ denotes the inverse of softmax temperature and we set it to $t = 4 0$ in our experiments. In models where the memory output is again embedded into a dense vector, we multiply the embedded output by the corresponding softmax component so as to provide a signal about confidence of the memory.
|
| 61 |
+
|
| 62 |
+
The forward computation of the memory module is thus very simple, the only interesting part being how to compute nearest neighbors efficiently, which we discuss below. But we must also answer the question how the memory is trained.
|
| 63 |
+
|
| 64 |
+
Memory Loss. Assume now that in addition to a query $q$ we are also given the correct desired (supervised) value $v$ . In the case of classification, this $v$ would be the class label. In a sequenceto-sequence task, $v$ would be the desired output token of the current time step. After computing the $k$ nearest neighbors $( n _ { 1 } , \ldots , n _ { k } )$ as above, let $p$ be the smallest index such that $V [ n _ { p } ] = { \bar { v } }$ and
|
| 65 |
+
|
| 66 |
+
Case $1 \colon V [ n _ { 1 } ] = v ; \quad \operatorname { L o s s } = [ q \cdot k _ { b } - q \cdot k _ { 1 } + \alpha ] _ { + }$ Update: $\begin{array} { r l } { K [ n _ { 1 } ] \gets \frac { q + k _ { 1 } } { \| q + k _ { 1 } \| } } & { { } A [ n _ { 1 } ] \gets 0 } \end{array}$
|
| 67 |
+
|
| 68 |
+
${ \mathrm { C a s e ~ } } 2 \colon V [ n _ { 1 } ] \neq v ; \quad { \mathrm { L o s s } } = [ q \cdot k _ { 1 } - q \cdot k _ { p } + \alpha ] _ { + }$ Update: $K [ n ^ { \prime } ] \gets q$ $\mid q \quad V [ n ^ { \prime } ] v \quad A [ n ^ { \prime } ] 0$
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 1: The operation of the memory module on a query $q$ with correct value $v$ ; see text for details.
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
|
| 75 |
+
$b$ the smallest index such that $V [ n _ { b } ] \ne v$ . We call $n _ { p }$ the positive neighbor and $n _ { b }$ the negative neighbor. When no positive neighbor is among the top- $k$ , we pick any vector from memory with value $v$ instead of $K [ n _ { p } ]$ . We define the memory loss as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathrm { l o s s } ( q , v , { \cal M } ) = \left[ q \cdot K [ n _ { b } ] - q \cdot K [ n _ { p } ] + \alpha \right] _ { + } .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Recall that both $q$ and the keys in memory are normalized, so the products in the above loss term correspond to cosine similarities between $q$ , the positive key, and the negative key. Since cosine similarity is maximal for equal terms, we want to maximize the similarity to the positive key and minimize the similarity to the negative one. But once they are far enough apart (by the margin $\alpha$ , 0.1 in all our experiments), we do not propagate any loss. This definition and reasoning behind it are almost identical to the one in Schroff et al. (2015) and similar to many other distance metric learning works (Weinberger & Saul, 2009; Weston et al., 2011).
|
| 82 |
+
|
| 83 |
+
Memory Update. In addition to computing the loss, we will also update the memory $\mathcal { M }$ to account for the fact that the newly presented query $q$ corresponds to $v$ . The update is done in a different way depending on whether the main value returned by the memory module already is the correct value $v$ or not. As before, let $n _ { 1 } = \mathrm { N N } ( q , { \mathcal { M } } )$ be the nearest neighbor to $q$ .
|
| 84 |
+
|
| 85 |
+
If the memory already returns the correct value, i.e., if $V [ n _ { 1 } ] = v$ , then we only update the key for $n _ { 1 }$ by taking the average of the current key and $q$ and normalizing it:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
K [ n _ { 1 } ] \gets \frac { q + K [ n _ { 1 } ] } { \lVert q + K [ n _ { 1 } ] \rVert } .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
When doing this, we also re-set the age: $A [ n _ { 1 } ] 0$ .
|
| 92 |
+
|
| 93 |
+
Otherwise, when $V [ n _ { 1 } ] \neq v$ , we find a new place in the memory and write the pair $( q , v )$ there. Which place should we choose? We find memory items with maximum age, and write to one of those (randomly chosen). More formally, we pick $n ^ { \prime } = \mathrm { a r g m a x } _ { i } A [ i ] + r _ { i }$ where $| r _ { i } | \ll | \mathcal { M } |$ is a random number that introduces some randomness in the choice so as to avoid race conditions in asynchronous multi-replica training. We then set:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
K [ n ^ { \prime } ] q , \quad V [ n ^ { \prime } ] v , \quad A [ n ^ { \prime } ] 0 .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
With every memory update we also increment the age of all non-updated indices by 1. The full operation of the memory module is depicted in Figure 1.
|
| 100 |
+
|
| 101 |
+
Efficient nearest neighbor computation. The most expensive operation in our memory module is the computation of $k$ nearest neighbors. This can be done exactly or in an approximate way.
|
| 102 |
+
|
| 103 |
+
In the exact mode, to calculate the nearest neighbors in $K$ to a mini-batch of queries $Q \ =$ $( q _ { 1 } , \dots , q _ { b } )$ , we perform a single matrix multiplication: $Q \times K ^ { T }$ . This multiplies the batch-size $\times \mathrm { \ k e y - s i z e }$ matrix $Q$ by the ${ \bf k e y - s i z e } \times { \bf m e m o r y - s i z e }$ matrix $K ^ { T }$ , and the result is the batch-size $\div \times \mathrm { ~ m } \in$ emory-size matrix of all distances, from which we can choose the top- $k$ . This procedure is linear in memory-size, so it can be expensive for very large memory sizes. But matrix multiplication is very heavily optimized, so in our experiments on GPUs we find that this operation is not a bottleneck for memory sizes up to half a million.
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 2: The GNMT model with added memory module. On each decoding step $t$ , the result of the attention $a _ { t }$ is used to query the memory. The resulting value is combined with the output of the final LSTM layer to produce the predicted logits $\hat { y } _ { t }$ . See text for further details.
|
| 107 |
+
|
| 108 |
+
If the exact mode is too slow, the $k$ nearest neighbors can be computed approximately using locality sensitive hashing (LSH). LSH is a hashing scheme so that near neighbors get similar hashes (Indyk & Motwani, 1998; Andoni $\&$ Indyk, 2006). For cosine similarity, the computation of an LSH is very simple. We pick a number of random normalized hash vectors $h _ { 1 } , \ldots , h _ { l }$ . The hash of a query $q$ is a sequence of $l$ bits, $b _ { 1 } , \ldots , b _ { l }$ , such that $b _ { i } = 1$ if, and only if, $q \cdot h _ { i } > 0$ . It turns out that near neighbors will, with high probability, have a large number of identical bits in their hash. To compute the nearest neighbors it is therefore sufficient to only look into parts of the memory with similar hashes. This makes the nearest neighbor computation work in approximately constant time – we only need to multiply the query by the hash vectors, and then only use the nearest buckets.
|
| 109 |
+
|
| 110 |
+
# 2.1 USING THE MEMORY MODULE
|
| 111 |
+
|
| 112 |
+
The memory module presented above can be added to any classification network. There are two main choices: which layer to use to generate queries, and how to use the output of the module.
|
| 113 |
+
|
| 114 |
+
In the simplest case, we use the final layer of a network as query and the output of the module is directly used for classification. This simplest case is similar to matching networks (Oriol Vinyals, 2016b) and our memory module yields good results already in this setting (see below).
|
| 115 |
+
|
| 116 |
+
Instead of using the output of the module directly, it is possible to embed it again into a dense representation and mix it with other predictions made by the network. To study this setting, we add the memory module to sequence-to-sequence recurrent neural networks. As described in detail below, a query to memory is made in every step of the decoder network. Memory output is embedded again into a dense representation and combined with inputs from other layers of the network.
|
| 117 |
+
|
| 118 |
+
Convolutional Network with Memory. To test our memory module in a simple setting, we first add it to a basic convolutional network network for image classification. Our network consists of two convolutional layers with ReLU non-linearity, followed by a max-pooling layer, another two convolutional-ReLU layers, another max-pooling, and two fully connected layers. All convolutions use $3 \times 3$ filters with 64 channels in the first pair, and 128 in the second. The fully connected layers have dimension 256 and dropout applied between them. The output of the final layer is used as query to our memory module and the nearest neighbor returned by the memory is used as the final network prediction. Even this basic architecture yields good results in one-shot learning, as discussed below.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Extended Neural GPU with memory module. Memory query is read from the position one below the current output logit, and the embedded memory value is put at the same position of the output tape $p$ . The network learns to use these values to produce the output in the next step.
|
| 122 |
+
|
| 123 |
+
Sequence-to-sequence with Memory. For large-scale experiments, we add the memory module into a large sequence-to-sequence model. Such sequence-to-sequence recurrent neural networks (RNNs) with long short-term memory (LSTM) cells (Hochreiter & Schmidhuber, 1997) have proven especially successful at natural language processing (NLP) tasks, including machine translation (Sutskever et al., 2014; Bahdanau et al., 2014; Cho et al., 2014). We add the memory module to the Google Neural Machine Translation (GNMT) model (Wu et al., 2016). This model consists of an encoder RNN, which creates a representation of the source language sentence, and a decoder RNN that outputs the target language sentence. We left the encoder RNN unmodified. In the decoder RNN, we use the vector retrieved by the attention mechanism as query to the memory module. In the GNMT model, the attention vector is used in all LSTM layers beyond the second one, so the computation of the other layers and the memory can happen in parallel. Before the final softmax layer, we combine the embedded memory output with the output of the final LSTM layer using an additional linear layer, as depicted in Figure 2.
|
| 124 |
+
|
| 125 |
+
Extended Neural GPU with Memory. To test versatility of our memory module, we also add it to the Extended Neural GPU, a convolutional-recurrent model introduced by Kaiser & Bengio (2016). The Extended Neural GPU is a sequence-to-sequence model too, but its decoder is convolutional and the size of its state changes depending on the size of the input. Again, we leave the encoder part of the model intact, and extend the decoder part by a memory query. This time, we use the position one step ahead to query memory, and we put the embedded result to the output tape, as shown in Figure 3. Note that in this model the result of the memory will be processed by two recurrent-convolutional cells before the corresponding output is produced. The fact that this model still does one-shot learning confirms that the output of our memory module can be used deep inside a network, not just near the output layer.
|
| 126 |
+
|
| 127 |
+
# 3 RELATED WORK
|
| 128 |
+
|
| 129 |
+
Memory in Neural Networks. Augmenting neural networks with memory has been heavily studied recently. Many of these approaches design a memory component that is intended as a generalization of the memory in standard recurrent neural networks. In recurrent networks, the state passed from one time step to the next can be interpreted as the network’s memory representation of the current example. Moving away from this fixed-length vector representation of memory to a larger and more versatile form is at the core of these methods.
|
| 130 |
+
|
| 131 |
+
Augmenting recurrent neural networks with attention (Bahdanau et al., 2014) can be interpreted as creating a large memory component that allows content-based addressing. More generally, Graves et al. (2014) augmented a recurrent neural network with a computing-inspired memory component that can be addressed via both content- and address-based queries. Sukhbaatar et al. (2015) present a similar augmentation and show the importance of allowing multiple reads and writes to memory between inputs. These approaches excel at tasks where it is necessary to store large parts of a sequential input in a representation that can later be precisely queried. Such tasks include algorithmic sequence manipulation tasks, natural language modelling, and question-answering tasks.
|
| 132 |
+
|
| 133 |
+
The success of these approaches hinges on making the memory component fully differentiable and backpropagating signal through every access of memory. In this setting, computational requirements necessitate that the memory be small. Some attempts have been made at making hard access queries to memory (Zaremba & Sutskever, 2015; Xu et al., 2015), but it was usually challenging to match the soft version. Recently, more successful training for hard queries was reported (Gulc¸ehre et al. ¨ , 2016) that makes use of a curriculum strategy that mixes soft and hard queries at training time. Our approach applies hard access as well, but we encourage the model to make good queries via a special memory loss.
|
| 134 |
+
|
| 135 |
+
Modifications to allow for large-scale memory in neural networks have been proposed. The original implementation of memory networks (Weston et al., 2014) and later work on scaling it (Bordes et al., 2015; Chandar et al., 2016) used memory with size in the millions. The cost of doing so is that the memory must be fixed prior to training. Moreover, since during the beginning of training the model is unlikely to query the memory correctly, strong supervision is used to encourage the model to query memory locations that are useful. These hints are either given as additional supervising information by the task or determined heuristically as in Hill et al. (2015).
|
| 136 |
+
|
| 137 |
+
All the work discussed so far has either used a memory that is fixed before training or used a memory that is not persistent between different examples. For one-shot and lifelong learning, a memory must necessarily be both volatile during training and persistent between examples. To bridge this gap, Santoro et al. (2016) propose to partition training into distinct episodes consisting of a sequence of labelled examples $\bar { \{ ( x _ { i } , y _ { i } ) \} } _ { i = 1 } ^ { n }$ . A network augmented with a fully-differentiable memory is trained to predict $y _ { i }$ given the previous sequence $( x _ { 1 } , y _ { 1 } , \dotsc , x _ { i - 1 } )$ . This way, the model learns to store important examples with their corresponding labels in memory and later re-use this information to correctly classify new examples. This model successfully exhibits one-shot learning on Omniglot.
|
| 138 |
+
|
| 139 |
+
However, this approach again requires fully-differentiable memory access and thus limits the size of the memory as well as the length of an episode. This restriction has recently been alleviated by Rae et al. (2016). Their model can utilize large memories, but unlike our work does not have an explicit cost to guide the formation of memory keys.
|
| 140 |
+
|
| 141 |
+
For classification tasks like Omniglot, it is easy to construct short episodes so that they include a few examples from each of several classes. However, this becomes harder as the output becomes richer. For example, in the difficult sequence-to-sequence tasks which we consider, it is hard to determine which examples would be helpful for correctly predicting others a priori, and so constructing short episodes each containing examples that are similar and act as hints to each other is intractable.
|
| 142 |
+
|
| 143 |
+
One-shot Learning. While the recent work of Santoro et al. (2016) succeeded in bridging the gap between memory-based models and one-shot learning, the field of one-shot learning has seen a variety of different approaches over time.
|
| 144 |
+
|
| 145 |
+
Early work utilized Bayesian methods to model data generatively (Fei-Fei et al., 2006; Lake et al., 2011). The paper that introduced the Omniglot dataset (Lake et al., 2011) approached the task with a generative model for strokes. This way, given a single character image, the probability of a different image being of the same character may be approximated via standard techniques. One early neural network approach to one-shot learning was given by Siamese networks (Koch, 2015). When our approach is applied to the Omniglot image classification dataset, the resulting training algorithm is actually similar to that of Siamese networks. The only difference is in the loss function: Siamese networks utilize a cross-entropy loss whereas our method uses a margin triplet loss.
|
| 146 |
+
|
| 147 |
+
A more sophisticated neural network approach is given by Vinyals et al. (2016). The strengths of this approach are (1) the model architecture utilizes recent advances in attention-augmented neural networks for set-to-set learning (Oriol Vinyals, 2016a), and (2) the training algorithm is designed to exactly match the testing phase (given $k$ distinct images and an additional image, the model must predict which of the $k$ images is of the same class as the additional image). This approach may also be considered as a generalization of previous work on metric learning.
|
| 148 |
+
|
| 149 |
+
Table 1: Results on the Omniglot dataset. Although our model uses only a simple convolutional neural network, the addition of our memory module allows it to approach much more complex models on 1-shot and multi-shot learning tasks.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Model</td><td>5-way 1-shot</td><td>5-way 5-shot</td><td>20-way 1-shot</td><td>20-way 5-shot</td></tr><tr><td>Pixels Nearest Neighbor</td><td>41.7%</td><td>63.2%</td><td>26.7%</td><td>42.6%</td></tr><tr><td>MANN (no convolutions)</td><td>82.8%</td><td>94.9%</td><td>1</td><td>1</td></tr><tr><td>Convolutional Siamese Net</td><td>96.7%</td><td>98.4%</td><td>88.0%</td><td>96.5%</td></tr><tr><td>Matching Network</td><td>98.1%</td><td>98.9%</td><td>93.8%</td><td>98.5%</td></tr><tr><td>ConvNet with Memory Module</td><td>98.4%</td><td>99.6%</td><td>95.0%</td><td>98.6%</td></tr></table>
|
| 152 |
+
|
| 153 |
+
# 4 EXPERIMENTS
|
| 154 |
+
|
| 155 |
+
We perform experiments using all three architectures described above. We experiment both on realworld data and on synthetic tasks that give us some insight into the performance and limitations of the memory module. In all our experiments we use the Adam optimizer (Kingma & Ba, 2014) and the parameters for the memory module remain unchanged $( k = 2 5 6 , \alpha = 0 . 1 )$ . Good performance with a single set of parameters shows the versatility of our memory module. The source code for the memory module, together with our settings for Omniglot, is available on github1.
|
| 156 |
+
|
| 157 |
+
Omniglot. The Omniglot dataset (Lake et al., 2011) consists of 1623 characters from 50 different alphabets, each hand-drawn by 20 different people. The large number of classes (characters) with relatively few data per class (20), makes this an ideal data set for testing one-shot classification. In the $N$ -way Omniglot task setup we pick $N$ unseen character classes, independent of alphabet. We provide the model with one drawing of each character and measure its accuracy the $K$ -th time it sees the character class. Our setup is identical to Oriol Vinyals (2016b), so we also augmented the data set with random rotations by multiples of 90 degrees and use 1200 characters for training, and the remaining character classes for evaluation. We present the results from Oriol Vinyals (2016b) and ours in Table 1. Even with a simpler network without batch normalization, we get similar results.
|
| 158 |
+
|
| 159 |
+
Synthetic task. To better understand the memory module operation and to test what it can remember, we devise a synthetic task and train the Extended Neural GPU with and without memory (we use a small Extended Neural GPU with 32 channels and memory of size half a million).
|
| 160 |
+
|
| 161 |
+
To create training and test data for our synthetic task, we use symbols from the set $S \_ =$ $\{ 2 , \ldots , 1 6 0 0 0 \}$ and first fix a random function $f : S S$ . The function $f$ is chosen at random, but fixed and the same for all training and testing examples (we used 40K training examples).
|
| 162 |
+
|
| 163 |
+
In our synthetic task, the input is a sequence consisting of As and Bs with one continuous substring of 7 digits from the set $0 , 1 , 2 , 3$ . The substring is interpreted as a number written in base-4, e.g., $1 9 8 2 = 1 3 2 3 3 2 _ { 4 }$ , so the string 132332 would be interpreted as 1982. The corresponding output is created by copying all As and Bs, but mapping the number through the random function $f$ . For instance, assuming ${ \bar { f } } ( 1 9 8 2 ) = 3 7 2 6$ , the output corresponding to 132332 would be 322032 as $3 7 2 6 = 3 2 2 0 3 2 _ { 4 }$ . Here is an example of an input-output pair:
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1>Input</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>B</td></tr><tr><td rowspan=1 colspan=1>Output</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>B</td></tr></table>
|
| 166 |
+
|
| 167 |
+
This task clearly requires memory to store the fixed random function. Since there are 16K elements to learn, it is hard to memorize, and each single instance occurs quite rarely. The raw Extended Neural GPU (or any other sequence-to-sequence model) are limited by their size. With long training, the small model can memorize some of the sequences, but it is only a small fraction.
|
| 168 |
+
|
| 169 |
+
Additionally, there is no direct indication in the data what part of the input should trigger the production of each output symbol. For example, to produce the first 3 output in the above example, the
|
| 170 |
+
|
| 171 |
+
Table 2: Results on the synthetic task. We report the percentage of fully correct sequences from the test set, which contains 10000 random examples. See text for details.
|
| 172 |
+
|
| 173 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Accuracy</td></tr><tr><td rowspan=1 colspan=1>HammingNearestNeighborBaseline Sequence-to-Sequence with AttentionBaseline Extended Neural GPU</td><td rowspan=1 colspan=1>0.1%0.9%12.2%</td></tr><tr><td rowspan=1 colspan=1>Sequence-to-Sequence with Attention and MemoryExtended Neural GPU with Memory Module</td><td rowspan=1 colspan=1>35.2%71.3%</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Table 3: Results on the WMT En-De task. As described in the text, we split the test set in two (odd lines and even lines) to evaluate the model on one-shot learning. Given the even test set, the model can perform better on the odd test set. We also see a dramatic improvement when the model is provided with the whole test set, validating that the memory module is working as intended.
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Full Test</td><td rowspan=1 colspan=1>Odd Test</td></tr><tr><td rowspan=1 colspan=1>GNMT</td><td rowspan=1 colspan=1>23.25</td><td rowspan=1 colspan=1>23.17</td></tr><tr><td rowspan=1 colspan=1>GNMT withMemoryModule</td><td rowspan=1 colspan=1>23.29</td><td rowspan=1 colspan=1>23.16</td></tr><tr><td rowspan=1 colspan=1>GNMTwithMemoryModule andEven Testcontext</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>23.60</td></tr><tr><td rowspan=1 colspan=1>GNMT with Memory Module and Whole Test context</td><td rowspan=1 colspan=1>31.11*</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 178 |
+
|
| 179 |
+
memory key needs to encode all base-4 symbols from the input. Not just one or two aligned symbols, but a number of them. Moreover, it should not encode more symbols or it will not generalize to the test set. Similarly, a basic nearest neighbor classifier fails on this task. We use sequences of length up to 40 during training, but there are only 7 relevant symbols. The simple nearest neighbor by Hamming distance will most probably select some sequence with similar prefix or suffix of As and Bs, and not the one with the corresponding base-4 part. We also trained a large sequence-tosequence model with attention on this task (a 2-layer LSTM model with 256 units in each layer). This model can memorize the whole training set, but it suffers from a similar problem as the Hamming nearest neighbor – it almost doesn’t generalize, its accuracy on the test set is only about $1 \%$ . The same model with a memory module generalizes much better, reaching over $3 0 \%$ accuracy. The Extended Neural GPU with our memory module yields even better results, see Table 2.
|
| 180 |
+
|
| 181 |
+
Translation. To evaluate the memory module in a large-scale setting we use the GNMT model (Wu et al., 2016) extended with our memory module on the WMT14 English-to-German translation task. We evaluate the model both qualitatively and quantitatively.
|
| 182 |
+
|
| 183 |
+
On the qualitative side, we note that our memory-augmented model can successfully translate rare words like Dostoevsky, unlike the baseline model which predicts an identity-mapped Dostoevsky for the German translation of Dostoevsky.
|
| 184 |
+
|
| 185 |
+
On the quantitative side, we use the WMT test set. We find that in terms of BLEU score, an aggregate measure, the memory-augmented GNMT is on par with the baseline GNMT, see Table 3.
|
| 186 |
+
|
| 187 |
+
To evaluate our memory-augmented model for one-shot capabilities we split the test set in two. We take the even lines of the test set (index starting at 0) as a context set and the odd lines of the test set as the one-shot evaluation set. While showing the context set to the model, no additional training occurs, only memory updates are allowed. So the weights of the model do not change, but the memory does. Since the sentences in the test set are highly-correlated to each other (they come from paragraphs with preserved order), we expect that if we allow a one-shot capable model to use the context set to update its memory and then evaluate it on the other half of the test set, its accuracy will increase. For our GNMT with memory model, we passed the context set through the memory update operations 3 times. As seen in Table 3, the context set indeed helps when evaluating on the odd lines, increasing the BLEU score by almost 0.5. As further indication that our memory module works properly, we also evaluate the model after showing the whole test set as a context set. Note that this is essentially an oracle: the memory module gets to see all the correct answers, we do this only to test and debug. As expected, this increases BLEU score dramatically, by over 8 points.
|
| 188 |
+
|
| 189 |
+
# 5 DISCUSSION
|
| 190 |
+
|
| 191 |
+
We presented a long-term memory module that can be used for life-long learning. It is versatile, so it can be added to different deep learning models and at different layers to give the networks one-shot learning capability. Several parts of the presented memory module could be tuned and studied in more detail. The update rule that averages the query with the correct key could be parametrized. Instead of returning only the single nearest neighbor we could also return a number of them to be processed by other layers of the network. We leave these questions for future research.
|
| 192 |
+
|
| 193 |
+
The main issue we encountered, though, is that evaluating one-shot learning is difficult, as standard metrics do not focus on this scenario. In this work, we adapted the standard metrics to investigate our approach. For example, in the translation task we used half of the test set as context for the other half, and we still report the standard BLEU score. This allows us to show that our module works, but it is only a temporary solution. Better metrics are needed to accelerate progress of one-shot and life-long learning. Thus, we consider the present work as just a first step on the way to making deep models learn to remember rare events through their lifetime.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
A. Andoni and P. Indyk. Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions. In 2006 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS’06), pp. 459–468, Oct 2006. doi: 10.1109/FOCS.2006.49.
|
| 198 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. URL http://arxiv.org/ abs/1409.0473.
|
| 199 |
+
Antoine Bordes, Nicolas Usunier, Sumit Chopra, and Jason Weston. Large-scale simple question answering with memory networks. CoRR, abs/1506.02075, 2015. URL http://arxiv.org/ abs/1506.02075.
|
| 200 |
+
Sarath Chandar, Sungjin Ahn, Hugo Larochelle, Pascal Vincent, Gerald Tesauro, and Yoshua Bengio. Hierarchical memory networks. arXiv preprint arXiv:1605.07427, 2016.
|
| 201 |
+
Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. URL http://arxiv.org/abs/1406. 1078.
|
| 202 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE Trans. Pattern Anal. Mach. Intell., 28(4):594–611, April 2006. ISSN 0162-8828. doi: 10.1109/TPAMI. 2006.79. URL http://dx.doi.org/10.1109/TPAMI.2006.79.
|
| 203 |
+
Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. URL http://arxiv.org/abs/1410.5401.
|
| 204 |
+
C¸ aglar Gulc¸ehre, Sarath Chandar, Kyunghyun Cho, and Yoshua Bengio. Dynamic neural turing ¨ machine with soft and hard addressing schemes. CoRR, abs/1607.00036, 2016.
|
| 205 |
+
Felix Hill, Antoine Bordes, Sumit Chopra, and Jason Weston. The goldilocks principle: Reading children’s books with explicit memory representations. CoRR, abs/1511.02301, 2015.
|
| 206 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdelrahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara Sainath, and Brian Kingsbury. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012.
|
| 207 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 208 |
+
Piotr Indyk and Rajeev Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the thirtieth annual ACM symposium on Theory of computing, pp. 604–613. ACM, 1998.
|
| 209 |
+
|
| 210 |
+
Łukasz Kaiser and Samy Bengio. Can active memory replace attention? In Advances in Neural Information Processing Systems, (NIPS), 2016.
|
| 211 |
+
|
| 212 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 213 |
+
|
| 214 |
+
Gregory Koch. Siamese neural networks for one-shot image recognition. PhD thesis, University of Toronto, 2015.
|
| 215 |
+
|
| 216 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton. Imagenet classification with deep convolutional neural network. In Advances in Neural Information Processing Systems, 2012.
|
| 217 |
+
|
| 218 |
+
Brenden M Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B Tenenbaum. One shot learning of simple visual concepts. 2011.
|
| 219 |
+
|
| 220 |
+
Manjunath Kudlur Oriol Vinyals, Samy Bengio. Order matters: Sequence to sequence for sets. In International Conference on Learning Representations (ICLR), 2016a.
|
| 221 |
+
|
| 222 |
+
Timothy Lillicrap Koray Kavukcuoglu Daan Wierstra Oriol Vinyals, Charles Blundell. Matching networks for one shot learning. CoRR, abs/1606.04080, 2016b.
|
| 223 |
+
|
| 224 |
+
Jack W Rae, Jonathan J Hunt, Tim Harley, Ivo Danihelka, Andrew Senior, Greg Wayne, Alex Graves, and Timothy P Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes. In Advances in Neural Information Processing Systems, (NIPS), 2016.
|
| 225 |
+
|
| 226 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Oneshot learning with memory-augmented neural networks. CoRR, abs/1605.06065, 2016.
|
| 227 |
+
|
| 228 |
+
Florian Schroff, Dmitry Kalenichenko, and James Philbin. Facenet: A unified embedding for face recognition and clustering. In CVPR, pp. 815–823, 2015.
|
| 229 |
+
|
| 230 |
+
Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. Weakly supervised memory networks. CoRR, abs/1503.08895, 2015. URL http://arxiv.org/abs/1503.08895.
|
| 231 |
+
|
| 232 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, pp. 3104–3112, 2014.
|
| 233 |
+
|
| 234 |
+
Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. CoRR, abs/1606.04080, 2016.
|
| 235 |
+
|
| 236 |
+
Kilian Q Weinberger and Lawrence K Saul. Distance metric learning for large margin nearest neighbor classification. Journal of Machine Learning Research, 10(Feb):207–244, 2009.
|
| 237 |
+
|
| 238 |
+
Jason Weston, Samy Bengio, and Nicolas Usunier. Wsabie: Scaling up to large vocabulary image annotation. In Proceedings of the International Joint Conference on Artificial Intelligence, IJCAI, 2011.
|
| 239 |
+
|
| 240 |
+
Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. CoRR, abs/1410.3916, 2014. URL http://arxiv.org/abs/1410.3916.
|
| 241 |
+
|
| 242 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing Liu, Łukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals, Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging the gap between human and machine translation. CoRR, abs/1609.08144, 2016. URL http://arxiv.org/abs/1609.08144.
|
| 243 |
+
|
| 244 |
+
Kelvin Xu, Jimmy Lei Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015.
|
| 245 |
+
|
| 246 |
+
Wojciech Zaremba and Ilya Sutskever. Reinforcement learning neural turing machines. CoRR, abs/1505.00521, 2015. URL http://arxiv.org/abs/1505.00521.
|