ZHANGYUXUAN-zR commited on
Commit
ee07021
·
verified ·
1 Parent(s): a0679d6

Add files using upload-large-folder tool

Browse files
md/train/9z_dNsC4B5t/9z_dNsC4B5t.md ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # METANORM: LEARNING TO NORMALIZE FEW-SHOT BATCHES ACROSS DOMAINS
2
+
3
+ Yingjun $\mathbf { D } \mathbf { u } ^ { 1 }$ , Xiantong $\mathbf { Z } \mathbf { h e n } ^ { 1 , 2 }$ , Ling Shao2, Cees G. M. Snoek1 1AIM Lab, University of Amsterdam 2Inception Institute of Artificial Intelligence
4
+
5
+ # ABSTRACT
6
+
7
+ Batch normalization plays a crucial role when training deep neural networks. However, batch statistics become unstable with small batch sizes and are unreliable in the presence of distribution shifts. We propose MetaNorm, a simple yet effective meta-learning normalization. It tackles the aforementioned issues in a unified way by leveraging the meta-learning setting and learns to infer adaptive statistics for batch normalization. MetaNorm is generic, flexible and model-agnostic, making it a simple plug-and-play module that is seamlessly embedded into existing meta-learning approaches. It can be efficiently implemented by lightweight hypernetworks with low computational cost. We verify its effectiveness by extensive evaluation on representative tasks suffering from the small batch and domain shift problems: few-shot learning and domain generalization. We further introduce an even more challenging setting: few-shot domain generalization. Results demonstrate that MetaNorm consistently achieves better, or at least competitive, accuracy compared to existing batch normalization methods.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Batch normalization (Ioffe & Szegedy, 2015) is crucial for training neural networks, and with its variants, e.g., layer normalization (Ba et al., 2016), group normalization (Wu & He, 2018) and instance normalization (Ulyanov et al., 2016), has thus become an essential part of the deep learning toolkit (Bjorck et al., 2018; Luo et al., 2018a; Yang et al., 2019; Jia et al., 2019; Luo et al., 2018b; Summers & Dinneen, 2020). Batch normalization helps stabilize the distribution of internal activations when a model is being trained. Given a mini-batch $\boldsymbol { B }$ , the normalization is conducted along each individual feature channel for 2D convolutional neural networks. During training, the batch normalization moments are calculated as follows:
12
+
13
+ $$
14
+ \mu _ { B } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } a _ { i } , \sigma _ { B } ^ { 2 } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } ( a _ { i } - \mu _ { B } ) ^ { 2 } ,
15
+ $$
16
+
17
+ where $a _ { i }$ indicates the $i$ -th element of the $M$ activations in the batch, $M = | \boldsymbol { B } | \times H \times W$ , in which $H$ and $W$ are the height and width of the feature map in each channel. We can now apply the normalization statistics to each activation:
18
+
19
+ $$
20
+ a _ { i } ^ { \prime } \mathbf { B N } ( a _ { i } ) \equiv \gamma \hat { a } _ { i } + \beta , \quad \mathrm { w h e r e , } \quad \hat { a } _ { i } = \frac { a _ { i } - \mu _ { \mathcal { B } } } { \sqrt { \sigma _ { \mathcal { B } } ^ { 2 } + \epsilon } } ,
21
+ $$
22
+
23
+ where $\gamma$ and $\beta$ are parameters learned during training, $\epsilon$ is a small scalar to prevent division by 0, and operations between vectors are element-wise. At test time, the standard practice is to normalize activations using the moving average over mini-batch means $\mu _ { B }$ and variance $\bar { \sigma } _ { B } ^ { 2 }$ . Batch normalization is based on an implicit assumption that the samples in the dataset are independent and identically distributed. However, this assumption does not hold in challenging settings like few-shot learning and domain generalization. In this paper, we strive for batch normalization when batches are of small size and suffer from distributions shifts between source and target domains.
24
+
25
+ Batch normalization for few-shot learning and domain generalization problems have so far been considered separately, predominantly in a meta-learning setting. For few-shot meta-learning (Finn et al., 2017; Gordon et al., 2019), most existing methods rely critically on transductive batch normalization, except those based on prototypes (Snell et al., 2017; Allen et al., 2019; Zhen et al., 2020a). However, the nature of transductive learning restricts its application due to the requirement to sample from the test set. To address this issue, Bronskill et al. (2020) proposes TaskNorm, which leverages other statistics from both layer and instance normalization. As a non-transductive normalization approach, it achieves impressive performance and outperforms conventional batch normalization (Ioffe & Szegedy, 2015). However, its performance is not always performing better than transductive batch normalization. Meanwhile, domain generalization (Muandet et al., 2013; Balaji et al., 2018; Li et al., 2017a;b) suffers from distribution shifts from training to test, which makes it problematic to directly apply statistics calculated from a seen domain to test data from unseen domains (Wang et al., 2019; Seo et al., 2019). Recent works deal with this problem by learning a domain specific normalization (Chang et al., 2019; Seo et al., 2019) or a transferable normalization in place of existing normalization techniques (Wang et al., 2019). We address the batch normalization challenges for few-shot classification and domain generalization in a unified way by learning a new batch normalization under the meta-learning setting.
26
+
27
+ We propose MetaNorm, a simple but effective meta-learning normalization. We leverage the metalearning setting and learn to infer normalization statistics from data, instead of applying direct calculations or blending various normalization statistics. MetaNorm is a general batch normalization approach, which is model-agnostic and serves as a plug-and-play module that can be seamlessly embedded into existing meta-learning approaches. We demonstrate its effectiveness for few-shot classification and domain generalization, where it learns task-specific statistics from limited data samples in the support set for each few-shot task; and it can also learn to generate domain-specific statistics from the seen source domains for unseen target domains. We verify the effectiveness of MetaNorm by extensive evaluation on few-shot classification and domain generalization tasks. For few-shot classification, we experiment with representative gradient, metric and model-based meta-learning approaches on fourteen benchmark datasets. For domain generalization, we evaluate the model on three widely-used benchmarks for cross-domain visual object classification. Last but not least, we introduce the challenging new task of few-shot domain generalization, which combines the challenges of both few-shot learning and domain generalization. The experimental results demonstrate the benefit of MetaNorm compared to existing batch normalizations.
28
+
29
+ # 2 RELATED WORKS
30
+
31
+ Transductive Batch Normalization For conventional batch normalization under supervised settings, i.i.d. assumptions about the data distribution imply that estimating moments from the training set will provide appropriate normalization statistics for test data. However, in the meta-learning scenario data points are only assumed to be i.i.d. within a specific task. Therefore, it is critical to select the moments when batch normalization is applied to support and query set data points during meta training and meta testing. Hence, in the recent meta-learning literature the running moments are no longer used for normalization at meta-test time, but instead replaced with support/query set statistics. These statistics are used for normalization, both at meta-train and meta-test time. This approach is referred to as transductive batch normalization (TBN) (Bronskill et al., 2020). Competitive meta-learning methods (e.g., Gordon et al., 2019; Finn et al., 2017; Zhen et al., 2020b) rely on TBN to achieve state-of-the-art performance. However, there are two critical problems with TBN. First, TBN is sensitive to the distribution over the query set used during meta-training, and as such is less generally applicable than non-transductive learning. Second, TBN uses extra information for multiple test samples, compared to non-transductive batch normalization at prediction time, which could be problematic as we are not guaranteed to have a set of test samples available during training in practical applications. In contrast, MetaNorm is a non-transductive normalization. It generates statistics from the support set only, without relying on query samples, making it more practical.
32
+
33
+ Meta Batch Normalization To address the problem of transductive batch normalization and improve conventional batch normalization, meta-batch normalization (MetaBN) was introduced (Triantafillou et al., 2020; Bronskill et al., 2020). In MetaBN, the support set alone is used to compute the normalization statistics for both the support and query sets at both meta-training and meta-test time. MetaBN is non-transductive since the normalization of a test input does not depend on other test inputs in the query set. However, Bronskill et al. (2020) observe that MetaBN performs less well for small-sized support sets. This leads to high variance in moment estimates, which is similar to the difficulty of using batch normalization with small-batch training (Wu & He, 2018). To address this issue, Bronskill et al. (2020) proposed TaskNorm, which learns to combine statistics from both layer normalization and instance normalization, with a lending parameter to be learned at meta-train time. As a non-transductive normalization, TaskNorm achieves impressive performance, outperforming conventional batch normalization. However, it can not always perform better than transductive batch normalization. TaskNorm indicates non-transductive batch normalization estimates proper normalization statistics by involving learning in the normalization process. We also propose to learn batch normalization within the meta-learning framework, but instead of employing a learnable combination of existing normalization statistics, we directly learn to infer statistics from data. At meta-train time, the model learns to acquire the ability to generate statistics only from the support set and at meta-test time we directly apply the model to infer statistics for new tasks.
34
+
35
+ Batch Normalization for Domain Adaptation and Domain Generalization Domain adaption suffers from a distribution shift between source and target domains, which makes it sub-optimal to directly apply batch normalization (Bilen & Vedaldi, 2017). Li et al. (2016) proposed adaptive batch normalization to increase the generalization ability of a deep neural network. By modulating the statistical information of all batch normalization layers in the neural network, it achieves deep adaptation effects for domain-adaptive tasks. Nado et al. (2020) noted the possibility of accessing small unlabeled batches of the shifted data just before prediction time. To improve model accuracy and calibration under covariate shift, they proposed prediction-time batch normalization. Since the activation statistics obtained during training do not reflect statistics of the test distribution, when testing in an out-of-distribution environment, Schneider et al. (2020) proposed estimating the batch statistics on the corrupted images. Kaku et al. (2020) demonstrated that standard non-adaptive feature normalization fails to correctly normalize the features of convolutional neural networks on held-out data where extraneous variables take values not seen during training. Learning domain-specific batch normalization has been explored (Chang et al., 2019; Wang et al., 2019). Wang et al. (2019) introduced transferable normalization, TransNorm, which normalizes the feature representations from source and target domain separately using domain-specific statistics. Along a similar vein, Chang et al. (2019) proposed a domain-specific batch normalization layer, which consists of two branches, each in charge of a single domain exclusively. The hope is that, through the normalization, the feature representation will become domain invariant. Nevertheless, these normalization methods are specifically designed for domain adaptation tasks, where data from target domains are available, though often unlabelled. This makes them inapplicable to domain generalization tasks where data from target domains are inaccessible at training time. Seo et al. (2019) proposed learning to optimize domain specific normalization for domain generalization tasks. Under the meta-learning settings, a mixture of different normalization techniques is optimized for each domain, where the mixture weights are learned specifically for different domains. Instead of combining different normalization statistics, MetaNorm learns from data to generate adaptive statistics specific to each domain. Moreover, we introduce an even more challenging setting, i.e., few-shot domain generalization, which combines the challenges of few-shot classification and domain generalization.
36
+
37
+ Conditional Batch Normalization de Vries et al. (2017) proposed conditional batch normalization to modulate visual processing by predicting the scalars $\gamma$ and $\beta$ of the batch normalization conditioned on the language from an early processing stage. Conditional batch normalization has also been applied to align different data distributions for domain adaptation (Li et al., 2016). Oreshkin et al. (2018) applies conditional batch normalization to metric-based models for the few-shot classification task. Tseng et al. (2020) proposed a learning-to-learn method to optimize the hyper-parameters of the feature-wise transformation layers by conditional batch normalization for cross-domain classification. Unlike conditional batch normalization, we use extra data (the query set) to generate normalization statistics under the meta-learning setting, rather than the scalars.
38
+
39
+ # 3 METHODOLOGY
40
+
41
+ We view finding appropriate statistics for batch normalization as a density estimation problem. We need to infer the distribution parameters, such as, $\mu$ and $\sigma$ when a Gaussian distribution is presumed, as in existing batch normalization approaches. The motivation behind MetaNorm is to leverage the meta-learning setting and learn from data to generate adaptive normalization statistics. MetaNorm is generic and model-agnostic, addressing batch normalization in a unified way for different settings by minimizing the KL divergence, which is a common metric to measure the difference between two
42
+
43
+ probability distributions:
44
+
45
+ $$
46
+ D _ { \mathrm { K L } } \big [ q _ { \phi } ( m ) | p _ { \theta } ( m ) \big ] ,
47
+ $$
48
+
49
+ where $m$ is a random variable that represents the distribution of activations, $p _ { \theta } ( m )$ and $q _ { \phi } ( m )$ are defined as Gaussian distributions with different implementations depending on the task of interest, e.g., few-shot classification or domain generalization. We leverage the amortized inference technique (Kingma & Welling, 2013) and implement this by inference networks. To be more specific, for each individual channel in each $\ell$ convolutional layer, we infer the moments $\mu$ and $\sigma$ by $f _ { \mu } ^ { \ell } ( \cdot )$ and $f _ { \sigma } ^ { \ell } ( \cdot )$ , respectively, which are realized as multi-layer perceptrons and we call hypernetworks (Ha et al., 2016). Hypernetworks use one network to generate the weights for another network. Our hypernetworks generate the statistics from data by using amortization techniques.
50
+
51
+ We simply incorporate the $D _ { \mathrm { K L } }$ term into the optimization of the existing model with the cross-entropy loss $\mathcal { L } _ { \mathrm { C E } }$ , resulting in a general loss function as follows:
52
+
53
+ $$
54
+ \mathcal { L } = \mathcal { L } _ { \mathrm { C E } } - \lambda D _ { \mathrm { K L } } \big [ q _ { \phi } ( m ) | p _ { \theta } ( m ) \big ]
55
+ $$
56
+
57
+ where $\lambda > 0$ is a regularization hyper-parameter.
58
+
59
+ MetaNorm for Few-Shot Classification In the few-shot classification scenario, we define the $\mathcal { C }$ -way $K$ -shot problem using the episodic formulation from (Vinyals et al., 2016). Each task $\mathcal { T } _ { i }$ is a classification problem sampled from a task distribution $p ( \tau )$ . The tasks are divided into a training meta-set ${ \mathcal { T } } ^ { t r }$ , validation meta-set ${ \mathcal { T } } ^ { \nu a l }$ , and test meta-set $\mathcal { T } ^ { t e s t }$ , each with a disjoint set of target classes (i.e., a class seen during testing is not seen during training). The validation meta-set is used for model selection, and the testing meta-set is used only for final evaluation. Each task instance $\mathcal { T } _ { i } \sim p \left( \mathcal { T } \right)$ is composed of a support set $s$ and a query set $\mathcal { Q }$ , and only contains $N$ classes randomly selected from the appropriate meta-set.
60
+
61
+ We aim to infer statistics from the support set that better match the query set. Therefore, we adopt a straightforward criterion for the inference:
62
+
63
+ $$
64
+ D _ { \mathrm { K L } } \big [ q _ { \phi } ( m | S ) | | p _ { \theta } ( m | Q ) \big ] ,
65
+ $$
66
+
67
+ where we define $q ( m | S ) { = } N ( \mu _ { S } , \sigma _ { S } )$ and $p ( m | Q ) { = } { \mathcal { N } } ( \mu _ { Q } , \sigma _ { Q } )$ , which are the distributions inferred from the support and query sets in a few-shot learning task. By minimizing the KL term in conjunction with the prime objective of a meta-learning algorithm, we are able to find the appropriate statistics from limited data samples for batch normalization. The KL term adheres to a closed form, which makes it easy to implement and computationally efficient. The $p ( m | Q )$ can be estimated by directly calculating statistics using the query set, which however performs inferior to inference by optimization. We note the inference from the query set only happens during meta-training time and we use the learned inference network to generate normalization statistics at meta-test time for a test task using its support set.
68
+
69
+ To infer $\mu _ { S }$ , we deploy an inference function $f _ { \mu } ^ { \ell } ( \cdot )$ that takes activations of a sample as input, and the outputs from all samples are then averaged as the final $\mu _ { S }$ :
70
+
71
+ $$
72
+ \mu _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { i } ) ,
73
+ $$
74
+
75
+ where $\mathbf { a } _ { i } \in \mathbb { R } ^ { w \times h }$ is the flattened vector of the activation map of the $i$ -th sample in the support set, $w$ is the width of activations, and $h$ is the height of the activation map. To infer $\sigma _ { S }$ , we use the obtained $\mu _ { S }$ and deploy a separate inference function $f _ { \sigma } ^ { \ell } ( \cdot )$ :
76
+
77
+ $$
78
+ \sigma _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \sigma } ^ { \ell } \big ( ( \mathbf { a } _ { i } - \mu _ { S } ) ^ { 2 } \big ) .
79
+ $$
80
+
81
+ It is worth mentioning that we actually use each sample to infer the statistics and take the average of all inferred statistics as the final normalization statistics. This enables us to fully exploit the samples to generate more accurate statistics.
82
+
83
+ Note that the inference functions $f _ { \mu } ^ { \ell } ( \cdot )$ and $f _ { \sigma } ^ { \ell } ( \cdot )$ are shared by different channels in the same layer and we will learn $L$ pairs of those functions if we have $L$ convolutional layers in the meta-learning model. They are parameterized by feed-forward multiple layer perception networks, which we call hypernetworks. Using these hypernetworks, we generate support moments $( \mu _ { S } , \sigma _ { S } )$ and query moments $( \mu _ { Q } , \sigma _ { Q } )$ from the support and query sets, which are used for calculating the KL term in Eq. (5) for optimization during meta-training time. At meta-training time, we apply the statistics inferred from the support set for normalization of both support and query samples:
84
+
85
+ $$
86
+ a ^ { \prime } = \gamma \left( \frac { a - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ,
87
+ $$
88
+
89
+ where $\gamma$ and $\beta$ are jointly learned with parameters of the hypernetworks at meta-training time and directly applied at meta-test time, as in conventional batch normalization. At meta-test time, given a test task, we use hypernetworks that take the support set as input to generate normalization statistics directly used for the query set.
90
+
91
+ MetaNorm for Domain Generalization In the domain generalization scenario, we adopt the metalearning setting from (Li et al., 2018a; Balaji et al., 2018; Du et al., 2020), and divide a dataset into the source domains used for training and the target domains held out for testing. At meta-training time, data in the source domains is episodically divided into sets of meta-source $\mathcal { D } ^ { s }$ and meta-target $\mathcal { D } ^ { t }$ domains.
92
+
93
+ In a similar vein to few-shot classification, we would like to learn to acquire the ability to generate domain-specific statistics from a single example, which can then be applied to unseen domains. We assume we can generate reasonable normalization statistics by using only one sample from the new domain, because, intuitively, a single sample already carries sufficient domain information. We use a single example and all the examples in the same domain to infer the domain-specific statistics and minimize the KL term:
94
+
95
+ $$
96
+ D _ { \mathrm { K L } } \big [ q _ { \phi } ( m | \mathbf { a } _ { i } ) | | p _ { \theta } ( m | \mathcal { D } ^ { s } \backslash \mathbf { a } _ { i } ) \big ] ,
97
+ $$
98
+
99
+ where we define $q ( m | \mathbf { a } _ { i } ) { = } { \mathcal { N } } ( { \boldsymbol { \mu } } _ { a } , { \boldsymbol { \sigma } } _ { a } )$ , and $p ( m | \mathcal { D } ^ { s } \backslash \mathbf { a } _ { i } ) { = } \mathcal { N } ( \mu _ { D } , \sigma _ { D } )$ , which are implemented in a similar way as Eq. (6) and Eq. (7), and ${ \bf a } _ { i }$ is an example from its own domain $\mathcal { D } ^ { s }$ . In both the meta-source and meta-target domains, each example is normalized using the statistics generated by itself, like in Eq. (8), in which we make $\gamma$ and $\beta$ shared across all domains. The minimization of the KL term in Eq. (9) is to encourage the model to generate domain-specific statistics for normalization from only a single example. This enables us to generate domain-specific statistics on target domains that are never seen at meta-training time.
100
+
101
+ In practice, we take the sum of all samples in all source domains as follows:
102
+
103
+ $$
104
+ \sum _ { i } ^ { | { \mathcal D } ^ { s } | } \sum _ { j } ^ { J } D _ { \mathrm { K L } } \big [ q _ { \phi } ( m | { \bf a } _ { i } ) | | p _ { \theta } ( m | { \mathcal D } _ { j } ^ { s } \backslash { \bf a } _ { i } ) \big ] ,
105
+ $$
106
+
107
+ where $\mathcal { D } _ { j } ^ { s }$ denotes the $j$ -th of $J$ meta-source domains. The inference networks are first at metatraining time learned and then directly used as examples from the target domain at meta-test time. Note that on the meta-target domain we do not apply the KL term; instead, we simply rely on each example to generate its statistics for normalization.
108
+
109
+ MetaNorm for Few-Shot Domain Generalization We introduce an even more challenging setting, i.e., few-shot domain generalization, that combines the challenges of both few-shot classification and domain generalization. Specifically, we aim to learn a model from a set of classification tasks, each of which has only a few samples in a support set for training and test the model on tasks in a query set, which are in a different domain from the support set. Like few-shot classification, the label space is not shared between training and testing. Cross-domain few-shot learning has been explored recently by Tseng et al. (2020) and Guo et al. (2020). However, the setting of our few-shot domain generalization is different and considered to be more challenging, as the support and query set are from different domains in the meta-test stage and the target domain is also unseen throughout the training stage. An example for the few-shot domain generalization setting is provided in Figure 1.
110
+
111
+ We divide a dataset into the source domains $\boldsymbol { S }$ used for training and the target domains $\tau$ held out for testing. During training time, data in the source domains $s$ is episodically divided into sets of meta-train $D ^ { s }$ and meta-test $\mathcal { D } ^ { t }$ domains. We sample $\mathcal { C }$ -way $k$ -shot data as the support set from each meta-source domain $\mathcal { D } ^ { s }$ , where $k$ is the number of labelled examples for each of the $\mathcal { C }$ classes. We sample $\mathcal { C }$ classes from the meta-test $\mathcal { D } ^ { t }$ domain as the query set. At test time, we sample $\mathcal { C }$ -way $k$ -shot data as the support set from each of the source domains $s$ . The model learned at meta-training time is then fine-tuned on few-shot tasks samples from the source domains and tested on the target domain $\tau$ . To learn the normalization statistics, we minimize the following KL term:
112
+
113
+ ![](images/a12c6a25225a9d04ad0464f882d29e7db657982f95f2e9a30d6b4b5ef7ab8f22.jpg)
114
+ Figure 1: Illustration of the novel few-shot domain generalization scenario using the 5-way, 1-shot setting. The training set in the upper box contains the meta-source domains $\mathcal { D } ^ { s }$ and the meta-target domain $\mathcal { D } ^ { t }$ , which are from different domains. Each training task contains meta-source domains with five different classes and one example of each meta-source domain, and more than four examples for evaluation in the meta-target domain. The test set is defined in the same way but with all source domains $s$ covering classes not present in any of the datasets in the training set, and more than four examples are used for evaluation in the target domain $\tau$ .
115
+
116
+ $$
117
+ \sum _ { i } ^ { | { \mathcal { D } } ^ { s } | } D _ { \mathrm { K L } } [ q _ { \phi } ( m | { \bf a } _ { i } ) | | p _ { \theta } ( m | { \mathcal { D } } ^ { s } ) ] ,
118
+ $$
119
+
120
+ where ${ \bf a } _ { i }$ is the activation associated with each sample from the meta-source domain $\mathcal { D } ^ { s }$ . Likewise, $q ( m | \mathbf { a } _ { i } )$ and $p ( m | \mathcal { D } ^ { s } )$ are also defined as factorized Gaussian distributions. We also adopt $\gamma$ and $\beta$ , which are shared across tasks and jointly learned. MetaNorm learns to acquire the ability to generate proper statistics for itself, and applies it to the samples in the meta-target domain.
121
+
122
+ # 4 EXPERIMENTAL RESULTS
123
+
124
+ We conduct an extensive set of experiments on a total of 17 datasets containing more than 15 million images. We use three representative approaches to meta-learning as our base models, i.e., MAML (Finn et al., 2017), ProtoNets (Snell et al., 2017), and VERSA (Gordon et al., 2019), which can verify our MetaNorm is generic, flexible and model-agnostic, making it a simple plug-and-play module that is seamlessly embedded into existing meta-learning approaches. We further compare different normalization methods: transductive batch normalization (TBN), “example” that denotes testing with one example at a time by using TBN, “class” that denotes testing with one class at a time by using TBN, w/o BN which is not using batch normalization, CBN which is using conventional batch normalization, RN (Nichol et al., 2018), MetaBN (Bronskill et al., 2020), TaskNorm-L (Bronskill et al., 2020), and TaskNorm-I (Bronskill et al., 2020). All details about datasets and implementation settings are provided in the appendix. More experimental results, including convergence analysis, are also provided in the appendix. Our code will be publicly released. 1
125
+
126
+ Effect of KL Term We first conduct ablation studies that measure the effectiveness of MetaNorm. The key of MetaNorm is the introduced KL term for learning to learn statistics. We test the performance of MetaNorm without the KL term by directly using the statistics generated from data.
127
+
128
+ Table 1: Effect of KL Term in MetaNorm for few-shot classification with MAML (Finn & Levine, 2018) on miniImageNet and domain generalization on PACS with ResNet-18. More few-shot classification results with ProtoNets (Snell et al., 2017) and VERSA (Gordon et al., 2019), as well as domain generalization results on Office-Home are provided in the appendix. Best performing methods and any other runs within the $9 5 \%$ confidence margin in bold. The KL term is crucial.
129
+
130
+ ![](images/263fcc7035b7f5105f1b2577ddbf1ede5433bef8be0206960a025a0ba9572f69.jpg)
131
+ Figure 2: Impact of Target Set Size. The performance increases for larger target sets and plateaus at around 125 for few-shot classification on miniImageNet and around 256 for domain generalization on PACS. TBN here is based on VERSA. MetaNorm generates proper normalization statistics with a reasonable batch size.
132
+
133
+ In this case, we also use the hypernetworks to generate the moments, $\mu$ and $\sigma$ by simply removing the KL term in the objective function. In Table 1 we present results for few-shot classification on miniImageNet (Vinyals et al., 2016) and for domain generalization on PACS (Li et al., 2017a). The performance of MetaNorm without KL degrades significantly. This is expected, as without the KL term the generation process of normalization statistics lacks direct supervision from the target distribution, resulting in improper statistics.
134
+
135
+ Impact of Target Set Size The other key parameter in MetaNorm is the size of the target set; that is, the number $| \mathcal { Q } |$ of samples in the query set (in few-shot classification) and the number $| \mathcal { D } ^ { s } |$ of samples in each domain (in domain generalization). This parameter is important when learning normalization statistics because we use the statistics generated by the target set as the ‘ground truth’. We evaluate its impact on the performance of MetaNorm in Figure 2. The experimental results show that TBN is not affected by the target size, both in the 5-way, 1-shot and 5 way, 5-shot tasks. MetaNorm performance rises as the size of the target set increases and plateaus at a reasonable size. In the few-shot setting, the performance reaches its peak at a size of about 125, which is slightly larger than the standard size of 75, while in the domain generalization setting, the performance plateaus at a size of about 128. This demonstrates that we are able to generate proper statistics with the mini-batch gradient descent optimization. In scenarios demanding a very small target set size, we could leverage image synthesis techniques to generate more samples for the targets sets.
136
+
137
+ Sensitivity to Algorithm We evaluate MetaNorm using the MAML (Finn et al., 2017), ProtoNets (Snell et al., 2017) and VERSA (Gordon et al., 2019) algorithms, which are representative gradient, metric and model based meta-learning approaches for few-shot classification. These experiments are conducted on the Omniglot and miniImageNet datasets under different settings. The comparison results on miniImageNet are summarized in Table 2 and the results on Omniglot are provided in the appendix. For all three meta-learning approaches under all settings, MetaNorm consistently achieves comparable performance both to the non-transductive and transductive normalization methods. Being non-transductive, TaskNorm can achieve impressive performance on all the tasks, but its performance is not always better than transductive batch normalization. MetaNorm achieves comparable performance to transductive batch normalization, especially under the 5-way-1-shot setting, which is challenging since only a few examples are available to generate statistics. Notice that, MetaNorm performs well with the standard query set size $| \mathcal { Q } |$ of 75 (15 per category). It is slightly better than non-transductive TaskNorm and comparable with TBN. MetaNorm achieves its best performance with a query size $| \mathcal { Q } |$ of 125 (25 per category), only slightly larger than the standard size of 75. This demonstrates the benefit of leveraging meta-learning by MetaNorm for batch normalization. We conclude that MetaNorm is general and serves as a plug-and-play module for existing meta-learning models to improve their performance.
138
+
139
+ Table 2: Sensitivity to Algorithm. Few-shot results on miniImageNet using different algorithms. Results on Omniglot are provided in the appendix. Best performing methods and any other runs within the $9 5 \%$ confidence margin in bold. Transductive results indicated above dashed line. MetaNorm is a consistent top-performer, regardless of the meta-learning algorithm.
140
+
141
+ <table><tr><td rowspan="2"></td><td colspan="2">ProtoNets†</td><td colspan="2">MAML†</td><td colspan="2">VERSA†</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><td>5-way,1-shot</td><td>5-way, 5-shot</td></tr><tr><td>TBN</td><td>45.9 ±0.6</td><td>65.5 ± 0.9</td><td>45.5 ±1.8</td><td>59.7 ± 0.9</td><td>53.4 ±1.8</td><td>67.3 ±0.9</td></tr><tr><td>example</td><td>43.9 ± 1.9</td><td>60.1 ± 0.8</td><td>26.9 ± 1.5</td><td>30.3 ±0.7</td><td>44.1 ± 1.7</td><td>60.3 ± 0.7</td></tr><tr><td>class</td><td>43.1 ± 1.8</td><td>59.8±0.8</td><td>26.9 ± 1.5</td><td>27.2 ±0.6</td><td>43.8 ± 1.8</td><td>59.7 ±0.6</td></tr><tr><td>w/BN</td><td>44.1 ±0.5</td><td>60.1 ±0.6</td><td>34.7 ±1.5</td><td>51.3±0.8</td><td>48.1 ±1.5</td><td>63.8 ±0.6</td></tr><tr><td>CBN (Ioffe &amp; Szegedy,2015)</td><td>47.8 ± 0.6</td><td>66.7 ± 0.5</td><td>20.1 ± 0.0</td><td>20.2 ± 0.2</td><td>45.7 ± 1.4</td><td>60.7 ± 0.8</td></tr><tr><td>RN (Nichol et al., 2018)</td><td>39.7 ± 0.5</td><td>63.1 ± 0.5</td><td>40.7 ± 1.7</td><td>57.6 ± 0.9</td><td></td><td></td></tr><tr><td>MetaBN (Bronskill et al., 2020)</td><td>42.6 ± 0.6</td><td>64.6 ± 0.5</td><td>41.6 ± 1.6</td><td>58.6 ± 0.9</td><td>50.1 ± 1.7</td><td>65.8 ± 0.9</td></tr><tr><td>TaskNorm-L (Bronskill et al.,2020)</td><td>47.5 ± 0.6</td><td>65.3 ± 0.5</td><td>42.0 ± 1.7</td><td>58.1 ± 0.9</td><td>52.1 ± 1.6</td><td>66.1 ± 0.7</td></tr><tr><td>TaskNorm-I (Bronskill et al., 2020)</td><td>43.2 ± 0.6</td><td>63.9 ±0.5</td><td>42.4 ± 1.7</td><td>58.7 ±0.9</td><td>52.9 ± 1.7</td><td>66.5 ±0.8</td></tr><tr><td>MetaNorm (|Q|=75)</td><td>47.3 ± 0.6</td><td>65.4 ± 0.5</td><td>44.7 ± 1.5</td><td>59.6 ± 0.8</td><td>52.7 ± 1.6</td><td>67.5 ± 0.8</td></tr><tr><td>MetaNorm (|Q|= 125)</td><td>48.1 ± 0.6</td><td>65.9 ± 0.9</td><td>46.8 ± 1.6</td><td>60.1 ± 0.8</td><td>53.7 ± 1.6</td><td>68.1 ± 0.8</td></tr></table>
142
+
143
+ † Results for MAML and ProtoNets (except w/o BN) provided by (Bronskill et al., 2020), and VERSA with TBN provided by (Gordon et al., 2019). All other results based on our re-implementations.
144
+
145
+ Sensitivity to Dataset We evaluate MetaNorm on a demanding few-shot classification challenge called Meta-Dataset (Triantafillou et al., 2020), which is composed of thirteen image classification datasets (eight for training, five testing). To compare with previous work, we perform experiments with ProtoNets and report the results in Table 3. All thirteen per-dataset results can be found in the appendix. MetaNorm achieves high performance in terms of average rank, with highest accuracy on eight of the thirteen datasets. MetaNorm outperforms transductive batch normalization on eleven datasets. It achieves comparable performance with transductive batch normalization on Omniglot and MNIST, which are relatively less challenging. Moreover, MetaNorm performs better than TaskNorm on seven of the thirteen datasets. We conclude that MetaNorm is effective, outperforming alternative normalizations for most datasets.
146
+
147
+ Table 3: Sensitivity to Dataset. Few-shot classification on Meta-Dataset using ProtoNets. MetaNorm performs best overall.
148
+
149
+ <table><tr><td>Wins</td><td>Rank</td></tr><tr><td>IN 1</td><td>10.61</td></tr><tr><td>CBN /</td><td>9.11</td></tr><tr><td>LN 3</td><td>8.19</td></tr><tr><td>TaskNorm-r</td><td>7.88</td></tr><tr><td>BRN 1</td><td>6.23</td></tr><tr><td>TBN 2</td><td>4.81</td></tr><tr><td>MetaBN 4</td><td>4.78</td></tr><tr><td>RN 3</td><td>4.73</td></tr><tr><td>TaskNorm-L 4</td><td>4.19</td></tr><tr><td>TaskNorm-I 6</td><td>3.07</td></tr><tr><td>MetaNorm 10</td><td>2.35</td></tr></table>
150
+
151
+ Sensitivity to Domains For this experiment we adopt two widely-used benchmarks for domain generalization of visual object recognition, i.e., PACS (Li et al., 2017a) and Office-Home (Venkateswara et al., 2017). Detailed descriptions on the experimental settings and implementations are provided in the appendix. For fair comparison with prior methods (Balaji et al., 2018; Li et al., 2018b; Seo et al., 2019), we employ ResNet-18 as the backbone network in all experiments. As shown in Table 4, MetaNorm achieves the best performance on PACS and Office-Home in terms of average accuracy. On PACS, MetaNorm consistently outperforms other normalization approaches including domain-specific normalization (Seo et al., 2019), on all four domains. It is worth mentioning that the baseline normalization uses the statistics from the source domains for the batch normalization of the target domain. As expected, the baseline method produces relatively poor performance on most domains, since the source domains cannot provide proper statistics for target domains due to the distribution shift. We have also done an experiment using standard batch normalization. In the training stage, we compute the ground truth statistics using all the test data on the meta-target domain $\mathcal { D } ^ { t }$ instead of using inferred statistics $p ( m | \mathcal { D } ^ { s } \backslash \mathbf { a } _ { i } )$ . MetaNorm is still better on most domains and on average. This is reasonable because ground truth statistics from the test data do not necessarily reflect the true data distribution. The experimental results demonstrate MetaNorm can generate reasonable normalization statistics from only one sample in its domain. We conclude that MetaNorm is effective for domain generalization.
152
+
153
+ Table 4: Sensitivity to Domains. Performance comparison on domain generalization. MetaNorm consistently achieves the best performance among all normalization methods.
154
+
155
+ <table><tr><td rowspan="2"></td><td colspan="5">PACS</td><td colspan="5">Office-Home</td></tr><tr><td>Photo</td><td>Art</td><td>Cartoon</td><td>Sketch</td><td>Mean</td><td>Art</td><td>Clipart</td><td>Product</td><td>Real-World</td><td>Mean</td></tr><tr><td>Baseline</td><td>95.87</td><td>78.47</td><td>70.41</td><td>70.68</td><td>78.86</td><td>58.71</td><td>44.20</td><td>71.75</td><td>73.19</td><td>61.96</td></tr><tr><td> IBN (Pan et al., 2018)</td><td>92.04</td><td>75.29</td><td>72.95</td><td>77.42</td><td>79.43</td><td>55.41</td><td>44.82</td><td>68.28</td><td>71.95</td><td>60.09</td></tr><tr><td>DSBN (Chang et al., 2019)</td><td>95.51</td><td>78.61</td><td>66.17</td><td>70.15</td><td>77.61</td><td>59.04</td><td>45.02</td><td>72.67</td><td>71.98</td><td>62.18</td></tr><tr><td> SN (Luo et al., 2018a)</td><td>93.47</td><td>82.50</td><td>76.80</td><td>80.77</td><td>83.38</td><td>54.10</td><td>44.97</td><td>64.54</td><td>71.40</td><td>58.75</td></tr><tr><td>DSON (Seo et al., 2019)</td><td>95.87</td><td>84.67</td><td>77.65</td><td>82.23</td><td>85.11</td><td>59.37</td><td>45.70</td><td>71.84</td><td>74.68</td><td>62.90</td></tr><tr><td>Ground truth statistics</td><td>95.78</td><td>85.17</td><td>78.15</td><td>82.91</td><td>85.50</td><td>59.35</td><td>46.12</td><td>72.77</td><td>75.08</td><td>63.33</td></tr><tr><td> MetaNorm</td><td>95.99</td><td>85.01</td><td>78.63</td><td>83.17</td><td>85.70</td><td>59.77</td><td>45.98</td><td>73.13</td><td>75.29</td><td>63.55</td></tr></table>
156
+
157
+ Few-Shot Domain Generalization In our final experiment, we adopt the DomainNet dataset (Peng et al., 2019) and introduce a new, more challenging setting to evaluate the performance for few-shot domain generalization. Detailed descriptions on the dataset and experimental settings are provided in the appendix. We conduct the experiments with the MAML and ProtoNets algorithms under both 5-way 1-shot and 5-way 5-shot settings, and the results are reported in Table 5. We implement transductive batch normalization, MetaBN and the variants of TaskNorm for direct comparison. Under both settings, our MetaNorm produces the best performance and surpasses the transductive batch normalization by large margins of up to $4 . 0 \%$ on the challenging 5-way 1-shot setting with MAML. MetaNorm also achieves better results than the non-transductive TaskNorm approaches. At the same time, with ProtoNet our MetaNorm again consistently delivers the best performance and surpasses both transductive and non-transductive normalizations, The performance on the challenging few-shot domain generalization scenario with different meta-learning algorithms again demonstrates the effectiveness of MetaNorm in handling the challenges of batch normalization for small batches and across domains.
158
+
159
+ Table 5: Few-Shot Domain Generalization. Comparison with different normalizations using MAML and ProtoNets on the Few-shot DomainNet dataset. Best performing methods and any other runs within the $9 5 \%$ confidence margin denoted in bold. Reported results use “Painting” as the target domain, all based on our implementations. MetaNorm consistently achieves top performance.
160
+
161
+ <table><tr><td rowspan="2"></td><td colspan="2">MAML</td><td colspan="2">ProtoNets</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>TBN</td><td>28.7 ± 1.8</td><td>49.3 ± 0.8</td><td>27.9 ± 1.8</td><td>47.1 ± 0.8</td></tr><tr><td>w/o BN</td><td>23.5 ± 1.7</td><td>45.4 ± 0.7</td><td>23.8 ± 1.8</td><td>45.9 ± 0.7</td></tr><tr><td>CBN</td><td>20.0 ± 0.0</td><td>20.1 ± 0.2</td><td>28.4 ± 1.8</td><td>47.9 ± 0.7</td></tr><tr><td>MetaBN</td><td>24.7 ± 1.6</td><td>46.1 ± 0.8</td><td>25.1 ± 1.8</td><td>46.1 ± 0.8</td></tr><tr><td>TaskNorm-L</td><td>26.9 ± 1.7</td><td>47.4 ± 0.8</td><td>29.5 ± 1.6</td><td>48.3 ± 0.8</td></tr><tr><td>TaskNorm-I</td><td>27.5 ± 1.6</td><td>48.8± 0.6</td><td>26.8 ± 1.8</td><td>46.9 ± 0.7</td></tr><tr><td> MetaNorm</td><td> 32.7 ± 1.7</td><td> 51.9 ± 0.9</td><td> 30.7 ± 1.8</td><td> 49.1 ± 0.9</td></tr></table>
162
+
163
+ # 5 CONCLUSION
164
+
165
+ In this paper we present MetaNorm, a meta-learning based batch normalization. MetaNorm tackles the challenging scenarios where the batch size is too small to produce sufficient statistics or when training statistics are not directly applicable to test data due to a domain shift. MetaNorm learns to learn adaptive statistics that are specific to tasks or domains. It is generic and model-agnostic, which enables it to be used with various meta-learning algorithms for different applications. We evaluate MetaNorm on two well-known existing tasks, i.e., few-shot classification and domain generalization, and we also introduce the challenging evaluation scenario of few-shot domain generalization that addresses the small batch and distribution shift problems simultaneously. An extensive evaluation on 17 datasets reveals that MetaNorm consistently achieves results that are better, or at least competitive, compared to other normalization approaches, verifying its effectiveness as a new meta-learning based batch normalization approach.
166
+
167
+ # REFERENCES
168
+
169
+ Kelsey Allen, Evan Shelhamer, Hanul Shin, and Joshua Tenenbaum. Infinite mixture prototypes for few-shot learning. In International Conference on Machine Learning, pp. 232–241. PMLR, 2019. 2
170
+
171
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. 1, 22
172
+
173
+ Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. MetaReg: Towards domain generalization using meta-regularization. In Advances in Neural Information Processing Systems, pp. 998–1008, 2018. 2, 5, 8
174
+
175
+ Hakan Bilen and Andrea Vedaldi. Universal representations: The missing link between faces, text, planktons, and cat breeds. arXiv preprint arXiv:1701.07275, 2017. 3
176
+
177
+ Nils Bjorck, Carla P Gomes, Bart Selman, and Kilian Q Weinberger. Understanding batch normalization. In Advances in Neural Information Processing Systems, pp. 7694–7705, 2018. 1
178
+
179
+ John Bronskill, Jonathan Gordon, James Requeima, Sebastian Nowozin, and Richard Turner. TaskNorm: Rethinking batch normalization for meta-learning. In International Conference on Machine Learning, pp. 4683–4694. 2020. 2, 3, 6, 8, 18, 20, 22
180
+
181
+ Fabio Maria Carlucci, Antonio D’Innocente, Silvia Bucci, Barbara Caputo, and Tatiana Tommasi. Domain generalization by solving jigsaw puzzles. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 15
182
+
183
+ Woong-Gi Chang, Tackgeun You, Seonguk Seo, Suha Kwak, and Bohyung Han. Domain-specific batch normalization for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 7354–7362, 2019. 2, 3, 9
184
+
185
+ Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In IEEE Conference on Computer Vision and Pattern Recognition, 2014. 16
186
+
187
+ Harm de Vries, Florian Strub, Jérémie Mary, Hugo Larochelle, Olivier Pietquin, and Aaron C Courville. Modulating early visual processing by language. In Advances in Neural Information Processing Systems, pp. 6594–6604, 2017. 3
188
+
189
+ Yingjun Du, Jun Xu, Huan Xiong, Qiang Qiu, Xiantong Zhen, Cees G.M. Snoek, and Ling Shao. Learning to learn with variational information bottleneck for domain generalization. In European Conference on Computer Vision, pp. 200–216. Springer, 2020. 5
190
+
191
+ Abdul Fatir. A re-implementation of “prototypical networks for few-shot learning”. https: //github.com/cyvius96/prototypical-network-pytorch, 2018. 18
192
+
193
+ Chelsea Finn. Code for “Model-agnostic meta-learning for fast adaptation of deep networks”. https://github.com/cbfinn/maml, 2017. 17
194
+
195
+ Chelsea Finn and Sergey Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. In International Conference on Learning Representations, 2018. 7, 23
196
+
197
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, pp. 1126–1135, 2017. 1, 2, 6, 7
198
+
199
+ Jonathan Gordon. Code for “Meta-learning probabilistic inference for prediction”. https:// github.com/Gordonjo/versa, 2019. 18
200
+
201
+ Jonathan Gordon, John Bronskill, Matthias Bauer, Sebastian Nowozin, and Richard Turner. Metalearning probabilistic inference for prediction. In International Conference on Learning Representations, 2019. 2, 6, 7, 8, 19, 20
202
+
203
+ Yunhui Guo, Noel C Codella, Leonid Karlinsky, James V Codella, John R Smith, Kate Saenko, Tajana Rosing, and Rogerio Feris. A broader study of cross-domain few-shot learning. In European Conference on Computer Vision, 2020. 5
204
+
205
+ David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016. 4
206
+
207
+ Sebastian Houben, Johannes Stallkamp, Jan Salmen, Marc Schlipsing, and Christian Igel. Detection of traffic signs in real-world images: The German traffic sign detection benchmark. In International joint conference on neural networks, pp. 1–8, 2013. 16
208
+
209
+ Sergey Ioffe. Batch renormalization: Towards reducing minibatch dependence in batch-normalized models. In Advances in Neural Information Processing Systems, pp. 1945–1953. 2017. 22
210
+
211
+ 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. 1, 2, 8, 20, 22
212
+
213
+ Songhao Jia, Ding-Jie Chen, and Hwann-Tzong Chen. Instance-level meta normalization. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 4865–4873, 2019. 1
214
+
215
+ Aakash Kaku, Sreyas Mohan, Avinash Parnandi, Heidi Schambra, and Carlos Fernandez-Granda. Be like water: Robustness to extraneous variables via adaptive feature normalization. arXiv preprint arXiv:2002.04019, 2020. 3
216
+
217
+ Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. 4
218
+
219
+ Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015. 15, 16
220
+
221
+ Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In IEEE International Conference on Computer Vision, pp. 5542–5550, 2017a. 2, 7, 8, 15
222
+
223
+ Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Metalearning for domain generalization. arXiv preprint arXiv:1710.03463, 2017b. 2
224
+
225
+ Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Metalearning for domain generalization. In AAAI Conference on Artificial Intelligence, 2018a. 5
226
+
227
+ Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In IEEE Conference on Computer Vision and Pattern Recognition, pp. 5400–5409, 2018b. 8, 15
228
+
229
+ Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. arXiv preprint arXiv:1603.04779, 2016. 3
230
+
231
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. In European Conference on Computer Vision, pp. 740–755, 2014. 16
232
+
233
+ Ping Luo, Jiamin Ren, Zhanglin Peng, Ruimao Zhang, and Jingyu Li. Differentiable learning-tonormalize via switchable normalization. arXiv preprint arXiv:1806.10779, 2018a. 1, 9
234
+
235
+ Ping Luo, Xinjiang Wang, Wenqi Shao, and Zhanglin Peng. Towards understanding regularization in batch normalization. arXiv preprint arXiv:1809.00846, 2018b. 1
236
+
237
+ Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. 16
238
+
239
+ Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning, pp. 10–18, 2013. 2
240
+
241
+ Zachary Nado, Shreyas Padhy, D Sculley, Alexander D’Amour, Balaji Lakshminarayanan, and Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv preprint arXiv:2006.10963, 2020. 3
242
+
243
+ Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018. 6, 8, 20, 22
244
+
245
+ Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics & Image Processing, pp. 722–729, 2008. 16
246
+
247
+ Boris Oreshkin, Pau Rodríguez López, and Alexandre Lacoste. Tadam: Task dependent adaptive metric for improved few-shot learning. Advances in Neural Information Processing Systems, 31: 721–731, 2018. 3
248
+
249
+ Xingang Pan, Ping Luo, Jianping Shi, and Xiaoou Tang. Two at once: Enhancing learning and generalization capacities via ibn-net. In European Conference on Computer Vision, pp. 464–479, 2018. 9
250
+
251
+ Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In IEEE International Conference on Computer Vision, pp. 1406–1415, 2019. 9, 15
252
+
253
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In International Conference on Learning Representations, 2017. 15
254
+
255
+ James Requeima, Jonathan Gordon, John Bronskill, Sebastian Nowozin, and Richard E Turner. Code for “Fast and flexible multi-task classification using conditional neural adaptive processes”, 2019. 18
256
+
257
+ Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander Berg, and Li Fei-Fei. ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. 16
258
+
259
+ Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. Advances in Neural Information Processing Systems, 33, 2020. 3
260
+
261
+ Seonguk Seo, Yumin Suh, Dongwan Kim, Jongwoo Han, and Bohyung Han. Learning to optimize domain specific normalization for domain generalization. arXiv preprint arXiv:1907.04275, 2019. 2, 3, 8, 9
262
+
263
+ Jake Snell, Kevin Swersky, and Richard Zeme. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, pp. 4077–4087. 2017. 2, 6, 7, 19
264
+
265
+ Cecilia Summers and Michael J Dinneen. Four things everyone should know to improve batch normalization. In International Conference on Learning Representations, 2020. 1
266
+
267
+ Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Utku Evci, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. Metadataset: A dataset of datasets for learning to learn from few examples. In International Conference on Learning Representations, 2020. 2, 8, 16, 18
268
+
269
+ Hung-Yu Tseng, Hsin-Ying Lee, Jia-Bin Huang, and Ming-Hsuan Yang. Cross-domain few-shot classification via learned feature-wise transformation. arXiv preprint arXiv:2001.08735, 2020. 3, 5
270
+
271
+ Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016. 1, 22
272
+
273
+ Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In IEEE Conference on Computer Vision and Pattern Recognition, 2017. 8, 15
274
+
275
+ Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638. 2016. 4, 7, 14, 15
276
+
277
+ Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The CaltechUCSD Birds-200-2011 Dataset. Technical report, 2011. 16
278
+
279
+ Ximei Wang, Ying Jin, Mingsheng Long, Jianmin Wang, and Michael I Jordan. Transferable normalization: Towards improving transferability of deep neural networks. In Advances in Neural Information Processing Systems, pp. 1953–1963, 2019. 2, 3
280
+
281
+ Yuxin Wu and Kaiming He. Group normalization. In European Conference on Computer Vision, pp. 3–19, 2018. 1, 3
282
+
283
+ Greg Yang, Jeffrey Pennington, Vinay Rao, Jascha Sohl-Dickstein, and Samuel S Schoenholz. A mean field theory of batch normalization. arXiv preprint arXiv:1902.08129, 2019. 1
284
+
285
+ Xiantong Zhen, Yingjun Du, Huan Xiong, Qiang Qiu, Cees G.M. Snoek, and Ling Shao. Learning to learn variational semantic memory. Advances in Neural Information Processing Systems, 2020a. 2
286
+
287
+ Xiantong Zhen, Haoliang Sun, Yingjun Du, Jun Xu, Yilong Yin, Ling Shao, and Cees Snoek. Learning to learn kernels with variational random features. In International Conference on Machine Learning, pp. 11409–11419. PMLR, 2020b. 2
288
+
289
+ # A ALGORITHMS DESCRIPTIONS
290
+
291
+ In this Appendix we provide the detailed MetaNorm algorithm descriptions to conduct batch normalization for few-shot classification (Algorithm 1), domain generalization (Algorithm 2) and few-shot domain generalization (Algorithm 3). The dataflow of the implementation is shown in Figure 3.
292
+
293
+ # Algorithm 1 MetaNorm for Few-Shot Classification
294
+
295
+ Meta-train: Input values of $a$ over support set $\mathbf { a } _ { S , i }$ and query set $\mathbf { a } Q , i$ ;
296
+ $\gamma$ , $\beta \gets$ Initialize parameters.
297
+
298
+ $$
299
+ \begin{array} { l } { \displaystyle \mu _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { S , i } ) ; \mu _ { Q } = \frac { 1 } { | Q | } \sum _ { i = 1 } ^ { | Q | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { Q , i } ) ; } \\ { \displaystyle \sigma _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \sigma } ^ { \ell } \left( ( \mathbf { a } _ { S , i } - \mu _ { S } ) ^ { 2 } \right) ; \sigma _ { Q } = \frac { 1 } { | Q | } \sum _ { i = 1 } ^ { | Q | } f _ { \sigma } ^ { \ell } \left( ( \mathbf { a } _ { Q , i } - \mu _ { Q } ) ^ { 2 } \right) ; } \\ { \displaystyle a _ { S , i } ^ { \prime } = \gamma \left( \frac { a _ { S , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; a _ { Q , i } ^ { \prime } = \gamma \left( \frac { a _ { Q , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; } \\ { \displaystyle \mathcal { L } _ { \mathrm { K L } } = D _ { \mathrm { K L } } \left[ N ( \mu _ { S } , \sigma _ { S } ) | | N ( \mu _ { Q } , \sigma _ { Q } ) \right] } \\ { \mathrm { r e t u r n } a _ { S , i } = \mathbf { M e t a N o r m } ( \mathbf { a } _ { S , i } ) ; a _ { Q , i } ^ { \prime } = \mathbf { M e t a N o r m } ( \mathbf { a } _ { Q , i } ) ; \mathcal { L } _ { K L } } \end{array}
300
+ $$
301
+
302
+ Meta-test: Input values of $a$ over support set $\mathbf { a } _ { S , i }$ and query set $\mathbf { a } _ { Q , i }$
303
+
304
+ $$
305
+ \begin{array} { r l } & { \mu _ { S } = \frac { 1 } { | S | } \displaystyle \sum _ { i = 1 } ^ { | S | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { S , i } ) ; } \\ & { \sigma _ { S } = \frac { 1 } { | S | } \displaystyle \sum _ { i = 1 } ^ { | S | } f _ { \sigma } ^ { \ell } \left( ( \mathbf { a } _ { S , i } - \mu _ { S } ) ^ { 2 } \right) ; } \\ & { a _ { Q , i } ^ { \prime } = \gamma \left( \frac { \mathbf { a } _ { Q , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; } \\ & { \mathrm { { r e t u r n } } a _ { Q , i } ^ { \prime } = \mathbf { M e t a N o r m } ( a _ { Q , i } } \end{array}
306
+ $$
307
+
308
+ # Algorithm 2 MetaNorm for Domain Generalization
309
+
310
+ <table><tr><td>Train: Input values of α over meta-source domain as,i and meta-target domain aT,i; γ,β← Initialize parameters.</td></tr><tr><td>|S|</td></tr><tr><td>μs,i= f(as,i); μs= f(as,i);</td></tr><tr><td>S σS,i = f(as,i - μs,i)²);σs = f((as,i-μs)²); M</td></tr><tr><td>μT,i = f²(aT,i); OT,i = f&((aT,i - μT,i)²);</td></tr><tr><td>aT,i =γ aT,i-μT,i +β;</td></tr><tr><td>V+e LKL=DkL[N(μs,),σs,))lIN(μs,σs)]</td></tr><tr><td>return aT,i =MetaNorm(aT,i); LKL</td></tr><tr><td>Test: Input values of a over test domain ai;</td></tr><tr><td>μi=f(ai);</td></tr><tr><td>Oi=f((ai-μi)²);</td></tr><tr><td>a=γ ai-μi +β;</td></tr></table>
311
+
312
+ # B DATASETS
313
+
314
+ We conduct an extensive set of experiments on a total of 17 datasets containing more than 15 million images. All dataset details and settings are provided in this Appendix.
315
+
316
+ miniImageNet. The miniImageNet is originally proposed in (Vinyals et al., 2016) and has been widely used for evaluating few-shot learning algorithms. It consists of 60,000 color images from 100
317
+
318
+ # Algorithm 3 MetaNorm for Few-Shot Domain Generalization
319
+
320
+ Meta-train: Input values of $a$ over meta-source domain set $\mathbf { a } _ { S , i }$ and meta-target domain set $\mathbf { a } _ { Q , i }$ $\gamma$ , $\beta \gets$ Initialize parameters.
321
+
322
+ $$
323
+ \begin{array} { l } { \displaystyle \mu _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { S , i } ) ; \mu _ { Q } = \frac { 1 } { | Q | } \sum _ { i = 1 } ^ { | Q | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { Q , i } ) ; } \\ { \displaystyle \sigma _ { S } = \frac { 1 } { | S | } \sum _ { i = 1 } ^ { | S | } f _ { \sigma } ^ { \ell } ( ( \mathbf { a } _ { S , i } - \mu _ { S } ) ^ { 2 } ) ; \sigma _ { Q } = \frac { 1 } { | Q | } \sum _ { i = 1 } ^ { | Q | } f _ { \sigma } ^ { \ell } \big ( ( \mathbf { a } _ { Q , i } - \mu _ { Q } ) ^ { 2 } \big ) ; } \\ { \displaystyle a _ { S , i } ^ { \prime } = \gamma \left( \frac { a _ { S , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; a _ { Q , i } ^ { \prime } = \gamma \left( \frac { a _ { Q , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; } \\ { \displaystyle C _ { \mathrm { K L } } = D _ { \mathrm { K L } } \left[ N ( \mu _ { S } , \sigma _ { S } ) | | N ( \mu _ { Q } , \sigma _ { Q } ) \right] } \\ { \mathrm { r e t u r n } a _ { S , i } ^ { \prime } = \mathbf { M e t a N o r m } ( \mathbf { a } _ { S , i } ) ; a _ { Q , i } ^ { \prime } = \mathbf { M e t a N o r m } ( \mathbf { a } _ { Q , i } ) ; \mathcal { L } _ { K L } } \end{array}
324
+ $$
325
+
326
+ Meta-test: Input values of $a$ over support set $\mathbf { a } _ { S , i }$ and query set $\mathbf { a } _ { Q , i }$
327
+
328
+ $$
329
+ \begin{array} { r l } & { \mu _ { S } = \frac { 1 } { | \mathcal { S } | } \displaystyle \sum _ { i = 1 } ^ { | S | } f _ { \mu } ^ { \ell } ( \mathbf { a } _ { S , i } ) ; } \\ & { \sigma _ { S } = \frac { 1 } { | \mathcal { S } | } \displaystyle \sum _ { i = 1 } ^ { | \mathcal { S } | } f _ { \sigma } ^ { \ell } \left( ( \mathbf { a } _ { S , i } - \mu _ { S } ) ^ { 2 } \right) ; } \\ & { a _ { Q , i } ^ { \ell } = \gamma \left( \frac { \mathbf { a } _ { Q , i } - \mu _ { S } } { \sqrt { \sigma _ { S } ^ { 2 } + \epsilon } } \right) + \beta ; } \\ & { \mathrm { r e t u r n } a _ { Q , i } ^ { \prime } = \mathbf { M e t a N o r m } ( a _ { Q , \ell } } \end{array}
330
+ $$
331
+
332
+ ![](images/a2c8a4ae2a779c11be8835af390b83997d35a8cee32961d66364322ab1025b8d.jpg)
333
+ Figure 3: The dataflow of the implementation for few-shot learning. “N” indicates support size, “M” indicates query size, “C” indicates the channel of activations, “W” indicates the width of activations, “H” indicates the height of activations.
334
+
335
+ classes with 600 examples per class. The images have dimensions of $8 4 \times 8 4$ pixels. We follow the train/val/ test split introduced in (Ravi & Larochelle, 2017), which uses 64 classes for meta-training, 16 classes for meta-validation, and the remaining 20 classes for meta-testing.
336
+
337
+ Omniglot. Omniglot (Lake et al., 2015) is a few-shot learning dataset consisting of 1,623 handwritten characters (each with 20 instances) derived from 50 alphabets. We follow the pre-processing and training procedure defined in (Vinyals et al., 2016). We resize images to $2 8 \times 2 8$ . The training, validation and test sets consist of a random split of 1,100, 100, and 423 characters.
338
+
339
+ PACS (Li et al., 2017a) contains a total of 9,991 images of the size $2 2 4 \times 2 2 4$ from 4 domains, i.e., photo, art-painting, cartoon and sketch, which demonstrate huge domain gaps. Images are from 7 object classes, i.e., dog, elephant, giraffe, guitar, horse, house, and person. We follow the “leave-one-out” protocol in (Li et al., 2017a; 2018b; Carlucci et al., 2019), where the model is trained on any three of the four domains, which we call source domains, and tested on the last (target) domain. The train-val-test splits are the same as in (Li et al., 2017a).
340
+
341
+ Office-Home (Venkateswara et al., 2017) also has 4 domains: art, product, clipart and real-world. For each domain, the dataset contains images of 65 object categories found typically in office and home settings. We use the same experimental protocol as for PACS.
342
+
343
+ DomainNet (Peng et al., 2019) contains 6 distinct domains, i.e., clipart, infograph, painting, quickdraw, real, and sketch for 345 categories. The categories are from 24 divisions, which are: Furniture, Mammal, Tool, Cloth, Electricity, Building, Office, Human Baby, Road Transportation, Food, Nature,
344
+
345
+ Cold Blooded, Music, Fruit, Sport, Tree, Bird, Vegetable, Shape, Kitchen, Water Transportation, Sky Transportation, Insect, Others.
346
+
347
+ Meta-Dataset (Triantafillou et al., 2020) is composed of ten (eight train, two test) existing image classification datasets. These are: ILSVRC-2012 (ImageNet, (Russakovsky et al., 2015)), Omniglot (Lake et al., 2015), Aircraft (Maji et al., 2013), CUB-200-2011 (Birds, (Wah et al., 2011)), Describable Textures (Cimpoi et al., 2014), Quick Draw, Fungi, VGG Flowr (Nilsback & Zisserman, 2008), Traffic Signs (Houben et al., 2013) and MSCOCO (Lin et al., 2014). Each episode generated in Meta-Dataset uses classes from a single dataset. Two of these datasets, Traffic Signs and MSCOCO, are fully reserved for evaluation, it means no classes from these sets participate in the training set. Except for Traffic Signs and MSCOCO, the remaining datasets contribute some classes to each of training, validation and test splits of classes. There are about 14 million images in total in Meta-Dataset.
348
+
349
+ # C FEW-SHOT DOMAINNET
350
+
351
+ To construct Few-shot DomainNet, we chose 200 random classes from DomainNet and used 140 for training, 20 for validation and the last 40 for testing. Note that the last 40 object classes were never seen during training. The dataset consists of 200,000 colour images of size $8 4 \times 8 4$ with each of the 200 classes having 1,000 examples. Please see Table 6, Table 7 and Table 8 for training, validation, and test classes.
352
+
353
+ Table 6: Training classes of Few-shot DomainNet
354
+
355
+ <table><tr><td rowspan=1 colspan=1>Furniture: bathtub,ceiling fan, couch, fence, hot tub,mailbox</td></tr><tr><td rowspan=1 colspan=1>Mammal: tiger, rhinoceros,bat,cat, lion, panda</td></tr><tr><td rowspan=1 colspan=1>Tool: anvil, basket, broom, sword, pliers</td></tr><tr><td rowspan=1 colspan=1>Cloth: belt, camouflage, eyeglasses, crown, bowtie</td></tr><tr><td rowspan=1 colspan=1>Electricity: calculator, computer,camera, cooler, dishwasher</td></tr><tr><td rowspan=1 colspan=1>Building: bridge, jail, pool, tent, castle</td></tr><tr><td rowspan=1 colspan=1>Offce: alarm clock, binoculars, backpack,book, bandage</td></tr><tr><td rowspan=1 colspan=1>Human Body:arm,ear,face,beard, elbow, finger, brain,eye,foot, knee</td></tr><tr><td rowspan=1 colspan=1>Road Transportation: ambulance,bus motorbike, bicycle, train</td></tr><tr><td rowspan=1 colspan=1>Food: birthday cake,cookie,hot dog,peanut, sandwich,bread, donut, pizza,steak,lollipop</td></tr><tr><td rowspan=1 colspan=1>Nature: beach, lightning,ocean, river, sun, cloud,moon,rain, tornado</td></tr><tr><td rowspan=1 colspan=1>Cold Blooded: crab, frog, crocodile,lobster, fish, octopus,shark</td></tr><tr><td rowspan=1 colspan=1>Music: cello, guitar, saxophone, violin, clarinet, harp, trombone</td></tr><tr><td rowspan=1 colspan=1>Fruit: apple, banana, blackberry, blueberry, grapes, pear</td></tr><tr><td rowspan=1 colspan=1>Sport: baseball,baseball bat, basketball,snorkel, yoga,tennis racquet</td></tr><tr><td rowspan=1 colspan=1>Tree: bush, grass,cactus, tree, flower</td></tr><tr><td rowspan=1 colspan=1>Bird: bird,owl</td></tr><tr><td rowspan=1 colspan=1>Vegetable: asparagus, broccoli, carrot, mushroom, onion</td></tr><tr><td rowspan=1 colspan=1>Shape: circle,hexagon</td></tr><tr><td rowspan=1 colspan=1>Kitchen: fork,frying pan,hourglass,knife,lighter</td></tr><tr><td rowspan=1 colspan=1>Water Transportation: aircraft carrier, canoe, cruise ship, submarine</td></tr><tr><td rowspan=1 colspan=1>Sky Transportation: airplane, helicopter</td></tr><tr><td rowspan=1 colspan=1>Insect: ant, bee</td></tr><tr><td rowspan=1 colspan=1>Others: angel,cannon, dragon, mermaid,stop sign, snowman, feather</td></tr></table>
356
+
357
+ Table 7: Validation classes of Few-shot DomainNet
358
+
359
+ <table><tr><td rowspan=1 colspan=1>Furniture: stairs,ladder</td></tr><tr><td rowspan=1 colspan=1> Mammal: monkey</td></tr><tr><td rowspan=1 colspan=1>Tool: paint can</td></tr><tr><td rowspan=1 colspan=1>Cloth: purse, t-shirt</td></tr><tr><td rowspan=1 colspan=1>Electricity: radio</td></tr><tr><td rowspan=1 colspan=1>Building: pond</td></tr><tr><td rowspan=1 colspan=1>Office: nail</td></tr><tr><td rowspan=1 colspan=1>Human Body: skull, tooth</td></tr><tr><td rowspan=1 colspan=1>Road Transportation: firetruck</td></tr><tr><td rowspan=1 colspan=1>Food: -</td></tr><tr><td rowspan=1 colspan=1>Nature: star, hurricane</td></tr><tr><td rowspan=1 colspan=1>Cold Blooded: sea turtle</td></tr><tr><td rowspan=1 colspan=1>Music: -</td></tr><tr><td rowspan=1 colspan=1>Fruit: strawberry</td></tr><tr><td rowspan=1 colspan=1>Sport: hockey stick</td></tr><tr><td rowspan=1 colspan=1>Tree: -</td></tr><tr><td rowspan=1 colspan=1>Bird: penguin</td></tr><tr><td rowspan=1 colspan=1>Vegetable: -</td></tr><tr><td rowspan=1 colspan=1>Shape: -</td></tr><tr><td rowspan=1 colspan=1>Kitchen: wine botle</td></tr><tr><td rowspan=1 colspan=1>Water Transportation: -</td></tr><tr><td rowspan=1 colspan=1>Sky Transportation: -</td></tr><tr><td rowspan=1 colspan=1>Insect: -</td></tr><tr><td rowspan=1 colspan=1>Others: teddy-bear</td></tr></table>
360
+
361
+ # D IMPLEMENTATION DETAILS.
362
+
363
+ In the few-shot learning task, MAML and ProtoNets use a simple CNN containing 4 convolutional layers, each of which is a $3 { \times } 3$ convolution with 32 filters, followed by MetaNorm, a ReLU nonlinearity, and finally a $2 \times 2$ max-pooling. VERSA uses a CNN containing 5 convolutional layers, each of which is a $3 { \times } 3$ convolution with 64 filters, followed by MetaNorm, a ReLU non-linearity, and finally a $2 \times 2$ max-pooling. In the domain generalization task, we rely on ResNet-18 as backbone for fair comparison with previous work. Each convolutional layer is followed by MetaNorm. The hypernetwork is a 3-layer MLP with 128 units per layer and rectifier nonlinearities. We implemented all models in the Tensorflow framework and tested on an NVIDIA Tesla V100. All code will be available at: https://github.com/YDU-AI/MetaNorm.
364
+
365
+ # D.1 MAML EXPERIMENTS
366
+
367
+ For MAML experiments, we used the codebase by Finn (Finn, 2017). We use the Adam optimizer with default parameters, and a meta batch size of 4 tasks. The number of test episodes is set as 600. The number of training iterations is 60,000. We set $\lambda { = } 0 . 0 0 1$ . The other hyper-parameters we use are the default MAML parameters. No early stopping was used. We used the first-order approximation of MAML for the experiments.
368
+
369
+ Table 8: Test classes of Few-shot DomainNet
370
+
371
+ <table><tr><td rowspan=1 colspan=1>Furniture: teapot, toothpaste, stove,umbrella</td></tr><tr><td rowspan=1 colspan=1>Mammal: mouse,</td></tr><tr><td rowspan=1 colspan=1>Tool: bucket, paint can</td></tr><tr><td rowspan=1 colspan=1>Cloth: sweater, shoe, flip flops</td></tr><tr><td rowspan=1 colspan=1>Electricity: television,stereo, toaster, flashlight</td></tr><tr><td rowspan=1 colspan=1>Building: waterslide, garden</td></tr><tr><td rowspan=1 colspan=1>Office: map, clock,calendar, scissors</td></tr><tr><td rowspan=1 colspan=1>Human Body: finger, nose, toe</td></tr><tr><td rowspan=1 colspan=1>Road Transportation: bulldozer</td></tr><tr><td rowspan=1 colspan=1>Food: peanut</td></tr><tr><td rowspan=1 colspan=1>Nature: mountain, sun</td></tr><tr><td rowspan=1 colspan=1>Cold Blooded: lobster, scorpion</td></tr><tr><td rowspan=1 colspan=1>Music: harp</td></tr><tr><td rowspan=1 colspan=1>Fruit: pineapple</td></tr><tr><td rowspan=1 colspan=1>Sport: soccer ball, hockey stick</td></tr><tr><td rowspan=1 colspan=1>Tree: house plant, leaf</td></tr><tr><td rowspan=1 colspan=1>Bird: swan</td></tr><tr><td rowspan=1 colspan=1>Vegetable: string bean</td></tr><tr><td rowspan=1 colspan=1>Shape: squiggle</td></tr><tr><td rowspan=1 colspan=1>Kitchen: -</td></tr><tr><td rowspan=1 colspan=1>Water Transportation: -</td></tr><tr><td rowspan=1 colspan=1>Sky Transportation: -</td></tr><tr><td rowspan=1 colspan=1>Insect: -</td></tr><tr><td rowspan=1 colspan=1>Others: feather, snowman</td></tr></table>
372
+
373
+ # D.2 PROTONETS EXPERIMENTS
374
+
375
+ For ProtoNets, we used the codebase by Fatir (Fatir, 2018). For miniImageNet, we used the following ProtoNets options: a learning rate of 0.001, 60,000 training iterations, 200 validation episodes, 600 test episodes and $\lambda { = } 0 . 0 0 0 1$ . We choose the units of hidden layers and $\lambda$ by cross-validation. For Meta-Dataset, we reproduce the code provided by CNAPS (Requeima et al., 2019) with TensorFlow. We simply replace its normalization method with our MetaNorm method and add the KL term to the final loss. We are consistent with the dataset configuration and follow the training process as specified in (Triantafillou et al., 2020). The number of training iterations is 80,000. We use a constant learning rate of 0.0001. We set $\lambda { = } 0 . 0 0 1$ . We follow TaskNorm’s (Bronskill et al., 2020) options: they do not use feature adaptation, and allow updates pre-trained feature extractor weights during meta-training stage.
376
+
377
+ # D.3 VERSA EXPERIMENTS
378
+
379
+ For VERSA, we used the codebase by Gordon (Gordon, 2019). For the 5-way 5-shot model, we train using the setting of 8 tasks per batch for 100,000 iterations and use a constant learning rate of 0.0001, $\lambda { = } 0 . 0 0 1$ . For the 5-way 1-shot model, we train with the setting of 8 tasks per batch for 150,000 iterations and use a constant learning rate of 0.00025, $\lambda { = } 0 . 0 1$ . We set validation episodes as 200, and test episodes as 600. The units of hidden layers and $\lambda$ were chosen by cross-validation.
380
+
381
+ Table 9: Inference function $f _ { \mu } ^ { l } ( \cdot )$
382
+
383
+ <table><tr><td>Output size</td><td>Layers</td></tr><tr><td>w×h</td><td>Input flattened vector of the activation map</td></tr><tr><td>128</td><td>fully connected, ELU</td></tr><tr><td>128</td><td>fully connected, ELU</td></tr><tr><td>w×h</td><td>fully connected to μ</td></tr></table>
384
+
385
+ Table 10: Inference function $f _ { \sigma } ^ { l } ( \cdot )$
386
+
387
+ <table><tr><td>Output size</td><td>Layers</td></tr><tr><td>w×h</td><td>Input flattened vector of the activation map and μ</td></tr><tr><td>128</td><td>fully connected, ELU</td></tr><tr><td>128</td><td>fully connected, ELU</td></tr><tr><td>w×h</td><td>fully connected to o</td></tr></table>
388
+
389
+ # E EXTRA RESULTS FOR EFFECT OF KL TERM
390
+
391
+ In this Appendix we consider extra results for the ablation on measuring the effect of the KL term. We report results for few-shot classification on miniImageNet with ProtoNets (Snell et al., 2017) and VERSA (Gordon et al., 2019) in Table 11. We also report domain generalization results on Office-Home in Table 12. In all cases the KL term is crucial.
392
+
393
+ Table 11: Effect of KL Term in MetaNorm for few-shot classification on miniImageNet with ProtoNets and VERSA. Best performing methods and any other runs within $9 5 \%$ confidence margin denoted in bold.
394
+
395
+ <table><tr><td rowspan="3">MetaNorm</td><td colspan="2">ProtoNets</td><td colspan="2">VERSA</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>w/o KL</td><td>40.1 ± 1.6</td><td>58.7 ± 0.8</td><td>48.7 ± 1.6</td><td>64.3 ± 0.8</td></tr><tr><td>w/ KL</td><td>48.1 ± 1.6</td><td>65.9 ± 0.9</td><td>53.7 ± 1.6</td><td>68.1 ± 0.8</td></tr></table>
396
+
397
+ Table 12: Effect of KL Term in MetaNorm for domain generalization on Office-Home.
398
+
399
+ <table><tr><td rowspan="2">MetaNorm</td><td colspan="5">Office-Home</td></tr><tr><td>Art</td><td>Clipart</td><td>Product</td><td>Real-World</td><td> Mean</td></tr><tr><td>w/o KL</td><td>51.25</td><td>39.27</td><td>69.75</td><td>68.19</td><td>57.12</td></tr><tr><td>w/ KL</td><td>59.77</td><td>45.98</td><td>73.13</td><td>75.29</td><td>63.55</td></tr></table>
400
+
401
+ # F SENSITIVITY TO ALGORITHM ON OMNIGLOT
402
+
403
+ The experiments on Omniglot for few-shot classification under the meta-learning settings of MAML, VERSA and ProtoNets are reported in Tables 13, 14 and 15. MetaNorm consistently outperforms both transductive and non-transductive normalization approaches.
404
+
405
+ # G SENSITIVITY TO DATASET
406
+
407
+ The complete set of results for each of the thirteen datasets in Meta-Dataset are provided in Table 16.
408
+
409
+ Table 13: Sensitivity to Algorithm. Few-shot results on Omniglot using MAML. Best performing methods and any other runs within the $9 5 \%$ confidence margin in bold. Transductive results indicated above dashed line.
410
+
411
+ <table><tr><td rowspan="2"></td><td colspan="4">Omniglot</td></tr><tr><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>TBN</td><td>98.4 ± 0.7</td><td>99.2 ± 0.2</td><td>90.9 ± 0.5</td><td>96.6 ± 0.2</td></tr><tr><td>example</td><td>21.6 ± 1.3</td><td>22.0 ± 0.5</td><td>3.7±0.2</td><td>5.5±0.2</td></tr><tr><td>class</td><td>21.6 ± 1.3</td><td>23.2 ± 0.5</td><td>3.7 ±0.2</td><td>14.5 ± 0.3</td></tr><tr><td>w/oBN</td><td>92.6 ± 0.9</td><td>90.7 ± 0.1</td><td>84.3 ± 0.4</td><td>91.7±0.2</td></tr><tr><td>CBN (Ioffe &amp; Szegedy, 2015)</td><td>20.1 ±0.0</td><td>20.0±0.0</td><td>5.0±0.0</td><td>5.0±0.0</td></tr><tr><td>RN (Nichol et al., 2018)</td><td>92.6 ± 0.9</td><td>98.2 ±0.2</td><td>89.0 ± 0.6</td><td>96.8 ± 0.2</td></tr><tr><td>MetaBN (Bronskill et al., 2020)</td><td>91.8 ±0.9</td><td>98.1 ± 0.3</td><td>89.6 ± 0.5</td><td>96.4 ± 0.2</td></tr><tr><td>TaskNorm-L (Bronskill et al., 2020)</td><td>94.0 ±0.8</td><td>98.0±0.3</td><td>89.6 ± 0.5</td><td>96.4 ±0.2</td></tr><tr><td>TaskNorm-I (Bronskill et al., 2020)</td><td>94.4 ±0.8</td><td>98.6± 0.2</td><td>90.0 ± 0.5</td><td>96.3 ±0.2</td></tr><tr><td>MetaNorm</td><td>98.8 ± 0.5</td><td>99.3 ± 0.2</td><td>91.3 ± 0.5</td><td>97.1 ± 0.2</td></tr></table>
412
+
413
+ Results (except w/o BN and our MetaNorm) provided by (Bronskill et al., 2020).
414
+
415
+ Table 14: Sensitivity to Algorithm. Few-shot results on Omniglot using VERSA. Best performing methods and any other runs within the $9 5 \%$ confidence margin in bold. Transductive results indicated above dashed line.
416
+
417
+ <table><tr><td rowspan="2"></td><td colspan="4">Omniglot</td></tr><tr><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>TBN</td><td>99.7 ± 0.2</td><td>99.8 ± 0.2</td><td>97.7 ± 0.2</td><td>98.8 ± 0.1</td></tr><tr><td>example</td><td>94.9 ± 0.2</td><td>95.1 ± 0.3</td><td>92.9 ± 0.2</td><td>95.9 ± 0.2</td></tr><tr><td>class</td><td>94.3 ± 0.3</td><td>94.8 ± 0.1</td><td>91.8 ± 0.3</td><td>95.1 ± 0.4</td></tr><tr><td>w/oBN</td><td>95.6 ± 0.7</td><td>96.5 ± 0.1</td><td>93.1 ± 0.3</td><td>96.3±0.2</td></tr><tr><td>CBN (Ioffe &amp; Szegedy, 2015)</td><td>94.3 ± 0.3</td><td>95.7 ± 0.0</td><td>92.7 ± 0.2</td><td>95.2 ± 0.3</td></tr><tr><td>MetaBN (Bronskill et al., 2020)</td><td>96.7 ± 0.3</td><td>98.1 ± 0.3</td><td>95.8 ± 0.2</td><td>97.1 ± 0.2</td></tr><tr><td>TaskNorm-L (Bronskill et al., 2020)</td><td>97.9 ± 0.3</td><td>99.2 ±0.2</td><td>96.1 ± 0.2</td><td>98.0±0.2</td></tr><tr><td>TaskNorm-I (Bronskill et al., 2020)</td><td>98.3 ±0.2</td><td>99.5 ± 0.2</td><td>96.7 ± 0.2</td><td>98.1 ± 0.1</td></tr><tr><td>MetaNorm</td><td>99.8 ± 0.1</td><td>99.9 ± 0.1</td><td>97.9 ± 0.2</td><td>98.8 ± 0.2</td></tr></table>
418
+
419
+ † Results of TBN provided by (Gordon et al., 2019). All other results based on our re-implementations.
420
+
421
+ Table 15: Sensitivity to Algorithm. Few-shot results on Omniglot using ProtoNets. Best performing methods and any other runs within $9 5 \%$ confidence margin denoted in bold. Transductive results indicated above dashed line.
422
+
423
+ <table><tr><td rowspan="2"></td><td colspan="4">Omniglot†</td></tr><tr><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>TBN</td><td>98.4 ± 0.2</td><td>99.6 ± 0.2</td><td>94.5 ± 0.2</td><td>98.6 ± 0.1</td></tr><tr><td>example</td><td>98.4 ± 0.2</td><td>99.5 ± 0.2</td><td>94.3 ± 0.2</td><td>98.5 ± 0.1</td></tr><tr><td>class</td><td>98.4 ± 0.2</td><td>99.3 ± 0.2</td><td>94.2 ± 0.2</td><td>98.4 ± 0.1</td></tr><tr><td>w/o BN</td><td>94.6±0.7</td><td>95.5 ±0.1</td><td>91.7 ±0.3</td><td>94.3±0.2</td></tr><tr><td>CBN (Ioffe &amp; Szegedy, 2015)</td><td>98.5 ± 0.2</td><td>99.6 ± 0.1</td><td>94.5 ± 0.2</td><td>98.6 ± 0.1</td></tr><tr><td>RN (Bronskill et al., 2020)</td><td>98.0±0.2</td><td>99.6 ± 0.1</td><td>94.1 ± 0.2</td><td>98.6 ± 0.1</td></tr><tr><td>MetaBN (Bronskill et al., 2020)</td><td>98.4 ± 0.2</td><td>99.6 ± 0.1</td><td>94.5 ± 0.2</td><td>98.6 ± 0.1</td></tr><tr><td>TaskNorm-L (Bronskill et al., 2020)</td><td>98.6 ±0.2</td><td>99.6 ± 0.1</td><td>95.0 ± 0.2</td><td>98.7 ± 0.1</td></tr><tr><td>TaskNorm-I (Bronskill et al., 2020)</td><td>98.4 ± 0.2</td><td>99.6 ± 0.2</td><td>93.4 ± 0.2</td><td>98.6 ± 0.1</td></tr><tr><td> MetaNorm</td><td>98.9 ± 0.2</td><td>99.7 ± 0.2</td><td>95.8 ± 0.2</td><td>98.9 ± 0.2</td></tr></table>
424
+
425
+ † Results (except w/o BN and our MetaNorm) provided by (Bronskill et al., 2020).
426
+
427
+ ![](images/e9f9057e57e5aa2fd5e997a1561de84cd0681c96954abcbb96ae4c929560b3be.jpg)
428
+ Figure 4: Training loss. Results of using the ProtoNets algorithm on miniImageNet with respect to training loss versus iterations. Our MetaNorm achieves fastest training convergence.
429
+
430
+ # H TRAINING SPEED
431
+
432
+ We plot the training loss versus training iterations by using the ProtoNets algorithm in Figure 4. MetaNorm achieves fastest training convergence. From Table 2 and Figure 4, MetaNorm achieves best classification accuracy and training efficiency, which demonstrates the benefit of leveraging meta-learning by MetaNorm for batch normalization.
433
+
434
+ <table><tr><td>48 3 8 10</td><td>3 10 4 4 5 4 30 3 10 10 10 10 二</td></tr><tr><td>CIIRIIO 4108 311</td><td>6000 444111 31171 6 404 4 王 干0&#x27;os</td></tr><tr><td>8049 30325 CITIIII</td><td>801&#x27;09 S05515 80505 8079 800£9 80419 80699 80 干9&#x27;29 L&#x27;0 干 1&#x27;29</td></tr><tr><td>40424 LSINW</td><td>9&#x27;0&#x27;98 406:16 406 0418 403356 03636 404155 406:16 533335 10 1:5</td></tr><tr><td></td><td></td></tr><tr><td>WSCCCC 33730</td><td>33999 333580 60500 60 33130 33983 33410 33770 333585 3.0 57.69</td></tr><tr><td>srs rrrer 80009</td><td></td></tr><tr><td></td><td>80565 8&#x27;0干&#x27;S9 60王169 80L09 80干0&#x27;99 8079 806.9 20029 L&#x27;08&#x27;S9 9&#x27;0 干 1&#x27;89</td></tr><tr><td>GEeeeoe 90188</td><td></td></tr><tr><td></td><td>908 90558 808 80469 20448 90098 L&#x27;Oi18 0678 903738 10 33.38</td></tr><tr><td>4494 5</td><td></td></tr><tr><td></td><td>45.14 333531 218.6 44.94 4594 441 44514 4 9.61 90 干 119</td></tr><tr><td>mrarm 8&#x27;00&#x27;SL</td><td></td></tr><tr><td>01179</td><td>805 8080L 14144 80 9&#x27;0 干 9&#x27;LL 804 L0454 1454 L&#x27;0SLL</td></tr><tr><td>L0LS</td><td></td></tr><tr><td>019 Jses</td><td></td></tr><tr><td></td><td>20509 90 干 L&#x27;99 5008 5085S 54355 L0169 L0干8&#x27;09 80459 L&#x27;06S9</td></tr><tr><td>BPpg</td><td></td></tr><tr><td>60579 60干969 600&#x27;69</td><td></td></tr><tr><td></td><td>8&#x27;0 干90/</td></tr><tr><td></td><td>31110 51411 60干9&#x27;89 809&#x27;89 6.4 747 60干889 6001</td></tr><tr><td>90388 Aarat</td><td></td></tr><tr><td>10448 Z00L</td><td></td></tr><tr><td></td><td>10691 900&#x27;SL 90干608 908 9096L 90718 933338 10148</td></tr><tr><td></td><td></td></tr><tr><td>L0主1&#x27;68 90L06 nomiii</td><td></td></tr><tr><td></td><td>90王806 80458 9°0806 90406 90706 $0 干 8&#x27;06 L09&#x27;88 9&#x27;0 干906</td></tr><tr><td>JTSSSC</td><td></td></tr><tr><td>45 410</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td>305630 3.53750 41511 0 410 451 1 3.33320</td></tr><tr><td> gge ss NN7 L 1 67 UT GE 0TN</td><td>eir eg TrTrnrr rnn rrenerggree</td></tr></table>
435
+
436
+ sign indicates the 95% confiden
437
+
438
+ Table 17: Effect of number of units of hidden layers in MetaNorm for few-shot classification with MAML (Finn & Levine, 2018) on miniImageNet. The $\pm$ sign indicates the $9 5 \%$ confidence interval over tasks. We achieve best results with 128 units of hidden layers.
439
+
440
+ <table><tr><td rowspan="2"></td><td colspan="2">MAML</td></tr><tr><td>5-way, 1-shot</td><td>5-way, 5-shot</td></tr><tr><td>n=64</td><td>44.3 ± 1.5</td><td>58.1 ± 0.8</td></tr><tr><td>n = 128</td><td>46.8 ± 1.6</td><td>60.1 ± 0.8</td></tr><tr><td>n = 256</td><td>46.2 ± 1.6</td><td>59.8 ± 0.8</td></tr><tr><td>n = 512</td><td>45.9 ± 1.5</td><td>59.5 ± 0.9</td></tr><tr><td>n = 1024</td><td>44.9 ± 1.5</td><td>58.7 ±0.8</td></tr></table>
md/train/BJg_2JHKvH/BJg_2JHKvH.md ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEMI-SUPERVISED LEARNING WITH NORMALIZING FLOWS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We propose Flow Gaussian Mixture Model (FlowGMM), a general-purpose method for semi-supervised learning based on a simple and principled probabilistic framework. We approximate the joint distribution of the labeled and unlabeled data with a flexible mixture model implemented as a Gaussian mixture transformed by a normalizing flow. We train the model by maximizing the exact joint likelihood of the labeled and unlabeled data. We evaluate FlowGMM on a wide range of semi-supervised classification problems across different data types: AG-News and Yahoo Answers text data, MNIST, SVHN and CIFAR-10 image classification problems as well as tabular UCI datasets. FlowGMM achieves promising results on image classification problems and outperforms the competing methods on other types of data. FlowGMM learns an interpretable latent representation space and allows hyper-parameter free feature visualization at real time rates. Finally, we show that FlowGMM can be calibrated to produce meaningful uncertainty estimates for its predictions.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ In many domains unlabeled data is plentiful, while labeled data may be scarce. Semi-supervised learning framework leverages both labeled and unlabeled data reducing the need for expensive manual annotation. Recently, consistency-based methods have shown outstanding performance in semisupervised image classification (Laine & Aila, 2016; Miyato et al., 2018; Tarvainen & Valpola, 2017; Athiwaratkun et al., 2019; Verma et al., 2019; Berthelot et al., 2019) and are currently state-of-the-art on challenging datasets like CIFAR-10, CIFAR-100, and ImageNet. However, these methods have not seen much application on domains other than images, where a suitable set of data perturbations to which the classifier should be invariant is not known a priori.
12
+
13
+ In this paper, we employ a simple and principled probabilistic framework for semi-supervised learning. We introduce a mixture distribution for modeling the data, where different components correspond to different classes. We can maximize the joint likelihood of unlabeled (using the mixture) and labeled (using individual mixture components) data. At test time, we classify the input to belong to the class corresponding to mixture component with the highest likelihood.
14
+
15
+ In order to apply this framework to complex data, we need to choose a sufficiently flexible family of distributions in the mixture, preserving the ability to compute exact likelihoods. We propose Flow Gaussian Mixture Model (FlowGMM), a mixture model based on normalizing flows (Dinh et al., 2014). Each component of the mixture is modeled as a trainable invertible transformation (normalizing flow) of the corresponding component of a Gaussian mixture in the latent space. The transformation is shared among all the mixture components. Due to invertibility, we can compute exact likelihood of the data using the change of variable formula.
16
+
17
+ We illustrate FlowGMM on a toy problem in Figure 1. We are solving a binary semi-supervised classification problem on the dataset shown in panel (a): the labeled data is shown with triangles colored according to their class, and unlabeled data is shown with blue circles. We introduce a Gaussian mixture with two components corresponding to each of the classes, shown in panel (c) in the latent space $\mathcal { Z }$ and an invertible transformation $f$ . The transformation $f$ is then trained to map the data distribution in the data space $\mathcal { X }$ to the latent Gaussian mixture in the $\mathcal { Z }$ space, mapping the labeled data to the corresponding mixture component. We visualize the learned transformation in panel (b), showing the positions of the images $f ( x )$ for all of the training data points. The inverse $f ^ { - 1 }$ of this mapping serves as a class-conditional generative model, that we visualize in panel (d). To classify a data point $x$ in the input space we compute its image $f ( x )$ in the latent space, and pick the class corresponding to the Gaussian that is closest to $f ( x )$ . We visualize the decision boundary of the learned classifier with a dashed line in panel (a).
18
+
19
+ ![](images/25cf50d85425a364bcb5402e89ddd79617e0a63a072fdd712098296937197c61.jpg)
20
+ Figure 1: Illustration of semi-supervised learning with FlowGMM on a binary classification problem. Colors represent the two classes or the corresponding Gaussian mixture components. Labeled data is shown with triangles, colored by the corresponding class label, and blue dots represent unlabeled data. (a): Data distribution and the classifier decision boundary. (b): The learned mapping of the data to the latent space. (c): Samples from the Gaussian mixture in the latent space. (d): Samples from the model in the data space.
21
+
22
+ Many of the previous attempts of using generative models for classification (Salimans et al., 2016; Nalisnick et al., 2019; Chen et al., 2019) have relied upon multitask learning, where a shared latent representation is learned for the generative model and the classifier. With the method of Chen et al. (2019), hybrid modeling is observed to reduce performance for both tasks in the supervised case. For GANs, Dai et al. (2017) have pointed out that classification performance and generative performance are in direct conflict: a perfect generator yields no benefit to classification performance. FlowGMM takes a different approach, where the generative model is used directly as a Bayes classifier, and in the limit of a perfect generative model the Bayes classifier achieves provably optimal misclassification rate (see e.g. Mohri et al., 2018).
23
+
24
+ FlowGMM naturally encodes the clustering principle: the decision boundary between classes must lie in the low-density region in the data space. Indeed, in the latent space the decision boundary between two classes coincides with the hyperplane perpendicular to the line segment connecting means of the corresponding mixture components and passing through the midpoint of this line segment (assuming the components are normal distributions with identity covariance matrices); in panel (b) of Figure 1 we show the decision boundary in the latent space with a dashed line. The density of the latent distribution near the decision boundary is low. As the flow is trained to represent data as a transformation of this latent distribution, the density near the decision boundary should also be low. In panel (a) of Figure 1 the decision boundary indeed lies in the low-density region.
25
+
26
+ The contributions of this work are as follows:
27
+
28
+ • We propose FlowGMM, a new probabilistic classification model based on normalizing flows, that can be naturally applied to semi-supervised learning. We evaluate FlowGMM on a range of semi-supervised classification benchmarks including text, tabular and image data, and it works well. FlowGMM outperforms alternative approaches on non-image data and shows promise for image data. We propose modified consistency regularization for FlowGMM and empirically demonstrate that it substantially improves performance of the method on image classification problems.
29
+
30
+ • We conduct a thorough empirical analysis of FlowGMM for supervised and semisupervised classification. One of the important features of FlowGMM is its interpretability. To demonstrate it, we visualize the learned latent space representations for the proposed semi-supervised model and show that interpolations between data points from different classes pass through low-density regions. We show how our classification model can be used for optimization free feature visualization. We also study the predictive uncertainties produced by the method and show that they can be calibrated by scaling the variances of mixture components.
31
+
32
+ # 2 BACKGROUND: NORMALIZING FLOWS
33
+
34
+ The normalizing flow (Dinh et al., 2016) is an unsupervised model for density estimation defined as an invertible mapping $f : \mathcal { X } \mathcal { Z }$ from the data space $\mathcal { X }$ to the latent space $\mathcal { Z }$ . We can model the data distribution as a transformation $f ^ { - 1 } : { \mathcal { Z } } \to { \bar { \mathcal { X } } }$ applied to a random variable from the latent distribution $z \sim p _ { \mathcal { Z } }$ often chosen to be Gaussian. The density of the transformed random variable $x = f ^ { - 1 } ( z )$ is given by the change of variables formula
35
+
36
+ $$
37
+ p \chi ( x ) = p \mathcal { Z } \bigl ( f ( x ) \bigr ) \cdot \left| \operatorname* { d e t } \left( \frac { \partial f } { \partial x } \right) \right| .
38
+ $$
39
+
40
+ The mapping $f$ is implemented as a sequence of invertible functions, parametrized by a neural network with architecture that is designed to ensure invertibility and efficient computation of logdeterminants, and a set of parameters $\theta$ that can be optimized. The model can be trained by maximizing the likelihood (equation 1) of the training data with respect to the parameters $\theta$ .
41
+
42
+ # 3 FLOW GAUSSIAN MIXTURE MODEL (FLOWGMM)
43
+
44
+ In FlowGMM, we introduce a discrete latent variable $y$ for the class label, $y \in \{ 1 \ldots . c \}$ . Our latent space distribution, conditioned on a given label $k$ , is Gaussian with mean $\mu _ { k }$ and covariance $\Sigma _ { k }$ :
45
+
46
+ $$
47
+ p _ { \mathcal { Z } } ( z | y = k ) = \mathcal { N } ( z | \mu _ { k } , \Sigma _ { k } ) .
48
+ $$
49
+
50
+ The marginal distribution of $z$ is then a Gaussian mixture. When the classes are balanced, this distribution is
51
+
52
+ $$
53
+ p _ { \mathcal Z } ( z ) = \frac { 1 } { \mathcal { C } } \sum _ { k = 1 } ^ { \mathcal { C } } \mathcal { N } ( z | \mu _ { k } , \Sigma _ { k } ) .
54
+ $$
55
+
56
+ Thus, the likelihood for labeled data is
57
+
58
+ $$
59
+ p _ { \mathcal { X } } ( x | y = k ) = \mathcal { N } \left( f ( x ) | \mu _ { k } , \Sigma _ { k } \right) \cdot \left| \operatorname* { d e t } \left( \frac { \partial f } { \partial x } \right) \right| ,
60
+ $$
61
+
62
+ and the likelihood for data with unknown label is $\begin{array} { r } { p _ { \mathcal { X } } ( x ) = \sum _ { k } p _ { \mathcal { X } } ( x | y = k ) p ( y = k ) } \end{array}$ . If we have access to both a labeled dataset $\mathcal { D } _ { \ell }$ and an unlabeled dataset $\mathcal { D } _ { u }$ , then we can train our model in a semi-supervised way to maximize the joint likelihood of the labeled and unlabeled data
63
+
64
+ $$
65
+ p _ { \mathcal { X } } ( \mathcal { D } _ { \ell } , \mathcal { D } _ { u } ) = \prod _ { ( x _ { i } , y _ { i } ) \in \mathcal { D } _ { \ell } } p _ { \mathcal { X } } ( x _ { i } , y _ { i } ) \prod _ { x _ { j } \in \mathcal { D } _ { u } } p _ { \mathcal { X } } ( x _ { j } ) ,
66
+ $$
67
+
68
+ over the parameters $\theta$ of the bijective function $f$ , which learns a density model with a Bayes classifier: given a test point $x$ , the model predictive distribution is given by
69
+
70
+ $$
71
+ p _ { \mathcal { X } } ( y | x ) = p _ { \mathcal { X } } ( x | y ) p ( y ) / p ( x ) = \frac { \mathcal { N } \left( f ( x ) | \mu _ { y } , \Sigma _ { y } \right) } { \sum _ { k = 1 } ^ { \mathcal { C } } \mathcal { N } \left( f ( x ) | \mu _ { k } , \Sigma _ { k } \right) } .
72
+ $$
73
+
74
+ We can then make predictions for a test point $x$ with the Bayes decision rule
75
+
76
+ $$
77
+ y = \arg \operatorname* { m a x } _ { i \in \{ 1 , \ldots , { c } \} } p _ { \mathcal { X } } ( y = i | x ) .
78
+ $$
79
+
80
+ Alternatively to direct likelihood maximization, we can adapt Expectation Maximization algorithm for model training (discussed in Appendix A).
81
+
82
+ # 3.1 CONSISTENCY REGULARIZATION
83
+
84
+ Most of the existing state-of-the-art approaches to semi-supervised learning on image data are based on consistency regularization (Laine & Aila, 2016; Miyato et al., 2018; Tarvainen & Valpola, 2017; Athiwaratkun et al., 2019; Verma et al., 2019). These methods penalize changes in network predictions with respect to input perturbations, such as random translations and horizontal flips, with an additional loss term that can be computed on unlabeled data,
85
+
86
+ $$
87
+ \ell _ { c o n s } ( x ) = \| g ( x ^ { \prime } ) - g ( x ^ { \prime \prime } ) \| ^ { 2 } ,
88
+ $$
89
+
90
+ where $x ^ { \prime } , x ^ { \prime \prime }$ are random perturbations of $x$ , and $g$ is the vector of probabilities over the classes.
91
+
92
+ Motivated by these methods, we introduce a simple consistency regularization term for FlowGMM. Let $y ^ { \prime \prime }$ be the label predicted on image $x ^ { \prime \prime }$ by FlowGMM according to equation 5. We then define the consistency loss term as the negative log likelihood of the input $x ^ { \prime }$ given the label $y ^ { \prime \prime }$ :
93
+
94
+ $$
95
+ L _ { \mathrm { c o n s } } ( x ^ { \prime } , x ^ { \prime \prime } ) = - \log p ( x ^ { \prime } | y ^ { \prime \prime } ) = - \log N ( f ( x ^ { \prime } ) | \mu _ { y ^ { \prime \prime } } , \Sigma _ { y ^ { \prime \prime } } ) - \log \left| \operatorname* { d e t } \left( \frac { \partial f } { \partial x ^ { \prime } } \right) \right| .
96
+ $$
97
+
98
+ This loss term encourages the model to map small perturbations of the same unlabeled inputs to the same components of the Gaussian mixture distribution in the latent space. Unlike the standard consistency loss of equation 6, the proposed loss in equation 7 takes values on the same scale as the data log likelihood (equation 4), and empirically we found it to perform better. We refer to FlowGMM with the consistency term as FlowGMM-cons. The final loss for FlowGMM-cons is then the weighted sum of the consistency loss (equation 7) and the negative log likelihood of both labeled and unlabeled data (equation 4).
99
+
100
+ # 4 RELATED WORK
101
+
102
+ Generative models have been used extensively in semi-supervised learning. In the work of Kingma et al. (2014), it was shown how the likelihood model of Variational Autoencoder (Kingma & Welling, 2013) could be used for semi-supervised image classification on datasets like MNIST and SVHN. Xu et al. (2017) later extended this framework to semi-supervised text classification. Generative Adversarial Networks (GANs) have been employed for semi-supervised learning through multitask objective where the model learns to simultaneously discriminate generated images from real (labeled and unlabeled) images and classify labeled data.
103
+
104
+ Along with GANs and VAEs, Normalizing Flows (NF) (Dinh et al., 2014) present another major class of deep generative models. Unlike GANs and VAEs, normalizing flows can be trained using exact likelihood. NFs admit controllable latent representations and can be sampled efficiently unlike auto-regressive models (Papamakarios et al., 2017; Oord et al., 2016). Recent work (Dinh et al., 2016; Kingma & Dhariwal, 2018; Behrmann et al., 2018) demonstrated that normalizing flows can produce high-fidelity samples for natural image datasets. Some normalizing flow papers (such as RealNVP (Dinh et al., 2016)) have used class-conditional sampling, where the transformation is conditioned on the class label. To do so, they pass the class label as an input to coupling layers, conditioning the output of the flow on the class.
105
+
106
+ Deep Invertible Generalized Linear Model (DIGLM, Nalisnick et al., 2019), most closely related to our work, trains a classifier on the latent representation of a normalizing flow to perform supervised or semi-supervised image classification. Our approach is principally different, as we use a mixture of Gaussians in the latent space $\mathcal { Z }$ and perform classification based on class-conditional likelihoods (see equation 5), rather than training a separate classifier. One of the key advantages of our approach is the explicit encoding of clustering principle in the method and a more natural probabilistic interpretation.
107
+
108
+ # 5 EXPERIMENTS
109
+
110
+ In all experiments, we use the RealNVP normalizing flow architecture. Throughout training, Gaussian mixture parameters are fixed: the means are initialized randomly from the standard normal distribution and the covariances are set to $I$ . See Appendix B for further discussion on GMM initialization and training.
111
+
112
+ # 5.1 SYNTHETIC DATA
113
+
114
+ We first apply FlowGMM to a range of two-dimensional synthetic datasets, in order to get a better visual intuition for the method. We use RealNVP architecture with 5 coupling layers, defined by fully-connected shift and scale networks, each with 1 hidden layer of size 512. In addition to the semi-supervised setting, we also trained the method only using the labeled data. In Figure 2 we visualize the decision boundaries of the classifier corresponding to FlowGMM for both of these settings on the two circles and pinwheel datasets. On both datasets FlowGMM is able to leverage the unlabeled data to push the decision boundary to a low-density region, as expected. On the two circles dataset the method is unable to fit the data perfectly, as it is impossible to represent this dataset as an invertible continuous mapping of two Gaussians, because they are topologically distinct. FlowGMM still produces a reasonable decision boundary and improves over the case when only labeled data is available. We provide additional visualizations in Appendix C, Figure 4.
115
+
116
+ ![](images/f4e929b21f9c1ca06c2fc39a2a9767651f687640b0b721001c6e90f894c51fac.jpg)
117
+ Figure 2: Illustration of FlowGMM performance on synthetic datasets. Labeled data is shown with colored triangles, and unlabeled data is shown with blue circles. Colors represent different classes. We compare the classifier decision boundaries when only using labeled data (panels b, d) and when using both labeled and unlabeled data (panels a, c) on two circles (panels a, b) and pinwheel (panels c, d) datasets. FlowGMM leverages unlabeled data to push the decision boundary to low-density regions of the space.
118
+
119
+ Table 1: Accuracy on BERT embedded text classification datasets and UCI datasets with a small number of labeled examples. The kNN baseline, logistic regression, and the 3-Layer $\mathrm { N N } +$ Dropout were trained on the labeled data only. Numbers reported for each method are the best of 3 runs (ranked by performance on the validation set). $n _ { l }$ and $n _ { u }$ are the number of labeled and unlabeled data points.
120
+ Dataset $\left( n _ { l } \right/ n _ { u }$ , classes)
121
+
122
+ <table><tr><td>Method</td><td>AG-News (200 / 200k,4)</td><td>Yahoo Answers (800 /50k,10)</td><td>Hepmass (20/140k,2)</td><td>Miniboone (20 / 65k,2)</td></tr><tr><td>kNN</td><td>51.3</td><td>28.4</td><td>84.6</td><td>77.7</td></tr><tr><td>Logistic Regression</td><td>78.9</td><td>54.9</td><td>84.9</td><td>75.9</td></tr><tr><td>3-Layer NN + Dropout</td><td>78.1</td><td>55.6</td><td>84.4</td><td>77.3</td></tr><tr><td>RBF Label Spreading</td><td>54.6</td><td>30.4</td><td>87.1</td><td>78.8</td></tr><tr><td>kNN Label Spreading</td><td>56.7</td><td>25.6</td><td>87.2</td><td>78.1</td></tr><tr><td>I-model</td><td>80.6</td><td>56.6</td><td>87.9</td><td>78.3</td></tr><tr><td>FlowGMM</td><td>84.8</td><td>57.4</td><td>88.8</td><td>80.6</td></tr></table>
123
+
124
+ # 5.2 TEXT AND TABULAR DATA
125
+
126
+ We believe that FlowGMM can be especially useful for semi-supervised learning on tabular data. Consistency-based semi-supervised methods have mostly been developed for image classification, where the predictions of the method are regularized to be invariant to random flips and translations of the image. On tabular data, where the structure is less prominent, finding suitable transformations to apply for consistency-based methods is not-trivial. Similarly, approaches based on GANs have mostly been developed for images. We evaluate FlowGMM on the Hepmass and Miniboone UCI classification datasets (previously used in Papamakarios et al. (2017) for density estimation).
127
+
128
+ Along with standard tabular UCI datasets, we also consider text classification on AG-News and Yahoo Answers datasets. Using the recent advances in transfer learning for NLP, we construct embeddings for input texts using the BERT transformer model (Devlin et al., 2018) trained on a corpus of Wikipedia articles, and then train FlowGMM and other baselines on the embeddings.
129
+
130
+ We compare FlowGMM to the graph based label spreading method from Zhou et al. (2004), a Π-Model (Laine & Aila, 2016) that uses dropout perturbations, as well as supervised logistic regression, $\mathbf { k }$ -nearest neighbors, and neural network that were trained on the labeled data only. We report
131
+
132
+ Table 2: Accuracy of the FlowGMM, VAE model $( \mathbf { M } 1 + \mathbf { M } 2 \mathbf { \Lambda }$ VAE, Kingma et al., 2014), DIGLM (Nalisnick et al., 2019) in supervised and semi-supervised settings on MNIST, SVHN, and CIFAR10. FlowGMM Sup (All labels) as well as DIGLM Sup (All labels) were trained on full train datasets with all labels to demonstrate general capacity of these models. FlowGMM Sup $\mathbf { \rho } _ { n _ { l } }$ labels) was trained on $n _ { l }$ labeled examples (and no unlabeled data). For reference, at the bottom we list the performance of the Π-Model (Laine & Aila, 2016) and BadGAN (Dai et al., 2017) as representative consistency-based and GAN-based state-of-the-art methods. Both of these methods use non-invertible architectures with substantially higher base performance and, thus, are not directly comparable.
133
+
134
+ Dataset (nl / nu)
135
+
136
+ <table><tr><td>Method</td><td>MNIST (1k/59k)</td><td>SVHN (1k/72k)</td><td>CIFAR-10 (4k/46k)</td></tr><tr><td>DIGLM Sup (All labels)</td><td>99.27</td><td>95.74</td><td>-</td></tr><tr><td>FlowGMM Sup (All labels)</td><td>99.63</td><td>95.81</td><td>88.44</td></tr><tr><td>M1+M2 VAE SSL DIGLM SSL</td><td>97.60 99.0</td><td>63.98</td><td></td></tr><tr><td>FlowGMM Sup (nt labels)</td><td>97.36</td><td>= 78.26</td><td>= 73.13</td></tr><tr><td>FlowGMM</td><td>98.94</td><td></td><td></td></tr><tr><td>FlowGMM-cons</td><td></td><td>82.42</td><td>78.24</td></tr><tr><td></td><td>99.0</td><td>86.44</td><td>80.9</td></tr><tr><td>BadGAN</td><td>=</td><td>95.75</td><td>85.59</td></tr><tr><td>II-Model</td><td></td><td>94.57</td><td>87.64</td></tr></table>
137
+
138
+ the results in Table 5.1, where FlowGMM beats the competing semi-supervised learning methods on each of the considered datasets. Implementation details for FlowGMM, the baselines, and the dataset preprocessing details are listed in Appendix D.
139
+
140
+ # 5.3 IMAGE CLASSIFICATION
141
+
142
+ We next evaluate the proposed method on semi-supervised image classification benchmarks on CIFAR-10, MNIST and SVHN datasets. For all the datasets, we use RealNVP (Dinh et al., 2016) architecture. Exact implementation details are listed in the appendix E. The supervised model is trained using the same loss (equation 4), where all the data points are labeled $( n _ { u } = 0 )$ ).
143
+
144
+ We present the results for FlowGMM and FlowGMM-cons in Table 2. We also report results from DIGLM (Nalisnick et al., 2019) (which only report semi-supervised performance on MNIST and supervised performance on MNIST and SVHN) and the $\mathbf { M } 1 { + } \mathbf { M } 2$ VAE model (Kingma et al., 2014). FlowGMM outperforms $\mathbf { M } 1 { + } \mathbf { M } 2$ model and performs better or on par with DIGLM. Furthermore, FlowGMM-cons improves over FlowGMM on all three datasets, suggesting that consistency regularization is very beneficial for the proposed model when useful perturbations are available.
145
+
146
+ Following Oliver et al. (2018), we evaluate FlowGMM-cons varying the number of labeled data points. Specifically, we follow the setup of Kingma et al. (2014) and train FlowGMM-cons on MNIST with 100, 600, 1000 and 3000 labeled data points. We present the results in Table 3. FlowGMM-cons outperforms the $\mathbf { M } 1 { + } \mathbf { M } 2$ model of Kingma et al. (2014) in all the considered settings.
147
+
148
+ We note that the results presented in this section are not directly comparable with the state-of-theart methods using GANs or consistency regularization (see e.g. Laine & Aila, 2016; Dai et al., 2017; Athiwaratkun et al., 2019; Berthelot et al., 2019), as the architecture we employ is much less powerful for classification than the ConvNet and ResNet architectures that have been designed for classification without the constraint of invertibility. We believe that invertible architectures with better inductive biases for classification (possibly like iResNet (Behrmann et al., 2018)) may help bridge this gap. The space of images is challenging to model and while there has been substantial progress using normalizing flows, there is still much ground to cover.
149
+
150
+ Table 3: Semi-supervised classification accuracy for FlowGMM-cons and VAE $\mathbf { M } 1 + \mathbf { M } 2$ model (Kingma et al., 2014) on MNIST for different number of labeled data points $n _ { l }$ .
151
+
152
+ <table><tr><td>Method</td><td>n =100</td><td>n = 600</td><td>n = 1000</td><td>n = 3000</td></tr><tr><td>M1+M2 VAE SSL (nt labels)</td><td>96.67</td><td>97.41 ± 0.05</td><td>97.60± 0.02</td><td>97.82 ± 0.04</td></tr><tr><td>FlowGMM-cons (ni labels)</td><td>98.2</td><td>98.7</td><td>99</td><td>99.2</td></tr></table>
153
+
154
+ Table 4: Negative log-likelihood and Expected Calibration Error for supervised FlowGMM trained on MNIST (1k train, 1k validation, 10k test) and CIFAR-10 ( $5 0 \mathrm { k }$ train, 1k validation, $9 \mathrm { k }$ test). FlowGMM-temp stands for tempered FlowGMM where a single scalar parameter $\sigma ^ { 2 }$ was learned on a validation set for variances in all components.
155
+
156
+ <table><tr><td rowspan="2"></td><td colspan="2">MNIST (test acc 97.3%)</td><td colspan="2">CIFAR-10 (test acc 89.3%)</td></tr><tr><td>FlowGMM</td><td>FlowGMM-temp</td><td>FlowGMM</td><td>FlowGMM-temp</td></tr><tr><td>NLL↓</td><td>0.295</td><td>0.094</td><td>2.98</td><td>0.444</td></tr><tr><td>ECE↓</td><td>0.024</td><td>0.004</td><td>0.108</td><td>0.038</td></tr></table>
157
+
158
+ # 6 MODEL ANALYSIS
159
+
160
+ # 6.1 UNCERTAINTY AND CALIBRATION
161
+
162
+ In many machine learning applications, it is crucial to understand how confident a model is in its predictions. In classification problems, well-calibrated models are expected to output meaningful probabilities of belonging to a particular class. In Guo et al. (2017), it was observed that modern deep learning models are highly overconfident, however, simple temperature scaling can substantially improve model’s calibration. In this section, we analyze the predictive uncertainties produced by the FlowGMM. In Appendix Section F, we additionally study the ability of FlowGMM to detect out-of-domain data.
163
+
164
+ When using FlowGMM for classification, the class predictive probabilities are $p ( y ~ = ~ k | x ) ~ =$ $\begin{array} { r } { \mathcal { N } ( x | \mu _ { k } , \boldsymbol { \Sigma _ { k } ^ { - } } ) / \sum _ { m } \mathcal { N } ( x | \mu _ { m } , \boldsymbol { \Sigma } _ { m } ) } \end{array}$ . Since we initialize Gaussian mixture means randomly from the standard normal distribution and do not train them along with the flow parameters (see section B), FlowGMM predictions become inherently overconfident due to the curse of dimensionality. Indeed, consider two Gaussians with means sampled independently from the standard normal $\mu _ { 1 } , \mu _ { 2 } \sim \mathcal { N } ( 0 , I )$ in $D$ -dimensional space. If $s _ { 1 } \sim \mathcal { N } ( \mu _ { 1 } , I )$ is a sample from the first Gaussian, then its expected squared distances to both mixture means are $\mathbb { E } \left[ \lVert s _ { 1 } - \mu _ { 1 } \rVert ^ { 2 } \right] = D$ and $\mathbb { E } \left[ \lVert s _ { 1 } - \mu _ { 2 } \rVert ^ { 2 } \right] = 3 D$ (for a detailed derivation see Appendix Section G.). In high dimensional spaces, such logits would lead to hard label assignment in FlowGMM $\boldsymbol { p } ( y | x ) = 1$ for exactly one class). In fact, in the experiments we observe that FlowGMM is overconfident and performs hard label assignment: predicted class probabilities are all close to either 1 or 0.
165
+
166
+ We address this problem by learning a single scalar parameter $\sigma ^ { 2 }$ for all components in the Gaussian mixture (the component $k$ will be $\bar { \mathcal { N } } ( \mu _ { k } , \bar { \sigma } ^ { 2 } I ) )$ by minimizing the negative log likelihood on a validation set. This way we can re-calibrate the variance of the latent GMM in a natural way. This procedure is also equivalent to applying temperature scaling (Guo et al., 2017) to logits $\log \mathcal { N } ( x | \mu _ { k } , \Sigma _ { k } )$ . We test FlowGMM calibration on MNIST and CIFAR datasets in the supervised setting. On MNIST we restricted the training set size to 1000 objects, since on the full dataset the model makes too few mistakes which makes evaluating calibration harder. In Table 4, we report negative log likelihood and expected calibration error (ECE, see Guo et al. (2017) for a description of this metric). We can see that re-calibrating variances of the Gaussians in the mixture significantly improves both metrics and mitigates overconfidence. The effectiveness of this simple rescaling procedure suggests that the latent space distances learned by the flow model are correlated with the probabilities of belonging to a particular class: the closer a datapoint is to the mean of a Gaussian in the latent space, the more likely it belongs to the corresponding class.
167
+
168
+ ![](images/b834a0b4c6efead5e83eb18dfd66b065cbb69bb8b24acda051517db5722b5aa3.jpg)
169
+ Figure 3: Visualizations of the latent space representations learned by supervised FlowGMM on MNIST. (a): Latent space interpolations between test images from the same class and (b): from different classes. Observe that interpolations between objects from different classes pass through low-density regions. (c): Histogram of distances from unlabeled data to the decision boundary for FlowGMM-cons trained on $1 k$ labeled and $5 9 k$ unlabeled data and FlowGMM Sup trained on $1 k$ labeled data only. FlowGMM-cons is able to push the decision boundary away from the data distribution using unlabeled data. (d): Feature visualization for CIFAR10: four test reconstructions are shown as an intermediate feature is perturbed. The value of the perturbation $\alpha$ is shown in red vs the distribution of the channel activations. Observe that the channel visualized activates on zeroed out pixels to the left of the image mimicking the random translations applied to the training data.
170
+
171
+ # 6.2 LEARNED LATENT REPRESENTATIONS
172
+
173
+ We next analyze the latent representation space learned by FlowGMM. We examine latent interpolations between members of the same class in Figure 3 (a) and between different classes in Figure 3 (b) for our MNIST FlowGMM-cons model trained with $n _ { \ell } = 1 k$ labels. As expected, inter-class interpolations pass through regions of low-density, leading to low quality samples but intra-class interpolations do not. These observations suggest that, as expected, the model learns to put the decision boundary in the low-density region of the data space.
174
+
175
+ In Appendix section H, we present images corresponding to the means of the Gaussian mixture and class-conditional samples from FlowGMM.
176
+
177
+ Distance to Decision Boundary To explicitly test this conclusion, we compute the distribution of distances from unlabeled data to the decision boundary for FlowGMM-cons and FlowGMM Sup trained on labeled data only. In order to compute this distance exactly for an image $x$ , we find the two closest means $\mu ^ { \prime } , \bar { \mu ^ { \prime \prime } }$ to the corresponding latent variable $z = { \dot { f } } ( x )$ , and evaluate the expression $\begin{array} { r } { d ( x ) \ = \ \frac { \left| \| \mu ^ { \prime } - f ( x ) \| ^ { 2 } - \| \mu ^ { \prime \prime } - f ( x ) \| ^ { 2 } \right| } { 2 \| \mu ^ { \prime } - \mu ^ { \prime \prime } \| } } \end{array}$ We visualize the distributions of the distances for the supervised and semi-supervised method in Figure 3 (c). While most of the unlabeled data are far from the decision boundary for both methods, the supervised method puts a substantially larger fraction of data close to the decision boundary. For example, the distance to the decision boundary is smaller than 5 for 1089 unlabeled data points with supervised model, but only 143 data points with FlowGMM-cons. This increased separation suggests that FlowGMM-cons indeed pushes the decision boundary away from the data distribution in agreement with the clustering principle.
178
+
179
+ # 6.3 FEATURE VISUALIZATION
180
+
181
+ Feature visualization has become an important tool for increasing the interpretability of neural networks. The majority of methods rely on maximizing the activations of a given neuron, channel, or layer over a parametrization of an input image with different kinds of image regularization (Szegedy et al., 2013; Olah et al., 2017; Mahendran & Vedaldi, 2015). These methods, while effective, require optimization and regularization hyper-parameters and iterative optimization too costly for real time interactive exploration.
182
+
183
+ Since our classification model uses a flow which is a sequence of invertible transformations $f ( x ) =$ $f _ { : L } ( x ) : = f _ { L } \circ f _ { L - 1 } \circ . . . f _ { 1 } ( x )$ , intermediate activations can be inverted directly. This means that we can combine the methods of feature inversion and feature maximization directly by feeding in a set of input images, modifying intermediate activations arbitrarily, and inverting the representation.
184
+
185
+ Given a set of activations in the $\ell ^ { t h }$ layer $a _ { \ell } [ c , i , j ] = f _ { : \ell } ( x ) _ { c i j }$ with channels $c$ and spatial extent $i , j$ , we may perturb a single neuron with
186
+
187
+ $$
188
+ x ( \alpha ) = f _ { : \ell } ^ { - 1 } ( f _ { : \ell } ( x ) + \alpha \sigma _ { c } \delta _ { c } ) ,
189
+ $$
190
+
191
+ where $\delta _ { c }$ is a one hot vector at channel $c$ ; and $\sigma _ { c }$ is the standard deviation of the activations in channel $c$ over the the training set and spatial locations. This can be performed at real time rates to explore the activation parametrized by $\alpha$ and the location $c i j$ without any optimization or hyper-parameters. The feature visualization of intermediate layers on CIFAR10 test images are shown in panel (d) of Figure 3. The given channel being visualized appears to activate on the zeroed pixels from random translations as well as the green channel, giving us insight into the workings of the model.
192
+
193
+ # 7 DISCUSSION
194
+
195
+ We proposed FlowGMM, a natural and interpretable model for semi-supervised learning with normalizing flows. FlowGMM outperforms graph-based and consistency-based baselines on tabular data including semi-supervised text classification with BERT embeddings. On image classification, FlowGMM is not yet competitive with the state-of-the-art approaches (Athiwaratkun et al., 2019; Verma et al., 2019), but we expect that the results could be greatly improved by using a better flow architecture that has stronger inductive biases for classification.
196
+
197
+ FlowGMM is greatly extensible and can be easily adapted to different settings. For example, consider an extreme case of semi-supervised learning where some classes may be completely unlabeled, and the model has to identify those extra classes and cluster them separately. An effective model that can operate in this setting could, for example, be used for automated scientific discovery: when applied to classify certain experimental data, it can identify new separate classes that were not considered by experts. FlowGMM can be applied in this scenario: instead of the standard Gaussian mixture model (GMM) in the latent space we can use the Chinese Restaurant Process GMM (CRPGMM), which can infer the number of mixture components from data automatically (Rasmussen, 2000).
198
+
199
+ Further, we can easily adapt FlowGMM to few-shot learning setting where the model has to generalize to classes not seen at train time by only using a few examples of that new class. In particular, we can fix the parameters of the flow model and add a new Gaussian to the mixture whenever we add a new class. We can estimate the parameters of this Gaussian from the few available examples.
200
+
201
+ We view interpretability as another strong advantage of FlowGMM. The access to latent space representations and feature visualization technique discussed in Section 6 as well as the ability to sample from the model can be used to get insights into the performance of the model in practical applications.
202
+
203
+ # REFERENCES
204
+
205
+ Ben Athiwaratkun, Marc Finzi, Pavel Izmailov, and Andrew Gordon Wilson. There are many consistent explanations of unlabeled data: Why you should average. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $=$ rkgKBhA5Y7.
206
+
207
+ Jens Behrmann, David Duvenaud, and Jorn-Henrik Jacobsen. Invertible residual networks. ¨ arXiv preprint arXiv:1811.00995, 2018.
208
+
209
+ David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. MixMatch: A holistic approach to semi-supervised learning. arXiv preprint arXiv:1905.02249, 2019.
210
+
211
+ Ricky TQ Chen, Jens Behrmann, David Duvenaud, and Jorn-Henrik Jacobsen. Residual flows for ¨ invertible generative modeling. arXiv preprint arXiv:1906.02735, 2019.
212
+
213
+ Zihang Dai, Zhilin Yang, Fan Yang, William W Cohen, and Ruslan R Salakhutdinov. Good semisupervised learning that requires a bad GAN. In Advances in Neural Information Processing Systems 30, pp. 6510–6520. 2017.
214
+
215
+ 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.
216
+
217
+ Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
218
+
219
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. arXiv preprint arXiv:1605.08803, 2016.
220
+
221
+ Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. CoRR, abs/1706.04599, 2017. URL http://arxiv.org/abs/1706.04599.
222
+
223
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
224
+
225
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
226
+
227
+ Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible $1 \times 1$ convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
228
+
229
+ 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.
230
+
231
+ Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016.
232
+
233
+ Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5188–5196, 2015.
234
+
235
+ Takeru Miyato, Shin-ichi Maeda, Shin Ishii, and Masanori Koyama. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 2018.
236
+
237
+ Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018.
238
+
239
+ Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don’t know? arXiv preprint arXiv:1810.09136, 2018.
240
+
241
+ Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Hybrid models with deep and invertible features. arXiv preprint arXiv:1902.02767, 2019.
242
+
243
+ Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. Distill, 2017. doi: 10.23915/distill.00007. https://distill.pub/2017/feature-visualization.
244
+
245
+ Avital Oliver, Augustus Odena, Colin A Raffel, Ekin Dogus Cubuk, and Ian Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. In Advances in Neural Information Processing Systems, pp. 3235–3246, 2018.
246
+
247
+ Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759, 2016.
248
+
249
+ George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pp. 2338–2347, 2017.
250
+
251
+ Carl Edward Rasmussen. The infinite gaussian mixture model. In Advances in neural information processing systems, pp. 554–560, 2000.
252
+
253
+ 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.
254
+
255
+ 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.
256
+
257
+ Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in neural information processing systems, pp. 1195–1204, 2017.
258
+
259
+ Vikas Verma, Alex Lamb, Juho Kannala, Yoshua Bengio, and David Lopez-Paz. Interpolation consistency training for semi-supervised learning. arXiv preprint arXiv:1903.03825, 2019.
260
+
261
+ Weidi Xu, Haoze Sun, Chao Deng, and Ying Tan. Variational autoencoder for semi-supervised text classification. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
262
+
263
+ Dengyong Zhou, Olivier Bousquet, Thomas N Lal, Jason Weston, and Bernhard Scholkopf. Learn- ¨ ing with local and global consistency. In Advances in neural information processing systems, pp. 321–328, 2004.
264
+
265
+ # A EXPECTATION MAXIMIZATION
266
+
267
+ As an alternative to direct optimization of the likelihood (equation 4), we consider ExpectationMaximization algorithm (EM). EM is a popular approach for finding maximum likelihood estimates in mixture models. Suppose $X = \{ x _ { i } \} _ { i = 1 } ^ { n }$ is the observed dataset, $T = \{ t _ { i } \} _ { i = 1 } ^ { n }$ are corresponding unobserved latent variables (often denoting the component in mixture model) and $\theta$ is a vector of model parameters. EM algorithm consists of the two alternating steps: on E-step, we compute posterior probabilities of latent variables for each data point $q ( t _ { i } | x _ { i } ) = P ( t _ { i } | x _ { i } , \theta )$ ; and on M-step, we fix $q$ and maximize the expected log likelihood of the data and latent variables with respect to $\theta$ : $\mathbb { E } _ { q } \log P ( X , T | \theta ) \to \operatorname* { m a x } _ { \theta }$ . The algorithm can be easily adapted to the semi-supervised setting where a subset of data is labeled with $\{ y _ { i } ^ { l } \} _ { i = 1 } ^ { n _ { l } }$ : then, on $\mathrm { E }$ -step we have hard assignment to the true mixture component $q ( t _ { i } | x _ { i } ) = I [ t _ { i } = y _ { i } ^ { l } ]$ for labeled data points.
268
+
269
+ EM algorithm is applicable in our setting which is fitting the transformed mixture of Gaussians. We can perform the exact $\mathrm { E }$ -step for unlabeled data in the model since
270
+
271
+ $$
272
+ q ( t | x ) = { \frac { p ( x | t , \theta ) } { p ( x | \theta ) } } = { \frac { { \mathcal { N } } ( f ( x ) | \mu _ { t } , \Sigma _ { t } ) \cdot \left| \operatorname* { d e t } \left( { \frac { \partial f } { \partial x } } \right) \right| } { \sum _ { k = 1 } ^ { \mathcal { C } } { \mathcal { N } } ( f ( x ) | \mu _ { k } , \Sigma _ { k } ) \cdot \left| \operatorname* { d e t } \left( { \frac { \partial f } { \partial x } } \right) \right| } } = { \frac { { \mathcal { N } } ( f ( x ) | \mu _ { t } , \Sigma _ { t } ) } { \sum _ { k = 1 } ^ { \mathcal { C } } { \mathcal { N } } ( f ( x ) | \mu _ { k } , \Sigma _ { k } ) } }
273
+ $$
274
+
275
+ which coincides with the $\mathrm { E }$ -step of EM algorithm on Gaussian mixture model. On M-step, the objective has the following form:
276
+
277
+ $$
278
+ \sum _ { i = 1 } ^ { n _ { l } } \log \left[ \mathcal { N } ( f _ { \theta } ( x _ { i } ^ { l } ) | \mu _ { y _ { i } ^ { l } } , \Sigma _ { y _ { i } ^ { l } } ) \left| \frac { \partial f _ { \theta } } { \partial x _ { i } ^ { l } } \right| \right] + \sum _ { i = 1 } ^ { n _ { u } } \mathbb { E } _ { q ( t _ { i } | x _ { i } ^ { u } , \theta ) } \log \left[ \mathcal { N } ( f _ { \theta } ( x _ { i } ^ { u } ) | \mu _ { t _ { i } } , \Sigma _ { t _ { i } } ) \left| \frac { \partial f _ { \theta } } { \partial x _ { i } ^ { u } } \right| \right] .
279
+ $$
280
+
281
+ Since the exact solution is not tractable due to complexity of the flow model, we perform a stochastic gradient step to optimize the expected log likelihood with respect to flow parameters $\theta$ .
282
+
283
+ Note that unlike regular EM algorithm for mixture models, we have Gaussian mixture parameters $\{ ( \mu _ { k } , \Sigma _ { k } ) \} _ { k = 1 } ^ { \mathcal { C } }$ fixed in our experiments, and on M-step the update of $\theta$ induces the change of $z _ { i } =$ $f _ { \boldsymbol { \theta } } ( \boldsymbol { x } _ { i } )$ latent space representations.
284
+
285
+ Using EM algorithm for optimization in the semi-supervised setting on MNIST dataset with 1000 labeled images, we obtain $9 8 . 9 7 \%$ accuracy which is comparable to the result for FlowGMM with regular SGD training. However, in our experiments, we observed that on E-step, hard label assignment happens for unlabeled points $\mathbf { \bar { \Psi } } q ( t | x ) \approx 1$ for one of the classes) because of the high dimensionality of the problem (see section 6.1) which affects the M-step objective and hinders training.
286
+
287
+ # B LATENT DISTRIBUTION MEAN AND COVARIANCE CHOICES
288
+
289
+ Initialization In our experiments, we draw the mean vectors $\mu _ { i }$ of Gaussian mixture model randomly from the standard normal distribution $\mu _ { i } \sim \mathcal { N } ( 0 , I )$ , and set the covariance matrices to identity $\Sigma _ { i } = I$ for all classes; we fixed GMM parameters throughout training. However, one could potentially benefit from data-dependent placing of means in the latent space. We experimented with different initialization methods, in particular, initializing means using the mean point of latent representations of labeled data in each class: $\mu _ { i } = ( 1 / n _ { l } ^ { i } ) \textstyle \sum _ { m = 1 } ^ { n _ { l } ^ { i } } f ( x _ { m } ^ { i } )$ where $x _ { m } ^ { i }$ represents labeled data points from class $i$ and $n _ { l } ^ { i }$ is the total number of labeled points in that class. In addition, we can scale all means by a scalar value ${ \hat { \mu } } _ { i } = r \mu _ { i }$ to increase or decrease distances between them. We observed that such initialization leads to much faster convergence of FlowGMM on semi-supervised classification on MNIST dataset, however, the final performance of the model was worse compared to the one with random mean placing. We hypothesize that it becomes easier for the flow model to warm up faster with data-dependent initialization because Gaussian means are closer to the initial latent representations, but afterwards the model gets stuck in a suboptimal solution.
290
+
291
+ GMM training FlowGMM would become even more flexible and expressive if we could learn Gaussian mixture parameters in a principled way. In the current setup where means are sampled from√ the standard normal distribution, the distances between mixture components are about $\sqrt { 2 D }$ where $D$ is the dimensionality of the data (see Appendix G). Thus, classes are quite far apart from each other in the latent space, which, as observed in Section 6.1, leads to model miscalibration. Training GMM parameters can further increase interpretability of the learned latent space representations: we can imagine a scenario in which some of the classes are very similar or even intersecting, and it would be useful to represent it in the latent space. We could train GMM by directly optimizing likelihood (equation 4), or using expectation maximization (see Section A), either jointly with the flow parameters or iteratively switching between training flow parameters with the fixed GMM and training GMM with the fixed flow. In our initial experiments on semi-supervised classification on MNIST, training GMM jointly with the flow parameters did not improve performance or lead to substantial change of the latent representations. Further improvements require careful hyperparameter choice which we leave for future work.
292
+
293
+ ![](images/8bc2da5f17acd9c0a03c362ce398089cd0884a969f11b585932339b489f33962.jpg)
294
+ Figure 4: Illustration of FlowGMM on synthetic datasets: two circles (top row), eight Gaussians (middle row) and pinwheel (bottom row). (a): Data distribution and classification decision boundaries. Unlabeled data is shown with blue circles and labeled data is shown with colored triangles, where color represents the class. Background color visualizes the classification decision boundaries of FlowGMM. (b): Mapping of the data to the latent space. (c): Gaussian mixture in the latent space. (d): Samples from the learned generative model corresponding to different classes, as shown by their color.
295
+
296
+ # C SYNTHETIC EXPERIMENTS
297
+
298
+ In Figure 4 we visualize the classification decision boundaries of FlowGMM as well as the learned mapping to the latent space and generated samples for three different synthetic datasets.
299
+
300
+ # D TABULAR DATA PREPARATION AND HYPERPARAMETERS
301
+
302
+ The AG-News and Yahoo Answers were constructed by applying BERT embeddings to the text input, yielding a 768 dimensional vector for each data point. AG-News has 4 classes while Yahoo Answers has 10. The UCI datasets Hepmass and Miniboone were constructed using the data preprocessing from Papamakarios et al. (2017), but with the inclusion of the removed background process class so that the two problems can be used for binary classification. We then subsample the fraction of background class examples so that the dataset is balanced. For each of the datasets, a separate validation set of size $5 \mathrm { k }$ was used to tune hyperparameters. All neural network models use the ADAM optimizer (Kingma & Ba, 2014).
303
+
304
+ Table 5
305
+
306
+ <table><tr><td>Method Learning Rate</td><td>AG-News</td><td>Yahoo Answers</td><td>Hepmass</td><td>Miniboone</td></tr><tr><td>3-Layer NN + Dropout</td><td>3e-4</td><td>3e-4</td><td>3e-4</td><td>3e-4</td></tr><tr><td>II-model</td><td>1e-3</td><td>1e-4</td><td>3e-3</td><td>1e-4</td></tr><tr><td>FlowGMM</td><td>1e-4</td><td>1e-4</td><td>3e-3</td><td>3e-4</td></tr><tr><td>kNN</td><td>k=4</td><td>k=18</td><td>k=9</td><td>k=3</td></tr></table>
307
+
308
+ $\mathbf { k }$ -Nearest Neighbors: We tested both using both L2 distance and L2 with inputs normalized to unit norm, $\sin ^ { 2 }$ distance), and the latter performed the best. The value $k$ chosen in the method was found sweeping over $1 - 2 0$ , and the optimal values for each of the datasets are shown in 5.
309
+
310
+ 3 Layer $\mathbf { N N } +$ Dropout: The 3-Layer $\mathrm { N N } +$ Dropout baseline network has three fully connected hidden layers with inner dimension $k = 5 1 2$ , ReLU nonlinearities, and dropout with $p = 0 . 5$ . We use the learning rate $\mathrm { 3 e { - } 4 }$ for training the supervised baseline across all datasets.
311
+
312
+ Π-Model: The Π-Model uses the same network architecture, and dropout for the perturbations. The additional consistency loss per unlabeled data point is computed as $L _ { \mathrm { U n l a b } } = | | g ( x ^ { \prime \prime } ) - g ( x ^ { \prime } ) | | ^ { 2 }$ , where $g$ is are the output probabilities after the softmax layer of the neural network and the consistency weight $\lambda = 3 0$ which worked the best across the datasets. The model was trained for 50 epochs with labeled and unlabeled batch size $n _ { \ell }$ for AG-News and Yahoo Answers, and labeled and unlabeled batch sizes $n _ { \ell }$ and 2000 for Hepmass and Miniboone.
313
+
314
+ Label Spreading: We use the local and global consistency method from Zhou et al. (2004), $Y ^ { * } =$ $( I - \alpha \bar { S } ) ^ { - 1 } Y$ where in our case $Y$ is the matrix of labels for the labeled, unlabeled, and test data but filled with zeros for unlabeled and test. $S = D ^ { - 1 / 2 } W D ^ { - 1 / 2 }$ computed from the affinity matrix $W _ { i j } = \exp \left( - \gamma \sin ^ { 2 } ( x _ { i } , x _ { j } ) \right)$ where $\begin{array} { r } { \sin ^ { 2 } ( x _ { i } , x _ { j } ) : = 1 - \frac { \langle x _ { i } , x _ { j } \rangle } { \| x _ { i } \| \| x _ { j } \| } } \end{array}$ . This is equivalent to L2 distance on the inputs normalized to unit magnitude. Because the algorithm scales poorly with number of unlabeled points for dense affinity matrices, $O ( n _ { u } ^ { 3 } )$ , we we subsampled the number of unlabeled data points to $1 0 k$ and test data points to $5 k$ for this graph method. However, we also evaluate the label spreading algorithm with a sparse kNN affinity matrix on using a larger subset $2 0 k$ of unlabeled data. The two hyperparameters for label spreading $( \gamma / k$ and $\alpha$ ) were tuned by separate grid search for each of the datasets. In both cases, we use the inductive variant of the algorithm where the test data is not included in the unlabeled data.
315
+
316
+ FlowGMM: We train our FlowGMM model with a RealNVP normalizing flow, similar to the architectures used in Papamakarios et al. (2017). Specifically, the model uses 7 coupling layers, with 1 hidden layer each and 256 hidden units for the UCI datasets but 512 for text classification. UCI models were trained for 50 epochs of unlabeled data and the text datasets were trained for 30 epochs of unlabeled data. The labeled and unlabeled batch sizes are the same as in the Π-Model.
317
+
318
+ The tuned learning rates for each of the models that we used for these experiments are shown in table 5.
319
+
320
+ # E IMAGE DATA PREPARATION AND HYPERPARAMETERS
321
+
322
+ We use the CIFAR-10 multi-scale architecture with 2 scales, each containing 3 coupling layers defined by 8 residual blocks with 64 feature maps. We use Adam optimizer (Kingma & Ba, 2014) with learning rate $1 0 ^ { - 3 }$ for CIFAR-10 and SVHN and $1 0 ^ { - 4 }$ for MNIST. We train the supervised model for 100 epochs, and semi-supervised models for 1000 passes through the labeled data for CIFAR-10 and SVHN and 3000 passes for MNIST. We use a batch size of 64 and sample 32 labeled and 32 unlabeled data points in each mini-batch. For the consistency loss term (equation 7), we linearly increase the weight from 0 to 1 for the first 100 epochs following Athiwaratkun et al. (2019).
323
+
324
+ For FlowGMM and FlowGMM-cons, we re-weight the loss on labeled data by $\lambda = 3$ (value tuned on validation (Kingma et al., 2014) on CIFAR-10), as otherwise, we observed that the method underfits the labeled data.
325
+
326
+ # F OUT-OF-DOMAIN DATA DETECTION
327
+
328
+ Density models have held promise for being able to detect out-of-domain data, an especially important task for robust machine learning systems (Nalisnick et al., 2019). Recently, it has been shown that existing flow and autoregressive density models are not as apt at this task as previously thought, yielding high likelihood on images coming from other (simpler) distributions. The conclusion put forward is that datasets like SVHN are encompassed by, or have roughly the same mean but lower variance than, more complex datasets like CIFAR10 (Nalisnick et al., 2018). We examine this hypothesis in the context of our flow model which has a multi-modal latent space distribution unlike methods considered in Nalisnick et al. (2018).
329
+
330
+ ![](images/03c120b2b67ca21f9f317f98afb01e803e6410988754d8489801ef847329c82e.jpg)
331
+ Figure 5: Left: Log likelihoods on in- and out-of-domain data for our model trained on MNIST. Center: Log likelihoods on in- and out-of-domain data for our model trained on FashionMNIST. Right: MNIST digits get mapped onto the sandal mode of the FashionMNIST model $7 5 \%$ of the time, often being assigned higher likelihood than elements of the original sandal class. Representative elements are shown above.
332
+
333
+ Using a fully supervised model trained on MNIST, we evaluate the log likelihood for data points coming from the NotMNIST dataset, consisting of letters instead of digits, and the FashionMNIST dataset. We then train a supervised model on the more complex dataset FashionMNIST and evaluate on MNIST and NotMNIST. The distribution of the log likelihood $\log p _ { \mathcal { X } } ( \cdot ) \ =$ $\begin{array} { r } { \log p _ { \mathcal Z } ( f ( \cdot ) ) + \log \left| \operatorname* { d e t } \left( \frac { \partial f } { \partial x } \right) \right| } \end{array}$ on these datasets is shown in Figure 5. For the model trained on MNIST we see that the data from Fashion MNIST and NotMNIST is assigned lower likelihood, as expected. However, the model trained on FashionMNIST predicts higher likelihoods for MNIST images. The majority $( \approx 7 5 \% )$ of the MNIST data points get mapped into the mode of the FashionMNIST model corresponding to sandals, which is the class with the largest fraction of pixels that are zero. Similarly, for the model trained on MNIST the image of all zeros has very high likelihood and gets mapped to the mode corresponding to the digit 1 which has the largest fraction of empty space.
334
+
335
+ # G EXPECTED DISTANCES BETWEEN GAUSSIAN SAMPLES
336
+
337
+ Consider two Gaussians with means sampled independently from the standard normal $\mu _ { 1 } , \mu _ { 2 } \sim { \mathcal { N } } ( 0 , I )$ in $D$ -dimensional space. If $\bar { s } _ { 1 } \sim \mathcal { N } ( \mu _ { 1 } , I )$ is a sample from the first Gaussian, then its expected squared distances to both mixture means are:
338
+
339
+ $$
340
+ \mathbb { E } \left[ \Vert s _ { 1 } - \mu _ { 1 } \Vert ^ { 2 } \right] = \mathbb { E } \left[ \mathbb { E } \left[ \Vert s _ { 1 } - \mu _ { 1 } \Vert ^ { 2 } | \mu _ { 1 } \right] \right] = \mathbb { E } \left[ \sum _ { i = 1 } ^ { D } \mathbb { E } \left[ ( s _ { 1 , i } - \mu _ { 1 , i } ) ^ { 2 } | \mu _ { 1 , i } \right] \right]
341
+ $$
342
+
343
+ $$
344
+ = \mathbb { E } \left[ \sum _ { i = 1 } ^ { D } \left( \mathbb { E } [ s _ { 1 , i } ^ { 2 } ] - 2 \mu _ { 1 , i } ^ { 2 } + \mu _ { 1 , i } ^ { 2 } \right) \right] = \mathbb { E } \left[ \sum _ { i = 1 } ^ { D } \left( 1 + \mu _ { 1 , i } ^ { 2 } - \mu _ { 1 , i } ^ { 2 } \right) \right] = D
345
+ $$
346
+
347
+ $$
348
+ \begin{array} { l } { \displaystyle \mathbb { E } \left[ \| s _ { 1 } - \mu _ { 2 } \| ^ { 2 } \right] = \mathbb { E } \left[ \mathbb { E } \left[ \| s _ { 1 } - \mu _ { 2 } \| ^ { 2 } | \mu _ { 1 } , \mu _ { 2 } \right] \right] = \mathbb { E } \left[ \sum _ { i = 1 } ^ { D } \mathbb { E } \left[ ( s _ { 1 , i } - \mu _ { 2 , i } ) ^ { 2 } | \mu _ { 1 , i } , \mu _ { 2 , i } \right] \right] } \\ { \displaystyle \quad = \mathbb { E } \left[ \sum _ { i = 1 } ^ { D } \left( 1 + \mu _ { 1 , i } ^ { 2 } - 2 \mu _ { 1 , i } \mu _ { 2 , i } + \mu _ { 2 , i } ^ { 2 } \right) \right] = 3 D } \end{array}
349
+ $$
350
+
351
+ For high-dimensional Gaussians the random variables $\| s _ { 1 } ~ - ~ \mu _ { 1 } \| ^ { 2 }$ and $\| s _ { 1 } ~ - ~ \mu _ { 2 } \| ^ { 2 }$ will be concentrated around their expectations. Since the function $\exp ( - x )$ decreases rapidly to zero for positive $x$ , the probability of $s _ { 1 }$ belonging to the first Gaussian $\exp ( - \Vert s _ { 1 } \ d$ µ $\begin{array}{c} \begin{array} { r l r } { \varepsilon _ { 1 } \| ^ { 2 } ) \big / \left( \exp ( - \| s _ { 1 } - \mu _ { 1 } \| ^ { 2 } ) + \exp ( - \| s _ { 1 } - \mu _ { 2 } \| ^ { 2 } ) \right) } & { \approx } & { \exp ( - D ) / \big ( \exp ( - D ) + \exp ( - 3 D ) \big ) } \\ & { } & \end{array} = \exp ( - 1 ) \left( \exp ( - \| s _ { 1 } - \mu _ { 1 } \| ^ { 2 } ) + \exp ( - \| s _ { 1 } - \mu _ { 2 } \| ^ { 2 } ) \right) \mid \mu _ { 1 } \approx \exp ( - D ) / \big ( \exp ( - D ) + \exp ( - 3 D ) \big ) \end{array}$ $1 / ( 1 + \exp ( - 2 D ) )$ saturates at 1 with the growth of dimensionality $D$ .
352
+
353
+ # H FLOWGMM AS GENERATIVE MODEL
354
+
355
+ ![](images/dc7d18b1a5a0424c4cd9ee2fb6db9a660e829eed39a79225f3b743e1d74e1701.jpg)
356
+ Figure 6: Visualizations of the latent space representations learned by supervised FlowGMM on MNIST. (a): Images corresponding to means of the Gaussians corresponding to different classes. (b): Class-conditional samples from the model at a reduced temperature $T = 0 . 2 5$ .
357
+
358
+ In Figure 6a we show the images $f ^ { - 1 } ( \mu _ { i } )$ corresponding to the means of the Gaussians representing each class. We see that the flow correctly learns to map the means to samples from the corresponding classes.Next, in Figure 6b we show class-conditional samples from the model. To produce a sample from class $i$ , we first generate $z \sim \mathcal { N } ( \mu _ { i } , T I )$ , where $T$ is a temperature parameter that controls trade-off between sample quality and diversity; we then compute the samples as $f ^ { - 1 } ( z )$ . We set $T = 0 . 2 5 ^ { 2 }$ to produce samples in Figure 6b. As we can see, FlowGMM can produce reasonable class-conditional samples simultaneously with achieving a high classification accuracy $( 9 9 . 6 3 \%$ ) on the MNIST dataset.
md/train/BJg_roAcK7/BJg_roAcK7.md ADDED
@@ -0,0 +1,480 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # INVASE: INSTANCE-WISE VARIABLE SELECTION USING NEURAL NETWORKS
2
+
3
+ Jinsung Yoon
4
+ Department of Electrical and Computer Engineering
5
+ UCLA, California, USA
6
+ jsyoon0823@g.ucla.edu
7
+ James Jordon
8
+ Engineering Science Department
9
+ University of Oxford, UK
10
+ james.jordon@wolfson.ox.ac.uk
11
+ Mihaela van der Schaar
12
+ University of Cambridge, UK
13
+ Department of Electrical and Computer Engineering, UCLA, California, USA
14
+ Alan Turing Institute, London, UK
15
+ mihaela@ee.ucla.edu
16
+
17
+ # ABSTRACT
18
+
19
+ The advent of big data brings with it data with more and more dimensions and thus a growing need to be able to efficiently select which features to use for a variety of problems. While global feature selection has been a well-studied problem for quite some time, only recently has the paradigm of instance-wise feature selection been developed. In this paper, we propose a new instance-wise feature selection method, which we term INVASE. INVASE consists of 3 neural networks, a selector network, a predictor network and a baseline network which are used to train the selector network using the actor-critic methodology. Using this methodology, INVASE is capable of flexibly discovering feature subsets of a different size for each instance, which is a key limitation of existing state-of-the-art methods. We demonstrate through a mixture of synthetic and real data experiments that INVASE significantly outperforms state-of-the-art benchmarks.
20
+
21
+ # 1 INTRODUCTION
22
+
23
+ High-dimensional data is becoming more readily available, and it brings with it a growing need to be able to efficiently select which features to use for a variety of problems. When doing predictions, it is well known that using too many variables with too few samples can lead to overfitting, which can significantly hinder the performance of predictive models. In the realm of interpretability, the large dimensionality of the data is often too much information to present to a human who may be using the machine learning model as a support system. Understanding which features are most relevant to an outcome or to a model output is an important first step in improving predictions and interpretability and many works exist that tackle feature selection on a global level. However, in the heterogeneous data we typically encounter, the prediction made by a model (and indeed the true label) may rely on a different subset of the features for different subgroups within the data [14]. In this paper we propose a novel instance-wise feature selection method, INVASE (INstance-wise VAriable SElection), which attempts to learn which subset of the features is relevant for each sample, allowing us to display the minimal information required to explain each prediction and also to reduce overfitting of predictive models.
24
+
25
+ Discovering a global subset of relevant features for a particular task is a well-studied problem and there are several existing methods for solving it such as Sequential Correlation Feature Selection [11], Mutual Information Feature Selection [21], Knockoff models [3], and more [10; 16]. However, global feature selection suffers from a key limitation - the features discovered by global feature selection are the same for all samples. In many cases, in particular when populations are highly heterogeneous, the relevant features may differ across samples [33; 32]. For instance, different patient subgroups have different relevant features for predicting heart failure [14]. Instance-wise feature selection methods such as [4; 27] instead try to discover the features that are relevant for each sample. When the goal is to provide an interpretable explanation of the predictions made, a key challenge is in ensuring that we do not over-explain by providing too much information (i.e. choosing too many features). Naturally, by performing feature selection on an individualized level we are able to select features that are more relevant to each sample, rather than having to choose the top $k$ features globally, which may not explain the predictions for some samples very well, but simply perform well on average across all samples.
26
+
27
+ In this paper, we propose a novel instance-wise feature selection method which we term INVASE. We draw influence from actor-critic models [22] to solve the problem of backpropagating through subset sampling. Our model consists of 3 neural networks: a selector network, a predictor network and a baseline network. During training, each of these are trained iteratively, with the selector network being trained to minimize a Kullback-Leibler (KL) divergence between the full conditional distribution and the selected-features-only conditional distribution of the outcome. Our model is capable of discovering a different number of relevant variables for each sample which is a key limitation in existing instance-wise approaches (such as [4]). We show significant improvements over the state-of-the-art in both synthetic data and real-word data in terms of true positive rates, false discovery rates, and show better predictive performance with respect to several prediction metrics. Our model can also be easily extended to handle both continuous and discrete outputs and time-series inputs (see the Appendix for details).
28
+
29
+ # 1.1 RELATED WORKS
30
+
31
+ There are many existing works on global variable selection (see [10] for a good summary paper). [21] and [11] use max-dependency min-redundancy criteria [17] with mutual information and Pearson correlation, respectively. [3] uses multiple hypothesis testing for global variable selection. As noted above, these global selection methods are not capable of learning sample-specific relevance.
32
+
33
+ Instance-wise variable selection is also closely related to model interpretation methods. Some previous works are based on backpropagation from the output of the predictive model to the input variables [29]. DeepLIFT [27] decomposes the output of the neural network on a reference input to compute the contribution of each input variable. However, both methods need white-box access to the pre-trained predictive models to compute the gradient and decomposition. [2] approximates the predictive models using a Parzen window approximator when there is only black-box access to the predictive models. Some other works are based on input perturbation such as [1], [15], [30] and [5]. [18] uses Shapley values to compute the variable importance, and [24] uses locally linear models to explain the linear dependency for each sample. [19] tries to interpret tree ensemble models using Shapley values but cannot generalize to other predictive models such as neural networks.
34
+
35
+ Our work is most closely related to L2X (Learning to Explain) [4]. However, there are 3 key differences between our work and theirs. In L2X, they try to maximize a lower bound of the mutual information between the target $Y$ and the selected input variables $X _ { S }$ . In contrast, we try to minimize the KL divergence between the conditional distributions $Y | X$ and $Y | X _ { S }$ . In order to be able to backpropagate through subset sampling, L2X use the Gumbel-softmax trick [13] to approximately discretize the continuous outputs of the neural network. In our work, we use methods from actorcritic models [22] to bypass backpropagation through the sampling and instead use the predictor network to provide a reward to the selector network. Finally, due to the Gumbel-softmax used in L2X, the number of variables to be detected must be fixed in advance and is necessarily the same for every sample. The actor-critic methodology used in our model has no such limitations and so we are able to flexibly select a different number of relevant variables for each sample and instead induce sparsity using an $l _ { 0 }$ penalty term. In fact, using the actor-critic methodology allows us to directly use the $l _ { 0 }$ penalty term (which is not differentiable and therefore not practical to use in general). A summary table highlighting the key features of all of the related works can be found in the Appendix.
36
+
37
+ # 2 PROBLEM FORMULATION
38
+
39
+ Let ${ \mathcal { X } } = { \mathcal { X } } _ { 1 } \times \ldots \times { \mathcal { X } } _ { d }$ be a $d$ -dimensional feature space and $\boldsymbol { \mathcal { V } } = \{ 1 , . . . , c \}$ be a discrete label space1. Let $\mathbf { X } = ( X _ { 1 } , . . . , X _ { d } ) \in \mathcal { X }$ and $Y \in \mathcal { D }$ be random variables with joint density (or mass) $p$ and marginal densities (or masses) $p _ { X }$ and $p _ { Y }$ respectively. We will refer to $\mathbf { s } \in \{ 0 , 1 \} ^ { d }$ as the selection vector, where $s _ { i } = 1$ will indicate that variable $i$ is selected, and $s _ { i } ~ = ~ 0$ will indicate that variable $i$ is not selected. Let $^ *$ be any point not in any of the spaces $\mathcal { X } _ { 1 } , . . . , \mathcal { X } _ { d }$ and define ${ { \mathcal { X } } _ { i } ^ { * } } = { { \mathcal { X } } _ { i } } \cup \left\{ * \right\}$ and $\mathcal { X } ^ { * } = \mathcal { X } _ { 1 } ^ { * } \times \ldots \times \mathcal { X } _ { d } ^ { * }$ . Given $\mathbf { x } \in \mathcal { X }$ we will write $\mathbf { x } ^ { ( \mathbf { s } ) }$ to denote the suppressed feature vector defined by
40
+
41
+ $$
42
+ x _ { i } ^ { ( \mathbf { s } ) } = \left\{ { \atop * \operatorname { i f } s _ { i } = 0 } \right.
43
+ $$
44
+
45
+ so that $^ *$ represents that a feature is not selected.
46
+
47
+ In the global feature selection literature, the goal is to find the smallest s (i.e. the one with fewest 1s) such that $\mathbb { E } ( Y | \mathbf { X } ^ { ( \mathbf { s } ) } ) = \mathbb { E } ( Y | \mathbf { X } )$ , or equivalently such that the conditional distribution of $Y$ given $\mathbf { X } ^ { ( \mathbf { s } ) }$ is the same as $Y$ given all of $\mathbf { X }$ . Note that this definition is given fully in terms of random variables, rather than realizations of those random variables.
48
+
49
+ In contrast, our problem necessarily needs to be defined in terms of realizations since we are aiming to select features for a given realization. We will write $\mathbf { x }$ to denote realizations of the random variable $\mathbf { X }$ . Then we formalize our problem as one of finding a selector function, $S : \mathcal { X } \{ 0 , 1 \} ^ { d }$ such that for almost every $\mathbf { x } \in \mathcal { X }$ (w.r.t. $p _ { X }$ ) we have
50
+
51
+ $$
52
+ ( Y | \mathbf { X } ^ { ( S ( \mathbf { x } ) ) } = \mathbf { x } ^ { ( S ( \mathbf { x } ) ) } ) \overset { d . } { = } ( Y | \mathbf { X } = \mathbf { x } )
53
+ $$
54
+
55
+ where $\underline { { \underline { { d . } } } }$ denotes equality in distribution and $S ( \mathbf { x } )$ is minimal (i.e. fewest 1s) such that (1) holds.
56
+
57
+ We suppose that we have a dataset $\mathbfcal { D } = \{ ( \mathbf { x } _ { j } , y _ { j } ) \} _ { j = 1 } ^ { n }$ consisting of $n$ i.i.d. realizations of the pair $( \mathbf { X } , Y )$ .2 Note that $Y$ can be viewed as having either come from a dataset, in which case the problem is of selecting predictive features, or as having come from a predictive model, in which case the problem is of explaining the model’s predictions.
58
+
59
+ # 2.1 OPTIMIZATION PROBLEM
60
+
61
+ In order to learn a suitable selector function, we transform the constraint (1) into a soft constraint using the Kullback-Leibler (KL) divergence which, for random variables $W$ and $V$ with densities $p _ { W }$ and $p _ { V }$ is defined as
62
+
63
+ $$
64
+ K L ( W | | V ) = \mathbb { E } \left[ \log \left( \frac { p _ { W } ( W ) } { p _ { V } ( W ) } \right) \right] .
65
+ $$
66
+
67
+ We define the following loss for our selector function $S$
68
+
69
+ $$
70
+ \mathcal { L } ( S ) = \mathbb { E } _ { \mathbf { x } \sim p _ { X } } \left[ K L ( Y | \mathbf { X } = \mathbf { x } | | Y | \mathbf { X } ^ { ( S ( \mathbf { x } ) ) } = \mathbf { x } ^ { ( S ( \mathbf { x } ) ) } ) + \lambda | | S ( \mathbf { x } ) | | \right]
71
+ $$
72
+
73
+ where $| | \cdot | |$ simply denotes the number of non-zero entries of a vector (or equivalently in this case, the number of 1s) and $\lambda$ is a hyper-parameter that trades off between the constraint in (1) and the number of selected features. The KL divergence in (2) can be rewritten as
74
+
75
+ $$
76
+ \begin{array} { l } { { \displaystyle K L ( Y | { \bf X } = { \bf x } | | Y | { \bf X } ^ { ( S ( { \bf x } ) ) } = { \bf x } ^ { ( S ( { \bf x } ) ) } ) = \mathbb { E } _ { y \sim Y | { \bf X } = { \bf x } } \left[ \log \left( \frac { p _ { Y } ( y | { \bf x } ) } { p _ { Y } ( y | { \bf x } ^ { ( S ( { \bf x } ) ) } ) } \right) \right] } \ ~ } \\ { { \displaystyle = \mathbb { E } _ { y \sim Y | { \bf X } = { \bf x } } \left[ \log ( p _ { Y } ( y | { \bf x } ) ) - \log ( p _ { Y } ( y | { \bf x } ^ { ( S ( { \bf x } ) ) } ) ) \right] } \ ~ } \\ { { \displaystyle = \int _ { y } p _ { Y } ( y | { \bf x } ) \left[ \log ( p _ { Y } ( y | { \bf x } ) ) - \log ( p _ { Y } ( y | { \bf x } ^ { ( S ( { \bf x } ) ) } ) ) \right] d y } , } \end{array}
77
+ $$
78
+
79
+ where $p _ { Y } ( \cdot | \cdot )$ denotes the appropriate conditional densities of $Y$ . We will write
80
+
81
+ $$
82
+ l ( \mathbf { x } , \mathbf { s } ) = \int _ { \mathcal { V } } p _ { Y } ( y | \mathbf { x } ) \left[ \log ( p _ { Y } ( y | \mathbf { x } ) ) - \log ( p _ { Y } ( y | \mathbf { x } ^ { ( s ) } ) ) \right] d y
83
+ $$
84
+
85
+ so that our final loss can be written as
86
+
87
+ $$
88
+ \mathcal { L } ( S ) = \mathbb { E } _ { \mathbf { x } \sim p _ { X } } \left[ l ( \mathbf { x } , S ( \mathbf { x } ) ) + \lambda | | S ( \mathbf { x } ) | | \right]
89
+ $$
90
+
91
+ where $| | \cdot | |$ denotes the $l _ { 0 }$ (pseudo-)norm.
92
+
93
+ # 3 PROPOSED MODEL
94
+
95
+ There are two main challenges in minimizing the loss in (4). First, the output space of the selector function $( \{ 0 , 1 \} ^ { d } )$ is large - its size increases exponentially with the dimension of the feature space; thus a complete search is impractical in high dimensional settings (and it should be noted that it is in high dimensional settings where feature selection is most necessary). Second, we do not have access to the densities $p _ { Y } \big ( \cdot | \mathbf { x } ^ { ( S ( \mathbf { x } ) ) } \big )$ and $p _ { Y } ( y \vert \mathbf { x } )$ required to compute (4).
96
+
97
+ # 3.1 LOSS ESTIMATION
98
+
99
+ To approximate the densities in (3), we introduce a pair of functions $f ^ { \phi } : \mathcal { X } ^ { * } \times \{ 0 , 1 \} ^ { d } \to [ 0 , 1 ] ^ { c }$ parametrized by $\phi$ and $f ^ { \gamma } : \mathcal { X } \to [ 0 , 1 ] ^ { c }$ parametrized by $\gamma$ that will estimate $p _ { Y } \big ( \cdot | \mathbf { x } ^ { ( S ( \mathbf { x } ) ) } \big )$ and $p _ { Y } ( \cdot | \mathbf { x } )$ respectively.
100
+
101
+ # 3.1.1 PREDICTOR NETWORK
102
+
103
+ We refer to $f ^ { \phi }$ as the predictor network. This will take as input a suppressed3 feature vector $\mathbf { x } ^ { ( \mathbf { s } ) }$ and its corresponding selection vector s and will output a probability distribution (using a softmax layer) over the $c$ -dimensional output space.
104
+
105
+ $f ^ { \phi }$ is trained to minimize the cross entropy loss given by
106
+
107
+ $$
108
+ l _ { 1 } ( \phi ) = - \mathbb { E } _ { ( \mathbf { x } , y ) \sim p , \mathbf { s } \sim \pi _ { \theta } ( \mathbf { x } , \cdot ) } \Big [ \sum _ { i = 1 } ^ { c } y _ { i } \log ( f _ { i } ^ { \phi } ( \mathbf { x } ^ { ( \mathbf { s } ) } , \mathbf { s } ) ) \Big ]
109
+ $$
110
+
111
+ where $y _ { i }$ is the $i$ th component of the one-hot encoding of $y$ and $\pi _ { \theta }$ is the distribution induced by our selector network which will be defined in the following section. $f ^ { \phi }$ is implemented as a fully connected neural network4.
112
+
113
+ # 3.1.2 BASELINE NETWORK
114
+
115
+ We refer to $f ^ { \gamma }$ as the baseline network, which is standard in the actor-critic literature for variance reduction. $f ^ { \gamma }$ is implemented as a fully connected neural network and is trained to minimize
116
+
117
+ $$
118
+ l _ { 3 } ( \gamma ) = - \mathbb { E } _ { ( \mathbf { x } , y ) \sim p } \Big [ \sum _ { i = 1 } ^ { c } y _ { i } \log ( f _ { i } ^ { \gamma } ( \mathbf { x } ) ) \Big ] .
119
+ $$
120
+
121
+ For fixed $\phi , \gamma$ we define our loss estimator, $\hat { l }$ , by
122
+
123
+ $$
124
+ \hat { l } ( \mathbf { x } , \mathbf { s } ) = - \left[ \sum _ { i = 1 } ^ { c } y _ { i } \log ( f _ { i } ^ { \phi } ( \mathbf { x ^ { ( s ) } } , \mathbf { s } ) ) - \sum _ { i = 1 } ^ { c } y _ { i } \log ( f _ { i } ^ { \gamma } ( \mathbf { x } ) ) \right] .
125
+ $$
126
+
127
+ # 3.2 SELECTOR FUNCTION OPTIMIZATION
128
+
129
+ We approximate the selector function $S : \mathcal { X } \{ 0 , 1 \} ^ { d }$ by using a single neural network, $\hat { S } ^ { \theta } : \mathcal { X } $ $[ 0 , 1 ] ^ { \bar { d } }$ parameterized by weights $\theta$ , that outputs a probability for selecting each feature (i.e. the ith component of $\hat { S } ^ { \theta } ( \mathbf { x } )$ will denote the probability with which we select the ith feature). The selector network induces a probability distribution over the selection space $( \{ 0 , 1 \} ^ { d } )$ , with the probability of a given joint selection vector $\mathbf { s } \in \{ 0 , 1 \} ^ { d }$ being given by5
130
+
131
+ $$
132
+ \pi _ { \boldsymbol \theta } ( \mathbf { x } , \mathbf { s } ) = \Pi _ { i = 1 } ^ { d } \hat { S } _ { i } ^ { \theta } ( \mathbf { x } ) ^ { s _ { i } } ( 1 - \hat { S } _ { i } ^ { \theta } ( \mathbf { x } ) ) ^ { 1 - s _ { i } } .
133
+ $$
134
+
135
+ ![](images/dab836e1e2e287b6c85e1510eb3ffcad658b59e83e87918824fa99ded51229df.jpg)
136
+ Figure 1: Block diagram of INVASE. Instances are fed into the selector network which outputs a vector of selection probabilities. The selection vector is then sampled according to these probabilities. The predictor network then receives the selected features and makes a prediction and the baseline network is given the entire feature vector and makes a prediction. Each of these networks are trained using backpropagation using the real label. The loss of the baseline network is then subtracted from the prediction network’s loss and this is used to update the selector network.
137
+
138
+ Using this, we define the following loss for our selector network
139
+
140
+ $$
141
+ \begin{array} { l } { l _ { 2 } ( \theta ) = \mathbb { E } _ { ( \mathbf { x } , y ) \sim p } \left[ \mathbb { E } _ { \mathbf { s } \sim \pi _ { \theta } ( \mathbf { x } , \cdot ) } \Big [ \hat { l } ( \mathbf { x } , \mathbf { s } ) + \lambda | | \mathbf { s } | | _ { 0 } \Big ] \right] } \\ { \displaystyle = \int _ { \mathcal { X } \times \mathcal { Y } } p ( \mathbf { x } , y ) \left( \sum _ { \mathbf { s } \in \{ 0 , 1 \} ^ { d } } \pi _ { \theta } ( \mathbf { x } , \mathbf { s } ) \left( \hat { l } ( \mathbf { x } , \mathbf { s } ) + \lambda | | \mathbf { s } | | _ { 0 } \right) \right) d x d y . } \end{array}
142
+ $$
143
+
144
+ Taking the gradient of this loss with respect to $\theta$ gives us
145
+
146
+ $$
147
+ \begin{array} { l } { { \displaystyle \nabla _ { \theta } l _ { 2 } ( \theta ) = \int _ { \mathcal { X } \times \mathcal { Y } } p ( { \bf x } , y ) \left( \sum _ { { \bf s \in \{ 0 , 1 \} } ^ { d } } \nabla _ { \theta } \pi _ { \theta } ( { \bf x } , { \bf s } ) \left( \hat { l } ( { \bf x } , { \bf s } ) + \lambda | | { \bf s } | | _ { 0 } \right) \right) d x d y } \ ~ } \\ { { \displaystyle ~ = \int _ { \mathcal { X } \times \mathcal { Y } } p ( { \bf x } , y ) \left( \sum _ { { \bf s \in \{ 0 , 1 \} } ^ { d } } \frac { \nabla _ { \theta } \pi _ { \theta } ( { \bf x } , { \bf s } ) } { \pi _ { \theta } ( { \bf x } , { \bf s } ) } \pi _ { \theta } ( { \bf x } , { \bf s } ) \left( \hat { l } ( { \bf x } , { \bf s } ) + \lambda | | { \bf s } | | _ { 0 } \right) \right) d x d y } \ ~ } \\ { { \displaystyle ~ = \int _ { \mathcal { X } \times \mathcal { Y } } p ( { \bf x } , y ) \left( \sum _ { { \bf s \in \{ 0 , 1 \} } ^ { d } } \nabla _ { \theta } \log \pi _ { \theta } ( { \bf x } , { \bf s } ) \pi _ { \theta } ( { \bf x } , { \bf s } ) \left( \hat { l } ( { \bf x } , { \bf s } ) + \lambda | | { \bf s } | | _ { 0 } \right) \right) d x d y } \ ~ } \\ { \displaystyle ~ = \mathbb { E } _ { ( { \bf x } , y ) \sim p } \left[ \mathbb { E } _ { { \bf s } \sim \pi _ { \theta } ( { \bf x } , { \bf s } ) } \left[ \left( \hat { l } ( { \bf x } , { \bf s } ) + \lambda | | { \bf s } | | _ { 0 } \right) \nabla _ { \theta } \log \pi _ { \theta } ( { \bf x } , { \bf s } ) \right] \right] . } \end{array}
148
+ $$
149
+
150
+ We update each of ${ \hat { S } } ^ { \theta }$ , $f ^ { \phi }$ and $f ^ { \gamma }$ iteratively using stochastic gradient descent. Pseudo-code of INVASE is given in Algorithm 1 and a block representation of INVASE can be found in Fig. 1.
151
+
152
+ # 4 EXPERIMENTS
153
+
154
+ In this section, we quantitatively evaluate INVASE against various state-of-the-art benchmarks on both synthetic and real-world datasets. We evaluate our performance both at identifying ground truth relevance and at enhancing predictions. We compare our model with 4 global variable selection models: Knockoffs [3], Tree Ensembles (Tree) [7], Sequential Correlation Feature Selection (SCFS) [11], and LASSO regularized linear model; and 3 instance-wise feature selection methods: L2X
155
+
156
+ # Algorithm 1 Pseudo-code of INVASE
157
+
158
+ 1: Inputs: learning rates $\alpha , \beta > 0$ , mini-batch size $n _ { m b } > 0$ , dataset $\mathcal { D }$
159
+ 2: Initialize parameters $\theta , \phi , \gamma$
160
+ 3: while Converge do
161
+ 4: Sample a mini-batch from the dataset $( \mathbf { x } _ { j } , y _ { j } ) _ { j = 1 } ^ { n _ { m b } } \sim \mathcal { D }$
162
+ 5: for $j = 1 , . . . , n _ { m b }$ do
163
+ 6: Calculate selection probabilities $( p _ { 1 } ^ { j } , . . . , p _ { d } ^ { j } ) \hat { S } ^ { \theta } ( \mathbf { x } _ { j } )$
164
+ 7: Sample selection vector
165
+ 8: for $i = 1 , . . . , d$ do $s _ { i } ^ { j } \sim B e r ( p _ { i } ^ { j } )$
166
+ 9: Calculate loss $\hat { l } _ { j } ( \mathbf { x } _ { j } , \mathbf { s } _ { j } ) \gets - \left[ \sum _ { i = 1 } ^ { c } y _ { i } ^ { j } \log ( f _ { i } ^ { \phi } ( \mathbf { x } _ { j } ^ { ( \mathbf { s } _ { j } ) } , \mathbf { s } _ { j } ) ) - \sum _ { i = 1 } ^ { c } y _ { i } ^ { j } \log ( f _ { i } ^ { \gamma } ( \mathbf { x } _ { j } ) ) \right]$
167
+
168
+ 10: Update the selector network parameters $\theta$
169
+
170
+ $$
171
+ \theta \theta - \alpha \frac { 1 } { n _ { m b } } \sum _ { j = 1 } ^ { n _ { m b } } ( \hat { l } _ { j } ( \mathbf { x } _ { j } , \mathbf { s } _ { j } ) + \lambda | | \mathbf { s } _ { j } | | ) \nabla _ { \theta } \log \pi _ { \theta } ( \mathbf { x } _ { j } , \mathbf { s } _ { j } )
172
+ $$
173
+
174
+ 11: Update the predictor network parameters $\phi$
175
+
176
+ $$
177
+ \phi \phi - \beta \frac { 1 } { n _ { m b } } \sum _ { j = 1 } ^ { n _ { m b } } \sum _ { i = 1 } ^ { c } y _ { i } ^ { j } \times \nabla _ { \phi } \log ( f _ { i } ^ { \phi } ( \mathbf { x } _ { j } ^ { ( \mathbf { s } _ { j } ) } , \mathbf { s } _ { j } ) )
178
+ $$
179
+
180
+ 12: Update the baseline network parameters $\gamma$
181
+
182
+ $$
183
+ \gamma \gamma - \beta \frac { 1 } { n _ { m b } } \sum _ { j = 1 } ^ { n _ { m b } } \sum _ { i = 1 } ^ { c } y _ { i } ^ { j } \times \nabla _ { \gamma } \log ( f _ { i } ^ { \gamma } ( \mathbf { x } _ { j } ) )
184
+ $$
185
+
186
+ [4], LIME [24], and Shapley [18]. The details of benchmark implementation can be found in the appendix. Implementation of INVASE can be found at https://github.com/jsyoon0823/ INVASE.
187
+
188
+ # 4.1 SYNTHETIC DATA EXPERIMENTS
189
+
190
+ # 4.1.1 EXPERIMENTAL SETTINGS
191
+
192
+ For our first set of experiments, we use the same synthetic data generation models as in L2X [4]. The input features are generated from an 11-dimensional67 Gaussian distribution with no correlations across the features $( \mathbf { X } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) )$ . The label $Y$ is sampled as a Bernoulli random variable with $\begin{array} { r } { \mathbb { P } ( Y = 1 | \mathbf { X } ) = \frac { 1 } { 1 + \mathrm { l o g i t } ( \mathbf { X } ) } } \end{array}$ , where logit $( \mathbf { X } )$ is varied to create 3 different synthetic datasets:
193
+
194
+ • Syn1: $\exp ( X _ { 1 } X _ { 2 } )$
195
+ • Syn2: $\textstyle \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$
196
+ • Syn3: $- 1 0 \times \sin 2 X _ { 7 } + 2 | X _ { 8 } | + X _ { 9 } + \exp ( - X _ { 1 0 } )$
197
+
198
+ In each of these datasets, the label depends on the same subset of features for every sample. To highlight the capability of INVASE to detect instance-wise dependence, we generate 3 further synthetic datasets as follows:
199
+
200
+ • Syn4: If $X _ { 1 1 } < 0$ , logit follows Syn1, otherwise, logit follows Syn2.
201
+ • Syn5: If $X _ { 1 1 } < 0$ , logit follows Syn1, otherwise, logit follows Syn3.
202
+ • Syn6: If $X _ { 1 1 } < 0$ , logit follows Syn2, otherwise, logit follows Syn3.
203
+
204
+ Note that in Syn4 and Syn5, the number of relevant features is different for different samples.
205
+
206
+ For each of Syn1 to Syn6 we draw 20,000 samples from the data generation model and separate each into trainingwe try to fin $( \mathcal { D } _ { t r a i n } { \bf \bar { \alpha } } = ( { \bf x } _ { i } , y _ { i } ) _ { i = 1 } ^ { 1 0 0 0 0 } )$ and testingures for each $( \mathcal { D } _ { t e s t } = ( \mathbf { \bar { x } } _ { j } ^ { - } , y _ { j } ) _ { j = 1 } ^ { 1 0 0 0 0 } )$ sets. For each methodfor Syn1, Syn2, Syn3, $k$ $k = 4$ Syn4, Syn5 and $k = 5$ for Syn6), note, however, that $k$ is not given as an input to INVASE (but is necessary for other methods). The performance metrics we use are the true positive rate (TPR) (higher is better) and false discovery rate $\mathrm { ( F D R ) } ^ { 8 }$ (lower is better) to measure the performance of the methods when the focus is on discovery (i.e. discovering which features are relevant) and we use Area Under the Receiver Operating Characteristic Curve (AUROC), Area Under the Precision Recall Curve (AUPRC) and accuracy when the focus is on predictions.
207
+
208
+ # 4.1.2 DISCOVERY
209
+
210
+ Table 1: Relevant feature discovery results for Synthetic datasets with 11 features
211
+
212
+ <table><tr><td>Dataset</td><td colspan="2">Syn1</td><td colspan="2">Syn2</td><td colspan="2">Syn3</td><td colspan="2">Syn4</td><td colspan="2">Syn5</td><td colspan="2">Syn6</td></tr><tr><td>Metrics (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>92.0</td><td>0.0</td><td>99.8</td><td>10.3</td><td>84.8</td><td>1.1</td><td>90.1</td><td>7.4</td></tr><tr><td>L2X LIME</td><td>100.0 13.8</td><td>0.0 86.2</td><td>100.0 100.0</td><td>0.0 0.0</td><td>69.4 98.1</td><td>30.6 1.9</td><td>79.5 40.7</td><td>21.8 49.4</td><td>74.8 41.1</td><td>26.3 50.6</td><td>83.3 50.5</td><td>16.7 49.5</td></tr><tr><td>Shapley Knockoff</td><td>60.4 10.0</td><td>39.6 70.0</td><td>93.3 8.7</td><td>6.7 36.2</td><td>90.9 81.2</td><td>9.1 17.5</td><td>65.2 38.8</td><td>31.9 35.1</td><td>62.9 41.0</td><td>33.7 51.1</td><td>71.2 56.6</td><td>28.8 42.1</td></tr><tr><td>Tree</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>54.7</td><td>39.0</td><td>56.8</td><td></td><td></td><td>40.0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>37.5</td><td>60.0</td><td></td></tr><tr><td>SCFS</td><td>23.5</td><td></td><td>39.5</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>76.5</td><td></td><td>60.5</td><td>78.3</td><td>22.0</td><td>48.9</td><td>52.4</td><td>42.4</td><td>51.2</td><td>56.1</td><td>43.9</td></tr><tr><td>LASSO</td><td>19.0</td><td>81.0</td><td>39.8</td><td>60.2</td><td>78.3</td><td>21.7</td><td>49.9</td><td>50.9</td><td>45.5</td><td>48.2</td><td>56.4</td><td>43.6</td></tr></table>
213
+
214
+ As demonstrated by Table 1, our method is capable of detecting relevant features on a global level (Syn1, Syn2 and Syn3) as well as on an instance-wise level (Syn4, Syn5 and Syn6) outperforming all other methods in both cases (both global and instance-wise methods). The particularly poor performance of some global feature selection methods in Syn1, Syn2 and Syn3 (where there is no instance-wise relevance) is due to the non-linearity of the relationship between features and labels, further details can be found in the Appendix.
215
+
216
+ The results for Syn4, Syn5 and Syn6 demonstrate that INVASE is capable of detecting a different number of relevant features for each sample when necessary - the performance improvement over L2X is greater in Syn4 and Syn5 than Syn6. In particular, in Syn4, L2X is forced to overselect features when $X _ { 1 1 } ~ < ~ 0$ and underselect when $X _ { 1 1 } \geq 0$ thus resulting in higher FDR and lower TPR, respectively. To highlight this, in Table 2 we report the group specific FDR and TPR on Syn4 and Syn5 when setting $k = 3 , 4 , 5$ , where Group 1 refers to samples with $X _ { 1 1 } < 0$ and Group 2 to samples with $X _ { 1 1 } \geq 0$ .
217
+
218
+ For $k = 3$ in Syn4, we see that INVASE and L2X have comparable FDR in Group 1, since the total number of relevant features for each sample is 3 $( X _ { 1 } , X _ { 2 } , X _ { 1 1 } )$ . However, when we increase $k$ , we see that the FDR increases for L2X as it is forced to select more than 3 features, which necessarily means that the FDR must be at least $40 \%$ even if L2X was finding the relevant features perfectly. On the other hand, for Group 2 we see that the TPR is low for $k = 3$ since necessarily, L2X cannot possibly select all of the 5 relevant features. INVASE, however, is able to select the correct number in both and hence enjoys low FDR and high TPR.
219
+
220
+ Syn5 reinforces the conclusions we drew for L2X in Syn4. Interestingly, though, for INVASE, we found that $X _ { 1 1 }$ was almost never selected for Group 1 in Syn5. We believe this is because the lack of overlap between the relevant features for each group means that the predictor network can essentially learn two separate networks - one for each group. This is because it is possible to create two subnetworks with non-overlapping weights that each take as input the features of a given group. $X _ { 1 1 }$ is therefore unnecessary for prediction. Note, however, that $X _ { 1 1 }$ is highly relevant for the selector network in deciding which features to pass on and so it is not true that $X _ { 1 1 }$ isn’t relevant, but simply that the selector network does not need to “pass on” its relevance to the predictor network. To investigate this further, results for settings where the features overlap between groups (and so it is not possible to disentangle the networks) can be found in the Appendix.
221
+
222
+ Table 2: Detailed comparison of INVASE with L2X in Syn4 and Syn5, highlighting the capability of INVASE to select a flexible number of features for each sample. Group 1: $X _ { 1 1 } < 0$ , Group 2: $X _ { 1 1 } \geq 0$
223
+
224
+ <table><tr><td>Datasets</td><td colspan="4">Syn4</td><td colspan="4">Syn5</td></tr><tr><td>Group</td><td>1</td><td></td><td colspan="2">2</td><td colspan="2">1</td><td colspan="2">2</td></tr><tr><td>Metrics (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE</td><td>99.5</td><td>24.6</td><td>100.0</td><td>0.4</td><td>1 69.2</td><td>1.6</td><td>99.8</td><td>0.6</td></tr><tr><td>L2X (k = 3)</td><td>71.1</td><td>28.9</td><td>57.2</td><td>4.6</td><td>65.5</td><td>34.5</td><td>55.4</td><td>7.7</td></tr><tr><td>L2X (k = 4)</td><td>81.0</td><td>39.2</td><td>74.9</td><td>6.3</td><td>76.2</td><td>42.9</td><td>72.4</td><td>9.4</td></tr><tr><td>L2X(k = 5)</td><td>89.9</td><td>46.0</td><td>84.6</td><td>15.4</td><td>87.5</td><td>47.5</td><td>82.1</td><td>17.9</td></tr></table>
225
+
226
+ # 4.1.3 PREDICTION
227
+
228
+ In this experiment we analyze the effect of using feature selection as a pre-processing step for prediction. We first perform feature selection (either instance-wise or global) and then train a 3-layer fully connected network with Batch Normalization [12] in every layer (to avoid overfitting) to perform predictions on top of the (feature-selected) data. In this setting we compare the two global feature selection methods (LASSO and Tree) and one instance-wise feature selection method (L2X). Furthermore, we also compare with the predictive model without any feature selections (w/o FS) and the predictive model with ground truth globally relevant features9 (with Global). In particular, this allows us to demonstrate that the improvements in prediction performance are not just because the global feature selection performed implicitly by INVASE is better than the other global feature selection methods but are also due to the fact that we select features on an instance-wise level. Experiments here are conducted on synthetic data with 100 features but the same labelling procedures as above.
229
+
230
+ As can be seen in Table 3, there is a significant performance improvement when discarding all of the irrelevant features (with Global). However, neither of the global feature selection methods (Tree and Lasso) are capable of achieving this improvement. On the other hand, INVASE is capable of achieving (and beating - in Syn4 and Syn6) this improvement, demonstrating its capability both at selecting features globally better than existing methods but also at improving on global selection with instance-wise selection (where relevant), to provide further improvements. On the other hand, $L 2 X$ performs worse than the global methods in Syn1-3, demonstrating an inability to perform even global feature selection in this higher dimensional setting (this is supported by the high dimensional discovery results in the Appendix), and in Syn4-6 is performing worse than with Global (which now is not even optimal).
231
+
232
+ Furthermore, even though we include Batch Normalization to avoid overfitting, with a small number of samples and high number of dimensions, the 3-layer fully connected network still suffers from overfitting as demonstrated by the significant difference in performance between w/o FS and with Global. This demonstrates the necessity of feature selection as a pre-processing step. Lastly, in comparison to with Global, with INVASE achieves performance gains in Syn4 and Syn6. It quantitatively shows that instance-wise feature selection can further improves the predictive model from ground truth global feature selection.
233
+
234
+ Table 3: Prediction performance comparison with and without feature selection methods (L2X, LASSO, Tree, INVASE, and Global). Global is using ground-truth globally relevant features for each dataset
235
+
236
+ <table><tr><td rowspan="2">Dataset</td><td colspan="6">AUROC</td></tr><tr><td>w/o FS</td><td>with Global</td><td>with INVASE</td><td>with Tree</td><td>with L2X</td><td>with LASSO</td></tr><tr><td>Syn1</td><td>.578±.004</td><td>.686±.005</td><td>.690±.006</td><td>.574±.101</td><td>.498±.005</td><td>.498±.006</td></tr><tr><td>Syn2</td><td>.789±.003</td><td>.873±.003</td><td>.877±.003</td><td>.872±.003</td><td>.823±.029</td><td>.555±.061</td></tr><tr><td>Syn3</td><td>.854±.004</td><td>.900±.003</td><td>.902±.003</td><td>.899±.001</td><td>.862±.009</td><td>.886±.003</td></tr><tr><td>Syn4</td><td>.558±.021</td><td>.774±.006</td><td>.787±.004</td><td>.684±.017</td><td>.678±.024</td><td>.514±.031</td></tr><tr><td>Syn5</td><td>.662±.013</td><td>.784±.005 .858±.004</td><td>.784±.005</td><td>.741±.004</td><td>.709±.008</td><td>.691±.024</td></tr><tr><td>Syn6</td><td>.692±.015</td><td></td><td>.877±.003</td><td>.771±.031</td><td>.827±.017</td><td>.727±.025</td></tr><tr><td rowspan="2">Dataset</td><td colspan="6">AUPRC</td></tr><tr><td>w/o FS</td><td>with Global</td><td>with INVASE</td><td>with Tree</td><td>with L2X</td><td>with LASSO</td></tr><tr><td>Syn1</td><td>.567±.007</td><td>.690±.006</td><td>.694±.006</td><td>.577±.102</td><td>.498±.007</td><td>.499±.008</td></tr><tr><td>Syn2</td><td>.799±.005</td><td>.878±.005</td><td>.886±.004</td><td>.878±.004</td><td>.817±.031</td><td>.591±.037</td></tr><tr><td>Syn3</td><td>.861±.003</td><td>.905±.002</td><td>.907±.003</td><td>.904±.002</td><td>.860±.012</td><td>.890±.002</td></tr><tr><td>Syn4</td><td>.572±.019</td><td>.794±.006</td><td>.804±.004</td><td>.681±.031</td><td>.672±.025</td><td>.536±.025</td></tr><tr><td>Syn5</td><td>.665±.019</td><td>.796±.005</td><td>.797±.006</td><td>.765±.003</td><td>.719±.011</td><td>.680±.040</td></tr><tr><td>Syn6</td><td>.709±.018</td><td>.870±.005</td><td>.886±.004</td><td>.779±.027</td><td>.835±.017</td><td>.757±.036</td></tr></table>
237
+
238
+ # 4.2 REAL-WORLD DATA EXPERIMENTS
239
+
240
+ # 4.2.1 DATA DESCRIPTION
241
+
242
+ In this section we use two real-world datasets to perform a series of further experiments. The first, the Meta-Analysis Global Group in Chronic Heart Failure (MAGGIC) dataset [23], has 40,409 patients each with 31 measured features. The label is all-cause mortality. The second, the Prostate, Lung, Colorectal and Ovarian (PLCO) Cancer Screening Trial in the US and the European Randomized Study of Screening for Prostate Cancer (ERSPC) dataset [8; 26] contains 38,001 each with 106 measured features. The label in this dataset is mortality due to prostate cancer. We refer to this as the PLCO dataset.
243
+
244
+ The first experiment we carried out was to create semi-synthetic datasets by using the labelling procedures Syn1-6 from above but with the features now coming from real data (instead of being i.i.d. Gaussian). The results of this experiment can be found in the Appendix.
245
+
246
+ # 4.2.2 THE DISCOVERED FEATURE IMPORTANCE IN MAGGIC DATASET
247
+
248
+ In this next experiment, we visualize the ability of INVASE to select features on an individualized level. Fig. 2(left) shows the selection probability (given by INVASE) of each feature for 20 randomly selected patients in the MAGGIC dataset. Fig. 2(right) shows the selection probability of each feature averaged over different binary splits of the data (i.e. when split into Male and Female). In Table 4, we also report the mean and variance of the number of selected features in each subgroup.
249
+
250
+ As can be seen, INVASE discovers significantly different features for both individuals and for different subgroups of the dataset.
251
+
252
+ # 4.2.3 RESULTS: PREDICTION USING REAL DATA VARIABLES WITH REAL LABEL
253
+
254
+ Evaluating the performance of feature selection methods on real data is difficult, since ground truth relevance is often not known. We therefore cannot use TPR and FDR to evaluate the performance on real data. In our final experiment, therefore, we instead focus on prediction performance exactly as in 4.1.3 (except now both the features and label come from real data).
255
+
256
+ ![](images/d1951e735951992fdbed0a447435470530b7108fcf6a6da51afe008e69ba6a2e.jpg)
257
+ Figure 2: Left: The feature importance for each of 20 randomly selected patients in the MAGGIC dataset. Right: The average feature importance for different binary splits in the MAGGIC dataset.
258
+
259
+ Table 4: Selection probability of overall and patient subgroups by INVASE in MAGGIC dataset. (Mean $\pm$ Std)
260
+
261
+ <table><tr><td rowspan=1 colspan=1>Overall</td><td rowspan=1 colspan=1>Male</td><td rowspan=1 colspan=1>Diabetes</td><td rowspan=1 colspan=1>Hypertension</td><td rowspan=1 colspan=1>Smoker</td><td rowspan=1 colspan=1>Heart Failure</td></tr><tr><td rowspan=3 colspan=1>42.5±18.4</td><td rowspan=1 colspan=2>43.5±10.7 53.2±10.8</td><td rowspan=1 colspan=2>46.6±9.3 41.0±12.1</td><td rowspan=1 colspan=1>51.8±11.1</td></tr><tr><td rowspan=1 colspan=1>Female</td><td rowspan=1 colspan=1>Non-diabetes</td><td rowspan=1 colspan=2>Non-hypertension Non-smoker</td><td rowspan=1 colspan=1>No Heart Failure</td></tr><tr><td rowspan=1 colspan=1>40.8±15.6</td><td rowspan=1 colspan=1>39.3±8.0</td><td rowspan=1 colspan=1>40.0±9.3</td><td rowspan=1 colspan=1>43.2±7.0</td><td rowspan=1 colspan=1>39.6±6.9</td></tr></table>
262
+
263
+ Table 5: Prediction performance for MAGGIC and PLCO dataset.
264
+
265
+ <table><tr><td rowspan=1 colspan=1>Datasets</td><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=2>AUROC AUPRC</td><td rowspan=1 colspan=2>AUROC AUPRC</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Labels</td><td rowspan=1 colspan=2>3year</td><td rowspan=1 colspan=2>5year</td></tr><tr><td rowspan=1 colspan=1>MAGGIC</td><td rowspan=1 colspan=1>INVASEWithout INVASE</td><td rowspan=1 colspan=1>.722±.005.720±.006</td><td rowspan=1 colspan=1>.655±.010.639±.009</td><td rowspan=1 colspan=2>.740±.005 .867±.006.730±.006 .855±.004</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Labels</td><td rowspan=1 colspan=2>5year</td><td rowspan=1 colspan=2>10 year</td></tr><tr><td rowspan=1 colspan=1>PLCO</td><td rowspan=1 colspan=1>INVASEWithout INVASE</td><td rowspan=1 colspan=1>.637±.007.629±.008</td><td rowspan=1 colspan=1>.329±.013.324±.011</td><td rowspan=1 colspan=1>.673±.007.657±.006</td><td rowspan=1 colspan=1>.506±.006.485±.008</td></tr></table>
266
+
267
+ As can be seen in Table 5, INVASE consistently improves prediction performance in each of the two settings (different time horizons) in each dataset.
268
+
269
+ # 5 FUTURE WORK
270
+
271
+ While this paper has focused on discovering relevant features in the static setting, this could also be extended to apply in the temporal setting. One such avenue of exploration for this would be to replace each of the networks with an RNN. Particular care will need to be taken in defining the problem, though; do we treat each stream as a feature or each time point of each stream? We leave this investigation to future work.
272
+
273
+ # ACKNOWLEDGEMENT
274
+
275
+ The authors would like to thank the reviewers for their helpful comments. The research presented in this paper was supported by the Office of Naval Research (ONR) and the NSF (Grant number: ECCS1462245, ECCS1533983, and ECCS1407712).
276
+
277
+ REFERENCES
278
+ [1] Sebastian Bach, Alexander Binder, Gregoire Montavon, Frederick Klauschen, Klaus-Robert ´ Muller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by ¨ layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015.
279
+ [2] David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and Klaus-Robert MA˜ zller. How to explain individual classification decisions. ˇ Journal of Machine Learning Research, 11(Jun):1803–1831, 2010.
280
+ [3] Emmanuel Candes, Yingying Fan, Lucas Janson, and Jinchi Lv. Panning for gold: \` Model-free knockoffs for high-dimensional controlled variable selection. arXiv preprint arXiv:1610.02351, 2016.
281
+ [4] Jianbo Chen, Le Song, Martin J Wainwright, and Michael I Jordan. Learning to explain: An information-theoretic perspective on model interpretation. arXiv preprint arXiv:1802.07814, 2018.
282
+ [5] Anupam Datta, Shayak Sen, and Yair Zick. Algorithmic transparency via quantitative input influence: Theory and experiments with learning systems. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 598–617. IEEE, 2016.
283
+ [6] Jeremy Elson, John JD Douceur, Jon Howell, and Jared Saul. Asirra: a captcha that exploits interest-aligned manual image categorization. 2007.
284
+ [7] Pierre Geurts, Damien Ernst, and Louis Wehenkel. Extremely randomized trees. Machine learning, 63(1):3–42, 2006.
285
+ [8] John K Gohagan, Philip C Prorok, Richard B Hayes, and Barnett-S Kramer. The prostate, lung, colorectal and ovarian (plco) cancer screening trial of the national cancer institute: history, organization, and status. Controlled clinical trials, 21(6):251S–272S, 2000.
286
+ [9] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http://www.deeplearningbook.org.
287
+ [10] Isabelle Guyon and Andre Elisseeff. An introduction to variable and feature selection. ´ Journal of machine learning research, 3(Mar):1157–1182, 2003.
288
+ [11] Mark Andrew Hall. Correlation-based feature selection for machine learning. 1999.
289
+ [12] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
290
+ [13] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
291
+ [14] David P Kao, James D Lewsey, Inder S Anand, Barry M Massie, Michael R Zile, Peter E Carson, Robert S McKelvie, Michel Komajda, John JV McMurray, and JoAnn Lindenfeld. Characterization of subgroups of heart failure patients with preserved ejection fraction with possible implications for prognosis and treatment response. European journal of heart failure, 17(9):925–935, 2015.
292
+ [15] Pieter-Jan Kindermans, Kristof Schutt, Klaus-Robert M ¨ uller, and Sven D ¨ ahne. Investigating ¨ the influence of noise and distractors on the interpretation of neural networks. arXiv preprint arXiv:1611.07270, 2016.
293
+
294
+ [16] Kenji Kira and Larry A Rendell. A practical approach to feature selection. In Machine Learning Proceedings 1992, pp. 249–256. Elsevier, 1992.
295
+
296
+ [17] Yaojin Lin, Qinghua Hu, Jinghua Liu, and Jie Duan. Multi-label feature selection based on max-dependency and min-redundancy. Neurocomputing, 168:92–103, 2015.
297
+
298
+ [18] Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pp. 4765–4774, 2017.
299
+
300
+ [19] Scott M Lundberg, Gabriel G Erion, and Su-In Lee. Consistent individualized feature attribution for tree ensembles. arXiv preprint arXiv:1802.03888, 2018.
301
+
302
+ [20] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pp. 3498–3505. IEEE, 2012.
303
+
304
+ [21] Hanchuan Peng, Fuhui Long, and Chris Ding. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Transactions on pattern analysis and machine intelligence, 27(8):1226–1238, 2005.
305
+
306
+ [22] Jan Peters and Stefan Schaal. Natural actor-critic. Neurocomputing, 71(7-9):1180–1190, 2008.
307
+
308
+ [23] Stuart J Pocock, Cono A Ariti, John JV McMurray, Aldo Maggioni, Lars Køber, Iain B Squire, Karl Swedberg, Joanna Dobson, Katrina K Poppe, Gillian A Whalley, et al. Predicting survival in heart failure: a risk score based on 39 372 patients from 30 studies. European heart journal, 34(19):1404–1413, 2012.
309
+
310
+ [24] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1135–1144. ACM, 2016.
311
+
312
+ [25] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234–241. Springer, 2015.
313
+
314
+ [26] Fritz H Schroder, Jonas Hugosson, Monique J Roobol, Teuvo LJ Tammela, Stefano Ciatto, ¨ Vera Nelen, Maciej Kwiatkowski, Marcos Lujan, Hans Lilja, Marco Zappa, et al. Screening and prostate-cancer mortality in a randomized european study. New England Journal of Medicine, 360(13):1320–1328, 2009.
315
+
316
+ [27] Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. arXiv preprint arXiv:1704.02685, 2017.
317
+
318
+ [28] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
319
+
320
+ [29] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
321
+
322
+ [30] Erik Strumbelj and Igor Kononenko. Explaining prediction models and individual predictions ˇ with feature contributions. Knowledge and information systems, 41(3):647–665, 2014.
323
+
324
+ [31] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996.
325
+
326
+ [32] Jinsung Yoon, William R Zame, Amitava Banerjee, Martin Cadeiras, Ahmed M Alaa, and Mihaela van der Schaar. Personalized survival predictions via trees of predictors: An application to cardiac transplantation. PloS one, 13(3):e0194985, 2018.
327
+
328
+ [33] Jinsung Yoon, William R Zame, and Mihaela van der Schaar. Tops: Ensemble learning with trees of predictors. IEEE Transactions on Signal Processing, 66(8):2141–2152, 2018.
329
+
330
+ # APPENDIX
331
+
332
+ # SUMMARY OF RELATED WORKS
333
+
334
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Key ideas</td><td rowspan=1 colspan=1>Experimentsshown</td><td rowspan=1 colspan=1>Global/Instance-wise</td><td rowspan=1 colspan=1>Modelagnostic</td><td rowspan=1 colspan=1>#of relevantfeatures</td></tr><tr><td rowspan=1 colspan=1>SCFS[11]</td><td rowspan=1 colspan=1>Max-dependency min-redundancycriteria with Pearson correlations</td><td rowspan=1 colspan=1>Feature selection</td><td rowspan=1 colspan=1>Global</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Not needed</td></tr><tr><td rowspan=1 colspan=1>MIFS[21]</td><td rowspan=1 colspan=1>Max-dependency min-redundancycriteria with Mutual Information</td><td rowspan=1 colspan=1>Feature selection</td><td rowspan=1 colspan=1>Global</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Not needed</td></tr><tr><td rowspan=1 colspan=1>LASSO[31]</td><td rowspan=1 colspan=1>Linear regressionwith l1-norm penalty</td><td rowspan=1 colspan=1>Feature selectionPrediction</td><td rowspan=1 colspan=1>Global</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Not needed</td></tr><tr><td rowspan=1 colspan=1>Knock-off[3]</td><td rowspan=1 colspan=1>Comparison between knock-offvariablesand real variables</td><td rowspan=1 colspan=1>Feature selectionHypothesis test</td><td rowspan=1 colspan=1>Global</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Not needed</td></tr><tr><td rowspan=1 colspan=1>L2X[4]</td><td rowspan=1 colspan=1>Mutual Information maximizationwith Gumbel-softmax</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>LIME[24]</td><td rowspan=1 colspan=1>Locally linearapproximation</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>Shapley[18]</td><td rowspan=1 colspan=1>Shapley value estimationto quantify feature importance</td><td rowspan=1 colspan=1>Feature selection</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>DeepLIFT[27]</td><td rowspan=1 colspan=1>Decompose the output ofNN on a reference input</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>No</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>Saliency[29]</td><td rowspan=1 colspan=1>Backpropagation from theoutput of the NN to the input</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>No</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>Tree SHAP[19]</td><td rowspan=1 colspan=1>Shapley value estimationonly for tree-ensemble models</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>No</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>Pixel-wise[1]</td><td rowspan=1 colspan=1>Measuring the effects onthe output using input perturbation</td><td rowspan=1 colspan=1>Interpretation</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>No</td><td rowspan=1 colspan=1>Should begiven</td></tr><tr><td rowspan=1 colspan=1>INVASE(Ours)</td><td rowspan=1 colspan=1>Minimize KL divergence usingdeep NN influenced byactor-critic models</td><td rowspan=1 colspan=1>Feature selectionInterpretationPrediction</td><td rowspan=1 colspan=1>Instance-wise</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Not needed</td></tr></table>
335
+
336
+ Table 6: Summary of the related works. (NN: Neural networks, KL: Kullback-Leibler)
337
+
338
+ # EXTENDING INVASE TO REGRESSION
339
+
340
+ To extend our model to the setting where $Y$ is continuous (regression problem), we replace the estimated loss with the reconstruction error as follows.
341
+
342
+ $$
343
+ \hat { l } ( { \bf x } , { \bf s } ) = - | | y - f ^ { \phi } ( { \bf x } , { \bf s } ) | | _ { 2 }
344
+ $$
345
+
346
+ where $f ^ { \phi } : \mathcal { X } \mathbb { R }$ is now the (continuous) predictor function trained to minimize the $\ell _ { 2 }$ -norm between its outputs and the real labels. As noted in [9], when the distribution of $Y$ given $\mathbf { X }$ is Gaussian, minimizing the $l _ { 2 }$ -norm is equivalent to minimizing the KL divergence.
347
+
348
+ # DETAILS OF INVASE
349
+
350
+ In the experiments, the depth of the selector, predictor, and baseline networks is set to 3. The number of hidden nodes in each layer is $d$ and $2 d$ , respectively. We use either ReLu or SeLu as the activation functions of each layer except for the output layer where we use the sigmoid activation function for the selector network and softmax activation function for the predictor and baseline networks. The number of samples in each mini-batch is 1000 for the selector, predictor, and baseline networks. We use cross-validation to select $\lambda$ among $\{ 0 . 1 , 0 . 3 , 0 . 5 , 1 , 2 , 5 , 1 0 \}$ . We use tensorflow to implement INVASE. The source-code can be found at https://github.com/iclr2018invase/ INVASE/.
351
+
352
+ # DETAILS OF BENCHMARKS
353
+
354
+ We use the following links for the implementations of 7 benchmarks.
355
+
356
+ • L2X: https://github.com/Jianbo-Lab/L2X
357
+ • LIME: https://github.com/marcotcr/lime
358
+ • Shapley: https://github.com/slundberg/shap
359
+ • Knock-off: http://web.stanford.edu/group/candes/knockoffs/ software/knockoff/
360
+ • Tree: http://scikit-learn.org/stable/modules/generated/ sklearn.ensemble.ExtraTreesClassifier.html
361
+ • LASSO: http://scikit-learn.org/stable/modules/linear_model. html#lasso
362
+
363
+ For L2X, we use the same network settings used in INVASE for fair comparisons. For SCFS, we explicitly implement from the reference ([11]).
364
+
365
+ # HIGH DIMENSIONAL DISCOVERY
366
+
367
+ To demonstrate the scalability of our method, we run an experiment in which we increase the total number of features to 100. The features are generated as a 100-dimensional Gaussian with no correlations $( \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) )$ and the relationships between features and label remains as in Table 1 in the main manucript (i.e. we are adding 89 additional noisy signals that have no effect on the label).
368
+
369
+ Table 7: Relevant feature discovery for synthetic datasets with 100 features
370
+
371
+ <table><tr><td rowspan="2">Dataset</td><td colspan="2">Syn1</td><td colspan="2">Syn2</td><td colspan="2">Syn3</td><td colspan="2">Syn4</td><td colspan="2">Syn5</td><td colspan="2">Syn6</td></tr><tr><td>Metrics (%) TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>66.3</td><td>40.5</td><td>73.2</td><td>23.7</td><td>90.5</td><td>15.4</td></tr><tr><td>L2X</td><td>6.1</td><td>93.9</td><td>81.4</td><td>18.6</td><td>57.7</td><td>42.3</td><td>48.5</td><td>46.4</td><td>35.4</td><td>60.8</td><td>66.3</td><td>33.7</td></tr><tr><td>LIME</td><td>0.0</td><td>100.0 95.6</td><td>100.0 95.1</td><td>0.0</td><td>92.7</td><td>7.3</td><td>43.8</td><td>47.4</td><td>42.3</td><td>50.1</td><td>50.1</td><td>49.9</td></tr><tr><td>Shapley</td><td>4.4</td><td></td><td></td><td>4.9</td><td>88.8</td><td>11.2</td><td>50.2</td><td>43.4</td><td>49.9</td><td>44.2</td><td>62.5</td><td>37.5</td></tr><tr><td>Knock off</td><td>0.0</td><td>64.9</td><td>3.7</td><td>71.2</td><td>74.9</td><td>24.9</td><td>28.2</td><td>59.8</td><td>33.1</td><td>59.4</td><td>46.9</td><td>53.0</td></tr><tr><td>Tree</td><td>49.9</td><td>50.1</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>40.7</td><td>49.5</td><td>56.7</td><td>37.5</td><td>58.4</td><td>41.6</td></tr><tr><td>SCFS</td><td>2.5</td><td>97.5</td><td>5.3</td><td>94.7</td><td>74.9</td><td>25.1</td><td>27.0</td><td>74.6</td><td>30.6</td><td>62.1</td><td>38.3</td><td>61.7</td></tr><tr><td>LASSO</td><td>2.5</td><td>97.5</td><td>4.0</td><td>96.0</td><td>75.3</td><td>24.7</td><td>28.3</td><td>73.2</td><td>36.0</td><td>56.9</td><td>45.9</td><td>54.1</td></tr></table>
372
+
373
+ As can be seen in Table 7, INVASE also works consistently better than all other benchmarks in all 6 synthetic datasets in this setting. In fact, we see a significant reduction in performance (compared to the 11 feature setting) for L2X in Syn1, with the TPR dropping more than $90 \%$ leading to an almost complete failure of the method to detect any relevant features. In particular, we see that L2X does not scale as well as INVASE with the dimensionality of the data, which is particularly limiting for a feature selection method.
374
+
375
+ We also compare the CPU times of the algorithm for training and testing with other instance-wise feature selection benchmarks to show the scalability in terms of computational complexity. As can be seen in Table 8, INVASE is much faster (10 times) than LIME and Shapley methods and comparable with L2X; we see that INVASE takes approximately $50 \%$ longer to run than L2X, which can be accounted for by the addition of a 3rd network (the baseline network) in INVASE that is not present in L2X. Note, however, that this baseline network can be trained in parallel with the predictor network and we believe that doing so would lead to both INVASE and L2X having the same run-time.
376
+
377
+ Table 8: Comparison of CPU clock time across different instance-wise feature selection methods on average across Syn1 to Syn6 with 100 features and 10,000 samples on training/testing, respectively
378
+
379
+ <table><tr><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>INVASE</td><td rowspan=1 colspan=1>L2X</td><td rowspan=1 colspan=1>Shapley</td><td rowspan=1 colspan=1>LIME</td></tr><tr><td rowspan=1 colspan=1>TrainTest</td><td rowspan=1 colspan=1>1327.69s0.38s</td><td rowspan=1 colspan=1>939.82s0.78s</td><td rowspan=1 colspan=1>12801.21s0.06s</td><td rowspan=1 colspan=1>-18931.98s</td></tr></table>
380
+
381
+ # HYPER-PARAMETER ANALYSIS
382
+
383
+ In the following experiment, we provide results for various values of the hyper-parameter, $\lambda$ , in the Syn4, Syn5, and Syn6 100-dimensional setting. Table 9 gives the results in terms of TPR and FDR. Note that in the other experiments, we select the hyper-parameter $\lambda$ which maximizes the predictor accuracy in terms of AUROC.
384
+
385
+ <table><tr><td>Datasets</td><td colspan="2">Syn4</td><td colspan="2">Syn5</td><td colspan="2">Syn6</td></tr><tr><td>X/Metris (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>0.1</td><td>98.0</td><td>94.3</td><td>90.0</td><td>93.4</td><td>99.2</td><td>92.3</td></tr><tr><td>0.3</td><td>93.7</td><td>87.9</td><td>84.2</td><td>88.9</td><td>96.9</td><td>86.7</td></tr><tr><td>0.5</td><td>99.0</td><td>43.1</td><td>88.3</td><td>50.6</td><td>99.6</td><td>31.7</td></tr><tr><td>1</td><td>66.3</td><td>40.5</td><td>73.2</td><td>23.7</td><td>90.5</td><td>15.4</td></tr><tr><td>2</td><td>0.0</td><td>0.0</td><td>25.4</td><td>4.1</td><td>67.1</td><td>3.6</td></tr><tr><td>5</td><td>0.0</td><td>0.0</td><td>7.5</td><td>2.7</td><td>7.6</td><td>2.5</td></tr><tr><td>10</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td></tr></table>
386
+
387
+ Table 9: Relevant feature discovery results for various values of the hyper-parameter $\lambda$ in the Syn4, Syn5, and Syn6 100-dimensional setting.
388
+
389
+ # ADDITIONAL RESULTS ON COMPLEX SYNTHETIC DATASETS
390
+
391
+ In the main paper, the relevant subset for a sample in each of our variable synthetic datasets (Syn4- 6) depended on $X _ { 1 1 }$ only, which was unused in the rest of the model (i.e. $X _ { 1 1 }$ determined only the relevant subset, and was otherwise unused as a predictive variable). In this set of experiments, we investigate the effect of having the subset relevance depend on a variable that is also used in the model itself (Syn4A, Syn5A, Syn6A). We then investigate the effect of having more than one variable being used to determine subset relevance (Syn4B, Syn5B, Syn6B, Syn7). The results for these are reported in Tables 10 and 11, respectively.
392
+
393
+ The input features are generated from a 100-dimensional Gaussian distribution with no correlations across the features $( \mathbf { X } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } ) )$ . $Y$ is generated according to $\begin{array} { r } { \mathbb { P } ( Y = 1 | \mathbf { X } ) = \frac { 1 } { 1 + \mathrm { l o g i t } ( \mathbf { X } ) } } \end{array}$ with the logit value for each synthetic dataset now defined as follows:
394
+
395
+ • Syn4A: If $X _ { 1 } < 0$ , ${ \mathrm { l o g i t } } = \exp ( X _ { 1 } X _ { 2 } )$ , otherwise, logit $= \textstyle \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$ .
396
+ • Syn5A: If $X _ { 1 } < 0$ , ${ \mathrm { l o g i t } } = \exp ( X _ { 1 } X _ { 2 } )$ , otherwise, logi $\mathrm { t = - 1 0 } \times \sin 2 X _ { 7 } + 2 | X _ { 8 } | + X _ { 9 } +$ $\exp ( - X _ { 1 0 } )$ .
397
+ • $X _ { 7 } < 0$ , $\scriptstyle { \mathrm { l o g i t } } = \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$ , otherwise, logi $\mathrel { \mathop { : = } } - 1 0 \times \sin 2 X _ { 7 } + 2 | X _ { 8 } | +$ $X _ { 9 } + \exp ( - X _ { 1 0 } )$
398
+
399
+ Table 10: Relevant feature discovery results for complex synthetic datasets (Syn4A, 5A, 6A) with 100 features
400
+
401
+ <table><tr><td>Dataset 1</td><td>Syn4A</td><td>Syn5A</td><td></td><td>Syn6A</td><td></td></tr><tr><td>Metrics (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE+</td><td>77.5</td><td>14.5</td><td>85.9</td><td>8.8</td><td>89.9</td><td>7.3</td></tr><tr><td>L2X</td><td>65.0</td><td>39.3</td><td>48.0</td><td>57.4</td><td>74.4</td><td>35.5</td></tr><tr><td>LIME Shapley</td><td>56.3 71.8</td><td>49.2 39.8</td><td>58.2 71.0</td><td>48.8 41.3</td><td>58.9 68.9</td><td>47.8 38.2</td></tr><tr><td>Knock off</td><td>59.8</td><td>62.6</td><td>55.0</td><td>49.9</td><td>65.0</td><td>40.0</td></tr><tr><td>Tree</td><td>61.3</td><td>46.9</td><td>75.6</td><td>39.4</td><td>66.9</td><td>40.0</td></tr><tr><td>SCFS</td><td>52.8</td><td>66.9</td><td>55.3</td><td>50.6</td><td>50.4</td><td>51.8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LASSO</td><td>61.0</td><td>61.2</td><td>55.0</td><td>50.0</td><td>53.9</td><td>48.8</td></tr></table>
402
+
403
+ • Syn4B: If $X _ { 1 } X _ { 3 } < 0$ , ${ \mathrm { l o g i t } } = \exp ( X _ { 1 } X _ { 2 } )$ , otherwise, logit $= \textstyle \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$
404
+
405
+ • Syn5B: If $X _ { 1 } X _ { 7 } < 0$ , ${ \mathrm { l o g i t } } = \exp ( X _ { 1 } X _ { 2 } )$ , otherwise, logit $= - 1 0 \times \sin 2 X _ { 7 } + 2 | X _ { 8 } | +$ $X _ { 9 } + \exp ( - X _ { 1 0 } )$ .
406
+
407
+ • Syn6B: If $X _ { 3 } X _ { 7 } \ < \ 0$ , logit $= \textstyle \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$ , otherwise, logit $= - 1 0 \times \sin 2 X _ { 7 } +$ $2 | X _ { 8 } | + X _ { 9 } + \exp ( - X _ { 1 0 } )$ .
408
+
409
+ • Syn7:
410
+
411
+ – If $X _ { 1 } < 0 , X _ { 2 } < 0$ , ${ \mathrm { l o g i t } } = \exp ( X _ { 1 } X _ { 2 } )$
412
+ – If $X _ { 1 } < 0 , X _ { 2 } \geq 0$ , $\scriptstyle { \mathrm { l o g i t } } = \exp ( \sum _ { i = 3 } ^ { 6 } X _ { i } ^ { 2 } - 4 )$ .
413
+ – If $X _ { 1 } \geq 0 , X _ { 2 } < 0$ , $\mathrm { l o g i t = - 1 0 \times \sin 2 X _ { 7 } + 2 } | X _ { 8 } | + X _ { 9 } + \exp ( - X _ { 1 0 } ) .$ – If $X _ { 1 } \geq 0 , X _ { 2 } \geq 0$ $\begin{array} { r } { ) , \mathrm { l o g i t } = 0 . 5 \times \exp ( X _ { 1 } X _ { 2 } ) + 0 . 5 \times \exp ( \sum _ { i = 3 } ^ { 4 } X _ { i } ^ { 2 } - 2 ) . } \end{array}$
414
+
415
+ # RESULTS ON SEMI-SYNTHETIC DATASETS
416
+
417
+ In this experiment, we use real features (which have correlation across features) but generate the labels as in the synthetic experiments from the main paper, using Syn1-Syn6. This allows us to know the ground truth relevance of the features, and calculate TPR and FDR, while using unknown and correlated feature distributions (instead of the unrealistic setting of i.i.d. Gaussian used in the fully synthetic experiment). The results for the MAGGIC and PLCO datasets are given below.
418
+
419
+ Table 11: Relevant feature discovery results for complex synthetic datasets (Syn4B, 5B, 6B, 7) with 100 features
420
+
421
+ <table><tr><td>Dataset</td><td colspan="2">Syn4B</td><td colspan="2">Syn5B</td><td colspan="2">Syn6B</td><td colspan="2">Syn7</td></tr><tr><td>Metrics (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE+</td><td>65.5</td><td>30.1</td><td>85.0</td><td>15.0</td><td>86.5</td><td>27.8</td><td>86.8</td><td>32.4</td></tr><tr><td>L2X</td><td>43.2</td><td>53.4</td><td>50.3</td><td>50.3</td><td>44.6</td><td>55.4</td><td>35.3</td><td>70.9</td></tr><tr><td>LIME</td><td>56.8</td><td>37.2</td><td>71.9</td><td>27.2</td><td>69.8</td><td>30.2</td><td>56.4</td><td>51.0</td></tr><tr><td>Shapley</td><td>51.4</td><td>43.5</td><td>77.2</td><td>24.1</td><td>69.3</td><td>30.7</td><td>61.8</td><td>45.6</td></tr><tr><td>Knock off</td><td>5.3</td><td>87.4</td><td>73.3</td><td>25.2</td><td>59.9</td><td>40.1</td><td>54.1</td><td>60.0</td></tr><tr><td>Tree</td><td>56.7</td><td>37.4</td><td>73.9</td><td>25.0</td><td>70.1</td><td>29.9</td><td>71.6</td><td>40.3</td></tr><tr><td>SCFS</td><td>3.7</td><td>96.2</td><td>72.3</td><td>26.3</td><td>61.1</td><td>38.9</td><td>22.9</td><td>77.5</td></tr><tr><td>LASSO</td><td>4.2</td><td>95.6</td><td>73.3</td><td>25.0</td><td>60.1</td><td>39.9</td><td>24.9</td><td>75.8</td></tr></table>
422
+
423
+ Table 12: Relevant feature discovery for real datasets with synthetic labels using MAGGIC dataset
424
+
425
+ <table><tr><td rowspan="2">Dataset</td><td colspan="2">Syn1</td><td colspan="2">Syn2</td><td colspan="2">Syn3</td><td colspan="2">Syn4</td><td colspan="2">Syn5</td><td colspan="2">Syn6</td></tr><tr><td>Metrics (%) TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>85.9</td><td>0.0</td><td>72.9</td><td>0.1</td><td>81.0</td><td>13.2</td></tr><tr><td>L2X LIME</td><td>68.8 46.9</td><td>31.2 53.1</td><td>99.9 99.9</td><td>0.1 0.1</td><td>83.0 87.2</td><td>17.0 12.8</td><td>60.0 63.6</td><td>31.3 24.4</td><td>68.3 50.2</td><td>22.3 37.6</td><td>73.5 68.7</td><td>26.5 31.3</td></tr><tr><td>Shapley Knock off</td><td>73.9 27.5</td><td>26.1 65.0</td><td>94.5 77.5</td><td>5.5 22.5</td><td>81.0 100.0</td><td>19.0 0.0</td><td>65.3</td><td>23.9 34.4</td><td>61.2</td><td>29.0</td><td>69.9</td><td>30.1</td></tr><tr><td>Tree</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>100.0</td><td>0.0</td><td>57.0 56.3</td><td>29.7</td><td>56.1 51.6</td><td>29.8 40.2</td><td>58.0 46.7</td><td>42.0 53.3</td></tr><tr><td>SCFS</td><td>30.0</td><td>70.0</td><td>53.0</td><td>47.0</td><td>100.0</td><td>0.0</td><td>52.0</td><td>39.9</td><td>54.0</td><td>32.4</td><td>64.5</td><td>35.5</td></tr><tr><td>LASSO</td><td></td><td></td><td>75.0</td><td>25.0</td><td>100.0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>25.0</td><td>75.0</td><td></td><td></td><td></td><td>0.0</td><td>60.7</td><td>33.1</td><td>56.1</td><td>29.8</td><td>58.2</td><td>41.8</td></tr></table>
426
+
427
+ Table 13: Relevant feature discovery for real datasets with synthetic labels using PLCO dataset
428
+
429
+ <table><tr><td>Dataset</td><td colspan="2">Syn1</td><td colspan="2">Syn2</td><td colspan="2">Syn3</td><td colspan="2">Syn4</td><td colspan="2">Syn5</td><td colspan="2">Syn6</td></tr><tr><td>Metrics (%)</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td><td>TPR</td><td>FDR</td></tr><tr><td>INVASE</td><td>35.9</td><td>0.0</td><td>100.0</td><td>0.0</td><td>84.0</td><td>7.0</td><td>59.2</td><td>38.6</td><td>64.6</td><td>31.7</td><td>70.0</td><td>29.9</td></tr><tr><td>L2X LIME</td><td>0.0 1.0</td><td>100.0 99.0</td><td>62.2 70.3</td><td>37.8 29.7</td><td>43.6 74.9</td><td>56.4 25.1</td><td>41.9 43.5</td><td>55.4 55.9</td><td>21.5 26.8</td><td>76.7 68.9</td><td>66.9 56.8</td><td>33.1 43.2</td></tr><tr><td>Shapley Knock off</td><td>5.4</td><td>94.6</td><td>68.5</td><td>31.5</td><td>67.9</td><td>32.1</td><td>32.7</td><td>69.4</td><td>39.6</td><td>58.6</td><td>48.5</td><td>51.5</td></tr><tr><td>Tree</td><td>15.0 0.0</td><td>50.0 100.0</td><td>85.0 71.0</td><td>15.0 29.0</td><td>100.0 75.0</td><td>0.0 25.0</td><td>46.1 34.5</td><td>52.1 66.3</td><td>34.5</td><td>58.3 54.7</td><td>60.0</td><td>40.0</td></tr><tr><td>SCFS</td><td>10.0</td><td>90.0</td><td>61.0</td><td>39.0</td><td>93.8</td><td>6.2</td><td>43.2</td><td>55.7</td><td>43.8</td><td></td><td>36.9</td><td>63.1</td></tr><tr><td>LASSO</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>31.0</td><td>63.6</td><td>55.5</td><td>44.5</td></tr><tr><td></td><td>0.0</td><td>100.0</td><td>72.5</td><td>27.5</td><td>100.0</td><td>0.0</td><td>39.2</td><td>60.8</td><td>33.2</td><td>68.2</td><td>45.0</td><td>55.0</td></tr></table>
430
+
431
+ As demonstrated in Tables 12 and 13, INVASE outperforms all other methods across all 6 of the synthetic-label settings using real features. This also demonstrates the capability of INVASE in settings where there are unknown correlation structures in the features.
432
+
433
+ # 5.1 PREDICTIVE PERFORMANCE COMPARISON ON REAL-WORLD DATASETS
434
+
435
+ In this experiment, we evaluate the predictive performance gains of using each feature selection method as a pre-processing step on the two real datasets, MAGGIC and PLCO (as was done for synthetic data in Section 4.1.3). For each method, we first perform feature selection and then train a predictive model on top of the feature-selected data, where the model has the same architecture as the INVASE predictor network (to create a fair comparison of methods). As can be seen in Table 14, INVASE significantly outperform the other approaches.
436
+
437
+ <table><tr><td>Datasets</td><td colspan="4">MAGGIC</td><td colspan="4">PLCO</td></tr><tr><td>Labels</td><td colspan="2">3-year</td><td colspan="2">5-year</td><td colspan="2">5-year</td><td colspan="2">10-year</td></tr><tr><td>Metrics</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td><td>AUROC</td><td>AUPRC</td></tr><tr><td>INVASE</td><td>0.722</td><td>0.655</td><td>0.740</td><td>0.867</td><td>0.637</td><td>0.329</td><td>0.673</td><td>0.506</td></tr><tr><td>L2X</td><td>0.609</td><td>0.529</td><td>0.607</td><td>0.794</td><td>0.558</td><td>0.170</td><td>0.583</td><td>0.365</td></tr><tr><td>LIME</td><td>0.637</td><td>0.5596</td><td>0.634</td><td>0.808</td><td>0.597</td><td>0.183</td><td>0.601</td><td>0.374</td></tr><tr><td>Shapley</td><td>0.641</td><td>0.557</td><td>0.617</td><td>0.797</td><td>0.614</td><td>0.194</td><td>0.615</td><td>0.381</td></tr><tr><td>Knockoff</td><td>0.686</td><td>0.614</td><td>0.711</td><td>0.853</td><td>0.619</td><td>0.230</td><td>0.658</td><td>0.475</td></tr><tr><td>Tree</td><td>0.678</td><td>0.604</td><td>0.708</td><td>0.850</td><td>0.632</td><td>0.269</td><td>0.655</td><td>0.469</td></tr><tr><td>SCFS</td><td>0.683</td><td>0.623</td><td>0.723</td><td>0.857</td><td>0.632</td><td>0.231</td><td>0.632</td><td>0.444</td></tr><tr><td>LASSO</td><td>0.692</td><td>0.615</td><td>0.709</td><td>0.847</td><td>0.623</td><td>0.218</td><td>0.656</td><td>0.467</td></tr></table>
438
+
439
+ Table 14: Predictive Performance Comparison on two real-world datasets (MAGGIC and PLCO) in terms of AUROC and AUPRC
440
+
441
+ CORRELATIONS BETWEEN FEATURES AND LABELS IN THE SYNTHETIC AND SEMI-SYNTHETIC EXPERIMENTS
442
+ Table 15: Correlation between features and labels in Synthetic datasets with 100 features. Ground truth (in the global sense) relevant features are given in bold. Features with correlation $> 0 . 0 5$ are highlighted in red.
443
+
444
+ <table><tr><td>Variables</td><td>Syn1</td><td>Syn2</td><td>Syn3</td><td>Syn4</td><td>Syn5</td><td>Syn6</td></tr><tr><td>X1 X</td><td>0.003 0.001</td><td>0.008 0.005</td><td>0.006 0.006</td><td>0.009 0.005</td><td>0.007 0.015</td><td>0.006 0.005</td></tr><tr><td>X3</td><td>0.006 0.006</td><td>0.011</td><td>0.001</td><td>0.017</td><td>0.016</td><td>0.010</td></tr><tr><td>X4</td><td></td><td>0.003</td><td>0.003</td><td>0.002</td><td>0.000</td><td>0.002</td></tr><tr><td>X5</td><td>0.003</td><td>0.015</td><td>0.022</td><td>0.004</td><td>0.017</td><td>0.028</td></tr><tr><td>X6</td><td>0.003</td><td>0.004</td><td>0.005</td><td>0.002</td><td>0.004</td><td>0.005</td></tr><tr><td>X7</td><td>0.013</td><td>0.009</td><td>0.481</td><td>0.002</td><td>0.242</td><td>0.235</td></tr><tr><td>X8</td><td>0.010</td><td>0.008</td><td>0.012</td><td>0.003</td><td>0.010</td><td>0.022</td></tr><tr><td>X9</td><td>0.001</td><td>0.003</td><td>0.239</td><td>0.002</td><td>0.115</td><td>0.121</td></tr><tr><td>X10</td><td>0.002</td><td>0.003</td><td>0.308</td><td>0.003</td><td>0.149</td><td>0.144</td></tr><tr><td>X11</td><td>0.014</td><td>0.012</td><td>0.004</td><td>0.028</td><td>0.018</td><td>0.002</td></tr></table>
445
+
446
+ As can be seen in Table 15, among 33 relevant features, only 9 features have more than 0.05 (linear) correlation with the label. In particular, using a linear model, it is very hard to discover the relevant features. However, Knock-off (based on LASSO and linear correlations), LASSO, and SCFS are linear models, resulting in a poor performance in our experiments. The above table results are directly reflected in the results given in the main manuscript.
447
+
448
+ Table 16: Correlation between features and labels in MAGGIC datasets. Ground truth relevant features are described in bold. Features with correlation $> 0 . 0 5$ are described in red
449
+
450
+ <table><tr><td>Variables</td><td>Syn1</td><td>Syn2</td><td>Syn3</td><td>Syn4</td><td>Syn5</td><td>Syn6</td></tr><tr><td>X1</td><td>0.028 0.002</td><td>0.030 0.011</td><td>0.070 0.009</td><td>0.011 0.001</td><td>0.044 0.001</td><td>0.026 0.012</td></tr><tr><td>X</td><td>0.018</td><td>0.079</td><td>0.008</td><td>0.038</td><td>0.006</td><td>0.046</td></tr><tr><td>X3 X4</td><td>0.005</td><td>0.113</td><td>0.006</td><td>0.056</td><td>0.001</td><td>0.055</td></tr><tr><td></td><td>0.006</td><td>0.034</td><td></td><td>0.013</td><td></td><td></td></tr><tr><td>X5 X6</td><td>0.019</td><td>0.114</td><td>0.032 0.027</td><td>0.099</td><td>0.016</td><td>0.036</td></tr><tr><td></td><td>0.005</td><td>0.010</td><td></td><td>0.000</td><td>0.018</td><td>0.004</td></tr><tr><td>X7</td><td></td><td></td><td>0.367</td><td></td><td>0.262</td><td>0.272</td></tr><tr><td>X8</td><td>0.020</td><td>0.030</td><td>0.112</td><td>0.023</td><td>0.075</td><td>0.082</td></tr><tr><td>X9</td><td>0.025</td><td>0.022</td><td>0.299</td><td>0.006</td><td>0.216</td><td>0.200</td></tr><tr><td>X10</td><td>0.07</td><td>0.043</td><td>0.328</td><td>0.027</td><td>0.222</td><td>0.206</td></tr><tr><td>X11</td><td>0.009</td><td>0.006</td><td>0.034</td><td>0.046</td><td>0.018</td><td>0.058</td></tr></table>
451
+
452
+ We do the same analysis for the MAGGIC dataset; results are given in Table 16. We see that here the linear correlation with the label is stronger and this is reflected in Tables 12 and 13, where all of the linear models performed better than in the fully-synthetic settings. However, we note that although they had a better performance, in most cases it was still not comparable with INVASE.
453
+
454
+ DEFINITION OF TPR AND FDR
455
+
456
+ Figure 3: The definitions of True Positive Rate (TPR) and False Discovery Rate (FDR)
457
+
458
+ <table><tr><td rowspan=2 colspan=2></td><td rowspan=1 colspan=2>True Condition</td></tr><tr><td rowspan=1 colspan=1>Positive</td><td rowspan=1 colspan=1>Negative</td></tr><tr><td rowspan=2 colspan=1>PredictedCondition</td><td rowspan=1 colspan=1>Positive</td><td rowspan=1 colspan=1>TruePositive</td><td rowspan=1 colspan=1>FalsePositive</td></tr><tr><td rowspan=1 colspan=1>Negative</td><td rowspan=1 colspan=1>FalseNegative</td><td rowspan=1 colspan=1>TrueNegative</td></tr></table>
459
+
460
+ ୘୰୳ୣ ୔୭ୱ୧୲୧୴ୣ
461
+ True Positive Rate (TPR) $=$ ୘୰୳ୣ ୔୭ୱ୧୲୧୴ୣା୊ୟ୪ୱ��� ୒ୣ୥ୟ୲୧୴ୣ ୊ୟ୪ୱୣ ୔୭ୱ୧୲୧୴ୣ
462
+ False Discovery Rate (FDR) $=$ ୘୰୳ୣ ୔୭ୱ୧୲୧୴ୣ ୊ୟ୪ୱୣ ୔୭ୱ୧୲୧୴ୣ $^ +$
463
+
464
+ # COMPUTER VISION
465
+
466
+ Another natural application of INVASE is in computer vision. To briefly demonstrate the applicability and capability of INVASE to computer vision, we conduct two experiments using the Kaggle Dogs vs. Cats dataset (https://www.kaggle.com/c/dogs-vs-cats) [6] and the Oxford Pet dataset (http://www.robots.ox.ac.uk/˜vgg/data/pets/) [20]. The goal is to select a set $1 6 \times 1 6$ patches of each image that maximize the predictive capability of a model. In order to apply INVASE to this problem, we simply treat each $1 6 \times 1 6$ patch as a feature.
467
+
468
+ We use the U-Net [25] architecture for the selector network and the VGG network [28] architecture for the predictor and baseline networks. Below we give qualitative results of INVASE applied to these datasets, where we see that INVASE successfully identifies patches of each image in which the animal’s face is visible.
469
+
470
+ ![](images/4f36cf05a53bf3d7e37f5224237ed6e770fab264b6463ced2d9ee180b9a626b6.jpg)
471
+ Figure 4: Selected $1 6 \mathrm { ~ x ~ } 1 6$ patches by INVASE on Kaggle Dogs vs. Cats dataset - Cats
472
+
473
+ ![](images/aa7861ab9378342c4713f4385cc0c535523fb2e28b91aa84c9951a7e10e9b6d0.jpg)
474
+ Figure 5: Selected $1 6 \times 1 6$ patches by INVASE on Kaggle Dogs vs. Cats dataset - Dogs
475
+
476
+ ![](images/b5bc222942ad195921fdf291082c28ac5a6e4f8c2d9edef9031184a9a0ca0f60.jpg)
477
+ Figure 6: Selected $1 6 \times 1 6$ patches by INVASE on Oxford Pet dataset - Cats
478
+
479
+ ![](images/c0d45684db148f7fe42f9625cf27b015fa3f4dba35149e59b0d12a308dbc8f23.jpg)
480
+ Figure 7: Selected $1 6 \mathrm { ~ x ~ } 1 6$ patches by INVASE on Oxford Pet dataset - Dogs
md/train/BkGiPoC5FX/BkGiPoC5FX.md ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # EFFICIENT CONVOLUTIONAL NEURAL NETWORKTRAINING WITH DIRECT FEEDBACK ALIGNMENT
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ There were many algorithms to substitute the back-propagation (BP) in the deep neural network (DNN) training. However, they could not become popular because their training accuracy and the computational efficiency were worse than BP. One of them was direct feedback alignment (DFA), but it showed low training performance especially for the convolutional neural network (CNN). In this paper, we overcome the limitation of the DFA algorithm by combining with the conventional BP during the CNN training. To improve the training stability, we also suggest the feedback weight initialization method by analyzing the patterns of the fixed random matrices in the DFA. Finally, we propose the new training algorithm, binary direct feedback alignment (BDFA) to minimize the computational cost while maintaining the training accuracy compared with the DFA. In our experiments, we use the CIFAR-10 and CIFAR-100 dataset to simulate the CNN learning from the scratch and apply the BDFA to the online learning based object tracking application to examine the training in the small dataset environment. Our proposed algorithms show better performance than conventional BP in both two different training tasks especially when the dataset is small.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Deep learning becomes the core of the machine learning and it has been utilized for many applications such as machine translation (Singh et al. (2017)), speech recognition (Wang et al. (2017)), and object classification (Rawat & Wang (2017)). Training the deep neural network (DNN) is an important portion of the deep learning because we need different pre-trained models to cover the various deep learning tasks. One well-known method of DNN training is the algorithm called backpropagation (BP) (Rumelhart et al. (1986)). The BP is the gradient descent based training method which follows the steepest gradient to find the optimum weights. Therefore, BP based training can be applied to any DNN configurations if the network consists of any differentiable operations. For instance, not only multi-layer perceptron (MLP) but also both convolutional neural network (CNN, LeCun et al. (1998)) and recurrent neural network (RNN, Hopfield (1982)) can be trained by using the BP.
12
+
13
+ Even though the BP shows the outstanding performance in DNN training, BP based training suffers from the overfitting problem. Since the BP easily sinks into a local minimum, we need a large scale of the dataset to avoid the overfitting. In addition, we use various data augmentation techniques such as flipping and cropping. If the DNN training is done in the limited resources and dataset, BP based DNN training is too slow to be converged and shows low accuracy. One example is MDNet (Nam & Han (2016)) which introduces an object tracking algorithm with the online learning concept. Realtime implementation is an important issue in object tracking, so it has the limitation to utilize various data augmentation and large dataset for online learning.
14
+
15
+ To break the BP based DNN training paradigm, a lot of new training methods have been developed. Salimans et al. (2017) proposed the evolution strategy which searches various weight without the gradient descent. It has a chance to be computed in parallel, but it needs a lot of seeds to find the global optimal solution. Moreover, evolution strategy has a slow convergence problem which can be an obstacle for fast online learning application. Another algorithm, feedback alignment (FA, Lillicrap et al. (2014)), was proposed based on the gradient descent methodology, but without following the steepest gradient. The FA pre-defines a feedback weight before starting the training, and the weight is determined by the random values.1 It is also known to converge slowly, and shows worse performance compared with the previous BP.
16
+
17
+ Direct feedback alignment (DFA, Nokland (2016)) was developed by getting the idea from the FA. Although the FA propagates errors from the last layer back to the first layer step-by-step, the DFA propagates errors from the last layer directly to each layer. This approach gives the opportunity of the parallel processing. Since the errors of every layer are generated independently in DFA, we can immediately calculate each layer’s gradient if the DNN inference is finished. Moreover, the number of required computation is reduced in the DFA. This is because the number of neurons in the last layer is usually fewer than the prior layer, so the size of the feedback weight becomes smaller than the BP. In spite of these advantages, the DFA suffers from accuracy degradation problem. The accuracy degradation problem becomes more serious when the DFA is applied to the CNN case. It is known that the DNN is not learnable with the DFA if the DNN becomes much deeper than AlexNet (Krizhevsky et al. (2012)).
18
+
19
+ In this paper, we explain the new DFA algorithm to improve the training accuracy in CNN, and suggest a feedback weight initialization method for the fast convergence. Moreover, we propose the binary direct feedback alignment (BDFA) to maximize the computational efficiency. We verified the training performance in the VGG-16 (Simonyan & Zisserman (2015)) without any data augmentation, and DFA shows higher accuracy compared with the BP. And then, the training with small dataset was proved through the online learning based object tracking application. Our proposed algorithm shows better performance than the conventional BP approach in both the learning from the scratch and the object tracking tasks.
20
+
21
+ The remaining part of the paper is organized as follows. The mathematical notation of the BP, FA, and DFA will be introduced in Section 2. Then, the details of the proposed algorithms will be explained in Section 3. The experiment will be followed in Section 4 and the paper will be concluded in Section 5.
22
+
23
+ # 2 PRELIMINARIES
24
+
25
+ # 2.1 BACK-PROPAGATION
26
+
27
+ Back-propagation is a general algorithm for the DNN training, suggested by Rumelhart et al. (1986). Let $\mathbf { o } _ { i }$ be the $i ^ { t h }$ layer’s feature map, when $W _ { i + 1 , i }$ be the weight and bias between the $i ^ { t h }$ layer and the $i + 1 ^ { t h }$ layer. If the activation function is represented as $f ( \cdot )$ , and $L$ is the total number of layers, the feature map of the $i + 1 ^ { t h }$ layer can be calculated as
28
+
29
+ $$
30
+ i _ { i + 1 } = W _ { i + 1 , i } \ o _ { i } , \quad o _ { i + 1 } = f ( i _ { i + 1 } ) , \quad i \in \{ 0 , 1 , \ldots , L - 1 \}
31
+ $$
32
+
33
+ Various activation functions such as sigmoid, tanh, and ReLU (Nair & Hinton (2010)) can be one of candidates of the $f ( \cdot )$ . Some DNNs such as generative adversarial networks (Goodfellow et al. (2014)) use more advanced activation functions like Leaky ReLU and PReLU $\mathrm { \Delta X u }$ et al. (2015)). Once the inference is over, the inference result is compared with the pre-defined labels, and the error map $e _ { L }$ is calculated by a loss function such as cross-entropy. The error is propagated gradually from the last layer to the first layer, and the $i ^ { t h }$ layer’s error map can be calculated as
34
+
35
+ $$
36
+ \pmb { e } _ { i } = ( W _ { i + 1 , i } ^ { T } \pmb { e } _ { i + 1 } ) \odot f ^ { \prime } ( i _ { i + 1 } ) , \quad i \in \{ 1 , 2 , . . . , L - 1 \}
37
+ $$
38
+
39
+ where $\odot$ is an element-wise multiplication operator and $f ^ { \prime } ( )$ is the derivative of the non-linear function. We need the transposed weight matrix, $W _ { i + 1 , i } ^ { T }$ , to propagate the errors in MLP case. After the BP, the gradient of each layer is computed by using both the $i ^ { t h }$ layer’s feature map and $i + 1 ^ { t h }$ layer’s error map. The $i ^ { t h }$ layer’s gradient, $G _ { i }$ is calculated as following.
40
+
41
+ $$
42
+ G _ { i , b } = e _ { i + 1 } \ o _ { i } ^ { T } , \quad i \in \{ 0 , 1 , \ldots , L - 1 \} , \quad b \in \{ 0 , 1 , \ldots , B \}
43
+ $$
44
+
45
+ $$
46
+ \pmb { G } _ { i } = \frac { 1 } { B } \sum _ { b } \pmb { G } _ { i , b } , \quad \pmb { W } _ { i + 1 , i } ^ { \prime } = \pmb { W } _ { i + 1 , i } - \eta \ \pmb { G } _ { i }
47
+ $$
48
+
49
+ If we use the mini-batch gradient descent with the batch size $B$ , total $B$ gradients, $G _ { i , b }$ are averaged and get the $G _ { i }$ . $G _ { i }$ is used to update the $W _ { i + 1 , i }$ by multiplying learning rate, $\eta$ . In the CNN case, the matrix multiplication operations in every step described in MLP is substituted with the convolution operations. One more different thing is that it uses $1 8 0 ^ { \circ }$ flipped kernel instead of the transposed weight used in the BP. Other operations are as same as in the MLP case.
50
+
51
+ # 2.2 FEEDBACK ALIGNMENT
52
+
53
+ Feedback alignment (FA) which was introduced by Lillicrap et al. (2016) substituted the transposed weight with the fixed random matrix in error propagation operation. In other words, they pre-defined the feedback weight which has the same size as the transposed weight, but the values of the feedback weight are determined randomly. Although the weights used in the training are updated for every iteration, the pre-defined random matrix is maintained until the training is finished. Let $R _ { i + 1 , i }$ be the feedback weight of the $i ^ { t h }$ layer, the propagated error in the FA is calculated as
54
+
55
+ $$
56
+ e _ { i } = ( R _ { i + 1 , i } ^ { T } ~ e _ { i + 1 } ) \odot f ^ { \prime } ( i _ { i + 1 } )
57
+ $$
58
+
59
+ , and the other procedures such as gradient generation and weight updating are same as BP does.
60
+
61
+ # 2.3 DIRECT FEEDBACK ALIGNMENT
62
+
63
+ Even though, both the BP and the FA propagate errors from the last layer to the first layer in order, the DFA (Nokland (2016)) directly propagates errors from the last layer to other layers. If the number of neurons in the last layer and the $\bar { i } ^ { t h }$ layer, are represented by $N _ { L }$ and $N _ { i }$ respectively, the size of the feedback weight is determined as $N _ { i } \times N _ { L }$ . Let, $i ^ { t h }$ layer’s feedback weight in the DFA be $D _ { i } ^ { T }$ , then the error is calculated as
64
+
65
+ $$
66
+ \pmb { e } _ { i } = ( D _ { i } ^ { T } \pmb { e } _ { L } ) \odot f ^ { \prime } ( \pmb { i } _ { i + 1 } )
67
+ $$
68
+
69
+ One of the interesting characteristics is that there is no data dependency between different errors because the DFA propagates the errors directly from the last layer. This characteristic gives the opportunity of parallel processing in the DFA based error propagation operation.
70
+
71
+ Compared with the BP, DFA showed similar training performance for the multi-layer perceptron (MLP) structure. Moreover, DFA requires fewer computations because $N _ { L }$ is generally smaller than the number of neurons in the intermediate layers. However, the DFA dramatically degrades the accuracy when it applied in the CNN training as shown in Figure 1. Furthermore, the elements of the intermediate feature map are all connected with the last layer neurons, so it requires much more computations compared with BP based CNN training. In summary, the DFA’s computational efficiency can be induced in the MLP training, but not in the CNN.
72
+
73
+ # 3 OUR APPROACH
74
+
75
+ As mentioned in Section 2, the DFA is efficient for MLP training, because it can be computed in parallel without accuracy degradation. However, this advantage is diminished when the DFA is applied in the CNN. To solve this problem, we propose the new training method to make the DFA applied to the CNN. In addition, the initialization method of the feedback weight is suggested for the fast and stable learning curve. At last, we propose the advanced training algorithm, binary direct feedback alignment (BDFA), which shows high computing efficiency and robust training performance in various conditions.
76
+
77
+ ![](images/a5ad26d059c99378a4fd14d3a6c18d5419391e11c682cdad631dba4f46028885.jpg)
78
+ Figure 1: BP (Black) vs Conventional DFA (Read) for CNN Training (Tested in CIFAR-10)
79
+
80
+ # 3.1 CDFA: CNN TRAINING BY COMBINING BOTH BP AND DFA
81
+
82
+ Generally, CNN consists of the convolutional layers and fully-connected (FC) layers. The two different kinds of layers have different roles. For example in object classification, convolutional layers are considered as the feature extractor by using the characteristics of the convolution computation. In contrast, FC layers receive the result of the feature extractor and judge what the object is. However, in the initial iterations of the BP based CNN training, training the convolutional layers can be ambiguous because the FC layers cannot be considered as a good object classifier. During some iterations of BP, the weight of the FC layers will be changed and the convolutional layers should be adaptive to the changed FC layers. In other words, convolutional layers can be confused if the propagated error’s domain is changed for every iteration.
83
+
84
+ If the error is propagated from the last FC layer to convolutional layer through the constant domain shifting, the training of the convolutional layer can be more stable than conventional BP. From this motivation, we use DFA instead of BP in the FC layers. As shown in Figure 2, the network maintains the BP in the convolutional layers but adopts the DFA for the FC layers. Since there is no data dependency among the FC layers, the DFA can directly propagate the error to the FC1. Since the DFA uses fixed feedback weight for error propagation, convolutional layers do not have to be adaptive to various errors which are derived from the different domain. In this method, the error propagation in the convolutional layers can be started even though the errors are not propagated for the remained FC layers. Therefore, the error propagation of both the convolutional layers and the FC layers can be computed in parallel right after DFA is done for the first FC layer.
85
+
86
+ Nokland (2016) shows that the randomly initialized feedback weight can be used for DFA based DNN training. However, both the FA and the DFA are sensitive to the initialization method of the feedback weight because it affects the training accuracy and the convergence speed significantly. As shown in Liao et al. (2015), it is observed that the batch-normalization (BN) seems to make the FA become not sensitive to the initialization method, but it is still a problem because of the slow convergence. To make the DFA robust to the initialization method, we fixed the feedback weight as the multiplication of the transposed weights in multiple layers. To sum up, the feedback weight of the $i ^ { t h }$ layer, $\mathbf { \nabla } D _ { i }$ , can be calculated as
87
+
88
+ $$
89
+ D _ { i } = W _ { L , L - 1 } \dots W _ { i + 2 , i + 1 } W _ { i + 1 , i }
90
+ $$
91
+
92
+ , and finally, the error propagation operation can be summarized as follow.
93
+
94
+ $$
95
+ e _ { i } = ( D _ { i } ^ { T } e _ { L } ) \odot f ^ { \prime } ( i _ { i + 1 } ) = ( W _ { i + 1 , i } ^ { T } \dots W _ { L - 1 , L - 2 } ^ { T } W _ { L , L - 1 } ^ { T } e _ { L } ) \odot f ^ { \prime } ( i _ { i + 1 } )
96
+ $$
97
+
98
+ The suggested initialization method is suitable for other various functions such as sigmoid, tanh and ReLU. Moreover, other normalization or optimization methods such as BN and dropout (Srivastava et al. (2014)) are also applicable with the proposed initialization with the equation (7).
99
+
100
+ ![](images/d430f8e3754a9d7423daa939460b1f81bc5c5213c3f8e48e4ca82be448b8cf7a.jpg)
101
+ Figure 2: Conventional DFA in CNN and Proposed DFA based Error Propagation
102
+
103
+ # 3.2 BINARY DIRECT FEEDBACK ALIGNMENT (BDFA)
104
+
105
+ The DFA needs the feedback weight addition to the forward weight matrix, and it occupies a larger memory to store both two matrices. Moreover, the DFA has the chance to be computed in parallel, but it requires much larger memory bandwidth. Since the throughput in the FC computing is vulnerable to the memory bandwidth, loading the additional feedback weight degrades the throughput compared with the unlimited bandwidth case.
106
+
107
+ To solve the throughput bottleneck problem caused limited bandwidth, we propose the binary direct feedback alignment (BDFA) algorithm. BDFA uses the binarized feedback weight, $B _ { i }$ , whose values are determined as either $+ 1$ or $^ { - 1 }$ . In other words, the $B _ { i }$ can be stored as a single bit to represent only the sign value of the feedback weight’s element. As a result, required memory to store the $\mathbf { \delta } _ { B _ { i } }$ is reduced by $9 6 . 9 \%$ compared with the 32-bit floating point representation which now becomes the general numeric representation in CPU or GPU. As we determined in the DFA, BDFA’s feedback weight, $\mathbf { \delta } _ { B _ { i } }$ can be similarly defined by a modification of the equation (7). $\mathbf { \delta } _ { B _ { i } }$ is determined as
108
+
109
+ $$
110
+ B _ { i } = s i g n ( W _ { L , L - 1 } \ldots W _ { i + 2 , i + 1 } W _ { i + 1 , i } ) , \quad e _ { i } = ( B _ { i } ^ { T } e _ { L } ) \odot f ^ { \prime } ( i _ { i + 1 } )
111
+ $$
112
+
113
+ , when the $s i g n ( \cdot )$ is the function which indicates the sign value of each element. The difference between equation (7) and (9) is only whether the $s i g n ( \cdot )$ is applied or not. By applying equation (9), BDFA shows faster and stable training convergence compared with the random initialization case. The effect of the binarization and initialization will be discussed in section 4.
114
+
115
+ # 4 EXPERIMENTS
116
+
117
+ In this section, we compared the training accuracy of the conventional BP and suggested training algorithm. We measured the relative accuracy by training CNN from the scratch in CIFAR-10 and CIFAR-100 dataset (Krizhevsky (2009)). We used the network configuration as described in Figure 3. The base network follows the VGG-16 (Simonyan & Zisserman (2015)) configuration, but has one additional FC layer. To sum up, it consists of 13 convolutional layers with BN and ReLU activation functions, followed by three FC layers without BN. The number of neurons in the last FC layer is determined by the number of classification categories in each different dataset. In the BP based approach, both the convolutional layers and the FC layers are trained by using BP. In contrast, the training method of the last three FC layers is substituted with the DFA or the BDFA to measure the performance of the proposed training algorithm. The simulation was based on minibatch gradient descent with the batch size 100 and uses momentum(Sutskever et al. (2013)) for the optimization method. The parameters of the network are initialized as introduced by He et al. (2015), and the learning rate decay and the weight decay method is adopted. Other hyper parameters are not changed for fair comparison.
118
+
119
+ # 4.1 CNN TRAINING FROM THE SCRATCH
120
+
121
+ The CNN training with the DFA and BDFA, are renamed as CDFA and CBDFA respectively for the simple explanation. Table 1 shows Top5 and Top1 test accuracy after the CNN training is done in the two different CIFAR datasets. In this simulation, there is no data augmentation to make an environment which has a limited dataset. This condition can examine whether the algorithm is robust to the training in the small dataset. To sum up, only 50,000 images in the CIFAR-10 and CIFAR-100 is only used for DNN training and the other 10,000 images are tested to evaluate the test accuracy. As a result, both the CDFA and the CBDFA show higher test accuracy compared with the conventional BP even though the feedback weight is randomly initialized. In CIFAR-10, the CDFA and CBDFA are $7 . 5 \%$ and $8 . 3 \%$ higher in Top1 test accuracy than the BP respectively. The accuracy improvement by the CDFA and the CBDFA seems much more remarkable in CIFAR-100. As shown in Figure 4, the training curve of the CDFA and CBDFA is much slower, but they achieve $2 1 . 3 \%$ and $1 9 . 6 \%$ better performance respectively compared with the BP. However, the feedback weight with the random initialization has critical problems for training. One of the problems is the slow training curve described in Figure 4. DFA requires time to be adaptive to the randomly initialized feedback weights, so it takes a long latency to be converged. In the BP approach, we generally take the larger learning rate to make the training faster. However, the test accuracy of the DFA and BDFA is swung up and down dramatically when the large learning rate is applied. Moreover, it still spends a long time to converge. In this problem, the initialization with the equation (7) and (9) can be useful to solve the learning speed and stability problem. After the feedback weight is initialized by the proposed equations, it shows faster and more stable convergence characteristic as shown in Figure 5. When the proposed initialization method is combined with the large learning rate, it shows the best training performance compared with the other results.
122
+
123
+ ![](images/1397f2721dd69bba7e3df64bc1b13e90c10aa7b1eefebb6638658f05997ff0ad.jpg)
124
+ Figure 3: Overall network configuration for training
125
+
126
+ Table 1: CNN Training Result in CIFAR-10 & CIFAR-100 (Small Learning Rate)
127
+
128
+ <table><tr><td>CIFAR 10</td><td>BP</td><td>BP w/ BN</td><td>CDFA Random</td><td>CDFA Eq (7)</td><td>CDFA w/ BN</td><td>CBDFA Random</td><td>CBDFA Eq(9)</td><td>CBDFA w/BN</td></tr><tr><td>Top5 Top1</td><td>98.63 81.11</td><td>98.24 76.91</td><td>98.42 88.68</td><td>98.55 86.36</td><td>98.56 87.41</td><td>98.63 89.39</td><td>98.88 87.65</td><td>98.83 86.46</td></tr></table>
129
+
130
+ <table><tr><td>CIFAR 100</td><td>BP</td><td>BP w/ BN</td><td>CDFA Random</td><td>CDFA Eq (7)</td><td>CDFA w/BN</td><td>CBDFA Random</td><td>CBDFA Eq (9)</td><td>CBDFA w/BN</td></tr><tr><td>Top5 Top1</td><td>67.80 40.29</td><td>63.91 37.80</td><td>77.05 61.42</td><td>72.82 48.24</td><td>77.55 55.11</td><td>75.07 59.92</td><td>71.92 47.48</td><td>76.85 54.47</td></tr></table>
131
+
132
+ ![](images/ff81cfbe9a2121a1d175c4379344f62f86043acaf726cb260f77964bb1a815ca.jpg)
133
+ < CIFAR-10o Training Result - Random Initialization & Small LR>
134
+ Figure 4: Training and Test Accuracy with Proposed Training Algorithm
135
+
136
+ When the dataset is augmented with the flipping and cropping, the training performance of the BP and CBDFA becomes higher than before. The simulation uses the large learning rate, and CBDFA takes the initialization with equation (9). In table 2, the performance of the CBDFA shows the highest accuracy compared with not only BP but also the training suggested by Hoffer et al. (2018). It trains only the convolutional layers, and the parameters of the FC layers are fixed. Even considering the data augmentation, CBDFA still shows higher training accuracy compared with the other two methods. As a result, CBDFA seems robust to the size of the dataset.
137
+
138
+ ![](images/f8e7c9fe9df953778ecd2a9e6583228191fe9924653b17621ccbad33f295fb77.jpg)
139
+ Figure 5: Training and Test Accuracy with Proposed Training Algorithm
140
+
141
+ Table 2: CNN Training Result with Data Augmentation (CIFAR-10)
142
+
143
+ <table><tr><td></td><td colspan="3">w/o Data Augmentation</td><td colspan="3">w/ Data Augmentation</td></tr><tr><td></td><td>BP</td><td>CBDFA</td><td>Conv. only Training</td><td>BP</td><td>CBDFA</td><td>Conv. only Training</td></tr><tr><td>Top5</td><td>99.15</td><td>99.07</td><td>98.84</td><td>99.33</td><td>99.49</td><td>99.46</td></tr><tr><td>Top1</td><td>82.33</td><td>87.35</td><td>82.06</td><td>87.97</td><td>90.13</td><td>88.48</td></tr></table>
144
+
145
+ There are some interesting observations in our simulation. First of all, the CBDFA shows negligible accuracy degradation compared with the CDFA based training. Sometimes, the CBDFA has a rather better performance than the CDFA case. Refer to the learning curve described in both Figure 4 and Figure 5, the CBDFA’s learning speed is slightly degraded, but the final training results are approximately the same. Therefore, CBDFA can improve the training performance and take the hardware benefits such as smaller memory bandwidth by adopting binarized feedback weights. The second one is the effect of the BN. Even though the suggested initialization method achieves the fast and stable training, it has a little accuracy degradation compared with the random initialization method. This accuracy degradation can be reduced when the BN layer is added after the FC layer. This result is counter characteristic compared with the BP case because the BP shows the worse training result when the BN layer is followed right after the FC layer. To sum up, the equation (7) and (9) are much more powerful when the BN is followed after the convolutional layer.
146
+
147
+ # 4.2 EXAMPLE OF ONLINE LEARNING WITH SMALL DATASET: OBJECT TRACKING
148
+
149
+ Nam & Han (2016) suggested online FC learning based object tracking algorithm, MDNet. The online learning concept in MDNet has derived many other algorithms such as BranchOut (Han et al. (2017)) and ADNet (Yun et al. (2017)). In the MDNet, both the convolutional layers and FC layers are pre-trained with the VOT (Kristan et al. (2013), Kristan et al. (2016)) and OTB (Wu et al. (2015)) object tracking dataset. However, the last layer of the FC layers is randomly initialized for the new tracking task. The convolutional layers do not need to be trained during the tracking but the FC layers are fine-tuned by using the BP. To apply BDFA to FC online learning with the small dataset, we replace the BP by the BDFA for FC layers in the MDNet.
150
+
151
+ ![](images/31487bb566301a24c7d55fac0d6937165872564cc84240dfc82c95ee1bac0db2.jpg)
152
+ Figure 6: Object Tracking Result with the Proposed Training Algorithm, CBDFA
153
+
154
+ We compared the object tracking performance by drawing the precision and the success plots of the one-pass evaluation (OPE) in the OTB dataset. As shown in Figure 6, the object tracking with the BDFA based online learning shows similar performance compared with the BP case. However, the BDFA shows better performance than BP when the batch size becomes smaller. Since the object tracking application is very sensitive to the online learning speed and the BDFA has a chance to be computed in parallel, BDFA based online learning becomes much more beneficial than conventional BP. Moreover, the BDFA can dramatically reduce the required data transaction in error propagation because of the fewer neuron interconnections and the binarization. As pointed out in the paper, Han et al. (2018), BP based online learning is inefficient for online learning in the devices which have limited memory bandwidth, computing resources, and small dataset. In this case, the effect of the BDFA can be maximized because of its profits.
155
+
156
+ # 5 CONCLUSION
157
+
158
+ In this work, we propose the new DNN learning algorithms to maximize the computation efficiency without accuracy degradation. We adopt one of the training method, DFA and combine it with the conventional BP. The combination of the DFA and the BP shows much better test accuracy in CNN training through the simulation in the CIFAFR-10 and CIFAR-100 dataset. BDFA takes one step further, binarizing the feedback weight while maintaining a similar performance compared with the full-precision DFA. The stability problem induced in the DFA and BDFA simulation (Figure 5) can be solved by the new feedback weight initialization method, equation (7) and (9). The BDFA is also simulated in the object tracking application, and it shows better tracking results compared with the conventional BP based online FC tuning.
159
+
160
+ In this research, we can see that the DFA can reduce the computational complexity and achieve better training performance than conventional training method. However, the feedback path of the DFA cannot still be applied directly into convolutional layer because of the significant accuracy degradation. To break the limitation of the current research, We will continue the research about expanding the usage of the DFA to not only convolutional layers but also other RNN networks such as LSTM (Hochreiter & Schmidhubers (1997)) and GRU (Chung et al. (2014)).
161
+
162
+ # REFERENCES
163
+
164
+ J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. ArXiv:1412.3555, 2014.
165
+
166
+ Ian J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Proceedings of Neural Information Processing Systems (NIPS), 2014.
167
+
168
+ B. Han, J. Sim, and H. Adam. Branchout: Regularization for online ensemble tracking with convolutional neural networks. In Proceedings of Computer Vision and Pattern Recognition (CVPR), 2017.
169
+
170
+ D. Han, J. Lee, J. Lee, S. Choi, and Hoi-Jun Yoo. A 141.4 mw low-power online deep neural network training processor for real-time object tracking in mobile devices. In Proceedings of International Symposium on Circuits and Systems (ISCAS), 2018.
171
+
172
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. CoRR, abs/1502.01852, 2015. URL http: //arxiv.org/abs/1502.01852.
173
+
174
+ S. Hochreiter and J. Schmidhubers. Long short-term memory. Neural Compututation, 9:1735–1780, 1997.
175
+
176
+ Elad Hoffer, Itay Hubara, and Daniel Soudry. Fix your classifier: the marginal value of training the last weight layer. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ S1Dh8Tg0-.
177
+
178
+ J. Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proc. Natl. Acad. Sci. USA 79, pp. 2554–2558, 1982.
179
+
180
+ M. Kristan, R. Pflugfelder, A. Leonardis, J. Matas, F. Porikli, L. Cehovin, G. Nebehay, G. Fernandez, and T. Vojir et al. The visual object tracking vot2013 challenge results. International Conference on Computer Vision Workshops (ICCVW), 2013.
181
+
182
+ M. Kristan, R. Pflugfelder, A. Leonardis, J. Matas, L. Cehovin, G. Nebehay, and G. Fernandez et al. The visual object tracking vot2014 challenge results. European Conference on Computer Vision Workshops (ECCVW), 2016.
183
+
184
+ A. Krizhevsky. Learning multiple layers of features from tiny images. 2009.
185
+
186
+ A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Proceedings of Neural Information Processing Systems (NIPS), pp. 1106– 1114, 2012.
187
+
188
+ Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proc. IEEE 86, pp. 2278–2324, 1998.
189
+
190
+ Q. Liao, J. Z. Leibo, and T. Poggio. How important is weight symmetry in backpropagation? arXiv:1510.05067, 2015.
191
+
192
+ T. P. Lillicrap, D. Cownden, D. B. Tweed, and C. J. Akerman. Random feedback weights support learning in deep neural networks. arXiv:1411.0247, 2014.
193
+
194
+ T. P. Lillicrap, D. Cownden, D. B. Tweed, and C. J. Akerman. Random feedback weights support learning in deep neural networks. Nature Communications, 7, 2016.
195
+
196
+ V. Nair and G. E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of International Conference on Machine Learning (ICML), 2010.
197
+
198
+ H. Nam and B. Han. Learning multi-domain convolutional neural networks. In Proceedings of Computer Vision and Pattern Recognition (CVPR), 2016.
199
+
200
+ A. Nokland. Direct feedback alignment provides learning in deep neural networks. In Proceedings of Neural Information Processing Systems (NIPS), 2016.
201
+
202
+ W. Rawat and Z. Wang. Deep convolutional neural networks for image classification: A comprehensive review. Neural computation, 29 no. 9, 2017.
203
+ D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning internal representations by backpropagating errors. Nature, 323:533–536, 1986.
204
+ T. Salimans, J. Ho, X. Chen, S. Sidor, and I. Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. ArXiv, 2017.
205
+ K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In Proceedings of Computer Vision and Pattern Recognition (CVPR), 2015.
206
+ S. P. Singh, A. Kumar, H. Darbari, L. Singh, A. Rastogi, and S. Jain. Machine translation using deep learning: An overview. International Conference on Computer, Communications and Electronics (Comptelix), pp. 162–167, 2017.
207
+ N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1): 1929–1958, 2014.
208
+ I. Sutskever, J. Martens, G. Dahl, and G. E. Hinton. On the importance of initialization and momentum in deep learning. In Proceedings of International Conference on Machine Learning (ICML), pp. 1139–1147, 2013.
209
+ Y. Wang, R. Skerry-Ryan, D. Stanton, Y. Wu, R. J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, and S. Bengio. Tacotron: Towards end-to-end speech synthesis. Interspeech, 2017.
210
+ Y. Wu, J. Lim, and M. Yang. Object tracking benchmark. Transactions on Pattern Analysis and Machine Intelligence, 37:1834–1848, 2015.
211
+ B. Xu, N. Wang, T. Chen, and M. Li. Empirical evaluation of rectified activations in convolutional network. arXiv:1505.00853, 2015.
212
+ S. Yun, J. Choi, Y. Yoo, K. Yun, and J. Y. Choi. Action-decision networks for visual tracking with deep reinforcement learning. In Proceedings of Computer Vision and Pattern Recognition (CVPR), 2017.
md/train/ByBAl2eAZ/ByBAl2eAZ.md ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PARAMETER SPACE NOISE FOR EXPLORATION
2
+
3
+ Matthias Plappert†‡, Rein Houthooft†, Prafulla Dhariwal†, Szymon Sidor†, Richard Y. Chen†, Xi Chen††, Tamim Asfour‡, Pieter Abbeel††, and Marcin Andrychowicz † OpenAI ‡ Karlsruhe Institute of Technology (KIT) †† University of California, Berkeley Correspondence to matthias@openai.com
4
+
5
+ # ABSTRACT
6
+
7
+ Deep reinforcement learning (RL) methods generally engage in exploratory behavior through noise injection in the action space. An alternative is to add noise directly to the agent’s parameters, which can lead to more consistent exploration and a richer set of behaviors. Methods such as evolutionary strategies use parameter perturbations, but discard all temporal structure in the process and require significantly more samples. Combining parameter noise with traditional RL methods allows to combine the best of both worlds. We demonstrate that both off- and on-policy methods benefit from this approach through experimental comparison of DQN, DDPG, and TRPO on high-dimensional discrete action environments as well as continuous control tasks.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Exploration remains a key challenge in contemporary deep reinforcement learning (RL). Its main purpose is to ensure that the agent’s behavior does not converge prematurely to a local optimum. Enabling efficient and effective exploration is, however, not trivial since it is not directed by the reward function of the underlying Markov decision process (MDP). Although a plethora of methods have been proposed to tackle this challenge in high-dimensional and/or continuous-action MDPs, they often rely on complex additional structures such as counting tables (Tang et al., 2016), density modeling of the state space (Ostrovski et al., 2017), learned dynamics models (Houthooft et al., 2016; Achiam & Sastry, 2017; Stadie et al., 2015), or self-supervised curiosity (Pathak et al., 2017).
12
+
13
+ An orthogonal way of increasing the exploratory nature of these algorithms is through the addition of temporally-correlated noise, for example as done in bootstrapped DQN (Osband et al., 2016a). Along the same lines, it was shown that the addition of parameter noise leads to better exploration by obtaining a policy that exhibits a larger variety of behaviors (Sun et al., 2009b; Salimans et al., 2017). We discuss these related approaches in greater detail in Section 5. Their main limitation, however, is that they are either only proposed and evaluated for the on-policy setting with relatively small and shallow function approximators (Rückstieß et al., 2008) or disregard all temporal structure and gradient information (Salimans et al., 2017; Kober & Peters, 2008; Sehnke et al., 2010).
14
+
15
+ This paper investigates how parameter space noise can be effectively combined with off-the-shelf deep RL algorithms such as DQN (Mnih et al., 2015), DDPG (Lillicrap et al., 2015), and TRPO (Schulman et al., 2015b) to improve their exploratory behavior. Experiments show that this form of exploration is applicable to both high-dimensional discrete environments and continuous control tasks, using on- and off-policy methods. Our results indicate that parameter noise outperforms traditional action space noise-based baselines, especially in tasks where the reward signal is extremely sparse.
16
+
17
+ # 2 BACKGROUND
18
+
19
+ We consider the standard RL framework consisting of an agent interacting with an environment. To simplify the exposition we assume that the environment is fully observable. An environment is modeled as a Markov decision process (MDP) and is defined by a set of states $s$ , a set of actions $\mathcal { A }$ , a distribution over initial states $p ( s _ { 0 } )$ , a reward function $r : S \times \mathcal { A } \mapsto \mathbb { R }$ , transition probabilities $p ( s _ { t + 1 } | s _ { t } , a _ { t } )$ , a time horizon $T$ , and a discount factor $\gamma \in \ [ 0 , 1 )$ . We denote by $\pi _ { \theta }$ a policy parametrized by $\theta$ , which can be either deterministic, $\pi : { \mathcal { S } } \mapsto A$ , or stochastic, $\pi : S \mapsto { \mathcal { P } } ( { \mathcal { A } } )$ . The agent’s goal is to maximize the expected discounted return $\begin{array} { r } { \eta ( \pi _ { \theta } ) = \mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { T } \gamma ^ { t } r ( s _ { t } , a _ { t } ) ] } \end{array}$ , where $\tau =$ $( s _ { 0 } , a _ { 0 } , \ldots , s _ { T } )$ denotes a trajectory with $s _ { 0 } \sim p ( s _ { 0 } )$ , $a _ { t } \sim \pi _ { \theta } ( a _ { t } | s _ { t } )$ , and $s _ { t + 1 } \sim p \big ( s _ { t + 1 } \vert s _ { t } , a _ { t } \big )$ . Experimental evaluation is based on the undiscounted return $\begin{array} { r } { \mathbb { E } _ { \tau } [ \sum _ { t = 0 } ^ { T } r ( s _ { t } , a _ { t } ) ] } \end{array}$ . 1
20
+
21
+ # 2.1 OFF-POLICY METHODS
22
+
23
+ Off-policy RL methods allow learning based on data captured by arbitrary policies. This paper considers two popular off-policy algorithms, namely Deep Q-Networks (DQN, Mnih et al. (2015)) and Deep Deterministic Policy Gradients (DDPG, Lillicrap et al. (2015)).
24
+
25
+ Deep Q-Networks (DQN) DQN uses a deep neural network as a function approximator to estimate the optimal $Q$ -value function, which conforms to the Bellman optimality equation:
26
+
27
+ $$
28
+ Q ( s _ { t } , a _ { t } ) = r ( s _ { t } , a _ { t } ) + \gamma \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ( s _ { t + 1 } , a ^ { \prime } ) .
29
+ $$
30
+
31
+ The policy is implicitly defined by $Q$ as $\pi ( s _ { t } ) = \operatorname { a r g m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ( s _ { t } , a ^ { \prime } )$ . Typically, a stochastic $\epsilon$ - greedy or Boltzmann policy (Sutton & Barto, 1998) is derived from the $Q$ -value function to encourage exploration, which relies on sampling noise in the action space. The $Q$ -network predicts a $Q$ -value for each action and is updated using off-policy data from a replay buffer.
32
+
33
+ Deep Deterministic Policy Gradients (DDPG) DDPG is an actor-critic algorithm, applicable to continuous action spaces. Similar to DQN, the critic estimates the $Q$ -value function using off-policy data and the recursive Bellman equation:
34
+
35
+ $$
36
+ Q ( s _ { t } , a _ { t } ) = r ( s _ { t } , a _ { t } ) + \gamma Q \left( s _ { t + 1 } , \pi _ { \theta } ( s _ { t + 1 } ) \right) ,
37
+ $$
38
+
39
+ where $\pi _ { \theta }$ is the actor or policy. The actor is trained to maximize the critic’s estimated $Q$ -values by back-propagating through both networks. For exploration, DDPG uses a stochastic policy of the form $\widehat { \pi _ { \boldsymbol { \theta } } } ( \boldsymbol { s } _ { t } ) \bar { \mathbf { \xi } } = \bar { \pi } _ { \boldsymbol { \theta } } ( \boldsymbol { s } _ { t } ) \bar { \mathbf { \xi } } + w$ , where $w$ is either $\boldsymbol { w } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ (uncorrelated) or $w \stackrel { \cdot } { \sim } \mathrm { O D } ( 0 , \sigma ^ { 2 } )$ c(correlated).2 Again, exploration is realized through action space noise.
40
+
41
+ # 2.2 ON-POLICY METHODS
42
+
43
+ In contrast to off-policy algorithms, on-policy methods require updating function approximators according to the currently followed policy. In particular, we will consider Trust Region Policy Optimization (TRPO, Schulman et al. (2015a)), an extension of traditional policy gradient methods (Williams, 1992b) using the natural gradient direction (Peters & Schaal, 2008; Kakade, 2001).
44
+
45
+ Trust Region Policy Optimization (TRPO) TRPO improves upon REINFORCE (Williams, 1992b) by computing an ascent direction that ensures a small change in the policy distribution. More specifically, TRPO solves the following constrained optimization problem:
46
+
47
+ $$
48
+ \begin{array} { r l } { \mathrm { m a x i m i z e } _ { \theta } } & { E _ { s \sim \rho _ { \theta ^ { \prime } } , a \sim \pi _ { \theta ^ { \prime } } } [ \frac { \pi _ { \theta } ( a | s ) } { \pi _ { \theta } ^ { \prime } ( a | s ) } A ( s , a ) ] } \\ { \mathrm { s . t . } \quad } & { E _ { s \sim \rho _ { \theta ^ { \prime } } } [ D _ { \mathrm { K L } } ( \pi _ { \theta ^ { \prime } } ( \cdot | s ) | | \pi _ { \theta } ( \cdot | s ) ) ] \leq \delta _ { \mathrm { K L } } } \end{array}
49
+ $$
50
+
51
+ where $\rho _ { \theta } = \rho _ { \pi _ { \theta } }$ is the discounted state-visitation frequencies induced by $\pi _ { \theta }$ , $A ( s , a )$ denotes the advantage function estimated by the empirical return minus the baseline, and $\delta _ { \mathrm { K L } }$ is a step size parameter which controls how much the policy is allowed to change per iteration.
52
+
53
+ # 3 PARAMETER SPACE NOISE FOR EXPLORATION
54
+
55
+ This work considers policies that are realized as parameterized functions, which we denote as $\pi _ { \theta }$ , with $\theta$ being the parameter vector. We represent policies as neural networks but our technique can be applied to arbitrary parametric models. To achieve structured exploration, we sample from a set of policies by applying additive Gaussian noise to the parameter vector of the current policy: $\widetilde { \theta } = \theta + \Lambda ( 0 , \sigma ^ { 2 } I )$ . Importantly, the perturbed policy is sampled at the beginning of each episode and kept fixed for the entire rollout. For convenience and readability, we denote this perturbed policy as $\widetilde { \pi } : = \pi _ { \widetilde { \theta } }$ and analogously define $\pi : = \pi _ { \theta }$ .
56
+
57
+ State-dependent exploration As pointed out by Rückstieß et al. (2008), there is a crucial difference between action space noise and parameter space noise. Consider the continuous action space case. When using Gaussian action noise, actions are sampled according to some stochastic policy, generating $a _ { t } = \bar { \pi } ( s _ { t } ) + \mathcal { N } ( 0 , \sigma ^ { 2 } I )$ . Therefore, even for a fixed state $s$ , we will almost certainly obtain a different action whenever that state is sampled again in the rollout, since action space noise is completely independent of the current state $s _ { t }$ (notice that this is equally true for correlated action space noise). In contrast, if the parameters of the policy are perturbed at the beginning of each episode, we get $a _ { t } = \widetilde { \pi } ( s _ { t } )$ . In this case, the same action will be taken every time the same state $s _ { t }$ is esampled in the rollout. This ensures consistency in actions, and directly introduces a dependence between the state and the exploratory action taken.
58
+
59
+ Perturbing deep neural networks It is not immediately obvious that deep neural networks, with potentially millions of parameters and complicated nonlinear interactions, can be perturbed in meaningful ways by applying spherical Gaussian noise. However, as recently shown by Salimans et al. (2017), a simple reparameterization of the network achieves exactly this. More concretely, we use layer normalization (Ba et al., 2016) between perturbed layers.3 Due to this normalizing across activations within a layer, the same perturbation scale can be used across all layers, even though different layers may exhibit different sensitivities to noise.
60
+
61
+ Adaptive noise scaling Parameter space noise requires us to pick a suitable scale $\sigma$ . This can be problematic since the scale will strongly depend on the specific network architecture, and is likely to vary over time as parameters become more sensitive to noise as learning progresses. Additionally, while it is easy to intuitively grasp the scale of action space noise, it is far harder to understand the scale in parameter space. We propose a simple solution that resolves all aforementioned limitations in an easy and straightforward way. This is achieved by adapting the scale of the parameter space noise over time and relating it to the variance in action space that it induces. More concretely, we can define a distance measure between perturbed and non-perturbed policy in action space and adaptively increase or decrease the parameter space noise depending on whether it is below or above a certain threshold:
62
+
63
+ $$
64
+ \sigma _ { k + 1 } = { \left\{ \begin{array} { l l } { \alpha \sigma _ { k } } & { { \mathrm { i f ~ } } d ( \pi , { \widetilde { \pi } } ) \leq \delta , } \\ { { \frac { 1 } { \alpha } } \sigma _ { k } } & { { \mathrm { o t h e r w i s e } } , } \end{array} \right. }
65
+ $$
66
+
67
+ where $\alpha \in \mathbb { R } _ { > 0 }$ is a scaling factor and $\delta \in \mathbb { R } _ { > 0 }$ a threshold value. The concrete realization of $d ( \cdot , \cdot )$ depends on the algorithm at hand and we describe appropriate distance measures for DQN, DDPG, and TRPO in Appendix C.
68
+
69
+ Parameter space noise for off-policy methods In the off-policy case, parameter space noise can be applied straightforwardly since, by definition, data that was collected off-policy can be used. More concretely, we only perturb the policy for exploration and train the non-perturbed network on this data by replaying it.
70
+
71
+ Parameter space noise for on-policy methods Parameter noise can be incorporated in an onpolicy setting, using an adapted policy gradient, as set forth by Rückstieß et al. (2008). Policy gradient methods optimize $\mathbb { E } _ { \tau \sim ( \pi , p ) } [ R ( \tau ) ]$ . Given a stochastic policy $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } )$ with $\theta \sim \mathcal { N } ( \phi , \Sigma )$ , the expected return can be expanded using likelihood ratios and the re-parametrization trick (Kingma & Welling, 2013) as
72
+
73
+ $$
74
+ \nabla _ { \phi , \Sigma } \mathbb { E } _ { \tau } [ R ( \tau ) ] \approx \frac { 1 } { N } \sum _ { \epsilon ^ { i } , \tau ^ { i } } \left[ \sum _ { t = 0 } ^ { T - 1 } \nabla _ { \phi , \Sigma } \log \pi ( a _ { t } | s _ { t } ; \phi + \epsilon ^ { i } \Sigma ^ { \frac { 1 } { 2 } } ) R _ { t } ( \tau ^ { i } ) \right]
75
+ $$
76
+
77
+ for $N$ samples $\epsilon ^ { i } \sim \mathcal { N } ( 0 , I )$ and $\tau ^ { i } \sim ( \pi _ { \phi + \epsilon ^ { i } \Sigma ^ { \frac { 1 } { 2 } } } , p )$ π i 1 , p) (see Appendix B for a full derivation). Rather than updating $\Sigma$ according to the previously derived policy gradient, we fix its value to $\sigma ^ { 2 } I$ and scale it adaptively as described in Appendix $\textrm { C }$ .
78
+
79
+ # 4 EXPERIMENTS
80
+
81
+ This section answers the following questions:
82
+
83
+ (i) Do existing state-of-the-art RL algorithms benefit from incorporating parameter space noise? (ii) Does parameter space noise aid in exploring sparse reward environments more effectively? (iii) How does parameter space noise exploration compare against evolution strategies for deep policies (Salimans et al., 2017) with respect to sample efficiency?
84
+
85
+ Reference implementations of DQN and DDPG with adaptive parameter space noise are available online.4
86
+
87
+ # 4.1 COMPARING PARAMETER SPACE NOISE TO ACTION SPACE NOISE
88
+
89
+ The added value of parameter space noise over action space noise is measured on both highdimensional discrete-action environments and continuous control tasks. For the discrete environments, comparisons are made using DQN, while DDPG and TRPO are used on the continuous control tasks.
90
+
91
+ Discrete-action environments For discrete-action environments, we use the Arcade Learning Environment (ALE, Bellemare et al. (2013)) benchmark along with a standard DQN implementation. We compare a baseline DQN agent with $\epsilon$ -greedy action noise against a version of DQN with parameter noise. We linearly anneal $\epsilon$ from 1.0 to 0.1 over the first 1 million timesteps. For parameter noise, we adapt the scale using a simple heuristic that increases the scale if the KL divergence between perturbed and non-perturbed policy is less than the KL divergence between greedy and $\epsilon$ -greedy policy and decreases it otherwise (see Section C.1 for details). By using this approach, we achieve a fair comparison between action space noise and parameter space noise since the magnitude of the noise is similar and also avoid the introduction of an additional hyperparameter.
92
+
93
+ For parameter perturbation, we found it useful to reparametrize the network in terms of an explicit policy that represents the greedy policy $\pi$ implied by the $Q$ -values, rather than perturbing the $Q$ - function directly. To represent the policy $\pi ( \bar { a } | s )$ , we add a single fully connected layer after the convolutional part of the network, followed by a softmax output layer. Thus, $\pi$ predicts a discrete probability distribution over actions, given a state. We find that perturbing $\pi$ instead of $Q$ results in more meaningful changes since we now define an explicit behavioral policy. In this setting, the $Q$ -network is trained according to standard DQN practices. The policy $\pi$ is trained by maximizing the probability of outputting the greedy action accordingly to the current $Q$ -network. Essentially, the policy is trained to exhibit the same behavior as running greedy DQN. To rule out this double-headed version of DQN alone exhibits significantly different behavior, we always compare our parameter space noise approach against two baselines, regular DQN and two-headed DQN, both with $\epsilon$ -greedy exploration.
94
+
95
+ We furthermore randomly sample actions for the first 50 thousand timesteps in all cases to fill the replay buffer before starting training. Moreover, we found that parameter space noise performs better if it is combined with a bit of action space noise (we use a $\epsilon$ -greedy behavioral policy with $\epsilon = 0 . 0 1$ for the parameter space noise experiments). Full experimental details are described in Section A.1.
96
+
97
+ We chose 21 games of varying complexity, according to the taxonomy presented by (Bellemare et al., 2016). The learning curves are shown in Figure 1 for a selection of games (see Appendix $\mathrm { D }$ for full results). Each agent is trained for $4 0 \mathrm { M }$ frames. The overall performance is estimated by running each configuration with three different random seeds, and we plot the median return (line) as well as the interquartile range (shaded area). Note that performance is evaluated on the exploratory policy since we are interested in its behavior especially.
98
+
99
+ ![](images/61298c2cec88b6524d9066702f45ad6fdf5ec54531ce7bfda5d16661fe0eaab1.jpg)
100
+ Figure 1: Median DQN returns for several ALE environment plotted over training steps.
101
+
102
+ Overall, our results show that parameter space noise often outperforms action space noise, especially on games that require consistency (e.g. Enduro, Freeway) and performs comparably on the remaining ones. Additionally, learning progress usually starts much sooner when using parameter space noise. Finally, we also compare against a double-headed version of DQN with $\epsilon$ -greedy exploration to ensure that this change in architecture is not responsible for improved exploration, which our results confirm. Full results are available in Appendix D.
103
+
104
+ That being said, parameter space noise is unable to sufficiently explore in extremely challenging games like Montezuma’s Revenge. More sophisticated exploration methods like Bellemare et al. (2016) are likely necessary to successfully learn these games. However, such methods often rely on some form of “inner” exploration method, which is usually traditional action space noise. It would be interesting to evaluate the effect of parameter space noise when combined with exploration methods.
105
+
106
+ On a final note, proposed improvements to DQN like double DQN (Hasselt, 2010), prioritized experience replay (Schaul et al., 2015), and dueling networks (Wang et al., 2015) are orthogonal to our improvements and would therefore likely improve results further. We leave the experimental validation of this theory to future work.
107
+
108
+ Continuous control environments We now compare parameter noise with action noise on the continuous control environments implemented in OpenAI Gym (Brockman et al., 2016). We use DDPG (Lillicrap et al., 2015) as the RL algorithm for all environments with similar hyperparameters as outlined in the original paper except for the fact that layer normalization (Ba et al., 2016) is applied after each layer before the nonlinearity, which we found to be useful in either case and especially important for parameter space noise.
109
+
110
+ We compare the performance of the following configurations: (a) no noise at all, (b) uncorrelated additive Gaussian action space noise $\mathit { \check { \Delta } } ( \sigma \ : = \ : 0 . 2 )$ , (c) correlated additive Gaussian action space noise (Ornstein–Uhlenbeck process (Uhlenbeck & Ornstein, 1930) with $\sigma = 0 . 2$ ), and (d) adaptive parameter space noise. In the case of parameter space noise, we adapt the scale so that the resulting change in action space is comparable to our baselines with uncorrelated Gaussian action space noise (see Section C.2 for full details).
111
+
112
+ We evaluate the performance on several continuous control tasks. Figure 2 depicts the results for three exemplary environments. Each agent is trained for $1 \mathrm { M }$ timesteps, where 1 epoch consists of 10 thousand timesteps. In order to make results comparable between configurations, we evaluate the performance of the agent every 10 thousand steps by using no noise for 20 episodes.
113
+
114
+ On HalfCheetah, parameter space noise achieves significantly higher returns than all other configurations. We find that, in this environment, all other exploration schemes quickly converge to a local optimum (in which the agent learns to flip on its back and then “wiggles” its way forward). Parameter space noise behaves similarly initially but still explores other options and quickly learns to break out of this sub-optimal behavior. Also notice that parameter space noise vastly outperforms correlated action space noise on this environment, clearly indicating that there is a significant difference between the two. On the remaining two environments, parameter space noise performs on par with other exploration strategies. Notice, however, that even if no noise is present, DDPG is capable of learning good policies. We find that this is representative for the remaining environments (see Appendix E for full results), which indicates that these environments do not require a lot of exploration to begin with due to their well-shaped reward function.
115
+
116
+ ![](images/ed5e4dc14f2f4e226edf0f7a744591727c42bad859a813f8b660dc9acbd80f6a.jpg)
117
+ Figure 2: Median DDPG returns for continuous control environments plotted over epochs.
118
+
119
+ ![](images/9885e69cbf6d92a02c4f9106643bd1c3a89e6eea14dded2a98ab49cf4833fa0d.jpg)
120
+ Figure 3: Median TRPO returns for continuous control environments plotted over epochs.
121
+
122
+ The results for TRPO are depicted in Figure 3. Interestingly, in the Walker2D environment, we see that adding parameter noise decreases the performance variance between seeds. This indicates that parameter noise aids in escaping local optima.
123
+
124
+ # 4.2 DOES PARAMETER SPACE NOISE EXPLORE EFFICIENTLY?
125
+
126
+ The environments in the previous section required relatively little exploration. In this section, we evaluate whether parameter noise enables existing RL algorithms to learn on environments with very sparse rewards, where uncorrelated action noise generally fails (Osband et al., 2016a; Achiam & Sastry, 2017).
127
+
128
+ A scalable toy example We first evaluate parameter noise on a well-known toy problem, following the setup described by Osband et al. (2016a) as closely as possible. The environment consists of a chain of $N$ states and the agent always starts in state $s _ { 2 }$ , from where it can either move left or right. In state $s _ { 1 }$ , the agent receives a small reward of $r = 0 . 0 0 1$ and a larger reward $r = 1$ in state $s N$ Obviously, it is much easier to discover the small reward in $s _ { 1 }$ than the large reward in $s _ { N }$ , with increasing difficulty as $N$ grows. The environment is described in greater detail in Section A.3.
129
+
130
+ We compare adaptive parameter space noise DQN, bootstrapped DQN, and $\epsilon$ -greedy DQN. The chain length $N$ is varied and for each $N$ three different seeds are trained and evaluated. After each episode, we evaluate the performance of the current policy by performing a rollout with all noise disabled (in the case of bootstrapped DQN, we perform majority voting over all heads). The problem is considered solved if one hundred subsequent rollouts achieve the optimal return. We plot the median number of episodes before the problem is considered solved (we abort if the problem is still unsolved after 2 thousand episodes). Full experimental details are available in Section A.3.
131
+
132
+ ![](images/208427c53eb21b40688d677cb4a4c368547959526e7427aeda5d613f1a0514c8.jpg)
133
+ Figure 4: Median number of episodes before considered solved for DQN with different exploration strategies. Green indicates that the problem was solved whereas blue indicates that no solution was found within $2 \mathrm { K }$ episodes. Note that less number of episodes before solved is better.
134
+
135
+ Figure 4 shows that parameter space noise clearly outperforms action space noise (which completely fails for moderately large $N$ ) and even outperforms the more computational expensive bootstrapped DQN. However, it is important to note that this environment is extremely simple in the sense that the optimal strategy is to always go right. In a case where the agent needs to select a different optimal action depending on the current state, parameter space noise would likely work less well since weight randomization of the policy is less likely to yield this behavior. Our results thus only highlight the difference in exploration behavior compared to action space noise in this specific case. In the general case, parameter space noise does not guarantee optimal exploration.
136
+
137
+ Continuous control with sparse rewards We now make the continuous control environments more challenging for exploration. Instead of providing a reward at every timestep, we use environments that only yield a non-zero reward after significant progress towards a goal. More concretely, we consider the following environments from rllab5 (Duan et al., 2016), modified according to Houthooft et al. (2016): (a) SparseCartpoleSwingup, which only yields a reward if the paddle is raised above a given threshold, (b) SparseDoublePendulum, which only yields a reward if the agent reaches the upright position, and (c) SparseHalfCheetah, which only yields a reward if the agent crosses a target distance, (d) SparseMountainCar, which only yields a reward if the agent drives up the hill, (e) SwimmerGather, yields a positive or negative reward upon reaching targets. For all tasks, we use a time horizon of $T = 5 0 0$ steps before resetting.
138
+
139
+ ![](images/91903298f12e26c5532e4f7af5f4b44a90388d39284a7f835c28aa0f9717a6a8.jpg)
140
+ Figure 5: Median DDPG returns for environments with sparse rewards plotted over epochs.
141
+
142
+ We consider both DDPG and TRPO to solve these environments (the exact experimental setup is described in Section A.2). Figure 5 shows the performance of DDPG, while the results for TRPO have been moved to Appendix F. The overall performance is estimated by running each configuration with five different random seeds, after which we plot the median return (line) as well as the interquartile range (shaded area).
143
+
144
+ For DDPG, SparseDoublePendulum seems to be easy to solve in general, with even no noise finding a successful policy relatively quickly. The results for SparseCartpoleSwingup and SparseMountainCar are more interesting: Here, only parameter space noise is capable of learning successful policies since all other forms of noise, including correlated action space noise, never find states with nonzero rewards. For SparseHalfCheetah, DDPG at least finds the non-zero reward but never learns a successful policy from that signal. On the challenging SwimmerGather task, all configurations of DDPG fail.
145
+
146
+ Our results clearly show that parameter space noise can be used to improve the exploration behavior of these off-the-shelf algorithms. However, it is important to note that improvements in exploration are not guaranteed for the general case. It is therefore necessary to evaluate the potential benefit of parameter space noise on a case-by-case basis.
147
+
148
+ 4.3 IS RL WITH PARAMETER SPACE NOISE MORE SAMPLE-EFFICIENT THAN ES?
149
+
150
+ Evolution strategies (ES) are closely related to our approach since both explore by introducing noise in the parameter space, which can lead to improved exploration behavior (Salimans et al., 2017).6 However, ES disregards temporal information and uses black-box optimization to train the neural network. By combining parameter space noise with traditional RL algorithms, we can include temporal information as well rely on gradients computed by back-propagation for optimization while still benefiting from improved exploratory behavior. We now compare ES and traditional RL with parameter space noise directly.
151
+
152
+ We compare performance on the 21 ALE games that were used in Section 4.1. The performance is estimated by running 10 episodes for each seed using the final policy with exploration disabled and computing the median returns. For ES, we use the results obtained by Salimans et al. (2017), which were obtained after training on $1 0 0 0 \mathrm { M }$ frames. For DQN, we use the same parameter space noise for exploration that was previously described and train on $4 0 \mathrm { M }$ frames. Even though DQN with parameter space noise has been exposed to 25 times less data, it outperforms ES on 15 out of 21 Atari games (full results are available in Appendix D). Combined with the previously described results, this demonstrates that parameter space noise combines the desirable exploration properties of ES with the sample efficiency of traditional RL.
153
+
154
+ # 5 RELATED WORK
155
+
156
+ The problem of exploration in reinforcement has been studied extensively. A range of algorithms (Kearns & Singh, 2002; Brafman & Tennenholtz, 2002; Auer et al., 2008) have been proposed that guarantee near-optimal solutions after a number of steps that are polynomial in the number of states, number of actions, and the horizon time. However, in many real-world reinforcements learning problems both the state and action space are continuous and high dimensional so that, even with discretization, these algorithms become impractical. In the context of deep reinforcement learning, a large variety of techniques have been proposed to improve exploration (Stadie et al., 2015; Houthooft et al., 2016; Tang et al., 2016; Osband et al., 2016a; Ostrovski et al., 2017; Sukhbaatar et al., 2017; Osband et al., 2016b). However, all are non-trivial to implement and are often computational expensive.
157
+
158
+ The idea of perturbing the parameters of a policy has been proposed by Rückstieß et al. (2008) for policy gradient methods. The authors show that this form of perturbation generally outperforms random exploration and evaluate their exploration strategy with the REINFORCE (Williams, 1992a) and Natural Actor-Critic (Peters & Schaal, 2008) algorithms. However, their policies are relatively lowdimensional compared to modern deep architectures, they use environments with low-dimensional state spaces, and their contribution is strictly limited to the policy gradient case. In contrast, our method is applied and evaluated for both on and off-policy setting, we use high-dimensional policies, and environments with large state spaces.
159
+
160
+ Our work is also closely related to evolution strategies (ES, Rechenberg & Eigen (1973); Schwefel (1977)), and especially neural evolution strategies (NES, Sun et al. (2009a;b); Glasmachers et al. (2010a;b); Schaul et al. (2011); Wierstra et al. (2014)). In the context of policy optimization, our work is closely related to Kober & Peters (2008) and Sehnke et al. (2010). More recently, Salimans et al. (2017) showed that ES can work for high-dimensional environments like Atari and OpenAI Gym continuous control problems. However, ES generally disregards any temporal structure that may be present in trajectories and typically suffers from sample inefficiency.
161
+
162
+ Bootstrapped DQN (Osband et al., 2016a) has been proposed to aid with more directed and consistent exploration by using a network with multiple heads, where one specific head is selected at the beginning of each episode. In contrast, our approach perturbs the parameters of the network directly, thus achieving similar yet simpler (and as shown in Section 4.2, sometimes superior) exploration behavior. Concurrently to our work, Fortunato et al. (2017) have proposed a similar approach that utilizes parameter perturbations for more efficient exploration.
163
+
164
+ # 6 CONCLUSION
165
+
166
+ In this work, we propose parameter space noise as a conceptually simple yet effective replacement for traditional action space noise like $\epsilon$ -greedy and additive Gaussian noise. This work shows that parameter perturbations can successfully be combined with contemporary on- and off-policy deep RL algorithms such as DQN, DDPG, and TRPO and often results in improved performance compared to action noise. Experimental results further demonstrate that using parameter noise allows solving environments with very sparse rewards, in which action noise is unlikely to succeed. Our results indicate that parameter space noise is a viable and interesting alternative to action space noise, which is still the de facto standard in most reinforcement learning applications.
167
+
168
+ # REFERENCES
169
+
170
+ Joshua Achiam and Shankar Sastry. Surprise-based intrinsic motivation for deep reinforcement learning. arXiv preprint arXiv:1703.01732, 2017.
171
+ Peter Auer, Thomas Jaksch, and Ronald Ortner. Near-optimal regret bounds for reinforcement learning. In Advances in Neural Information Processing Systems 21 (NIPS), pp. 89–96, 2008. URL http://papers.nips.cc/paper/ 3401-near-optimal-regret-bounds-for-reinforcement-learning.
172
+ Lei Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. CoRR, abs/1607.06450, 2016. URL http://arxiv.org/abs/1607.06450.
173
+ Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013. doi: 10.1613/jair.3912. URL http://dx.doi.org/10.1613/jair.3912.
174
+ Marc G 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 29 (NIPS), pp. 1471–1479, 2016.
175
+ Ronen I. Brafman and Moshe Tennenholtz. R-MAX - A general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research, 3:213–231, 2002. URL http://www. jmlr.org/papers/v3/brafman02a.html.
176
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI gym. arXiv preprint arXiv:1606.01540, 2016. URL http://arxiv.org/abs/1606. 01540.
177
+ Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continous control. In Proceedings of the 33rd International Conference on Machine Learning (ICML), pp. 1329–1338, 2016.
178
+ Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017.
179
+
180
+ Tobias Glasmachers, Tom Schaul, and Jürgen Schmidhuber. A natural evolution strategy for multi-objective optimization. In Parallel Problem Solving from Nature - PPSN XI, 11th International Conference, Kraków, Poland, September 11-15, 2010, Proceedings, Part I, pp. 627–636, 2010a. doi: 10.1007/978-3-642-15844-5_ 63. URL https://doi.org/10.1007/978-3-642-15844-5_63.
181
+
182
+ Tobias Glasmachers, Tom Schaul, Yi Sun, Daan Wierstra, and Jürgen Schmidhuber. Exponential natural evolution strategies. In Genetic and Evolutionary Computation Conference, GECCO 2010, Proceedings, Portland, Oregon, USA, July 7-11, 2010, pp. 393–400, 2010b. doi: 10.1145/1830483.1830557. URL http://doi.acm.org/10.1145/1830483.1830557.
183
+
184
+ Hado V Hasselt. Double Q-learning. In Advances in Neural Information Processing Systems 23 (NIPS), pp. 2613–2621, 2010.
185
+
186
+ Rein Houthooft, Xi Chen, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. VIME: Variational information maximizing exploration. In Advances in Neural Information Processing Systems 29 (NIPS), pp. 1109–1117, 2016. URL http://papers.nips.cc/paper/ 6591-vime-variational-information-maximizing-exploration.
187
+
188
+ Sham Kakade. A natural policy gradient. Advances in neural information processing systems, 14:1531–1538, 2001.
189
+
190
+ Michael J. Kearns and Satinder P. Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209–232, 2002. doi: 10.1023/A:1017984413808. URL http://dx.doi.org/10. 1023/A:1017984413808.
191
+
192
+ Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2015.
193
+
194
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
195
+
196
+ Jens Kober and Jan Peters. Policy search for motor primitives in robotics. In Advances in Neural Information Processing Systems 21 (NIPS), pp. 849–856, 2008. URL http://papers.nips.cc/paper/ 3545-policy-search-for-motor-primitives-in-robotics.
197
+
198
+ 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, abs/1509.02971, 2015. URL http://arxiv.org/abs/1509.02971.
199
+
200
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin A. Riedmiller, Andreas Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. doi: 10.1038/nature14236. URL http://dx.doi.org/10.1038/nature14236.
201
+
202
+ Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In Advances in Neural Information Processing Systems 29 (NIPS), pp. 4026–4034, 2016a. URL http://papers.nips.cc/paper/6501-deep-exploration-via-bootstrapped-dqn.
203
+
204
+ Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. In Proceedings of the 33nd International Conference on Machine Learning, ICML, pp. 2377–2386, 2016b. URL http://jmlr.org/proceedings/papers/v48/osband16.html.
205
+
206
+ Georg Ostrovski, Marc G. Bellemare, Aäron van den Oord, and Rémi Munos. Count-based exploration with neural density models. arXiv preprint arXiv:1703.01310, 2017. URL http://arxiv.org/abs/1703. 01310.
207
+
208
+ Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by selfsupervised prediction. In ICML, 2017.
209
+
210
+ Jan Peters and Stefan Schaal. Natural actor-critic. Neurocomputing, 71(7-9):1180–1190, 2008. doi: 10.1016/j. neucom.2007.11.026. URL http://dx.doi.org/10.1016/j.neucom.2007.11.026.
211
+
212
+ Ananth Ranganathan. The Levenberg-Marquardt algorithm. Tutoral on LM algorithm, pp. 1–5, 2004.
213
+
214
+ Ingo Rechenberg and Manfred Eigen. Evolutionsstrategie: Optimierung technischer Systeme nach Prinzipien der biologishen Evolution. Frommann-Holzboog Stuttgart, 1973.
215
+
216
+ Thomas Rückstieß, Martin Felder, and Jürgen Schmidhuber. State-dependent exploration for policy gradient methods. In Proceedings of the European Conference on Machine Learning and Knowledge Discovery in Databases ECML/PKDD, pp. 234–249, 2008. doi: 10.1007/978-3-540-87481-2_16. URL http: //dx.doi.org/10.1007/978-3-540-87481-2_16.
217
+
218
+ Thomas Rückstieß, Martin Felder, and Jürgen Schmidhuber. State-dependent exploration for policy gradient methods. Machine Learning and Knowledge Discovery in Databases, pp. 234–249, 2008.
219
+
220
+ Tim Salimans, Jonathan Ho, Xi Chen, and Ilya Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864, 2017. URL http://arxiv.org/abs/1703. 03864.
221
+
222
+ Tom Schaul, Tobias Glasmachers, and Jürgen Schmidhuber. High dimensions and heavy tails for natural evolution strategies. In 13th Annual Genetic and Evolutionary Computation Conference, GECCO 2011, Proceedings, Dublin, Ireland, July 12-16, 2011, pp. 845–852, 2011. doi: 10.1145/2001576.2001692. URL http://doi.acm.org/10.1145/2001576.2001692.
223
+
224
+ Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
225
+
226
+ John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1889–1897, 2015a.
227
+
228
+ John Schulman, Sergey Levine, Pieter Abbeel, Michael I. Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pp. 1889–1897, 2015b. URL http://jmlr.org/proceedings/papers/ v37/schulman15.html.
229
+
230
+ Hans-Paul Schwefel. Numerische Optimierung von Computermodellen mittels der Evolutionsstrategie, volume 1. Birkhäuser, Basel Switzerland, 1977.
231
+
232
+ Frank Sehnke, Christian Osendorfer, Thomas Rückstieß, Alex Graves, Jan Peters, and Jürgen Schmidhuber. Parameter-exploring policy gradients. Neural Networks, 23(4):551–559, 2010. doi: 10.1016/j.neunet.2009.12. 004. URL http://dx.doi.org/10.1016/j.neunet.2009.12.004.
233
+
234
+ Bradly C. Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. arXiv preprint arXiv:1507.00814, 2015. URL http://arxiv.org/abs/1507. 00814.
235
+
236
+ Sainbayar Sukhbaatar, Ilya Kostrikov, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. arXiv preprint arXiv:1703.05407, 2017. URL http://arxiv.org/ abs/1703.05407.
237
+
238
+ Yi Sun, Daan Wierstra, Tom Schaul, and Jürgen Schmidhuber. Stochastic search using the natural gradient. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML 2009, Montreal, Quebec, Canada, June 14-18, 2009, pp. 1161–1168, 2009a. doi: 10.1145/1553374.1553522. URL http: //doi.acm.org/10.1145/1553374.1553522.
239
+
240
+ Yi Sun, Daan Wierstra, Tom Schaul, and Jürgen Schmidhuber. Efficient natural evolution strategies. In Genetic and Evolutionary Computation Conference, GECCO 2009, Proceedings, Montreal, Québec, Canada, July 8-12, 2009, pp. 539–546, 2009b. doi: 10.1145/1569901.1569976. URL http://doi.acm.org/10. 1145/1569901.1569976.
241
+
242
+ Richard S Sutton and Andrew G Barto. Introduction to reinforcement learning, volume 135. MIT Press Cambridge, 1998.
243
+
244
+ Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. #Exploration: A study of count-based exploration for deep reinforcement learning. arXiv preprint arXiv:1611.04717, 2016.
245
+
246
+ George E Uhlenbeck and Leonard S Ornstein. On the theory of the brownian motion. Physical review, 36(5): 823, 1930.
247
+
248
+ 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.
249
+
250
+ Daan Wierstra, Tom Schaul, Tobias Glasmachers, Yi Sun, Jan Peters, and Jürgen Schmidhuber. Natural evolution strategies. Journal of Machine Learning Research, 15(1):949–980, 2014. URL http://dl.acm.org/ citation.cfm?id $= _ { c } ^ { \prime }$ 2638566.
251
+
252
+ Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992a. doi: 10.1007/BF00992696. URL http://dx.doi.org/10. 1007/BF00992696.
253
+
254
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992b.
255
+
256
+ # A EXPERIMENTAL SETUP
257
+
258
+ # A.1 ARCADE LEARNING ENVIRONMENT (ALE)
259
+
260
+ For ALE (Bellemare et al., 2013), the network architecture as described in Mnih et al. (2015) is used. This consists of 3 convolutional layers (32 filters of size $8 \times 8$ and stride 4, 64 filters of size $4 \times 4$ and stride 2, 64 filters of size $3 \times 3$ and stride 1) followed by 1 hidden layer with 512 units followed by a linear output layer with one unit for each action. ReLUs are used in each layer, while layer normalization (Ba et al., 2016) is used in the fully connected part of the network. For parameter space noise, we also include a second head after the convolutional stack of layers. This head determines a policy network with the same architecture as the $Q$ -value network, except for a softmax output layer. The target networks are updated every $1 0 \mathrm { K }$ timesteps. The $Q$ -value network is trained using the Adam optimizer (Kingma & Ba, 2015) with a learning rate of $1 0 ^ { - 4 }$ and a batch size of 32. The replay buffer can hold $1 \mathrm { M }$ state transitions. For the $\epsilon$ -greedy baseline, we linearly anneal $\epsilon$ from 1 to 0.1 over the first $1 \mathrm { M }$ timesteps. For parameter space noise, we adaptively scale the noise to have a similar effect in action space (see Section C.1 for details), effectively ensuring that the maximum KL divergence between perturbed and non-perturbed $\pi$ is softly enforced. The policy is perturbed at the beginning of each episode and the standard deviation is adapted as described in Appendix C every 50 timesteps. Notice that we only perturb the policy head after the convolutional part of the network (i.e. the fully connected part, which is also why we only include layer normalization in this part of the network). To avoid getting stuck (which can potentially happen for a perturbed policy), we also use $\epsilon$ -greedy action selection with $\epsilon = 0 . 0 1$ . In all cases, we perform $5 0 \mathrm { K }$ random actions to collect initial data for the replay buffer before training starts. We set $\gamma = 0 . 9 9$ , clip rewards to be in $[ - 1 , 1 ]$ , and clip gradients for the output layer of $Q$ to be within $[ - 1 , 1 ]$ . For observations, each frame is down-sampled to $8 4 \times 8 4$ pixels, after which it is converted to grayscale. The actual observation to the network consists of a concatenation of 4 subsequent frames. Additionally, we use up to 30 noop actions at the beginning of the episode. This setup is identical to what is described by Mnih et al. (2015).
261
+
262
+ # A.2 CONTINUOUS CONTROL
263
+
264
+ For DDPG, we use a similar network architecture as described by Lillicrap et al. (2015): both the actor and critic use 2 hidden layers with 64 ReLU units each. For the critic, actions are not included until the second hidden layer. Layer normalization (Ba et al., 2016) is applied to all layers. The target networks are soft-updated with $\tau = 0 . 0 0 1$ . The critic is trained with a learning rate of $1 0 ^ { - 3 }$ while the actor uses a learning rate of $1 0 ^ { - 4 }$ . Both actor and critic are updated using the Adam optimizer (Kingma & Ba, 2015) with batch sizes of 128. The critic is regularized using an $L 2$ penalty with $1 0 ^ { - 2 }$ . The replay buffer holds $1 0 0 \mathrm { K }$ state transitions and $\gamma = 0 . 9 9$ is used. Each observation dimension is normalized by an online estimate of the mean and variance. For parameter space noise with DDPG, we adaptively scale the noise to be comparable to the respective action space noise (see Section C.2). For dense environments, we use action space noise with $\sigma = 0 . 2$ (and a comparable adaptive noise scale). Sparse environments use an action space noise with $\sigma = 0 . 6$ (and a comparable adaptive noise scale).
265
+
266
+ TRPO uses a step size of $\delta _ { \mathrm { K L } } = 0 . 0 1$ , a policy network of 2 hidden layers with 32 tanh units for the nonlocomotion tasks, and 2 hidden layers of 64 tanh units for the locomotion tasks. The Hessian calculation is subsampled with a factor of 0.1, $\gamma = 0 . 9 9$ , and the batch size per epoch is set to $5 \mathrm { K }$ timesteps. The baseline is a learned linear transformation of the observations.
267
+
268
+ The following environments from OpenAI $\mathrm { G y m } ^ { 7 }$ (Brockman et al., 2016) are used:
269
+
270
+ • HalfCheetah $\mathcal { S } \subset \mathbb { R } ^ { 1 7 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 6 }$ ), • Hopper $S \subset \mathbb { R } ^ { 1 1 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 3 }$ ), • InvertedDoublePendulum $( S \subset \mathbb { R } ^ { 1 1 } , \mathcal { A } \subset \mathbb { R } )$ , • InvertedPendulum $( S \subset \mathbb { R } ^ { 4 } , \mathcal { A } \subset \mathbb { R } )$ , • Reacher $\mathcal { S } \subset \mathbb { R } ^ { 1 1 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 2 }$ ), • Swimmer $\mathcal { S } \subset \mathbb { R } ^ { 8 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 2 }$ ), and • Walker2D $S \subset \mathbb { R } ^ { 1 7 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 6 }$ ).
271
+
272
+ For the sparse tasks, we use the following environments from rllab8 (Duan et al., 2016), modified as described by Houthooft et al. (2016):
273
+
274
+ • SparseCartpoleSwingup $\mathcal { S } \subset \mathbb { R } ^ { 4 }$ , ${ \mathcal { A } } \subset \mathbb { R }$ ), which only yields a reward if the paddle is raised above a given threshold,
275
+ • SparseHalfCheetah $( \mathcal { S } \subset \mathbb { R } ^ { 1 7 } , \mathcal { A } \subset \mathbb { R } ^ { 6 } )$ , which only yields a reward if the agent crosses a distance threshold,
276
+ • SparseMountainCar $\mathcal { S } \subset \mathbb { R } ^ { 2 }$ , ${ \mathcal { A } } \subset \mathbb { R }$ ), which only yields a reward if the agent drives up the hill,
277
+ • SparseDoublePendulum $( S \subset \mathbb { R } ^ { 6 } , \mathcal { A } \subset \mathbb { R } )$ , which only yields a reward if the agent reaches the upright position, and
278
+ • SwimmerGather $\mathcal { S } \subset \mathbb { R } ^ { 3 3 }$ , $\mathcal { A } \subset \mathbb { R } ^ { 2 }$ ), which yields a positive or negative reward upon reaching targets.
279
+
280
+ # A.3 CHAIN ENVIRONMENT
281
+
282
+ We follow the state encoding proposed by Osband et al. (2016a) and use $\phi ( s _ { t } ) = ( \mathbb { 1 } \{ x \leq s _ { t } \} )$ as the observation, where 1 denotes the indicator function. DQN is used with a very simple network to approximate the $Q$ -value function that consists of 2 hidden layers with 16 ReLU units. Layer normalization (Ba et al., 2016) is used for all hidden layers before applying the nonlinearity. Each agent is then trained for up to $2 \mathrm { K }$ episodes. The chain length $N$ is varied and for each $N$ three different seeds are trained and evaluated. After each episode, the performance of the current policy is evaluated by sampling a trajectory with noise disabled (in the case of bootstrapped DQN, majority voting over all heads is performed). The problem is considered solved if one hundred subsequent trajectories achieve the optimal episode return. Figure 6 depicts the environment.
283
+
284
+ ![](images/5cc78f484cfabcc31591952238afef3a067b6d32169fc2c1b40242738d1c3213.jpg)
285
+ Figure 6: Simple and scalable environment to test for exploratory behavior (Osband et al., 2016a).
286
+
287
+ We compare adaptive parameter space noise DQN, bootstrapped DQN (Osband et al., 2016a) (with $K = 2 0$ heads and Bernoulli masking with $p = 0 . 5 $ ), and $\epsilon$ -greedy DQN (with $\epsilon$ linearly annealed from 1.0 to 0.1 over the first one hundred episodes). For adaptive parameter space noise, we only use a single head and perturb $Q$ directly, which works well in this setting. Parameter space noise is adaptively scaled so that $\delta \approx 0 . 0 5$ . In all cases, $\gamma = 0 . 9 9 9$ , the replay buffer holds $1 0 0 \mathrm { K }$ state transitions, learning starts after 5 initial episodes, the target network is updated every 100 timesteps, and the network is trained using the Adam optimizer (Kingma & Ba, 2015) with a learning rate of $1 0 ^ { - 3 }$ and a batch size of 32.
288
+
289
+ # B PARAMETER SPACE NOISE FOR ON-POLICY METHODS
290
+
291
+ Policy gradient methods optimize $\mathbb { E } _ { \tau \sim ( \pi , p ) } [ R ( \tau ) ]$ . Given a stochastic policy $\pi _ { \boldsymbol { \theta } } ( a | \boldsymbol { s } )$ with $\theta \sim$ $\mathcal { N } ( \phi , \Sigma )$ , the expected return can be expanded using likelihood ratios and the reparametrization trick (Kingma & Welling, 2013) as
292
+
293
+ $$
294
+ \begin{array} { r l } & { \nabla _ { \phi , \Sigma } \mathbb { E } _ { \tau } [ R ( \tau ) ] = \nabla _ { \phi , \Sigma } \mathbb { E } _ { \theta \sim N ( \phi , \Sigma ) } \left[ \displaystyle \sum _ { \tau } p ( \tau | \theta ) R ( \tau ) \right] } \\ & { \qquad = \mathbb { E } _ { \epsilon \sim N ( 0 , I ) } \nabla _ { \phi , \Sigma } \left[ \displaystyle \sum _ { \tau } p ( \tau | \phi + \epsilon \Sigma ^ { \frac { 1 } { 2 } } ) R ( \tau ) \right] } \\ & { \qquad = \mathbb { E } _ { \epsilon \sim N ( 0 , I ) , \tau } \left[ \displaystyle \sum _ { t = 0 } ^ { T - 1 } \nabla _ { \phi , \Sigma } \log \pi ( a _ { t } | s _ { t } ; \phi + \epsilon \Sigma ^ { \frac { 1 } { 2 } } ) R _ { t } ( \tau ) \right] } \\ & { \qquad \approx \displaystyle \frac { 1 } { N } \sum _ { \epsilon \sim \tau ^ { \prime \prime } } \left[ \displaystyle \sum _ { t = 0 } ^ { T - 1 } \nabla _ { \phi , \Sigma } \log \pi ( a _ { t } | s _ { t } ; \phi + \epsilon ^ { i } \Sigma ^ { \frac { 1 } { 2 } } ) R _ { t } ( \tau ^ { i } ) \right] } \end{array}
295
+ $$
296
+
297
+ for $N$ samples $\epsilon ^ { i } \sim \mathcal { N } ( 0 , I )$ and $\tau ^ { i } \sim ( \pi _ { \phi + \epsilon ^ { i } \Sigma ^ { \frac { 1 } { 2 } } } , p )$ , with $\begin{array} { r } { R _ { t } ( \tau ^ { i } ) = \sum _ { t ^ { \prime } = t } ^ { T } \gamma ^ { t ^ { \prime } - t } r _ { t ^ { \prime } } ^ { i } } \end{array}$ . This also allows us to subtract a variance-reducing baseline $b _ { t } ^ { i }$ , leading to
298
+
299
+ $$
300
+ \nabla _ { \phi , \Sigma } \mathbb { E } _ { \tau } [ R ( \tau ) ] \approx \frac { 1 } { N } \sum _ { \epsilon ^ { i } , \tau ^ { i } } \left[ \sum _ { t = 0 } ^ { T - 1 } \nabla _ { \phi , \Sigma } \log \pi ( a _ { t } | s _ { t } ; \phi + \epsilon ^ { i } \Sigma ^ { \frac { 1 } { 2 } } ) ( R _ { t } ( \tau ^ { i } ) - b _ { t } ^ { i } ) \right] .
301
+ $$
302
+
303
+ In our case, we set $\Sigma : = \sigma ^ { 2 } I$ and use our proposed adaption method to re-scale as appropriate.
304
+
305
+ # C ADAPTIVE SCALING
306
+
307
+ Parameter space noise requires us to pick a suitable scale $\sigma$ . This can be problematic since the scale will highly depend on the specific network architecture, and is likely to vary over time as parameters become more sensitive as learning progresses. Additionally, while it is easy to intuitively grasp the scale of action space noise, it is far harder to understand the scale in parameter space.
308
+
309
+ We propose a simple solution that resolves all aforementioned limitations in an easy and straightforward way. This is achieved by adapting the scale of the parameter space noise over time, thus using a time-varying scale $\sigma _ { k }$ . Furthermore, $\sigma _ { k }$ is related to the action space variance that it induces, and updated accordingly. Concretely, we use the following simple heuristic to update $\sigma _ { k }$ every $K$ timesteps:
310
+
311
+ $$
312
+ \sigma _ { k + 1 } = { \left\{ \begin{array} { l l } { \alpha \sigma _ { k } , } & { { \mathrm { i f ~ } } d ( \pi , { \widetilde { \pi } } ) < \delta } \\ { { \frac { 1 } { \alpha } } \sigma _ { k } , } & { { \mathrm { o t h e r w i s e } } , } \end{array} \right. }
313
+ $$
314
+
315
+ where $d ( \cdot , \cdot )$ denotes some distance between the non-perturbed and perturbed policy (thus measuring in action space), $\alpha \in \mathbb { R } _ { > 0 }$ is used to rescale $\sigma _ { k }$ , and $\delta \in \mathbb { R } _ { > 0 }$ denotes some threshold value. This idea is based on the Levenberg-Marquardt heuristic (Ranganathan, 2004). The concrete distance measure and appropriate choice of $\delta$ depends on the policy representation. In the following sections, we outline our choice of $d ( \cdot , \cdot )$ for methods that do (DDPG and TRPO) and do not (DQN) use behavioral policies. In our experiments, we always use $\alpha = 1 . 0 1$ .
316
+
317
+ # C.1 A DISTANCE MEASURE FOR DQN
318
+
319
+ For DQN, the policy is defined implicitly by the $Q$ -value function. Unfortunately, this means that a naïve distance measure between $Q$ and $\widetilde { Q }$ has pitfalls. For example, assume that the perturbed policy has only changed the bias of the final layer, thus adding a constant value to each action’s $Q$ -value. In this case, a naïve distance measure like the norm $\lVert Q - \widetilde { Q } \rVert _ { 2 }$ would be nonzero, although the policies $\pi$ and $\widetilde { \pi }$ (implied by $Q$ and $\widetilde { Q }$ , respectively) are exactly equal. This equally applies to the case where eDQN as two heads, one for $Q$ and one for $\pi$ .
320
+
321
+ We therefore use a probabilistic formulation9 for both the non-perturbed and perturbed policies: $\pi , \widetilde { \pi } : \mathcal { S } \times \mathcal { A } \mapsto [ 0 , 1 ]$ by applying the softmax function over predicted $Q$ values: $\pi ( s ) = \exp Q _ { i } ( s ) / { \sum _ { i } \exp \bar { Q } _ { i } ( \dot { s } ) }$ , where $Q _ { i } ( \cdot )$ denotes the $Q$ -value of the $i$ -th action. $\widetilde { \pi }$ is defined analogously but uses the perturbed $\widetilde { Q }$ instead (or the perturbed head for $\pi$ ). Using this probabilistic formulation of the policies, we can now measure the distance in action space:
322
+
323
+ $$
324
+ d ( \pi , { \widetilde { \pi } } ) = D _ { \mathrm { K L } } ( \pi \parallel { \widetilde { \pi } } ) ,
325
+ $$
326
+
327
+ where $D _ { \mathrm { K L } } ( \cdot \parallel \cdot )$ denotes the Kullback-Leibler (KL) divergence. This formulation effectively normalizes the $Q$ -values and therefore does not suffer from the problem previously outlined.
328
+
329
+ We can further relate this distance measure to $\epsilon$ -greedy action space noise, which allows us to fairly compare the two approaches and also avoids the need to pick an additional hyperparameter $\delta$ . More concretely, the KL divergence between a greedy policy ${ \bar { \pi } } ( s , a ) = 1$ for $a = \mathrm { a r g m a x } _ { a ^ { \prime } } Q ( s , a ^ { \prime } )$ and $\pi ( s , a ) = 0$ otherwise and an $\epsilon$ -greedy policy $\begin{array} { r } { \widehat { \pi } ( s , a ) = 1 - \epsilon + \frac { \epsilon } { | A | } } \end{array}$ for $a = \mathrm { a r g m a x } _ { a ^ { \prime } } Q ( s , a ^ { \prime } )$ and $\textstyle { \widehat { \pi } } ( s , a ) = { \frac { \epsilon } { | { \mathcal { A } } | } }$ otherwise is $\begin{array} { r } { D _ { \mathrm { K L } } ( \pi \parallel \widehat { \pi } ) = - \log \left( 1 - \epsilon + \frac { \epsilon } { | A | } \right) } \end{array}$ , where $| { \cal { A } } |$ denotes the number of actions (this follows immediately from the definition of the KL divergence for discrete probability distributions). We can use this distance measure to relate action space noise and parameter space noise to have similar distances, by adaptively scaling $\sigma$ so that it matches the KL divergence between greedy and $\epsilon$ -greedy policy, thus setting $\begin{array} { r } { \delta : = - \log { ( 1 - \epsilon + \frac { \epsilon } { | A | } ) } } \end{array}$ .
330
+
331
+ # C.2 A DISTANCE MEASURE FOR DDPG
332
+
333
+ For DDPG, we relate noise induced by parameter space perturbations to noise induced by additive Gaussian noise. To do so, we use the following distance measure between the non-perturbed and perturbed policy:
334
+
335
+ $$
336
+ d ( \pi , { \widetilde { \pi } } ) = { \sqrt { { \frac { 1 } { N } } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { s } \left[ { \big ( } \pi ( s ) _ { i } - { \widetilde { \pi } } ( s ) _ { i } { \big ) } ^ { 2 } \right] } } ,
337
+ $$
338
+
339
+ where $\mathbb { E } _ { s } [ \cdot ]$ is estimated from a batch of states from the replay buffer and $N$ denotes the dimension of the action space (i.e. $\mathcal { A } \subset \mathbb { R } ^ { N }$ ). It is easy to show that $d ( \pi , \dot { \pi } + \mathcal { N } ( 0 , \sigma ^ { 2 } I ) ) = \sigma$ . Setting $\delta : = \sigma$ as the adaptive parameter space threshold thus results in effective action space noise that has the same standard deviation as regular Gaussian action space noise.
340
+
341
+ # C.3 A DISTANCE MEASURE FOR TRPO
342
+
343
+ In order to scale the noise for TRPO, we adapt the sampled noise vectors $\epsilon \sigma$ by computing a natural step $H ^ { - 1 } \epsilon \sigma$ . We essentially compute a trust region around the noise direction to ensure that the perturbed policy $\widetilde { \pi }$ remains sufficiently close to the non-perturbed version via
344
+
345
+ $$
346
+ \begin{array} { r } { E _ { s \sim \rho _ { \widetilde { \theta } } } [ D _ { \mathrm { K L } } ( \pi _ { \widetilde { \theta } } ( \cdot | s ) | | \pi _ { \theta } ( \cdot | s ) ) ] \leq \delta _ { \mathrm { K L } } . } \end{array}
347
+ $$
348
+
349
+ Concretely, this is computed through the conjugate gradient algorithm, combined with a line search along the noise direction to ensure constraint conformation, as described in Appendix C of Schulman et al. (2015b).
350
+
351
+ # D ADDITIONAL RESULTS ON ALE
352
+
353
+ Figure 7 provide the learning curves for all 21 Atari games.
354
+
355
+ Table 1 compares the final performance of ES after $1 0 0 0 \mathrm { M }$ frames to the final performance of DQN with $\epsilon$ -greedy exploration and parameter space noise exploration after $4 0 \mathrm { M }$ frames. In all cases, the performance is estimated by running 10 episodes with exploration disabled. We use the numbers reported by Salimans et al. (2017) for ES and report the median return across three seeds for DQN.
356
+
357
+ ![](images/a36375faf74b9b1009d28e6408616c1843c710707084f0688c798c9517b56a5d.jpg)
358
+ Figure 7: Median DQN returns for all ALE environment plotted over training steps.
359
+
360
+ Table 1: Performance comparison between Evolution Strategies (ES) as reported by Salimans et al. (2017), DQN with $\epsilon$ -greedy, and DQN with parameter space noise (this paper). ES was trained on $1 0 0 0 \mathrm { M }$ , while DQN was trained on only $4 0 \mathrm { M }$ frames.
361
+
362
+ <table><tr><td>Game</td><td>ES DQN w/ e-greedy</td><td>DQN w/ param noise</td><td></td></tr><tr><td>Alien</td><td>994.0</td><td>1535.0</td><td>2070.0</td></tr><tr><td>Amidar</td><td>112.0</td><td>281.0</td><td>403.5</td></tr><tr><td>BankHeist</td><td>225.0</td><td>510.0</td><td>805.0</td></tr><tr><td>BeamRider</td><td>744.0</td><td>8184.0</td><td>7884.0</td></tr><tr><td>Breakout</td><td>9.5</td><td>406.0</td><td>390.5</td></tr><tr><td>Enduro</td><td>95.0</td><td>1094</td><td>1672.5</td></tr><tr><td>Freeway</td><td>31.0</td><td>32.0</td><td>31.5</td></tr><tr><td>Frostbite</td><td>370.0</td><td>250.0</td><td>1310.0</td></tr><tr><td>Gravitar</td><td>805.0</td><td>300.0</td><td>250.0</td></tr><tr><td>MontezumaRevenge</td><td>0.0</td><td>0.0</td><td>0.0</td></tr><tr><td>Pitfall</td><td>0.0</td><td>-73.0</td><td>-100.0</td></tr><tr><td>Pong</td><td>21.0</td><td>21.0</td><td>20.0</td></tr><tr><td>PrivateEye</td><td>100.0</td><td>133.0</td><td>100.0</td></tr><tr><td>Qbert</td><td>147.5</td><td>7625.0</td><td>7525.0</td></tr><tr><td>Seaquest</td><td>1390.0</td><td>8335.0</td><td>8920.0</td></tr><tr><td>Solaris</td><td>2090.0</td><td>720.0</td><td>400.0</td></tr><tr><td>SpaceInvaders</td><td>678.5</td><td>1000.0</td><td>1205.0</td></tr><tr><td>Tutankham</td><td>130.3</td><td>109.5</td><td>181.0</td></tr><tr><td>Venture</td><td>760.0</td><td>0</td><td>0</td></tr><tr><td>WizardOfWor</td><td>3480.0</td><td>2350.0</td><td>1850.0</td></tr><tr><td>Zaxxon</td><td>6380.0</td><td>8100.0</td><td>8050.0</td></tr></table>
363
+
364
+ # E ADDITIONAL RESULTS ON CONTINUOUS CONTROL WITH SHAPED REWARDS
365
+
366
+ For completeness, we provide the plots for all evaluated environments with dense rewards. The results are depicted in Figure 8.
367
+
368
+ ![](images/eceea1288c26a6255041a87cf6149ab0ed62c5d0539461b469aad2d18badd246.jpg)
369
+ Figure 8: Median DDPG returns for all evaluated environments with dense rewards plotted over epochs.
370
+
371
+ The results for InvertedPendulum and InvertedDoublePendulum are very noisy due to the fact that a small change in policy can easily degrade performance significantly, and thus hard to read. Interestingly, adaptive parameter space noise achieves the most stable performance on InvertedDoublePendulum. Overall, performance is comparable to other exploration approaches. Again, no noise in either the action nor the parameter space achieves comparable results, indicating that these environments combined with DDPG are not well-suited to test for exploration.
372
+
373
+ # F ADDITIONAL RESULTS ON CONTINUOUS CONTROL WITH SPARSE REWARDS
374
+
375
+ The performance of TRPO with noise scaled according to the parameter curvature, as defined in Section C.3 is shown in Figure 9. The TRPO baseline uses only action noise by using a policy network that outputs the mean of a Gaussian distribution, while the variance is learned. These results show that adding parameter space noise aids in either learning much more consistently on these challenging sparse environments.
376
+
377
+ ![](images/a1aa594787adef36f0e6c8fed77cae227776d9a490e04329cc45723017eece08.jpg)
378
+ Figure 9: Median TRPO returns with three different environments with sparse rewards plotted over epochs.
md/train/ByxT7TNFvH/ByxT7TNFvH.md ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEMANTICALLY-GUIDED REPRESENTATION LEARNING FOR SELF-SUPERVISED MONOCULAR DEPTH
2
+
3
+ Vitor Guizilini1 Rui Hou1,2 Jie Li1 Rares, Ambrus, 1 Adrien Gaidon1
4
+
5
+ 1Toyota Research Institute (TRI) {first.last}@tri.global
6
+
7
+ 2University of Michigan rayhou@umich.edu
8
+
9
+ # ABSTRACT
10
+
11
+ Self-supervised learning is showing great promise for monocular depth estimation, using geometry as the only source of supervision. Depth networks are indeed capable of learning representations that relate visual appearance to 3D properties by implicitly leveraging category-level patterns. In this work we investigate how to leverage more directly this semantic structure to guide geometric representation learning, while remaining in the self-supervised regime. Instead of using semantic labels and proxy losses in a multi-task approach, we propose a new architecture leveraging fixed pretrained semantic segmentation networks to guide self-supervised representation learning via pixel-adaptive convolutions. Furthermore, we propose a two-stage training process to overcome a common semantic bias on dynamic objects via resampling. Our method improves upon the state of the art for self-supervised monocular depth prediction over all pixels, fine-grained details, and per semantic categories.†
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Accurate depth estimation is a key problem in computer vision and robotics, as it is instrumental for perception, navigation, and planning. Although perceiving depth typically requires dedicated sensors (e.g., stereo rigs, LiDAR), learning to predict depth from monocular imagery can provide useful cues for a wide array of tasks (Michels et al., 2005; Kendall et al., 2018; Manhardt et al., 2019; Lee et al., 2019). Going beyond supervised learning from direct measurements (Eigen et al., 2014), self-supervised methods exploit geometry as supervision (Guo et al., 2018; Pillai et al., 2019; Zou et al., 2018; Yang et al., 2017), therefore having the potential to leverage large scale datasets of raw videos to outperform supervised methods (Guizilini et al., 2019).
16
+
17
+ Although depth from a single image is an ill-posed inverse problem, monocular depth networks are able to make accurate predictions by learning representations connecting the appearance of scenes and objects with their geometry in Euclidean 3D space. Due to perspective, there is indeed an equivariance relationship between the visual appearance of an object in 2D and its depth, when conditioned on the object’s category. For instance, a car 25 meters away appears smaller (on the image plane) than a car only 5 meters away but bigger than a truck 50 meters away. Current depth estimation methods either do not leverage this structure explicitly or rely on strong semantic supervision to jointly optimize geometric consistency and a semantic proxy task in a multi-task objective (Ochs et al., 2019; Chen et al., 2019), thus departing from the self-supervised paradigm.
18
+
19
+ In this paper, we explore how we can leverage semantic information to improve monocular depth prediction in a self-supervised way. Our main contribution is a novel architecture that uses a fixed pre-trained semantic segmentation network to guide geometric representation learning in a selfsupervised monocular depth network. In contrast to standard convolutional layers, our architecture uses pixel-adaptive convolutions (Su et al., 2019) to learn semantic-dependent representations that can better capture the aforementioned equivariance property. Leveraging semantics may nonetheless introduce category-specific biases. Our second contribution is a two-stage training process where we automatically detect the presence of a common bias on dynamic objects (projections at infinity) and resample the training set to de-bias it. Our method improves upon the state of the art in selfsupervised monocular depth estimation on the standard KITTI benchmark (Geiger et al., 2013), both on average over pixels, over classes, and for dynamic categories in particular.
20
+
21
+ ![](images/b09c90637e486163bce4d7333340755790cf27ff41a391d503abe5d3014d643d.jpg)
22
+ Figure 1: Example of a pointcloud generated using our proposed semantically-guided architecture, colored by RGB values from the input image and corresponding predicted semantic labels.
23
+
24
+ # 2 RELATED WORK
25
+
26
+ Since the seminal work of Eigen et al. (2014), substantial progress has been done to improve the accuracy of supervised depth estimation from monocular images, including the use of Conditional Random Fields (CRFs) (Li et al., 2015), joint optimization of surface normals (Qi et al., 2018), fusion of multiple depth maps (Lee et al., 2018), and ordinal classification (Fu et al., 2018). Consequently, as supervised techniques for depth estimation advanced rapidly, the availability of largescale depth labels became a bottleneck, especially for outdoor applications. Garg et al. (2016) and Godard et al. (2017) provided an alternative self-supervised strategy involving stereo cameras, where Spatial Transformer Networks (Jaderberg et al., 2015) can be used to geometrically warp, in a differentiable way, the right image into a synthesized left image, using the predicted depth from the left image. The photometric consistency loss between the resulting synthesized and original left images can then be minimized in an end-to-end manner using a Structural Similarity term (Wang et al., 2004) and additional depth regularization terms. Following Godard et al. (2017) and Ummenhofer et al. (2017), Zhou et al. (2017) generalized this to the purely monocular setting, where a depth and a pose networks are simultaneously learned from unlabeled monocular videos. Rapid progress in terms of architectures and objective functions (Yin & Shi, 2018; Mahjourian et al., 2018; Casser et al., 2019; Zou et al., 2018; Klodt & Vedaldi, 2018; Wang et al., 2018; Yang et al., 2018) have since then turned monocular depth estimation into one of the most successful applications of self-supervised learning, even outperforming supervised methods (Guizilini et al., 2019).
27
+
28
+ The introduction of semantic information to improve depth estimates has been explored in prior works, and can be broadly divided into two categories. The first one uses semantic (or instance) information to mask out or properly model dynamic portions of the image, which are not accounted for in the photometric loss calculation. Guney & Geiger ¨ (2015) leveraged object knowledge in a Markov Random Field (MRF) to resolve stereo ambiguities, while Bai et al. (2016) used a conjunction of instance-level segmentation and epipolar constraints to reduce uncertainty in optical flow estimation. Casser et al. (2019) used instance-level masks to estimate motion models for different objects in the environment, and account for their external motion in the resulting warped image. The second category attempts to learn both tasks in a single framework, and uses consistency losses to ensure that both are optimized simultaneously and regularize each other, so the information contained in one task can be transferred to improve the other. For instance, Ochs et al. (2019) estimated depth with an ordinal classification loss similar to the standard semantic classification loss, and used empirical weighting to combine them into a single loss for optimization. Similarly, Chen et al. (2019) used a unified conditional decoder that can generate either semantic or depth estimates, and both outputs are used to generate a series of losses also combined using empirical weighting to generate the final loss to be optimized.
29
+
30
+ Our approach focuses instead on representation learning, exploiting semantic features into the selfsupervised depth network by using a pretrained semantic segmentation network to guide the generation of depth features. This is done using pixel-adaptive convolutions, recently proposed in Su et al. (2019) and applied to tasks such as depth upsampling using RGB images for feature guidance. We show that different depth networks can be readily modified to leverage this semantic feature guidance, ranging from widely used ResNets (He et al., 2016) to the current state-of-the-art PackNet (Guizilini et al., 2019), with a consistent gain in performance across these architectures.
31
+
32
+ # 3 SELF-SUPERVISED STRUCTURE-FROM-MOTION
33
+
34
+ Our semantically-guided architecture is developed within a self-supervised monocular depth estimation setting, commonly known as structure-from-motion (SfM). Learning in a self-supervised structure-from-motion setting requires two networks: a monocular depth model $f _ { D } : I D$ , that outputs a depth prediction $\hat { D } = f _ { D } ( I ( p ) )$ for every pixel $p$ in the target image $I$ ; and a monocular ego-motion estimator $f _ { \mathbf { x } } : ( I _ { t } , I _ { S } ) \to \mathbf { x } _ { t \to S }$ , that predicts the $6 \mathrm { D o F }$ transformations for all $s \in S$ given by $\mathbf { x } _ { t s } = ( \mathbf { \Sigma } _ { \mathbf { 0 } } ^ { \mathbf { R } \textbf { t } } ) \in \mathbf { S } \mathbf { E } ( 3 )$ between the target image $I _ { t }$ and a set of temporal context source images $I _ { s } \in I _ { S }$ . In all reported experiments we use $I _ { t - 1 }$ and $I _ { t + 1 }$ as source images.
35
+
36
+ # 3.1 THE SELF-SUPERVISED OBJECTIVE LOSS
37
+
38
+ We train the depth and pose networks simultaneously, using the same protocols and losses as described in Guizilini et al. (2019). Our self-supervised objective loss consists of an appearance matching term ${ \mathcal { L } } _ { p }$ that is imposed between the synthesized $\bar { \hat { I } } _ { t }$ and original $I _ { t }$ target images, and a depth regularization term $\mathcal { L } _ { s }$ that ensures edge-aware smoothing in the depth estimates $\hat { D } _ { t }$ . The final objective loss is averaged per pixel, pyramid scale and image batch, and is defined as:
39
+
40
+ $$
41
+ \mathcal { L } ( I _ { t } , \hat { I } _ { t } ) = \mathcal { L } _ { p } ( I _ { t } , \hat { I } _ { t } ) + \lambda _ { 1 } \mathcal { L } _ { s } ( \hat { D } _ { t } )
42
+ $$
43
+
44
+ where $\lambda _ { 1 }$ is a weighting coefficient between the photometric ${ \mathcal { L } } _ { p }$ and depth smoothness $\mathcal { L } _ { s }$ loss terms. Following Godard et al. (2017) and Zhou et al. (2017), the similarity between synthesized $\hat { I } _ { t }$ and original $I _ { t }$ target images is estimated using a Structural Similarity (SSIM) term (Wang et al., 2004) combined with an L1 loss term, inducing the following overall photometric loss:
45
+
46
+ $$
47
+ \mathcal { L } _ { p } ( I _ { t } , \hat { I } _ { t } ) = \alpha \frac { 1 - \mathrm { S S I M } ( I _ { t } , \hat { I } _ { t } ) } { 2 } + ( 1 - \alpha ) \parallel I _ { t } - \hat { I } _ { t } \parallel
48
+ $$
49
+
50
+ In order to regularize the depth in low gradient regions, we incorporate an edge-aware term similar to Godard et al. (2017). This loss is weighted for each of the pyramid levels, decaying by a factor of 2 on each downsampling, starting with a weight of 1 for the $0 ^ { \mathrm { { i } \mathrm { { \bar { h } } } } }$ pyramid level.
51
+
52
+ $$
53
+ \mathcal { L } _ { s } ( \hat { D } _ { t } ) = | \delta _ { x } \hat { D } _ { t } | e ^ { - | \delta _ { x } I _ { t } | } + | \delta _ { y } \hat { D } _ { t } | e ^ { - | \delta _ { y } I _ { t } | }
54
+ $$
55
+
56
+ We also incorporate some of the insights introduced in Godard et al. (2018), namely auto-masking, minimum reprojection error, and inverse depth map upsampling to further improve depth estimation performance in our self-supervised monocular setting.
57
+
58
+ # 3.2 DEPTH AND POSE NETWORKS
59
+
60
+ Our baseline depth and pose networks are based on the PackNet architecture introduced by Guizilini et al. (2019), which proposes novel packing and unpacking blocks to respectively downsample and upsample feature maps during the encoding and decoding stages. This network was selected due to its state-of-the-art performance in the task of self-supervised monocular depth estimation, so we can analyze if our proposed architecture is capable of further improving the current state-of-the-art. However, there are no restrictions as to which models our proposed semantically-guided architecture can be applied to, and in Section 5.4 we study its application to different depth networks.
61
+
62
+ # 4 SEMANTICALLY-GUIDED GEOMETRIC REPRESENTATION LEARNING
63
+
64
+ In this section, we describe our method to inject semantic information into a self-supervised depth network via its augmentation with semantic-aware convolutions. Our proposed architecture is depicted in Figure 2 and is composed of two networks: a primary one, responsible for the generation of depth predictions $\hat { D } = f _ { D } ( I ( p ) )$ ; and a secondary one, capable of producing semantic predictions. Only the first network is optimized during self-supervised learning; the semantic network is initialized from pretrained weights and is not further optimized. This is in contrast to the common practice of supervised (ImageNet) pretraining of depth encoders (Godard et al., 2018; Casser et al., 2019; Zou et al., 2018): here instead of fine-tuning from pre-trained weights, we preserve these secondary weights to guide the feature learning process of the primary depth network. Our approach also differs from learning without forgetting (Li & Hoiem, 2017) by leveraging fixed intermediate feature representations as a way to maintain consistent semantic guidance throughout training.
65
+
66
+ ![](images/768e7a4db114cab117418b58a69ddf5a06d6900d9c4ab615ba74d01856d69ab0.jpg)
67
+ Figure 2: Diagram of our proposed architecture for self-supervised monocular depth estimation with semantically-guided feature learning. The semantic network is fixed and initialized from pretrained weights, while the depth network is trained end-to-end in a self-supervised way, including pixel-adaptive convolutions (Guidance) on its decoder to learn semantic-dependent geometric features.
68
+
69
+ # 4.1 SEMANTICALLY-GUIDED DEPTH FEATURES
70
+
71
+ We leverage the information from the pretrained semantic network in the depth network through the use of pixel-adaptive convolutions (Su et al., 2019). They were recently proposed to address some limitations inherent to the standard convolution operation, namely its translation invariance making it content-agnostic. While this significantly reduces the number of parameters of the resulting network, this might also lead to sub-optimal solutions under certain conditions important for geometric representation learning. For example, spatially-shared filters globally average the loss gradients over the entire image, forcing the network to learn weights that cannot leverage location-specific information beyond their limited receptive fields. Content-agnostic filters are unable to distinguish between different pixels that are visually similar (i.e. dark areas due to shadows or black objects) or generalize to similar objects that are visually different (i.e. cars with varying colors). In this work, we use pixel-adaptive convolutions to produce semantic-aware depth features, where the fixed information encoded in the semantic network is used to disambiguate geometric representations for the generation of multi-level depth features.
72
+
73
+ As shown in Figure 2, we extract multi-level feature maps from the semantic network. For each feature map, we apply a $3 \times 3$ and a $1 \times 1$ convolutional layer followed by Group Normalization (Wu & He, 2018) and ELU non-linearities (Clevert et al., 2016). These processed semantic feature maps are then used as guidance on their respective pixel-adaptive convolutional layers, following the formulation proposed in $\mathrm { S u }$ et al. (2019):
74
+
75
+ $$
76
+ \mathbf { v } _ { i } ^ { \prime } = \sum _ { j \in \Omega ( i ) } K ( \mathbf { f } _ { i } , \mathbf { f } _ { j } ) \mathbf { W } [ \mathbf { p } _ { i } - \mathbf { p } _ { j } ] \mathbf { v } _ { j } + \mathbf { b }
77
+ $$
78
+
79
+ In the above equation, $\mathbf { f } \in \mathcal { R } ^ { D }$ are processed features from the semantic network that will serve to guide the pixel-adaptive convolutions from the depth network, $\mathbf { p } = ( x , y ) ^ { T }$ are pixel coordinates, with $[ { \bf p } _ { i } - { \bf p } _ { j } ]$ denoting 2D spatial offsets between pixels, $\mathbf { W } _ { k \times k }$ are convolutional weights with kernel size $k , \check { \Omega } _ { i }$ defines a $k \times k$ convolutional window around $i$ , $\mathbf { v }$ is the input signal to be convolved, and $\mathbf { b } \in \mathcal { R } ^ { 1 }$ is a bias term. $K$ is the kernel used to calculate the correlation between guiding features, here chosen to be the standard Gaussian kernel:
80
+
81
+ $$
82
+ K ( \mathbf { f } _ { i } , \mathbf { f } _ { j } ) = \exp \left( - \frac { 1 } { 2 } ( \mathbf { f } _ { i } - \mathbf { f } _ { j } ) ^ { T } \Sigma _ { i j } ^ { - 1 } ( \mathbf { f } _ { i } - \mathbf { f } _ { j } ) \right)
83
+ $$
84
+
85
+ where $\Sigma _ { i j }$ is the covariance matrix between features $\mathbf { f } _ { i }$ and $\mathbf { f } _ { j }$ , here chosen to be a diagonal matrix $\sigma ^ { 2 } \cdot I _ { D }$ , with $\sigma$ as an extra learnable parameter for each convolutional filter. These kernel evaluations can be seen as a secondary set of weights applied to the standard convolutional weights, changing their impact on the resulting depth features depending on the content stored in the guiding semantic features. For example, the information contained in depth features pertaining to the sky should not be used to generate depth features describing a pedestrian, and this behavior is now captured as a larger distance between their corresponding semantic features, which in turn produces smaller weights for that particular convolutional filter. Note that the standard convolution can be considered a special case of the pixel-adaptive convolution, where $\forall ~ i j , K ( \mathbf { f } _ { i } , \mathbf { f } _ { j } ) ~ = ~ 1$ .
86
+
87
+ ![](images/c1133bd34f68068e6cc07f5e3946ece1ab608146cce40ed0d3a8c96d349ad49c.jpg)
88
+ Figure 3: Qualitative results of our proposed two-stage training to address the infinite depth problem. Top images were obtained evaluating the first-stage depth network, and bottom images were obtained using the second-stage depth network, trained with a filtered dataset.
89
+
90
+ # 4.2 SEMANTIC GUIDANCE NETWORK
91
+
92
+ As the secondary network used to provide semantic guidance for the generation of depth features, we use a Feature Pyramid Network (FPN) with ResNet backbone (Lin et al., 2017). This architecture has been shown to be efficient for both semantic and instance-level predictions towards panoptic segmentation (Kirillov et al., 2019; Li et al., 2018; Xiong et al., 2019; Porzi et al., 2019). While our proposed semantically-guided architecture is not restricted to any particular network, we chose this particular implementation to facilitate the future exploration of different sources for guidance information. Architectural details follow the protocols described in Li et al. (2018), and unless mentioned otherwise the same pretrained model was used in all reported experiments. The semantic network is assumed fixed, pretrained on a held out dataset different than the raw data used for selfsupervised learning, i.e. we do not require any semantic ground truth on the target dataset.
93
+
94
+ # 4.3 TWO-STAGE TRAINING
95
+
96
+ One well-known limitation of the self-supervised photometric loss is its inability to model dynamic objects, due to a static world assumption that only accounts for camera ego-motion (Godard et al., 2018; Casser et al., 2019). A resulting common failure mode is the infinite depth problem, which is caused by the presence of objects moving at the same speed as the camera. This typically causes distinct holes in the predicted depth maps, with arbitrarily large values where these objects should be. This severely hinders the applicability of such models in real-world applications, particularly for automated driving, where the ability to detect and properly model dynamic objects is crucial. Moreover, this limitation may be further accentuated in our proposed semantically-guided architecture, as the infinite depth problem occurs mostly on dynamic categories (i.e. cars and motorcycles) and the semantic-aware features may reinforce this bias.
97
+
98
+ We propose a simple and efficient two-stage training method to detect and remove this bias from the training set. In the first stage, we learn a standard depth network on all available training data. This network, exhibiting the infinite depth problem, is then used to resample the dataset by automatically filtering out sequences with infinite depth predictions that violate a basic geometric prior. We indeed find that depth predictions for pixels corresponding to the nearby ground plane are generally robust. This enables getting a coarse estimate of the ground plane using RANSAC and detecting the number of pixels whose predicted depth projects them significantly below the ground. If that number is above a threshold, then the corresponding image is subsequently ignored (we found a conservative threshold of 10 to work well in all our experiments, filtering out roughly $5 \%$ of the KITTI training dataset). During the second stage, we retrain the network on the subsampled dataset (from scratch to avoid the previous local optimum). As this subsampled dataset is de-biased, the network learns better depth estimates on dynamic objects. This process can be repeated, but we find that two stages are enough to remove any traces of infinite depth in our experiments, as shown in Figure 3.
99
+
100
+ # 5 EXPERIMENTAL RESULTS
101
+
102
+ # 5.1 DATASETS
103
+
104
+ We use the standard KITTI benchmark (Geiger et al., 2013) for self-supervised training and evaluation. More specifically, we adopt the training, validation and test splits used in Eigen et al. (2014) with the pre-processing from Zhou et al. (2017) to remove static frames, which is more suitable for
105
+
106
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Superv.</td><td colspan="4">Lower is Better</td><td colspan="3">Higher is Better</td></tr><tr><td>Abs Rel</td><td>Sq Rel</td><td>RMSE</td><td>RMSEtog</td><td>δ&lt;1.25δ&lt;1.25²</td><td></td><td>δ&lt;1.253</td></tr><tr><td>Garg et al. (2016)</td><td>M</td><td>0.152</td><td>1.226</td><td>5.849</td><td>0.246</td><td>0.784</td><td>0.921</td><td>0.967</td></tr><tr><td>Zou et al. (2018)</td><td>M</td><td>0.150</td><td>1.124</td><td>5.507</td><td>0.223</td><td>0.806</td><td>0.933</td><td>0.973</td></tr><tr><td>Godard et al. (2017)</td><td>M</td><td>0.141</td><td>1.186</td><td>5.677</td><td>0.238</td><td>0.809</td><td>0.928</td><td>0.969</td></tr><tr><td>Zhan et al. (2018)</td><td>M</td><td>0.135</td><td>1.132</td><td>5.585</td><td>0.229</td><td>0.820</td><td>0.933</td><td>0.971</td></tr><tr><td>Godard et al. (2018) (R18)</td><td>M</td><td>0.115</td><td>0.903</td><td>4.863</td><td>0.193</td><td>0.877</td><td>0.959</td><td>0.981</td></tr><tr><td>Godard et al. (2018) (R50)</td><td>M</td><td>0.112</td><td>0.851</td><td>4.754</td><td>0.190</td><td>0.881</td><td>0.960</td><td>0.981</td></tr><tr><td>Guizilini et al. (2019) (MR)</td><td>M</td><td>0.108</td><td>0.727</td><td>4.426</td><td>0.184</td><td>0.885</td><td>0.963</td><td>0.983</td></tr><tr><td>Guizilini et al. (2019) (HR)</td><td>M</td><td>0.104</td><td>0.758</td><td>4.386</td><td>0.182</td><td>0.895</td><td>0.964</td><td>0.982</td></tr><tr><td>Casser et al. (2019)</td><td>S+Inst</td><td>0.141</td><td>1.025</td><td>5.290</td><td>0.215</td><td>0.816</td><td>0.945</td><td>0.979</td></tr><tr><td>Chen et al. (2019)</td><td>S+Sem</td><td>0.118</td><td>0.905</td><td>5.096</td><td>0.211</td><td>0.839</td><td>0.945</td><td>0.977</td></tr><tr><td>Ochs et al. (2019)</td><td>D+Sem</td><td>0.116</td><td>0.945</td><td>4.916</td><td>0.208</td><td>0.861</td><td>0.952</td><td>0.968</td></tr><tr><td>Ours (MR)</td><td>M+Sem</td><td>0.102</td><td>0.698</td><td>4.381</td><td>0.178</td><td>0.896</td><td>0.964</td><td>0.984</td></tr><tr><td>Ours (HR)</td><td>M+Sem</td><td>0.100</td><td>0.761</td><td>4.270</td><td>0.175</td><td>0.902</td><td>0.965</td><td>0.982</td></tr></table>
107
+
108
+ Table 1: Quantitative performance comparison of our proposed architecture on KITTI for depths up to $8 0 \mathrm { m }$ . $M$ refers to methods that train using monocular images, S refers to methods that train using stereo pairs, $D$ refers to methods that use ground-truth depth supervision, Sem refers to methods that include semantic information, and Inst refers to methods that include semantic and instance information. $M R$ indicates $6 4 0 \times 1 9 2$ input images, and $H R$ indicates $1 2 8 0 \mathrm { ~ x ~ } 3 8 4$ input images. Our proposed architecture is able to further improve the current state of the art in self-supervised monocular depth estimation, and outperforms other methods that exploit semantic information (including ground truth labels) by a substantial margin.
109
+
110
+ monocular self-supervised learning. This results in 39810 images for training, 4424 for validation, and 697 for evaluation. Following common practice, we pretrain our depth and pose networks on the CityScapes dataset (Cordts et al., 2016), consisting of 88250 unlabeled images. Unless noted otherwise, input images are downsampled to $6 4 0 \times 1 9 2$ resolution and output inverse depth maps are upsampled to full resolution using bilinear interpolation. Our fixed semantic segmentation network is pretrained on Cityscapes, achieving a mIoU of $7 5 \%$ on the validation set.
111
+
112
+ # 5.2 IMPLEMENTATION DETAILS
113
+
114
+ We implement our models with PyTorch (Paszke et al., 2017) and follow the same training protocols of Guizilini et al. (2019) when optimizing our depth and pose networks. The initial training stage is conducted on the CityScapes dataset for 50 epochs, with a batch size of 4 per GPU and initial depth and pose learning rates of $2 \cdot 1 0 ^ { - 4 }$ and $5 \cdot { \bar { 1 } } 0 ^ { - 4 }$ respectively, that are halved every 20 epochs. Afterwards, the depth and pose networks are fine-tuned on KITTI for 30 epochs, with the same parameters and halving the learning rates after every 12 epochs. This fine-tuning stage includes the proposed architecture, where information from the fixed semantic network, pretrained separately, is used to directly guide the generation of depth features. There is no direct supervision at any stage during depth training, all semantic information is derived from the fixed secondary network.
115
+
116
+ When pretraining the semantic segmentation network, we use a ResNet-50 backbone with Imagenet (Deng et al., 2009) pretrained weights and optimize the network for $4 8 k$ iterations on the CityScapes dataset with a learning rate of 0.01, momentum of 0.9, weight decay of $1 0 ^ { - 4 }$ , and a batch size of 1 per GPU. Random scaling between (0.7, 1.3), random horizontal flipping, and a crop size of $1 0 0 0 \times 2 0 0 0$ are used for data augmentation. We decay the learning rate by a factor of 10 at iterations $3 6 k$ and $4 4 k$ . Once training is complete, the semantic segmentation network is fixed and becomes the only source of semantic information when fine-tuning the depth and pose networks on KITTI.
117
+
118
+ # 5.3 DEPTH ESTIMATION PERFORMANCE
119
+
120
+ Our depth estimation results are summarized in Table 1, where we compare our proposed architecture with other published works. From these results we can see that the introduction of semanticallyguided geometric representation learning further improves upon the current state of the art in selfsupervised monocular depth estimation from Guizilini et al. (2019), which served as our baseline. Our approach also outperforms other methods that leverage semantic information by a substantial margin, even those using ground-truth KITTI semantic segmentation and depth labels during train
121
+
122
+ <table><tr><td rowspan="2">Network</td><td rowspan="2">SEM</td><td rowspan="2">TST</td><td colspan="4">Lower is Better</td><td colspan="2">Higher is Better δ &lt;1.25 δ&lt;1.252 δ&lt; 1.253</td><td rowspan="2">Class-Avg. Abs Rel</td></tr><tr><td>Abs Rel</td><td>Sq Rel RMSE RMSElog</td><td></td><td></td><td></td><td></td></tr><tr><td>ResNet-18</td><td>√</td><td></td><td>0.120 0.117</td><td>0.896 0.854</td><td>4.869 4.714</td><td>0.198 0.191</td><td>0.868 0.957 0.873</td><td>0.981 0.963 0.981</td><td>0.149 0.139</td></tr><tr><td>ResNet-50</td><td>√</td><td></td><td>0.117 0.113</td><td>0.900 0.831</td><td>4.826 4.663</td><td>0.196 0.189</td><td>0.873 0.967 0.878 0.971</td><td>0.980 0.983</td><td>0.144 0.136</td></tr><tr><td>PackNet</td><td>√</td><td>√</td><td>0.108 0.103 0.102</td><td>0.727 0.710 0.698</td><td>4.426 4.301 4.381</td><td>0.184 0.179 0.178</td><td>0.885 0.963 0.895 0.964 0.896 0.963</td><td>0.983 0.984 0.984</td><td>0.132 0.121 0.117</td></tr></table>
123
+
124
+ Table 2: Ablative analysis of our semantic guidance (SEM) and two-stage-training (TST) contributions. The last column indicates class-average Abs. Rel. obtained by averaging all class-specific depth errors in Figure 4, while other columns indicate pixel-average metrics.
125
+
126
+ ing (Ochs et al., 2019). Furthermore, in Figure 5 we also present qualitative results showing the improvements in depth estimation generated by our proposed framework, compared to our baseline. Note how our semantically-guided architecture produces sharper boundaries and better object delineation, especially in structures further away or not clearly distinguishable in the input image.
127
+
128
+ # 5.4 ABLATIVE ANALYSIS
129
+
130
+ # 5.4.1 DIFFERENT DEPTH NETWORKS
131
+
132
+ To better evaluate our main contribution, we provide an ablative analysis showing how it generalizes to different depth networks. To this end, we consider two variations of the widely used ResNet architecture as the encoder for our depth network: ResNet-18 and ResNet-50 (the same pretrained semantic network was used in all experiments). Depth estimation results considering these variations are shown in Table 2, where we can see that our proposed semantically-guided architecture is able to consistently improve the performance of different depth networks, for all considered metrics.
133
+
134
+ # 5.4.2 CLASS-SPECIFIC DEPTH PERFORMANCE
135
+
136
+ To further showcase the benefits of our semantically-guided architecture, we also provide classspecific evaluation metrics, as shown in Figure 4. As we do not have ground-truth semantic segmentation for these images, we use the prediction of the semantic network to bin pixels per predicted category, and evaluate only on those pixels. From these results we can see that our proposed architecture consistently improves depth performance for pixels across all predicted classes, especially those containing fine-grained structures and sharp boundaries, e.g. poles and traffic signs.
137
+
138
+ ![](images/029bba1944c05b59fd31cd1b470c4d6e1b61b263ba0128d9dbf7c9034beaab1f.jpg)
139
+ Figure 4: Class-specific depth evaluation for our proposed architecture (blue), relative to our baseline (red). The rightmost column indicates class-average depth metrics, obtained by averaging all individual classes. The introduction of semantically-guided features, in conjunction with our proposed two-stage training methodology to address the infinite depth problem, consistently improved depth results for all considered classes (lower is better).
140
+
141
+ ![](images/8b4a389f1dbad0e331cbee9e393af3ad825e78c305d86b9334b90a768bca6149.jpg)
142
+ Figure 5: Qualitative results of our proposed architecture. The left, middle, and right columns show respectively input images, baseline predicted depth maps (Guizilini et al., 2019), and the depths maps obtained using our proposed architecture. Our semantic-aware depth network predicts sharper boundaries and fine-grained details on distant objects. The dotted lines indicate class-average errors, obtained by averaging all the class-specific depth errors.
143
+
144
+ We also measure the impact of our two-stage training process, which is expected to address the infinite depth problem in dynamic objects. Although we find the pixel-average difference in performance to not be significant (see Table 2), there is a significant improvement in class-average depth estimation, from 0.121 to 0.117 Abs-Rel. This is because the number of pixels affected by the infinite depth problem is vastly smaller than the total number of pixels. However, when considering class-average depth evaluation, the improvement over classes such as cars (0.200 to 0.177 Abs-Rel) and motorcycles (0.091 to 0.069) becomes statistically significant. This further exemplifies the importance of fine-grained metrics in depth evaluation, so these underlying behaviors can be properly observed and accounted for in the development of new techniques.
145
+
146
+ # 6 CONCLUSION
147
+
148
+ This paper introduces a novel architecture for self-supervised monocular depth estimation that leverages semantic information from a fixed pretrained network to guide the generation of multi-level depth features via pixel-adaptive convolutions. Our monodepth network learns semantic-aware geometric representations that can disambiguate photometric ambiguities in a self-supervised learning structure-from-motion context. Furthermore, we introduce a two-stage training process that resamples training data to overcome a common bias on dynamic objects resulting in predicting them at infinite depths. Our experiments on challenging real-world data shows that our proposed architecture consistently improves the performance of different monodepth architectures, thus establishing a new state of the art in self-supervised monocular depth estimation. Future directions of research include leveraging other sources of guidance (i.e. instance masks, optical flow, surface normals), as well as avenues for self-supervised fine-tuning of the semantic network.
149
+
150
+ # REFERENCES
151
+
152
+ Min Bai, Wenjie Luo, Kaustav Kundu, and Raquel Urtasun. Exploiting semantic information and deep matching for optical flow. In ECCV, 2016. 2
153
+
154
+ Holger Caesar, Varun Bankiti, Alex H. Lang, Sourabh Vora, Venice Erin Liong, Qiang Xu, Anush Krishnan, Yu Pan, Giancarlo Baldan, and Oscar Beijbom. nuscenes: A multimodal dataset for autonomous driving. CoRR, 2019. 13, 14
155
+
156
+ Vincent Casser, Soeren Pirk, Reza Mahjourian, and Anelia Angelova. Depth prediction without the sensors: Leveraging structure for unsupervised learning from monocular videos. AAAI, 2019. 2, 3, 5, 6
157
+
158
+ Po-Yi Chen, Alexander H. Liu, Yen-Cheng Liu, and Yu-Chiang Frank Wang. Towards scene understanding: Unsupervised monocular depth estimation with semantic-aware representation. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2019. 1, 2, 6
159
+
160
+ Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (elus). In ICLR, 2016. 4
161
+
162
+ Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3213–3223, 2016. 6, 12
163
+
164
+ 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, 2009. 6, 12
165
+
166
+ 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, 2014. 1, 2, 5
167
+
168
+ 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. 2
169
+
170
+ Ravi Garg, Vijay Kumar BG, Gustavo Carneiro, and Ian Reid. Unsupervised cnn for single view depth estimation: Geometry to the rescue. In European Conference on Computer Vision, pp. 740–756. Springer, 2016. 2, 6
171
+
172
+ 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. 1, 5
173
+
174
+ 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. 2, 3, 6
175
+
176
+ Clement Godard, Oisin Mac Aodha, Michael Firman, and Gabriel J. Brostow. Digging into self-´ supervised monocular depth prediction. arXiv:1806.01260, 2018. 3, 5, 6, 14
177
+
178
+ Vitor Guizilini, Sudeep Pillai, Rares Ambrus, and Adrien Gaidon. Packnet-sfm: 3d packing for self-supervised monocular depth estimation. arXiv preprint arXiv:1905.02693, 2019. 1, 2, 3, 6, 8, 14
179
+
180
+ Fatma Guney and Andreas Geiger. Displets: Resolving stereo ambiguities using object knowledge.¨ In Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 2
181
+
182
+ Xiaoyang Guo, Hongsheng Li, Shuai Yi, Jimmy Ren, and Xiaogang Wang. Learning monocular depth by distilling cross-domain stereo networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 484–500, 2018. 1
183
+
184
+ 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. 2
185
+
186
+ Max Jaderberg, Karen Simonyan, Andrew Zisserman, et al. Spatial transformer networks. In Advances in neural information processing systems, pp. 2017–2025, 2015. 2
187
+
188
+ Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7482–7491, 2018. 1
189
+
190
+ Alexander Kirillov, Ross Girshick, Kaiming He, and Piotr Dollar. Panoptic feature pyramid net- ´ works. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6399–6408, 2019. 5
191
+
192
+ Maria Klodt and Andrea Vedaldi. Supervising the new with the old: Learning sfm from sfm. In European Conference on Computer Vision, pp. 713–728. Springer, 2018. 2
193
+
194
+ Jae-Han Lee, Minhyeok Heo, Kyung-Rae Kim, and Chang-Su Kim. Single-image depth estimation based on fourier domain analysis. In International Conference on Computer Vision and Pattern Recognition (CVPR), pp. 330–339, 2018. 2
195
+
196
+ Kuan-Hui Lee, German Ros, Jie Li, and Adrien Gaidon. Spigan: Privileged adversarial learning from simulation. In ICLR, 2019. 1
197
+
198
+ Bo Li, Chunhua Shen, Yuchao Dai, Anton Van, and Mingyi He. Depth and surface normal estimation from monocular images using regression on deep features and hierarchical crfs. In International Conference on Computer Vision and Pattern Recognition (CVPR), pp. 1119–1127, 2015. 2
199
+
200
+ Jie Li, Allan Raventos, Arjun Bhargava, Takaaki Tagawa, and Adrien Gaidon. Learning to fuse things and stuff. arXiv preprint arXiv:1812.01192, 2018. 5
201
+
202
+ Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE TPAMI, 40(12):2935–2947, 2017. 3
203
+
204
+ Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie.´ Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2117–2125, 2017. 5
205
+
206
+ 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. 2
207
+
208
+ Fabian Manhardt, Wadim Kehl, and Adrien Gaidon. Roi-10d: Monocular lifting of 2d detection to 6d pose and metric shape. International Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1
209
+
210
+ Jeff Michels, Ashutosh Saxena, and Andrew Y Ng. High speed obstacle avoidance using monocular vision and reinforcement learning. In Proceedings of the 22nd international conference on Machine learning, pp. 593–600. ACM, 2005. 1
211
+
212
+ Matthias Ochs, Adrian Kretz, and Rudolf Mester. Sdnet: Semantically guided depth estimation network. In arXiv:1907.10659, 2019. 1, 2, 6, 7
213
+
214
+ 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-W, 2017. 6
215
+
216
+ Sudeep Pillai, Rares Ambrus, and Adrien Gaidon. Superdepth: Self-supervised, super-resolved monocular depth estimation. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), 2019. 1
217
+
218
+ Lorenzo Porzi, Samuel Rota Bulo, Aleksander Colovic, and Peter Kontschieder. Seamless scene segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8277–8286, 2019. 5
219
+
220
+ Xiaojuan Qi, Renjie Liao, Zhengzhe Liu, Raquel Urtasun, and Jiaya Jia. Geonet: Geometric neural network for joint depth and surface normal estimation. In International Conference on Computer Vision and Pattern Recognition (CVPR), pp. 283–291, 2018. 2
221
+
222
+ Hang Su, Varun Jampani, Deqing Sun, Orazio Gallo, Erik Learned-Miller, and Jan Kautz. Pixeladaptive convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 1, 2, 4
223
+
224
+ 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 IEEE Conference on computer vision and pattern recognition (CVPR), volume 5, pp. 6, 2017. 2
225
+
226
+ 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. 2
227
+
228
+ Zhou Wang, Alan C Bovik, Hamid R Sheikh, and Eero P Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE transactions on image processing, 2004. 2, 3
229
+
230
+ Yuxin Wu and Kaiming He. Group normalization. In Proceedings of the 15th European Conference on Computer Vision (ECCV), pp. 3–19, 2018. 4
231
+
232
+ Yuwen Xiong, Renjie Liao, Hengshuang Zhao, Rui Hu, Min Bai, Ersin Yumer, and Raquel Urtasun. Upsnet: A unified panoptic segmentation network. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8818–8826, 2019. 5
233
+
234
+ Nan Yang, Rui Wang, Jorg St ¨ uckler, and Daniel Cremers. Deep virtual stereo odometry: Leveraging ¨ deep depth prediction for monocular direct sparse odometry. arXiv:1807.02570, 2018. 2
235
+
236
+ Zhenheng Yang, Peng Wang, Wei Xu, Liang Zhao, and Ramakant Nevatia. Unsupervised learning of geometry with edge-aware depth-normal consistency. arXiv preprint arXiv:1711.03665, 2017. 1
237
+
238
+ 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 (CVPR), volume 2, 2018. 2
239
+
240
+ Huangying Zhan, Ravi Garg, Chamara Saroj Weerasekera, Kejie Li, Harsh Agarwal, and Ian Reid. Unsupervised learning of monocular depth estimation and visual odometry with deep feature reconstruction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 340–349, 2018. 6
241
+
242
+ Tinghui Zhou, Matthew Brown, Noah Snavely, and David G Lowe. Unsupervised learning of depth and ego-motion from video. In CVPR, volume 2, pp. 7, 2017. 2, 3, 5
243
+
244
+ Yuliang Zou, Zelun Luo, and Jia-Bin Huang. Df-net: Unsupervised joint learning of depth and flow using cross-task consistency. In European Conference on Computer Vision, 2018. 1, 2, 3, 6
245
+
246
+ # A PRE-TRAINING THE SEMANTIC SEGMENTATION NETWORK
247
+
248
+ The introduction of a semantic segmentation network to the depth estimation task increases the depth estimation performance, however it also increases model complexity (e.g. number of trainable parameters). To investigate that the increased performance for the depth estimation task is indeed due to the semantic features encoded in the secondary network, we perform an in-depth analysis (summarized in Table 3) where we explore the impact of pre-training the semantic segmentation network before it is used to guide the generation of depth features. From these results we can see that the presence of semantic information encoded in the secondary network indeed leads to an increase in performance, and that fine-tuning this secondary network for the speficic task of depth estimation actually decreases performance.
249
+
250
+ In the first two rows an untrained semantic network is utilized, with only its encoder initialized from ImageNet (Deng et al., 2009) weights. Two different scenarios are explored: in the first one (D) only the depth network is fine-tuned in a self-supervised fashion, while in $\mathbf { D + S }$ both networks are fine-tuned together in the same way. As expected, using untrained features as guidance leads to significantly worse results, since there is no structure encoded in the secondary network and the primary network needs to learn to filter out all this spurious information. When both networks are fine-tuned simultaneously, results improve because now the added complexity from the secondary network can be leveraged for the task of depth estimation, however there is still no improvement over the baseline.
251
+
252
+ Next, the semantic network was pre-trained on only half of the CityScapes (Cordts et al., 2016) dataset (samples chosen randomly), leading to a worse semantic segmentation performance (validation mIoU of around $7 0 \%$ vs. $\dot { 7 } 5 \%$ for the fully trained one). This partial pre-training stage was enough to enable the transfer of useful information between networks, leading to improvements over the baseline. Interestingly, fine-tuning both networks for the task of depth estimation actually hurt performance this time, which we attribute to forgetting the information contained in the secondary network, as both networks are optimized for the depth task. When the semantic network is pretrained with all of CityScapes (last two rows), these effects are magnified, with fine-tuning only the depth network leading to our best reported performance (Table 1) and fine-tuning both networks again leading to results similar to the baseline.
253
+
254
+ Table 3: Analysis of the impact of pre-training the semantic segmentation network. On the PreTrain column, $I$ indicates ImageNet (Deng et al., 2009) pretraining and CS indicates CityScapes (Cordts et al., 2016) pretraining, with $1 / 2$ indicating the use of only half the dataset (samples chosen randomly). In the Fine-Tune column, $D$ indicates fine-tuning the depth network and $s$ indicates finetuning the semantic network (note that this is a self-supervised fine-tuning for the depth task, using the objective described in Section 3.1).
255
+
256
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">Pre-Train</td><td rowspan="2">Fine-Tune</td><td colspan="4">Lower is Better</td><td colspan="3">Higher is Better</td></tr><tr><td>Abs Rel</td><td>Sq Rel</td><td>RMSE</td><td>RMSElog</td><td>δ &lt;1.25 δ&lt;1.252</td><td></td><td>δ&lt;1.253</td></tr><tr><td>Baseline</td><td></td><td>D</td><td>0.108</td><td>0.727</td><td>4.426</td><td>0.184</td><td>0.885</td><td>0.963</td><td>0.983</td></tr><tr><td rowspan="6">Proposed</td><td>I</td><td>D+S</td><td>0.116</td><td>0.847</td><td>4.751</td><td>0.192</td><td>0.879</td><td>0.960</td><td>0.981</td></tr><tr><td>I</td><td>D</td><td>0.197</td><td>1.323</td><td>6.114</td><td>0.265</td><td>0.776</td><td>0.918</td><td>0.966</td></tr><tr><td>CS (1/2)</td><td>D+S</td><td>0.109</td><td>0.737</td><td>4.389</td><td>0.185</td><td>0.884</td><td>0.962</td><td>0.982</td></tr><tr><td>CS (1/2)</td><td>D</td><td>0.104</td><td>0.716</td><td>4.322</td><td>0.180</td><td>0.893</td><td>0.964</td><td>0.984</td></tr><tr><td>Cs</td><td>D+S</td><td>0.107</td><td>0.741</td><td>4.407</td><td>0.183</td><td>0.883</td><td>0.963</td><td>0.983</td></tr><tr><td>Cs</td><td>D</td><td>0.102</td><td>0.698</td><td>4.381</td><td>0.178</td><td>0.896</td><td>0.964</td><td>0.984</td></tr></table>
257
+
258
+ # B UNCERTAINTY AND GENERALIZATION TO DIFFERENT OBJECTS
259
+
260
+ In a self-supervised setting, increasing the number of unlabeled videos used for depth training is expected to lead to an increasing specialization away from the domain in which the semantic network was pre-trained. This might result in harmful guidance if our method is not robust to this gap. However, our approach does not use semantic predictions directly, but rather the decoded features of the semantic network themselves, which represent general appearance information that should be more robust to this domain gap. To validate our hypothesis, we further explore the impact of erroneous semantic information in the performance of our proposed semantically-guided depth framework. In Figure 6 we present qualitative results highlighting situations in which our pretrained semantic network failed to generate correct semantic predictions for certain objects in the scene, and yet our proposed framework was still able to properly recover depth values for that portion of the environment. These exemplify possible scenarios for erroneous semantic prediction.
261
+
262
+ • Imprecise boundaries: in the first row, we can see that the semantic segmentation network does not correctly detect the traffic sign, yet the semantically-guided depth network predicts its shape and depth accurately.
263
+ • Wrong classification: in the second row, the truck was mistakenly classified as partially “road” and “building”, however our semantically-guided depth network was still able to properly recover its overall shape with sharp delineation that was not available from its semantic contour. A similar scenario happens in the same image, with “fence” being partially labeled as “bicycle”.
264
+ • Missing ontology: there is no “trash can” class on the CityScapes ontology, however in the third row our semantically-guided depth network was able to correctly reconstruct such object even though it was classified as “fence”, similarly to its surroundings.
265
+ • Object Hallucination: in the fourth row, the contour of a “person” was erroneously introduced in the image and correctly removed by our semantically-guided framework.
266
+
267
+ These examples are evidence that our proposed framework is able to reason over the uncertainty inherent to semantic classification, leveraging this information when accurate to achieve the results reported in this paper, but also discarding it if necessary to generate a better reconstruction according to the self-supervised photometric loss.
268
+
269
+ ![](images/1571107d15766292cb50733ff1a095273dd604cd102c3c0235ac0a84b6b5dd4e.jpg)
270
+ Figure 6: Examples of erroneous semantic predictions that still led to accurate depth predictions using our proposed semantically-guided depth framework.
271
+
272
+ # C GENERALIZATION TO DIFFERENT DATASETS
273
+
274
+ In the previous sections, we show that our proposed framework is robust to a degraded semantic network, both by pretraining the semantic network with fewer annotated labels (Appendix A) and also by providing evidence that the depth network is able to reason over erroneous predictions to still generate accurate reconstructions (Appendix B). We now go one step further and analyze how our proposed semantically-guided framework generalizes to a dataset that was used neither during pre-training nor for fine-tuning. To this end, we evaluate our KITTI depth model on the recently released NuScenes dataset (Caesar et al., 2019). The official NuScenes validation split is used, containing 6019 images from the front camera with ground-truth depth maps generated by LiDAR reprojection. Results presented in Table 4 provide additional evidence that our method indeed results in generalization improvements, even on significantly different data from different platforms
275
+
276
+ and environments (Karlsruhe, Germany for KITTI vs Boston, USA and Singapore for NuScenes), outperforming the state of the art methods and our baseline (Guizilini et al., 2019).
277
+ Table 4: Generalization capability of different networks, trained on both KITTI and CityScapes datasets and evaluated on the NuScenes (Caesar et al., 2019) dataset. Our proposed semanticallyguided architecture is able to further improve upon the baseline from Guizilini et al. (2019), which only used unlabeled image sequences for self-supervised depth training.
278
+
279
+ <table><tr><td>Method</td><td>Abs Rel</td><td>Sq Rel</td><td>RMSE</td><td>RMSElog</td><td></td><td>δ&lt;1.25δ&lt;1.25²</td><td>δ&lt;1.253</td></tr><tr><td>Godard et al. (2018) (R18)</td><td>0.212</td><td>1.918</td><td>7.958</td><td>0.323</td><td>0.674</td><td>0.898</td><td>0.954</td></tr><tr><td>Godard et al. (2018) (R50)</td><td>0.210</td><td>2.017</td><td>8.111</td><td>0.328</td><td>0.697</td><td>0.903</td><td>0.960</td></tr><tr><td>Guizilini et al. (2019) (MR)</td><td>0.187</td><td>1.852</td><td>7.636</td><td>0.289</td><td>0.742</td><td>0.917</td><td>0.961</td></tr><tr><td>Ours (MR)</td><td>0.181</td><td>1.505</td><td>7.237</td><td>0.271</td><td>0.765</td><td>0.931</td><td>0.969</td></tr></table>
md/train/H1eJxngCW/H1eJxngCW.md ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DUORC: TOWARDS COMPLEX LANGUAGE UNDER-STANDING WITH PARAPHRASED READING COMPRE-HENSION
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ We propose DuoRC, a novel dataset for Reading Comprehension (RC) that motivates several new challenges for neural approaches in language understanding beyond those offered by existing RC datasets. DuoRC contains 186,089 unique question-answer pairs created from a collection of 7680 pairs of movie plots where each pair in the collection reflects two versions of the same movie - one from Wikipedia and the other from IMDb - written by two different authors. We asked crowdsourced workers to create questions from one version of the plot and a different set of workers to extract or synthesize answers from the other version. This unique characteristic of DuoRC where questions and answers are created from different versions of a document narrating the same underlying story, ensures by design, that there is very little lexical overlap between the questions created from one version and the segments containing the answer in the other version. Further, since the two versions have different levels of plot detail, narration style, vocabulary, etc., answering questions from the second version requires deeper language understanding and incorporating external background knowledge. Additionally, the narrative style of passages arising from movie plots (as opposed to typical descriptive passages in existing datasets) exhibits the need to perform complex reasoning over events across multiple sentences. Indeed, we observe that state-ofthe-art neural RC models which have achieved near human performance on the SQuAD dataset (Rajpurkar et al., 2016b), even when coupled with traditional NLP techniques to address the challenges presented in DuoRC exhibit very poor performance (F1 score of $3 7 . 4 2 \%$ on DuoRC v/s $86 \%$ on SQuAD dataset). This opens up several interesting research avenues wherein DuoRC could complement other RC datasets to explore novel neural approaches for studying language understanding.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Natural Language Understanding is widely accepted to be one of the key capabilities required for AI systems. Scientific progress on this endeavor is measured through multiple tasks such as machine translation, reading comprehension, question-answering, and others, each of which requires the machine to demonstrate the ability to “comprehend” the given textual input (apart from other aspects) and achieve their task-specific goals. In particular, Reading Comprehension (RC) systems are required to “understand” a given text passage as input and then answer questions based on it. It is therefore critical, that the dataset benchmarks established for the RC task keep progressing in complexity to reflect the challenges that arise in true language understanding, thereby enabling the development of models and techniques to solve these challenges.
12
+
13
+ For RC in particular, there has been significant progress over the recent years with several benchmark datasets, the most popular of which are the SQuAD dataset (Rajpurkar et al., 2016a), TriviaQA (Joshi et al., 2017), MS MARCO (Nguyen et al., 2016), MovieQA (Tapaswi et al., 2016) and cloze-style datasets(Mostafazadeh et al., 2016; Onishi et al., 2016; Hermann et al., 2015). However, these benchmarks, owing to both the nature of the passages and the question-answer pairs to evaluate the RC task, have 2 primary limitations in studying language understanding: (i) Other than MovieQA, which is a small dataset of 15K QA pairs, all other large-scale RC datasets deal only with factual descriptive passages and not narratives (involving events with causality linkages that require reasoning
14
+
15
+ # Movie: Twelve Monkeys
16
+
17
+ # Original Plot Synopsis(Wikipedia)
18
+
19
+ # Paraphrased Plot Synopsis (IMDB)
20
+
21
+ A deadly virus released in 1996..,[James Cole is a prisoner living in a subterranean compound beneath the ruins of Philadelphia $1 ^ { \circ 1 }$ [Cole is selected foramission]Q2
22
+
23
+ [Cole arrives in Baltimore]Q3 in 1990, not 1996 as planned...[Goines denies any involvement with the group and says that in 199o Cole originated the idea of wiping out humanity with a virus stolen from Goines' virologist father.jQ4
24
+
25
+ Cole convinces himself. Railly confronts him with evidence of his time travel.. [They decide to spend their remaining time together in the Florida Keys before the onset of the plague]Q5 [At the airport, Cole leaves a last message]Q6 .. [He is soon confronted by Jose,an acquaintance from his own time,who gives Cole a handgunjQ7 and ambiguously instructs him to follow orders.At the same time,Raillyspots Dr.Peters..
26
+
27
+ Cole forces his way through a security checkpoint... [Peters, aboard theplane with the virus]Q8
28
+
29
+ A virus,deliberately released in 1996 .. One such prisoner is [James Cole,who after retrieving samples is given the chance to go back in time to $1 9 9 6 ] ^ { \circ 2 }$ and find information about the group believed responsible, known as "The Army of 12 Monkeys."
30
+
31
+ Throughout the ensuing episodes, Cole .. There he meets Jeffrey Goines, ... Cole is now racing against time...he wants to stay in 1996 with Dr. Railly,... They [travel toPhiladelphia]Q1,
32
+
33
+ [Jeffrey rambles about how Cole had given him the idea to release a virus that would destroy most of humanity. $| ^ { \circ 4 }$ Cole leaves,...and then posts flyers declaring "We did it!"[Cole realizes that the "Army" isnot the threat, and he leaves a phone message to that effectjQ6.
34
+
35
+ [Jose,a fellow "volunteer" from the present,approaches Cole with orders forhimtocompletehismissionand handshima revolverjQ7...Inan airport,while attempting with Cole to elude capture, Dr. Railly recognizes [Dr Peters,a man who worked with Jeffrey Goines's father.... The man goes through airport screening and manages to persuade security that his biological samplesjQ8
36
+
37
+ Q1: James Cole is a prisonerliving in a subterranean shelter beneath what city?Philadelphia,Philadelphia Q2:What is the name of the person selected for the mission? James Cole, James Cole Q3:Where did Cole arrive in 1990? Baltimore, - Q4: Who does Goines claim came up with the idea to exterminate humanity? Cole, Cole Q5:Where do Cole and Railly decide to go before the plague? Florida Keys, Q6:Where does Cole leave his message? At the airport, on the phone Q7:Who gives Cole a handgun? Jose, Jose Q8:Peters is aboard the plane with what? Virus, biological samples
38
+
39
+ Figure 1: Example QA pairs obtained from the original movie plot and the paraphrased plot. The relevant spans needed for answering the corresponding question are highlighted in blue and red with the respective question numbers. Note that the span highlighting shown here is for illustrative purposes only and is not available in the dataset.
40
+
41
+ and background knowledge) which is the case with a lot of real-world content such as story books, movies, news reports, etc. (ii) their questions possess a large lexical overlap with segments of the passage, or have a high noise level in Q/A pairs themselves. As demonstrated by recent work, this makes it easy for even simple keyword matching algorithms to achieve high accuracy (Weissenborn et al., 2017). In fact, these models have been shown to perform poorly in the presence of adversarially inserted sentences which have a high word overlap with the question but do not contain the answer (Jia & Liang, 2017). While this problem does not exist in TriviaQA it is admittedly noisy because of the use of distant supervision. Similarly, for cloze-style datasets, due to the automatic question generation process, it is very easy for current models to reach near human performance (Cui, 2017). This therefore limits the complexity in language understanding that a machine is required to demonstrate to do well on the RC task.
42
+
43
+ Motivated by these shortcomings and to push the state-of-the-art in language understanding in RC, in this paper we propose DuoRC, which specifically presents the following challenges beyond the existing datasets:
44
+
45
+ 1. DuoRC is especially designed to contain a large number of questions with low lexical overlap between questions and their corresponding passages.
46
+ 2. It requires the use of background and common-sense knowledge to arrive at the answer and go beyond the content of the passage itself.
47
+ 3. It contains narrative passages from movie plots that require complex reasoning across multiple sentences to infer the answer.
48
+ 4. Several of the questions in DuoRC, while seeming relevant, cannot actually be answered from the given passage, thereby requiring the machine to detect the unanswerability of questions.
49
+
50
+ In order to capture these four challenges, DuoRC contains QA pairs created from pairs of documents describing movie plots which were gathered as follows. Each document in a pair is a different version of the same movie plot written by different authors; one version of the plot is taken from the Wikipedia page of the movie whereas the other from its IMDb page (see Fig. 1 for portions of an example pair of plots from the movie “Twelve Monkeys”). We first showed crowd workers on Amazon Mechanical Turk (AMT) the first version of the plot and asked them to create QA pairs from it. We then showed the second version of the plot along with the questions created from the first version to a different set of workers on AMT and asked them to provide answers by reading the second version only. Since the two versions contain different levels of plot detail, narration style, vocabulary, etc., answering questions from the second version exhibits all of the four challenges mentioned above.
51
+
52
+ We now make several interesting observations from the example in Fig. 1. For 4 out of the 8 questions (Q1, Q2, Q4, and Q7), though the answers extracted from the two plots are exactly the same, the analysis required to arrive at this answer is very different in the two cases. In particular, for Q1 even though there is no explicit mention of the prisoner living in a subterranean shelter and hence no lexical overlap with the question, the workers were still able to infer that the answer is Philadelphia because that is the city to which James Cole travels to for his mission. Another interesting characteristic of this dataset is that for a few questions (Q6, Q8) alternative but valid answers are obtained from the second plot. Further, note the kind of complex reasoning required for answering Q8 where the machine needs to resolve coreferences over multiple sentences (that man refers to Dr. Peters) and use common sense knowledge that if an item clears an airport screening, then a person can likely board the plane with it. To re-emphasize, these examples exhibit the need for machines to demonstrate new capabilities in RC such as: (i) employing a knowledge graph (e.g. to know that Philadelphia is a city in Q1), (ii) common-sense knowledge (e.g., clearing airport security implies boarding) (iii) paraphrase/semantic understanding (e.g. revolver is a type of handgun in Q7) (iv) multiple-sentence inferencing across events in the passage including coreference resolution of named entities and nouns, and (v) educated guesswork when the question is not directly answerable but there are subtle hints in the passage (as in Q1). Finally, for quite a few questions, there wasn’t sufficient information in the second plot to obtain their answers. In such cases, the workers marked the question as “unanswerable”. This brings out a very important challenge for machines to exhibit (i.e. detect unanswerability of questions) because a practical system should be able to know when it is not possible for it to answer a particular question given the data available to it, and in such cases, possibly delegate the task to a human instead.
53
+
54
+ Current RC systems built using existing datasets are far from possessing these capabilities to solve the above challenges. In Section 4, we seek to establish solid baselines for DuoRC employing state-of-the-art RC models coupled with a collection of standard NLP techniques to address few of the above challenges. Proposing novel neural models that solve all of the challenges in DuoRC is out of the scope of this paper. Our experiments demonstrate that when the existing state-of-the-art RC systems are trained and evaluated on DuoRC they perform poorly leaving a lot of scope for improvement and open new avenues for research in RC. Do note that this dataset is not a substitute for existing RC datasets but can be coupled with them to collectively address a large set of challenges in language understanding with RC (the more the merrier).
55
+
56
+ # 2 RELATED WORK
57
+
58
+ Over the past few years, there has been a surge in datasets for Reading Comprehension. Most of these datasets differ in the manner in which questions and answers are created. For example, in SQuAD (Rajpurkar et al., 2016a), NewsQA (Trischler et al., 2016), TriviaQA (Joshi et al., 2017) and MovieQA (Tapaswi et al., 2016) the answers correspond to a span in the document. MS-MARCO uses web queries as questions and the answers are synthesized by workers from documents relevant to the query. On the other hand, in most cloze-style datasets (Mostafazadeh et al., 2016; Onishi et al., 2016) the questions are created automatically by deleting a word/entity from a sentence. There are also some datasets for RC with multiple choice questions (Richardson et al., 2013; Berant et al., 2014; Lai et al., 2017) where the task is to select one among $k$ given candidate answers.
59
+
60
+ Given that there are already a few datasets for RC, a natural question to ask is “Do we really need any more datasets?”. We believe that the answer to this question is yes. Each new dataset brings in new challenges and contributes towards building better QA systems. It keeps researchers on their toes and prevents research from stagnating once state-of-the-art results are achieved on one dataset. A classic example of this is the CoNLL NER dataset (Tjong Kim Sang & De Meulder, 2003). While several NER systems (Passos et al., 2014) gave close to human performance on this dataset, NER on general web text, domain specific text, noisy social media text is still an unsolved problem (mainly due to the lack of representative datasets which cover the real-world challenges of NER). In this context, DuoRC presents 4 new challenges mentioned earlier which are not exhibited in existing RC datasets and would thus enable exploring novel neural approaches in complex language understanding. The hope is that all these datasets (including ours) will collectively help in addressing a wide range of challenges in QA and prevent stagnation via overfitting on a single dataset.
61
+
62
+ # 3 DATASET
63
+
64
+ In this section, we elaborate on our dataset collection process which consisted of the following three phrases.
65
+
66
+ 1. Extracting parallel movie plots: We first collected top 40K movies from IMDb across different genres (crime, drama, comedy, etc.) whose plot synopsis were crawled from Wikipedia as well as IMDb. We retained only 7680 movies for which both the plots were available and longer than 100 words. In general, we found that the IMDb plots were usually longer (avg. length 926 words) and more descriptive than the Wikipedia plots (avg. length 580 words).
67
+
68
+ 2. Collecting QA pairs from shorter version of the plot (SelfRC): As mentioned earlier, on average the longer version of the plot is almost double the size of the shorter version which is itself usually 500 words long. Intuitively, the longer version should have more details and the questions asked from the shorter version should be answerable from the longer one. Hence, we first showed the shorter version of the plot to workers on AMT and ask them to create QA pairs from it. For the answer, the workers were given freedom to either pick an answer which directly matches a span in the document or synthesize the answer from scratch. This option allowed them to be creative and ask hard questions where possible. We found that in $70 \%$ of the cases the workers picked an answer directly from the document and in $30 \%$ of the cases they synthesized the answer. We thus collected 85,773 such QA pairs along with their corresponding documents. We refer to this as the SelfRC dataset because the answers were derived from the same document from which the questions were asked.
69
+
70
+ 3. Collecting answers from longer version of the plot (ParaphraseRC): We then paired the questions from the SelfRC dataset with the corresponding longer version of the plot and showed it to a different set of AMT workers asking them to answer these questions from the longer version of the plot. They now have the option of either (a) selecting an answer which matches a span in the longer version, or (b) synthesizing the answer from scratch, or (c) marking the question not-answerable because of lack of information in the given passage. We found that in $50 \%$ of the cases the workers selected an answer which matched a span in the document, whereas in $37 \%$ cases they synthesized the answer and in $13 \%$ cases they said that question was not answerable. The workers were strictly instructed to derive the answer from the plot and not rely on their personal knowledge about the movie (in any case given the large number of movies in our dataset the chance of a worker remembering all the plot details for a given movie is very less). Further, a wait period of 2-3 weeks was deliberately introduced between the two phases of data collection to ensure the availability of a fresh pool of workers as well as to reduce information bias among any worker common to both the tasks. We refer to this dataset, where the questions are taken from one version of the document and the answers are obtained from a different version, as ParaphraseRC dataset. We collected 100,316 such {question, answer, document} triplets.
71
+
72
+ Note that the number of unique questions in the ParaphraseRC dataset is the same as that in SelfRC because we do not create any new questions from the longer version of the plot. We end up with a greater number of {question, answer, document} triplets in ParaphraseRC as compared to SelfRC (100,316 v/s 85,773) since movies that are remakes of a previous movie had very little difference in their Wikipedia plots. Therefore, we did not separately collect questions from the Wikipedia plot of the remake. However, the IMDb plots of the two movies are very different and so we have two different longer versions of the movie (one for the original and one for the remake). We can thus pair the questions created from the Wikipedia plot with both the IMDb versions of the plot and hence we end up with more {question, answer, document} triplets.
73
+
74
+ Table 1: Statistics regarding the Self and ParaphraseRC Datasets
75
+
76
+ <table><tr><td rowspan=1 colspan=2>Question/Answer-Length Statistics</td></tr><tr><td rowspan=1 colspan=1>Avg. Question-Length</td><td rowspan=1 colspan=1>9 words</td></tr><tr><td rowspan=1 colspan=1>Avg.Answer Length (SelfRC Dataset)</td><td rowspan=1 colspan=1>3words</td></tr><tr><td rowspan=1 colspan=1>Avg.AnswerLength (ParaphraseRCDataset)</td><td rowspan=1 colspan=1>5words</td></tr><tr><td rowspan=1 colspan=1>Avg.Number of noun phrases in Question</td><td rowspan=1 colspan=1>4</td></tr><tr><td rowspan=1 colspan=1>Avg.Number of noun phrases in Answers</td><td rowspan=1 colspan=1>1.5</td></tr><tr><td rowspan=1 colspan=1>Comparative Hardness of ParaphraseRC w.r.t SelfRC</td><td rowspan=1 colspan=1>:.t SelfRC</td></tr><tr><td rowspan=1 colspan=1>% of QAs with no noun phrase common between Ques-tion and Answer (SelfRC)</td><td rowspan=1 colspan=1>35.86%</td></tr><tr><td rowspan=1 colspan=1>%of QAs with no noun phrase common between Ques-tion and Answer (ParaphraseRC)</td><td rowspan=1 colspan=1>49.76%</td></tr><tr><td rowspan=1 colspan=1>Avg.Minimum Distance between Named Entities inQuestion and Answer (in the Self and ParaphraseRCPlot)</td><td rowspan=1 colspan=1>Avg distance16wordsmore forParaphraseRC</td></tr><tr><td rowspan=1 colspan=1>% Length of the Longest Common Subsequence ofNon-stop words in Query and SelfRC plot</td><td rowspan=1 colspan=1>38.1%ofthequery</td></tr><tr><td rowspan=1 colspan=1>% Length of the Longest Common Subsequence ofNon-stop words in Query and ParaphraseRC plot</td><td rowspan=1 colspan=1>21.9%ofthequery</td></tr></table>
77
+
78
+ ![](images/df4e0e5c2b8ec94d99ad7d0345d9174b6ba227def1a974b43ca20c5006eb516b.jpg)
79
+ Figure 2: Analysis of the Question Types
80
+
81
+ We refer to this combined dataset containing a total of 186,089 instances as DuoRC. Fig. 2 shows the distribution of different Wh-type questions in our dataset. Some more interesting statistics about the dataset are presented in Table 1 and also in Appendix B.
82
+
83
+ Another notable observation is that in many cases the answers to the same question are different in the two versions. Specifically, only $4 0 . 7 \%$ of the questions have the same answer in the two documents. For around $3 7 . 8 \%$ of the questions there is no overlap between the words in the two answers. For the remaining $21 \%$ of the questions there is a partial overlap between the two answers. For e.g., the answer derived from the shorter version could be “using his wife’s gun” and from the longer version could be “with Dana’s handgun” where Dana is the name of the wife. In Appendix A, we provide a few randomly picked examples from our dataset which should convince the reader of the difficulty of ParaphraseRC and its differences with SelfRC.
84
+
85
+ # 4 MODELS
86
+
87
+ In this section, we describe in detail the various state-of-the-art RC and language generation models along with a collection of traditional NLP techniques employed together that will serve to establish baseline performance on the DuoRC dataset.
88
+
89
+ Most of the current state-of-the-art models for RC assume that the answer corresponds to a span in the document and the task of the model is to predict this span. This is indeed true for the SQuAD, TriviaQA and NewsQA datasets. However, in our dataset, in many cases the answers do not correspond to an exact span in the document but are synthesized by humans. Specifically, for the SelfRC version of the dataset around $30 \%$ of the answers are synthesized and do not match a span in the document whereas for the ParaphraseRC task this number is $50 \%$ . Nevertheless, we could still leverage the advances made on the SQuAD dataset and adapt these span prediction models for our task. To do so, we propose to use two models. The first model is a basic span prediction model which we train and evaluate using only those instances in our dataset where the answer matches a span in the document. The purpose of this model is to establish whether even for instances where the answer matches a span in the document, our dataset is harder than the SQuAD dataset or not. Specifically, we want to explore the performance of state-of-the-art models (such as DCN (Xiong et al., 2016)), which exhibit near human results on the SQuAD dataset, on DuoRC (especially, in the ParaphraseRC setup). To do so, we seek to employ a good span prediction model for which (i) the performance is within $3- 5 \%$ of the top performing model on the SQuAD leaderboard (Rajpurkar et al., 2016b) and (ii) the results are reproducible based on the code released by the authors of the paper. Note that the second criteria is important to ensure that the poor performance of the model is not due to incorrect implementation. The Bidirectional Attention Flow (BiDAF) model (Seo et al., 2016) satisfies these criteria and hence we employ this model. Due to space constraints, we do not provide details of the
90
+
91
+ BiDAF model here and simply refer the reader to the original paper. In the remainder of this paper we will refer to this model as the SpanModel.
92
+
93
+ The second model that we employ is a two stage process which first predicts the span and then synthesizes the answers from the span. Here again, for the first step (i.e., span prediction) we use the BiDAF model (Seo et al., 2016). The job of the second model is to then take the span (mini-document) and question (query) as input and generate the answer. For this, we employ a state-of-the-art query based abstractive summarization model (Nema et al., 2017) as this task is very similar to our task. Specifically, in query based abstractive summarization the training data is of the form {query, document, generated summary} and in our case the training data is of the form {query, mini-document, generated answer}. Once again we refer the reader to the original paper (Nema et al., 2017) for details of the model. We refer to this two stage model as the GenModel.
94
+
95
+ Note that Tan et al. (2017) recently proposed an answer generation model for the MS MARCO dataset. However, the authors have not released their code and therefore, in the interest of reproducibility of our work, we omit incorporating this model in this paper.
96
+
97
+ Additional NLP pre-processing: Referring back to the example cited in Fig. 1, we reiterate that ideally a good model for ParaphraseRC would require: (i) employing a knowledge graph, (ii) common-sense knowledge (iii) paraphrase/semantic understanding (iv) multiple-sentence inferencing across events in the passage including coreference resolution of named entities and nouns, and (v) educated guesswork when the question is not directly answerable but there are subtle hints in the passage. While addressing all of these challenges in their entirety is beyond the scope of a single paper, in the interest of establishing a good baseline for DuoRC, we additionally seek to address some of these challenges to a certain extent by using standard NLP techniques. Specifically, we look at the problems of paraphrase understanding, coreference resolution and handling long passages.
98
+
99
+ To do so, we prune the document and extract only those sentences which are most relevant to the question, so that the span detector does not need to look at the entire 900-word long ParaphraseRC plot. Now, since these relevant sentences are obtained not from the original but the paraphrased version of the document, they may have a very small word overlap with the question. For example, the question might contain the word “hand gun” and the relevant sentence in the document may contain the word “revolver”. Further some of the named entities in the question may not be exactly present in the relevant sentence but may simply be co-referenced. To resolve these coreferences, we first employ the Stanford coreference resolution on the entire document. We then compute the fraction of words in a sentence which match a query word (ignoring stop words). Two words are considered to match if (a) they have the same surface form, or (b) one words is an inflected form of the word (e.g., river and rivers), or (c) the Glove and Skip-thought embeddings of the two words are very close to each other, or (d) the two words appear in the same synset in Wordnet. We consider a sentence to be relevant for the question if at least $50 \%$ of the query words (ignoring stop words) match the words in the sentence. If none of the sentences in the document have atleast $50 \%$ overlap with the question, then we pick sentences having atleast a $30 \%$ overlap with the question.
100
+
101
+ # 5 EXPERIMENTAL SETUP
102
+
103
+ In the following sub-sections we describe (i) the evaluation metrics, and (ii) the choices considered for augmenting the training data for the answer generation model. Note that when creating the train, validation and test set, we ensure that the test set does not contain question-answer pairs for any movie that was seen during training. We split the movies in such a way that the resulting train, valid, test sets respectively contain $70 \%$ , $15 \%$ and $15 \%$ of the total number of QA pairs.
104
+
105
+ Span-Based Test Set and Full Test Set As mentioned earlier, the SpanModel only predicts the span in the document whereas the GenModel generates the answer after predicting the span. Ideally, the SpanModel should only be evaluated on those instances in the test set where the answer matches a span in the document. We refer to this subset of the test set as the Span-based Test Set. Though not ideal, we also evaluate the SpanModel model on the entire test set. We say this is not ideal because we know for sure that there are many answers in the test set which do not correspond to a span in the document whereas the model was only trained to predict spans. We refer to this as the Full Test Set. We also evaluate the GenModel on both the test sets.
106
+
107
+ Training Data for the GenModel As mentioned earlier, the GenModel contains two stages; the first stage predicts the span and the second stage then generates an answer from the predicted span. For the first step we plug-in the best performing SpanModel from our earlier exploration. To train the second stage we need training data of the form $\{ x = s p a n , y = a n s w e r \}$ which comes from two types of instances: one where the answer matches a span and the other where the answer is synthesized and the span corresponding to it is not known. In the first case $x { = } y$ and there is nothing interesting for the model to learn (except for copying the input to the output). In the second case $x$ is not known. To overcome this problem, for the second type of instances, we consider various approaches for finding the approximate span from which the answer could have been generated, in order to augment the training data with $\{ x = a p p r o x \_ s p a n , y = a n s w e r \}$ pairs.
108
+
109
+ The easiest method was to simply treat the entire document as the true span from which the answer was generated $x =$ document, $y = a n s w e r$ ). The second alternative that we tried was to first extract the named entities, noun phrases and verb phrases from the question and create a lucene query from these components. We then used the lucene search engine to extract the most relevant portions of the document given this query. We then considered this portion of the document as the true span (as opposed to treating the entire document as the true span). Note that lucene could return multiple relevant spans in which case we treat all these $\left\{ x = a p p r o x \ldots s p a n , y = a n s w e r \right.$ as training instances. Another alternative was to find the longest common subsequence (LCS) between the document and the question and treat this subsequence as the span from which the answer was generated. Of these, we found that the model trained using $\{ x = a p p r o x \_ s p a n , y = a n s w e r \}$ pairs created using the LCS based method gave the best results. We report numbers only for this model.
110
+
111
+ Evaluation Metrics Similar to Rajpurkar et al. (2016a) we use Accuracy and F-score as the evaluation metric. While accuracy, being a stricter metric, considers a predicted answer to be correct only if it exactly matches the true answer, F-score also gives credit to predictions partially overlapping with the true answer.
112
+
113
+ # 6 RESULTS AND DISCUSSIONS
114
+
115
+ The results of our experiments are summarized in Tables 2 to 4 which we discuss in the following sub-sections.
116
+
117
+ Table 2: Performance of the preprocessing step. Plot compression is the $\%$ size of the extracted plot w.r.t the original plot size
118
+
119
+ <table><tr><td rowspan=1 colspan=1>Preprocessing step of Relevant Sub-plot Extraction</td><td rowspan=1 colspan=1>Plot Com-pression</td><td rowspan=1 colspan=1>AnswerRecall</td></tr><tr><td rowspan=1 colspan=1>Using WordNet synonym+Glove basedparaphrase</td><td rowspan=1 colspan=1>30%</td><td rowspan=1 colspan=1>66.51%</td></tr><tr><td rowspan=1 colspan=1>WordNet synonym + Glove based para-phrase on Coref resolved plots</td><td rowspan=1 colspan=1>50%</td><td rowspan=1 colspan=1>84.10%</td></tr><tr><td rowspan=1 colspan=1>WordNet synonym + Glove + Skip-thought based paraphrase on Coref re-solved plots</td><td rowspan=1 colspan=1>48%</td><td rowspan=1 colspan=1>85%</td></tr></table>
120
+
121
+ Table 3: Performance of the SpanModel and GenModel on the Span Test subset and the Full Test Set of the Self and ParaphraseRC.
122
+
123
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>Span Test Set</td><td rowspan=1 colspan=2>Full Test Set</td></tr><tr><td rowspan=1 colspan=1>TrainOn</td><td rowspan=1 colspan=1>TestOn</td><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td></tr><tr><td rowspan=3 colspan=1>SelfRC</td><td rowspan=1 colspan=1>SelfRC</td><td rowspan=1 colspan=1>46.14</td><td rowspan=1 colspan=1>57.49</td><td rowspan=1 colspan=1>37.53</td><td rowspan=1 colspan=1>50.56</td></tr><tr><td rowspan=1 colspan=1>Para-phraseRC</td><td rowspan=1 colspan=1>27.85</td><td rowspan=1 colspan=1>36.82</td><td rowspan=1 colspan=1>15.16</td><td rowspan=1 colspan=1>22.70</td></tr><tr><td rowspan=1 colspan=1>SelfRC+ Para-phraseRC</td><td rowspan=1 colspan=1>37.79</td><td rowspan=1 colspan=1>48.05</td><td rowspan=1 colspan=1>25.05</td><td rowspan=1 colspan=1>35.01</td></tr><tr><td rowspan=3 colspan=1>Para-phraseRC</td><td rowspan=1 colspan=1>SelfRC</td><td rowspan=1 colspan=1>34.85</td><td rowspan=1 colspan=1>45.71</td><td rowspan=1 colspan=1>28.25</td><td rowspan=1 colspan=1>40.16</td></tr><tr><td rowspan=1 colspan=1>Para-phraseRC</td><td rowspan=1 colspan=1>19.74</td><td rowspan=1 colspan=1>27.57</td><td rowspan=1 colspan=1>10.78</td><td rowspan=1 colspan=1>17.13</td></tr><tr><td rowspan=1 colspan=1>SelfRC+Para-phraseRC</td><td rowspan=1 colspan=1>27.94</td><td rowspan=1 colspan=1>37.42</td><td rowspan=1 colspan=1>18.50</td><td rowspan=1 colspan=1>27.31</td></tr><tr><td rowspan=3 colspan=1>SelfRC +Para-phraseRC</td><td rowspan=1 colspan=1>SelfRC</td><td rowspan=1 colspan=1>49.66</td><td rowspan=1 colspan=1>61.45</td><td rowspan=1 colspan=1>40.24</td><td rowspan=1 colspan=1>54.04</td></tr><tr><td rowspan=1 colspan=1>Para-phraseRC</td><td rowspan=1 colspan=1>29.88</td><td rowspan=1 colspan=1>39.34</td><td rowspan=1 colspan=1>16.33</td><td rowspan=1 colspan=1>24.25</td></tr><tr><td rowspan=1 colspan=1>Self+Para-phraseRC</td><td rowspan=1 colspan=1>40.62</td><td rowspan=1 colspan=1>51.35</td><td rowspan=1 colspan=1>26.90</td><td rowspan=1 colspan=1>37.42</td></tr></table>
124
+
125
+ Table 4: Combined and Cross-Testing between Self and ParaphraseRC Dataset, by taking the best performing SpanModel from Table 3.
126
+
127
+ <table><tr><td rowspan=2 colspan=1>SelfRC</td><td rowspan=1 colspan=2>Span Test subset</td><td rowspan=1 colspan=2>Full Test set</td></tr><tr><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td></tr><tr><td rowspan=1 colspan=1>SpanModel</td><td rowspan=1 colspan=1>46.14</td><td rowspan=1 colspan=1>57.49</td><td rowspan=1 colspan=1>37.53</td><td rowspan=1 colspan=1>50.56</td></tr><tr><td rowspan=1 colspan=1>GenModel(withaug-mented training data)</td><td rowspan=1 colspan=1>16.45</td><td rowspan=1 colspan=1>26.97</td><td rowspan=1 colspan=1>15.31</td><td rowspan=1 colspan=1>24.05</td></tr><tr><td rowspan=2 colspan=1>ParaphraseRC</td><td rowspan=1 colspan=2>Span Test subset</td><td rowspan=1 colspan=2>Full Test set</td></tr><tr><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td><td rowspan=1 colspan=1>Accur.</td><td rowspan=1 colspan=1>F1</td></tr><tr><td rowspan=1 colspan=1>SpanModel</td><td rowspan=1 colspan=1>17.93</td><td rowspan=1 colspan=1>26.27</td><td rowspan=1 colspan=1>9.78</td><td rowspan=1 colspan=1>16.33</td></tr><tr><td rowspan=1 colspan=1>SpanModel with Prepro-cessed Data</td><td rowspan=1 colspan=1>27.49</td><td rowspan=1 colspan=1>35.10</td><td rowspan=1 colspan=1>14.92</td><td rowspan=1 colspan=1>21.53</td></tr><tr><td rowspan=1 colspan=1>GenModel(withaug-mented training data)</td><td rowspan=1 colspan=1>12.66</td><td rowspan=1 colspan=1>19.48</td><td rowspan=1 colspan=1>5.42</td><td rowspan=1 colspan=1>9.64</td></tr></table>
128
+
129
+ • SpanModel v/s GenModel: Comparing the first two rows (SelfRC) and the last two rows (ParaphraseRC) of Table 3 we see that the SpanModel clearly outperforms the GenModel. This is not very surprising for two reasons. First, around $70 \%$ (and $50 \%$ ) of the answers in SelfRC (and ParaphraseRC) respectively, match an exact span in the document so the span based model still has scope to do well on these answers. On the other hand, even if the first stage of the GenModel predicts the span correctly, the second stage could make an error in generating the correct answer from it because generation is a harder problem. For the second stage, it is expected that the GenModel should learn to copy the predicted span to produce the answer output (as is required in most cases) and only occasionally where necessary, generate an answer. However, surprisingly the GenModel fails to even do this. Manual inspection of the generated answers shows that in many cases the generator ends up generating either more or fewer words compared the true answer. This demonstrates that there is clearly scope for the GenModel to perform better.
130
+
131
+ • SelfRC v/s ParaphraseRC: Comparing the SelfRC and ParaphraseRC numbers in Table 3, we observe that the performance of the models clearly drops for the latter task, thus validating our hypothesis that ParaphraseRC is a indeed a much harder task.
132
+
133
+ • Effect of NLP pre-processing: As mentioned in Section 4, for ParaphraseRC, we first perform a few pre-processing steps to identify relevant sentences in the longer document. In order to evaluate whether the pre-processing method is effective, we compute: (i) the percentage of the document that gets pruned, and (ii) whether the true answer is present in the pruned document (i.e., average recall of the answer). We can compute the recall only for the span-based subset of the data since for the remaining data we do not know the true span. In Table 2, we report these two quantities for the span-based subset using different pruning strategies. Finally, comparing the SpanModel with and without Paraphrasing in Table 3 for ParaphraseRC, we observe that the pre-processing step indeed improves the performance of the Span Detection Model.
134
+
135
+ • Effect of oracle pre-processing: As noted in Section 3, the ParaphraseRC plot is almost double in length in comparison to the SelfRC plot, which while adding to the complexities of the former task, is clearly not the primary reason of the model’s poor performance on that. To empirically validate this, we perform an Oracle pre-processing step, where, starting with the knowledge of the span containing the true answer, we extract a subplot around it such that the span is randomly located within that subplot and the average length of the subplot is similar to the SelfRC plots. The SpanModel with this Oracle preprocessed data exhibits a minor improvement in performance over that with rule-based preprocessing ( $1 . 6 \%$ in Accuracy and $4 . 3 \%$ in F1 over the Span Test), still failing to bridge the wide performance gap between the SelfRC and ParaphraseRC task.
136
+
137
+ • Cross Testing We wanted to examine whether a model trained on SelfRC performs well on ParaphraseRC and vice-versa. We also wanted to evaluate if merging the two datasets improves the performance of the model. For this we experimented with various combinations of train and test data. The results of these experiments for the SpanModel are summarized in Table 4. We make two main observations. First, training on one dataset and evaluating on the other results in a drop in the performance. Merging the training data from the two datasets exhibits better performance on the individual test sets.
138
+
139
+ Based on our experiments and empirical observations we believe that the DuoRC dataset indeed holds a lot of potential for advancing the horizon of complex language understanding by exposing newer challenges in this area.
140
+
141
+ # 7 CONCLUSION
142
+
143
+ In this paper we introduced DuoRC, a large scale RC dataset of 186K human-generated questionanswer pairs created from 7680 pairs of parallel movie-plots, each pair taken from Wikipedia and IMDb. We then showed that this dataset, by design, ensures very little or no lexical overlap between the questions created from one version and the segments containing the answer in the other version. With this, we hope to introduce the RC community to new research challenges on question-answering requiring external knowledge and common-sense driven reasoning, deeper language understanding and multiple-sentence inferencing. Through our experiments, we show how the state-of-the-art RC models, which have achieved near human performance on the SQuAD dataset, perform poorly on our dataset, thus emphasizing the need to explore further avenues for research.
144
+
145
+ # REFERENCES
146
+
147
+ Jonathan Berant, Vivek Srikumar, Pei-Chun Chen, Abby Vander Linden, Brittany Harding, Brad Huang, Peter Clark, and Christopher D. Manning. Modeling biological processes for reading comprehension. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, EMNLP 2014, October 25-29, 2014, Doha, Qatar, A meeting of SIGDAT, a Special Interest Group of the ACL, 2014. URL http://aclweb.org/anthology/D/D14/ D14-1159.pdf.
148
+
149
+ Yiming Cui. Cloze explorer, 2017. URL https://github.com/ymcui/ Eval-on-NN-of-RC/.
150
+
151
+ Karl Moritz Hermann, Tomas Kocisk ´ y, Edward Grefenstette, Lasse Espeholt, Will Kay, ´ Mustafa Suleyman, and Phil Blunsom. Teaching machines to read and comprehend. In Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 1693–1701, 2015. URL http://papers.nips.cc/paper/ 5945-teaching-machines-to-read-and-comprehend.
152
+
153
+ Robin Jia and Percy Liang. Adversarial examples for evaluating reading comprehension systems. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, EMNLP 2017, Copenhagen, Denmark, September 9-11, 2017, pp. 2011–2021, 2017. URL http://aclanthology.info/papers/D17-1214/d17-1214.
154
+
155
+ Mandar Joshi, Eunsol Choi, Daniel S. Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers, pp. 1601–1611, 2017. doi: 10.18653/v1/P17-1147. URL https://doi.org/10.18653/v1/P17-1147.
156
+
157
+ Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard H. Hovy. RACE: large-scale reading comprehension dataset from examinations. CoRR, abs/1704.04683, 2017. URL http: //arxiv.org/abs/1704.04683.
158
+
159
+ Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James F. Allen. A corpus and evaluation framework for deeper understanding of commonsense stories. CoRR, abs/1604.01696, 2016. URL http: //arxiv.org/abs/1604.01696.
160
+
161
+ Preksha Nema, Mitesh M. Khapra, Anirban Laha, and Balaraman Ravindran. Diversity driven attention model for query-based abstractive summarization. CoRR, abs/1704.08300, 2017. URL http://arxiv.org/abs/1704.08300.
162
+
163
+ Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. MS MARCO: A human generated machine reading comprehension dataset. In Proceedings of the Workshop on Cognitive Computation: Integrating neural and symbolic approaches 2016 co-located with the 30th Annual Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain, December 9, 2016., 2016. URL http: //ceur-ws.org/Vol-1773/CoCoNIPS_2016_paper9.pdf.
164
+
165
+ Takeshi Onishi, Hai Wang, Mohit Bansal, Kevin Gimpel, and David McAllester. Who did what: A large-scale person-centered cloze dataset. arXiv preprint arXiv:1608.05457, 2016.
166
+
167
+ Alexandre Passos, Vineet Kumar, and Andrew McCallum. Lexicon infused phrase embeddings for named entity resolution. In Proceedings of the Eighteenth Conference on Computational Natural Language Learning, CoNLL 2014, Baltimore, Maryland, USA, June 26-27, 2014, pp. 78–86, 2014. URL http://aclweb.org/anthology/W/W14/W14-1609.pdf.
168
+
169
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. arXiv preprint arXiv:1606.05250, 2016a.
170
+
171
+ Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad explorer, 2016b. URL https://rajpurkar.github.io/SQuAD-explorer/.
172
+
173
+ Matthew Richardson, Christopher J. C. Burges, and Erin Renshaw. Mctest: A challenge dataset for the open-domain machine comprehension of text. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, EMNLP 2013, 18-21 October 2013, Grand Hyatt Seattle, Seattle, Washington, USA, A meeting of SIGDAT, a Special Interest Group of the ACL, pp. 193–203, 2013. URL http://aclweb.org/anthology/D/D13/D13-1020.pdf.
174
+
175
+ Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. CoRR, abs/1611.01603, 2016. URL http://arxiv.org/ abs/1611.01603.
176
+
177
+ Chuanqi Tan, Furu Wei, Nan Yang, Weifeng Lv, and Ming Zhou. S-net: From answer extraction to answer generation for machine reading comprehension. CoRR, abs/1706.04815, 2017. URL http://arxiv.org/abs/1706.04815.
178
+
179
+ Makarand Tapaswi, Yukun Zhu, Rainer Stiefelhagen, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Movieqa: Understanding stories in movies through question-answering. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
180
+
181
+ Erik F. Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Languageindependent named entity recognition. In Walter Daelemans and Miles Osborne (eds.), Proceedings of CoNLL-2003, pp. 142–147. Edmonton, Canada, 2003.
182
+
183
+ Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. Newsqa: A machine comprehension dataset. CoRR, abs/1611.09830, 2016. URL http://arxiv.org/abs/1611.09830.
184
+
185
+ Dirk Weissenborn, Georg Wiese, and Laura Seiffe. Making neural QA as simple as possible but not simpler. In Proceedings of the 21st Conference on Computational Natural Language Learning (CoNLL 2017), Vancouver, Canada, August 3-4, 2017, pp. 271–280, 2017. doi: 10.18653/v1/ K17-1028. URL https://doi.org/10.18653/v1/K17-1028.
186
+
187
+ Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. CoRR, abs/1611.01604, 2016. URL http://arxiv.org/abs/1611.01604.
188
+
189
+ # APPENDIX A EXAMPLES
190
+
191
+ In this appendix, we showcase some examples of plots from which questions are created and answered. Since the questions are created from the smaller plot, answering these questions by the reading the smaller plot (which is named as the SelfRC task) is straightforward. However, answering them by reading the larger plot (i.e. the ParaphraseRC task) is more challenging and requires multi-sentence and sometimes multi-paragraph inferencing.
192
+
193
+ Due to shortage of space, we truncate the plot contents and only show snippets from which the questions can be answered. In the smaller plot, blue indicates that an answer can directly be found from the sentence and cyan indicates that the answer spans over multiple sentences. For the larger plot, red and orange are used respectively.
194
+
195
+ # A.1 EXAMPLE 1: PALE RIDER (1985)
196
+
197
+ # A.1.1 SMALLER PLOT
198
+
199
+ In the countryside outside the fictional town of Lahood, California, sometime around 1880, [[thugs working for big-time miner Coy LaHood ride in and destroy the camp of a group of struggling miners]Q1 and their families who have settled in nearby Carbon Canyon and are panning for gold there. In leaving, they also shoot the little dog of fourteen-year-old Megan Wheeler]Q15. As Megan buries her dog in the woods and prays for a miracle, a stranger passes by heading to the town on horseback.
200
+
201
+ [Megan’s mother, Sarah]Q16, is being courted by [Hull Barret, the leader of the miners]Q17 . . . [Coy LaHood’s son Josh]Q8 . . . [Club, who with one hammer blow smashes a large rock]Q7 . . . [Coy LaHood has been away in Sacramento]Q9 . . . [[Megan, who has grown fond of the Preacher, goes looking for him, but Josh confronts and attempts to rape her]Q11, while his cohorts look on and encourage him, except for Club, who sees what is happening and moves forward to help Megan]Q13 before Josh can do anything serious. At this moment the [Preacher arrives on horseback armed with a Remington Model 1858 revolver he has recovered from a Wells Fargo office and, after shooting Josh]Q14 . . . [Stockburn, who appears startled and says that he sounds like someone that he once knew, but that couldn’t be, since that man is dead]Q5. [Stockburn and his men gun down Spider Conway] Q4, . . .
202
+
203
+ [The Preacher and Hull go to LaHood’s strip mining site and blow it up with dynamite]Q6. [To stop Hull from following him, the Preacher then scares off Hull’s horse]Q3 and rides into town alone. . . [Coy LaHood, watching from his office]Q10, . [snow-covered mountains]Q2. [Megan then drives into town and shouts her love to the Preacher]Q12 and thanks after him. The words echo along the ravine that he is traversing.
204
+
205
+ # A.1.2 LARGER PLOT
206
+
207
+ Somewhere in California, at the end of the Gold Rush, several horsemen come riding down from the nearby mountains . . . [The horsemen shoot cattle and Megan’s dog]Q4,Q15, and then chase donkeys as they leave . . .
208
+
209
+ Hull describes the fight between the stranger and McGill and his men. [Megan’s mother, Sarah]Q16 says he sounds no different from McGill, Tyson, or any of LaHood’s roughnecks . . . Preacher says there is lot of sinners around, that he can’t leave before he finishes his work. [Josh says, ”Club”, who gets down and walks into the stream. Everyone is apprehensive. He rolls down his sleeves, and then. . . quickly grabs Hull’s sledgehammer with one hand and strikes the boulder once, screaming, splitting it]Q7 .
210
+
211
+ [A train pulls into the station from Sacramento while Josh and McGill wait. [Josh’s father Coy LaHood]]Q8,Q9 (Richard Dysart) exits the train, and then he goes with Josh and McGill. . .
212
+
213
+ Josh asks what she really came for. She replies that she’s just riding, taking a look around. [Josh says he wants to take a look too, at her real close. He pulls her off the horse. She screams as he carries her downhill. . . Josh grabs her hair and kisses her. They both fall to the ground. The men cheer him on while Megan begs him to stop]Q11 . . . a gunshot sounds out. Josh gets up and everyone turns around. [Preacher, on his horse. . . His gun is trained on Josh. Megan sees him and smiles]Q13, . . . [Josh falls to the ground. He reaches for his gun, but Preacher shoots his hand]Q14 . . . LaHood replies, ”Tall. Lean. His eyes. . . his eyes. Something strange about em. That mean something to you?” [Stockburn says that it sounds like a man he knew, but that man is dead]Q5 . . . [LaHood watches through the window]Q10 as they kill Spider, . . .
214
+
215
+ Table 5: QA for Pale Rider
216
+
217
+ <table><tr><td>Question</td><td></td><td>Shorter Plot Answer</td><td>Larger Plot Answer</td></tr><tr><td>Q1</td><td>For which big-time miner are the thugs who destroyed miners camp in Carbon Canyon working for?</td><td>Coy Lahood</td><td>Coy Lahood</td></tr><tr><td>Q2</td><td>How are the mountains in the film?</td><td>Covered with snow</td><td> snow-capped</td></tr><tr><td>Q3</td><td>How does the Preacher stop Hull from following him?</td><td> Scares Hulls&#x27; horse</td><td>To stop Hull from following him, the Preacher then scares off Hull&#x27;s horse and rides into town alone</td></tr><tr><td>Q4</td><td>In the movie, who do Stockburn and his men gun down?</td><td> Spider Conway</td><td>Megan&#x27;s dog and cattle</td></tr><tr><td>Q5</td><td>In the movie, why does Stockburn say that the Preacher could not be the man he once knew?</td><td> that man is dead</td><td>The man Stockburn once knew is dead</td></tr><tr><td>Q6</td><td>What did they use to blow up the strip mining site?</td><td>Dynamite</td><td>dynamite</td></tr><tr><td>Q7</td><td>What does Club smash?</td><td>A rock</td><td>A Boulder</td></tr><tr><td>Q8</td><td>What is Coy Lahood&#x27;s relation to Josh?</td><td>Father and son</td><td>Father</td></tr><tr><td>Q9</td><td>Where has Coy Lahood been living?</td><td> Sacramento</td><td> Sacramento</td></tr><tr><td>Q10</td><td>Where was Coy watching from?</td><td>Office</td><td> a window</td></tr><tr><td>Q11</td><td> Who attempts to rape Megan?</td><td>Josh</td><td>Josh</td></tr><tr><td>Q12</td><td>Who does megan love?</td><td>The preacher</td><td>The preacher</td></tr><tr><td>Q13</td><td>Who prevents Josh from raping Megan?</td><td>Club</td><td>the preacher The</td></tr><tr><td>Q14</td><td>Who shoots Josh in the hand?</td><td>Preacher</td><td> Preacher</td></tr><tr><td>Q15</td><td>Whose little dog did the thugs shoot?</td><td>Megan Wheeler</td><td> Megan</td></tr><tr><td>Q16</td><td>Who is Megan&#x27;s mother?</td><td> Sarah</td><td> Sarah</td></tr><tr><td>Q17</td><td>Who is the leader of the miners ?</td><td>Hull Barret</td><td>Coy LaHood</td></tr></table>
218
+
219
+ Hull insists on going with him so Preacher agrees. [They go to the LaHood camp and blow up their pipes, sluices, tents, and the barracks with dynamite]Q6. [After fooling Hull to dismount, Preacher scares away his horse. He then tells Hull to take care of Sarah and Megan, and rides into town]Q3 . . . Blankenship tells her that the horses are exhausted and she would kill them. [Megan runs to the end of town and shouts out thank you to Preacher, that they love him, that she loves him]Q12 . . . The final shot of the movie shows Preacher riding through the [snow in the mountains]Q2.
220
+
221
+ # A.2 EXAMPLE 2: BIG JAKE (1971)
222
+
223
+ # A.2.1 SMALLER PLOT
224
+
225
+ [In 1909]Q6, [there is a raid on the McCandles family . . . Martha, the head of the family . . . [In consequence, she sends for her estranged husband, the aging Jacob ”Big Jake” McCandles]Q9, . . . [the ransom to the kidnappers, a million dollars]Q4
226
+
227
+ . . . [The Texas Ranger captain is present and offers the services of his men]Q11, . . . Jake, preferring the old ways, has followed on horseback, accompanied by an old Apache associate, Sam Sharpnose. [He is now joined by his sons, Michael and James]Q2, . . . Knowing that they have been followed by another gang intent on stealing the strongbox, [Jake sets a trap for them and they are all killed]Q16. [During the attack, the chest is blasted open]Q1, [revealing clipped bundles of newspaper instead of money] Q5
228
+
229
+ A thunderstorm breaks and [Pop Dawson, one of the outlaws, arrives to give them the details of the exchange]Q7 . . . [Jake arranges for Michael to follow after them to take care of the sharp] . . . [Jake tosses the key of the chest to Fain, who opens it up to discover that he has been tricked]Q12. [Fain orders his brother Will to kill the boy]Q13 but he is shot by Jake. [Dog is wounded by the sniper]Q15 and Jake is wounded in the leg before Michael kills him. Jake tells the boy to escape but Little Jake is hunted by the machete wielding [John Goodfellow, who has already hacked Sam to death]Q10 . . . [With Little Jake rescued, and the broken family bonded, they prepare to head home]Q3.
230
+
231
+ # A.2.2 LARGER PLOT
232
+
233
+ [[Jacob McCandles (John Wayne) is a big man with a bigger reputation. A successful rancher and landowner]Q14, his many businesses keep him conveniently away from his home and estranged wife Martha (Maureen O’Hara)]Q9. . . , [and is demanding one million dollars for his safe return]Q4.
234
+
235
+ [The local sheriff has convened a posse complete with then state-of-the-art automobiles. [Two of Jake’s sons, the passionate, gunslinging James (Patrick Wayne) and the motorcycle-riding, sharpshooting Michael (Christopher Mitchum) $] ^ { Q 2 }$ elect to go with the sheriff’s posse. Big Jake decides to set off across the rough terrain on his horse with his Dog at his side, and soon meets up with his Native American friend, Sam Sharpnose (Bruce Cabot), who has brought additional horses and supplies]Q11.
236
+
237
+ [They then devise their strategy: James will go have a good time in the saloon, Big Jake will head to the barbershop for a shower, Sam will secrete himself on the roof of the hotel, seemingly leaving Michael alone protecting the strong box. Big Jake tells Sam to listen for a ”disturbance” in the street, and use the distraction to join Michael in the hotel room to protect the strong box. As Big Jake predicted, the gang tries to hit the strong box when it looks most vulnerable. Fain and another of his gang members start a fight with James in the saloon, one keeps a gun on Big Jake in the barbershop, and two others come up the hotel stairs and toward the room. Big Jake dispatches his captor in the barbershop, James fights his way out of the saloon with Jake’s help, and the two head to the hotel. At the hotel, once Sam hears the fight in the saloon, he climbs over the roof and slips in the window to aid Michael in protecting the strong box. Shotguns blast as the gang hits the hotel room. When James and Jake arrive they find Sam, Michael and the Dog unharmed, [but the strong box has suffered damage. To their horror, James and Michael realize they’ve been risking their lives to protect a box of newspaper clippings!]]Q1,Q5,Q16 .
238
+
239
+ [Big Jake takes the few moments he has to plan with his sons. He tells Michael of the sharpshooter and instructs him to find a high position and take him out whenever he can. Big Jake takes the Dog and goes to the meet as instructed, while the others follow discreetly behind]Q8 . . . [As Fain unlocks the strong box, he realizes hes been had ´ ]Q12. Big Jake whispers to him that no matter what happens, Fain will be the first one to die. [Fain screams his command to kill the boy ]Q13,
240
+
241
+ [Dog giving his life protecting Little Jake from one of Fain’s machete-wielding gang]Q15. . . Sam points him toward James at the exit, [who helps Little Jake escape. Fain and Big Jake are in a duel to the death, when Michael takes a fatal shot at Fain, saving his father and Little Jake. After a harrowing journey and a risky gamble, the family leaves, happy to be together]Q3.
242
+
243
+ Table 6: QA for Big Jake
244
+
245
+ <table><tr><td>Question</td><td></td><td>Shorter Plot Answer</td><td>Larger Plot Answer</td></tr><tr><td>Q1</td><td>How was the strongbox opened?</td><td>It was blasted during an attack</td><td>it was damaged during the fight</td></tr><tr><td>Q2</td><td>What are the names of Jake&#x27;s sons?</td><td>Jake&#x27;s sons are Michael and James</td><td>James and Michael</td></tr><tr><td>Q3</td><td>What did the family prepare to do once Jake had been rescued?</td><td>head home</td><td>Leave</td></tr><tr><td>Q4</td><td>What is the amount of the ransom?</td><td>The ransom amount is a million dollars</td><td> one million dollars</td></tr><tr><td>Q5</td><td>What was in the strongbox?</td><td>Clipped bundles of newspaper</td><td> newspaper clippings</td></tr><tr><td>Q6</td><td>What year does the movie take place?</td><td>1909</td><td> No Answer</td></tr><tr><td>Q7</td><td>Which outlaw gives details of the exchange to the others?</td><td>Pop Dawson</td><td> No Answer</td></tr><tr><td>Q8</td><td>Who does Jake arrange to follow the rest of the group?</td><td>Michael</td><td>Michael</td></tr><tr><td>Q9</td><td>Who is married to Big Jake?</td><td>Martha</td><td>Martha</td></tr><tr><td>Q10</td><td>Who killed Sam?</td><td>John Goodfellow</td><td> No Answer</td></tr><tr><td>Q11</td><td>Who offers his services to help Jake combat the kidnappers?</td><td>The Texas ranger captain offers the services of men</td><td>the posse, native American friend and his two sons</td></tr><tr><td>Q12</td><td>Who opens the chest to discover he has been tricked?</td><td>Fain</td><td>Fain</td></tr><tr><td>Q13</td><td>Who orders Will to kill the boy?</td><td>Fain</td><td>Fain</td></tr><tr><td>Q14</td><td>Who owns the ranch?</td><td>McCandles family</td><td> McCandles family</td></tr><tr><td>Q15</td><td>Who wounded the dog?</td><td>A sniper</td><td>Fain&#x27;s machete-wielding gang</td></tr><tr><td>Q16</td><td>Why does Jake set a trap and kill another gang?</td><td>on stealing the strongbox</td><td>to protect the strongbox</td></tr></table>
246
+
247
+ # APPENDIX B DATA ANALYSIS
248
+
249
+ We conducted a manual verification of 100 question-answer pairs where the SelfRC and ParaphraseRC were different or the latter was marked as non-answerable. As noted in Fig. 3, the chief reason behind getting No Answer from the Paraphrase plot is lack of information and at times, need for an educated guesswork or missing general knowledge (e.g. Philadelphia is a city) or missing movie meta-data (e.g. to answer questions like ‘Where did Julia Roberts’ character work in the movie?’). On the other hand, SelfRC and ParaphraseRC answers are occasionally seen to have partial or no overlap, mainly because of the following causes; phrasal paraphrases or subjective questions (e.g. Why and How type questions) or different valid answers to objective questions (e.g. ‘Where did Jane work?’ is answered by one worker as ‘Bloomberg�� and other as ‘New York City’) or differently spelt names in the answers (e.g. ‘Rebeca’ as opposed to ‘Rebecca’).
250
+
251
+ ![](images/cc758b5c05b95d333ecb70264727ad69aa0622190ab33fdd35c3f0f51c68a706.jpg)
252
+ Figure 3: Manual Analysis of 100 Questions and their corresponding answers from the SelfRC and ParaphraseRC Dataset to understand the various reasons behind these two answers being different or the latter being non-answerable
253
+
254
+ # APPENDIX C MODEL ARCHITECTURE
255
+
256
+ Fig. 4 illustrates the 5-step process of answering a question from the comprehension, by optionally pre-processing the input passage in Step 2 and 3, then using the BiDirectional Attention Flow (BiDAF) model for Span identification, and finally generating the answer text from the identified span by employing a state-of-the-art query-based Abstractive Summarization (qBAS) model.
257
+
258
+ ![](images/bbf4e4186cba1284a210e98de5e53be59cef477dc4238c76a15317654ae61e4e.jpg)
259
+ Figure 4: Model architecture
260
+
261
+ Question: Peters is aboard the plane with what?
262
+
263
+ # APPENDIX D PERFORMANCE ANALYSIS
264
+
265
+ In Fig. 5 we show a performance analysis of the SelfRC and ParaphraseRC tasks when evaluated on the Span Test Subset and the Full Test Set, over different question types and plots of different length.
266
+
267
+ ![](images/dc5087c0dbcf25d98d448d4fcd1a74b4dfda8d170bea4b4bfb36212da7cd6e05.jpg)
268
+ Figure 5: Performance Analysis of the Self and ParaphraseRC on different plot-lengths or different questiontypes
md/train/H1kG7GZAW/H1kG7GZAW.md ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VARIATIONAL INFERENCE OF DISENTANGLED LATENTCONCEPTS FROM UNLABELED OBSERVATIONS
2
+
3
+ Abhishek Kumar, Prasanna Sattigeri, Avinash Balakrishnan
4
+
5
+ IBM Research AI
6
+ Yorktown Heights, NY
7
+ {abhishk,psattig,avinash.bala}@us.ibm.com
8
+
9
+ # ABSTRACT
10
+
11
+ Disentangled representations, where the higher level data generative factors are reflected in disjoint latent dimensions, offer several benefits such as ease of deriving invariant representations, transferability to other tasks, interpretability, etc. We consider the problem of unsupervised learning of disentangled representations from large pool of unlabeled observations, and propose a variational inference based approach to infer disentangled latent factors. We introduce a regularizer on the expectation of the approximate posterior over observed data that encourages the disentanglement. We also propose a new disentanglement metric which is better aligned with the qualitative disentanglement observed in the decoder’s output. We empirically observe significant improvement over existing methods in terms of both disentanglement and data likelihood (reconstruction quality).
12
+
13
+ # 1 INTRODUCTION
14
+
15
+ Feature representations of the observed raw data play a crucial role in the success of machine learning algorithms. Effective representations should be able to capture the underlying (abstract or high-level) latent generative factors that are relevant for the end task while ignoring the inconsequential or nuisance factors. Disentangled feature representations have the property that the generative factors are revealed in disjoint subsets of the feature dimensions, such that a change in a single generative factor causes a highly sparse change in the representation. Disentangled representations offer several advantages – (i) Invariance: it is easier to derive representations that are invariant to nuisance factors by simply marginalizing over the corresponding dimensions, (ii) Transferability: they are arguably more suitable for transfer learning as most of the key underlying generative factors appear segregated along feature dimensions, (iii) Interpretability: a human expert may be able to assign meanings to the dimensions, $( i \nu )$ Conditioning and intervention: they allow for interpretable conditioning and/or intervention over a subset of the latents and observe the effects on other nodes in the graph. Indeed, the importance of learning disentangled representations has been argued in several recent works (Bengio et al., 2013; Lake et al., 2016; Ridgeway, 2016).
16
+
17
+ Recognizing the significance of disentangled representations, several attempts have been made in this direction in the past (Ridgeway, 2016). Much of the earlier work assumes some sort of supervision in terms of: (i) partial or full access to the generative factors per instance (Reed et al., 2014; Yang et al., 2015; Kulkarni et al., 2015; Karaletsos et al., 2015), (ii) knowledge about the nature of generative factors (e.g, translation, rotation, etc.) (Hinton et al., 2011; Cohen & Welling, 2014), (iii) knowledge about the changes in the generative factors across observations (e.g., sparse changes in consecutive frames of a Video) (Goroshin et al., 2015; Whitney et al., 2016; Fraccaro et al., 2017; Denton & Birodkar, 2017; Hsu et al., 2017), (iv) knowledge of a complementary signal to infer representations that are conditionally independent of it1 (Cheung et al., 2014; Mathieu et al., 2016; Siddharth et al., 2017). However, in most real scenarios, we only have access to raw observations without any supervision about the generative factors. It is a challenging problem and many of the earlier attempts have not been able to scale well for realistic settings (Schmidhuber, 1992; Desjardins et al., 2012; Cohen & Welling, 2015) (see also, Higgins et al. (2017)).
18
+
19
+ Recently, Chen et al. (2016) proposed an approach to learn a generative model with disentangled factors based on Generative Adversarial Networks (GAN) (Goodfellow et al., 2014), however implicit generative models like GANs lack an effective inference mechanism2, which hinders its applicability to the problem of learning disentangled representations. More recently, Higgins et al. (2017) proposed an approach based on Variational AutoEncoder (VAE) Kingma & Welling (2013) for inferring disentangled factors. The inferred latents using their method (termed as $\beta$ -VAE ) are empirically shown to have better disentangling properties, however the method deviates from the basic principles of variational inference, creating increased tension between observed data likelihood and disentanglement. This in turn leads to poor quality of generated samples as observed in (Higgins et al., 2017).
20
+
21
+ In this work, we propose a principled approach for inference of disentangled latent factors based on the popular and scalable framework of amortized variational inference (Kingma & Welling, 2013; Stuhlmuller et al., 2013; Gershman & Goodman, 2014; Rezende et al., 2014) powered by stochastic ¨ optimization (Hoffman et al., 2013; Kingma & Welling, 2013; Rezende et al., 2014). Disentanglement is encouraged by introducing a regularizer over the induced inferred prior. Unlike $\beta$ -VAE (Higgins et al., 2017), our approach does not introduce any extra conflict between disentanglement of the latents and the observed data likelihood, which is reflected in the overall quality of the generated samples that matches the VAE and is much better than $\beta$ -VAE. This does not come at the cost of higher entanglement and our approach also outperforms $\beta$ -VAE in disentangling the latents as measured by various quantitative metrics. We also propose a new disentanglement metric, called Separated Attribute Predictability or SAP, which is better aligned with the qualitative disentanglement observed in the decoder’s output compared to the existing metrics.
22
+
23
+ # 2 FORMULATION
24
+
25
+ We start with a generative model of the observed data that first samples a latent variable $\mathbf { z } \sim p ( \mathbf { z } )$ , and an observation is generated by sampling from $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ . The joint density of latents and observations is denoted as $p _ { \theta } ( \mathbf { \bar { x } } , \mathbf { z } ) = p ( \mathbf { \bar { z } } ) p _ { \theta } ( \mathbf { \bar { x } } | \mathbf { z } )$ . The problem of inference is to compute the posterior of the latents conditioned on the observations, i.e., $\begin{array} { r } { p _ { \theta } ( \mathbf { z } | \mathbf { x } ) = \frac { p _ { \theta } ( \mathbf { x } , \mathbf { z } ) } { \int p _ { \theta } ( \mathbf { x } , \mathbf { z } ) d \mathbf { z } } } \end{array}$ . We assume that we are given a finite set of samples (observations) from the true data distribution $p ( \mathbf { x } )$ . In most practical scenarios involving high dimensional and complex data, this computation is intractable and calls for approximate inference. Variational inference takes an optimization based approach to this, positing a family $\mathcal { D }$ of approximate densities over the latents and reducing the approximate inference problem to finding a member density that minimizes the Kullback-Leibler divergence to the true posterior, i.e., $\begin{array} { r } { q _ { \mathbf { x } } ^ { * } = \operatorname* { m i n } _ { \boldsymbol { q } \in \mathcal { D } } \mathrm { K L } ( q ( \mathbf { z } ) \bar { | | } p _ { \boldsymbol { \theta } } ( \mathbf { z } | \mathbf { x } ) ) } \end{array}$ (Blei et al., 2017). The idea of amortized inference (Kingma & Welling, 2013; Stuhlmuller et al., 2013; Gershman & Goodman, 2014; Rezende et al., 2014) is ¨ to explicitly share information across inferences made for each observation. One successful way of achieving this for variational inference is to have a so-called recognition model, parameterized by $\phi$ , that encodes an inverse map from the observations to the approximate posteriors (also referred as variational autoencoder or VAE) (Kingma & Welling, 2013; Rezende et al., 2014). The recognition model parameters are learned by optimizing the problem $\begin{array} { r } { \operatorname* { m i n } _ { \phi } \mathbb { E } _ { \mathbf { x } } \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } | \mathbf { x } ) ) } \end{array}$ , where the outer expectation is over the true data distribution $p ( \mathbf { x } )$ which we have samples from. This can be shown as equivalent to maximizing what is termed as evidence lower bound (ELBO):
26
+
27
+ $$
28
+ \underset { \theta , \phi } { \mathrm { a r g } \mathrm { m i n } } \mathbb { E } _ { \mathbf { x } } \mathbf { K } \mathbf { L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p _ { \theta } ( \mathbf { z } | \mathbf { x } ) ) = \underset { \theta , \phi } { \mathrm { a r g } \mathrm { m a x } } \mathbb { E } _ { \mathbf { x } } \left[ \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \mathbf { K } \mathbf { L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) ) \right]
29
+ $$
30
+
31
+ The ELBO (the objective at the right side of Eq. 1) lower bounds the log-likelihood of observed data, and the gap vanishes at the global optimum. Often, the density forms of $p ( \mathbf { z } )$ and $q _ { \phi } ( { \bf z } | { \bf x } )$ are chosen such that their KL-divergence can be written analytically in a closed-form expression (e.g., $p ( \mathbf { z } )$ is $N ( 0 , I )$ and $q _ { \phi } ( { \bf z } | { \bf x } )$ is $\bar { N } ( \mu _ { \phi } ( { \bf x } ) , \Sigma _ { \phi } ( { \bf x } ) ) )$ (Kingma & Welling, 2013). In such cases, the ELBO can be efficiently optimized (to a stationary point) using stochastic first order methods where both expectations are estimated using mini-batches. Further, in cases when $q _ { \phi } ( \cdot )$ can be written as a continuous transformation of a fixed base distribution (e.g., the standard normal distribution), a low variance estimate of the gradient over $\phi$ can be obtained by coordinate transformation (also referred as reparametrization) (Fu, 2006; Kingma & Welling, 2013; Rezende et al., 2014).
32
+
33
+ # 2.1 GENERATIVE STORY: DISENTANGLED PRIOR
34
+
35
+ Most VAE based generative models for real datasets (e.g., text, images, etc.) already work with a relatively simple and disentangled prior $p ( \mathbf { z } )$ having no interaction among the latent dimensions (e.g., the standard Gaussian $N ( 0 , I ) ,$ ) (Bowman et al., 2015; Miao et al., 2016; Hou et al., 2017; Zhao et al., 2017). The complexity of the observed data is absorbed in the conditional distribution $p _ { \theta } ( \mathbf { x } | \mathbf { z } )$ which encodes the interactions among the latents. Hence, as far as the generative modeling is concerned, disentangled prior sets us in the right direction.
36
+
37
+ # 2.2 INFERRING DISENTANGLED LATENTS
38
+
39
+ Although the generative model starts with a disentangled prior, our main objective is to infer disentangled latents which are potentially conducive for various goals mentioned in Sec. 1 (e.g., invariance, transferability, interpretability). To this end, we consider the density over the inferred latents induced by the approximate posterior inference mechanism,
40
+
41
+ $$
42
+ q _ { \phi } ( \mathbf { z } ) = \int q _ { \phi } ( \mathbf { z } | \mathbf { x } ) p ( \mathbf { x } ) d \mathbf { x } ,
43
+ $$
44
+
45
+ which we will subsequently refer to as the inferred prior or expected variational posterior ${ \bf \nabla } ( p ( { \bf x } )$ is the true data distribution that we have only samples from). For inferring disentangled factors, this should be factorizable along the dimensions, i.e., $\begin{array} { r } { q _ { \phi } ( \mathbf { z } ) = \prod _ { i } q _ { i } ( z _ { i } ) } \end{array}$ , or equivalently $q _ { i \mid j } ( z _ { i } | z _ { j } ) =$ $q _ { i } ( z _ { i } ) , \forall i , j$ . This can be achieved by minimizing a suitable distance between the inferred prior $q _ { \phi } ( \mathbf { z } )$ and the disentangled generative prior $p ( \mathbf { z } )$ . We can also define expected posterior as $p _ { \boldsymbol { \theta } } ( \mathbf { z } ) =$ $\begin{array} { r } { \int p _ { \theta } ( \mathbf { z } | \mathbf { x } ) p ( \mathbf { x } ) d \mathbf { x } } \end{array}$ . If we take KL-divergence as our choice of distance, by relying on its pairwise convexity (i.e., $\mathrm { K L } ( \lambda p _ { 1 } + ( 1 - \lambda ) p _ { 2 } | | \lambda q _ { 1 } + ( 1 - \lambda ) q _ { 2 } ) \le \lambda \mathrm { K L } ( p _ { 1 } | | q _ { 1 } ) + ( 1 - \lambda ) \mathrm { K L } ( p _ { 2 } | | q _ { 2 } ) )$ (Van Erven & Harremos, 2014), we can show that the distance between $q _ { \phi } ( \mathbf { z } )$ and $p _ { \boldsymbol { \theta } } ( \mathbf { z } )$ is bounded by the objective of the variational inference:
46
+
47
+ $$
48
+ \begin{array} { r } { \mathrm { K L } \big ( q _ { \phi } ( \mathbf { z } ) \| p _ { \theta } ( \mathbf { z } ) \big ) = \mathrm { K L } \big ( \mathbb { E } _ { \mathbf { x } \sim p ( \mathbf { x } ) } q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \big ) \| \mathbb { E } _ { \mathbf { x } \sim p ( \mathbf { x } ) } p _ { \theta } ( \mathbf { z } | \mathbf { x } ) \big ) \leq \mathbb { E } _ { \mathbf { x } \sim p ( \mathbf { x } ) } \mathrm { K L } \big ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p _ { \theta } ( \mathbf { z } | \mathbf { x } ) \big ) . } \end{array}
49
+ $$
50
+
51
+ In general, the prior $p ( \mathbf { z } )$ and expected posterior $p _ { \boldsymbol { \theta } } ( \mathbf { z } )$ will be different, although they may be close (they will be same when $\begin{array} { r } { p _ { \theta } ( \mathbf { x } ) \overset { \cdot } { = } \int p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) d \mathbf { z } } \end{array}$ is equal to $p ( \mathbf { x } ) .$ ). Hence, variational posterior inference of latent variables with disentangled prior naturally encourages inferring factors that are close to being disentangled. We think this is the reason that the original VAE (Eq. (1)) has also been observed to exhibit some disentangling behavior on simple datasets such as MNIST (Kingma $\&$ Welling, 2013). However, this behavior does not carry over to more complex datasets (Aubry et al., 2014; Liu et al., 2015; Higgins et al., 2017), unless extra supervision on the generative factors is provided (Kulkarni et al., 2015; Karaletsos et al., 2015). This can be due to: (i) $p ( \mathbf { x } )$ and $p _ { \theta } ( \mathbf { x } )$ being far apart which in turn causes $p ( \mathbf { z } )$ and $p _ { \boldsymbol { \theta } } ( \mathbf { z } )$ being far apart, and (ii) the non-convexity of the ELBO objective which prevents us from achieving the global minimum of $\mathbb { E } _ { \mathbf { x } } \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p _ { \theta } ( \mathbf { z } | \mathbf { x } ) )$ (which is 0 and implies $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) | | p _ { \theta } ( \mathbf { z } ) ) = 0 )$ . In other words, maximizing the ELBO (Eq. (1)) might also result in reducing the value of $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ , however, due to the aforementioned reasons, the gap between $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ and $\mathbb { E } _ { \mathbf { x } } \ K \ L ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p _ { \theta } ( \mathbf { z } | \mathbf { x } ) )$ could be large at the stationary point of convergence. Hence, minimizing $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ or any other suitable distance $D ( q _ { \phi } ( \mathbf { z } ) , p ( \mathbf { z } ) )$ explicitly will give us better control on the disentanglement. This motivates us to add $D ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ as part of the objective to encourage disentanglement during inference, i.e.,
52
+
53
+ $$
54
+ \operatorname* { m a x } _ { \theta , \phi } \mathbb { E } _ { \mathbf { x } } \left[ \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) ) \right] - \lambda D ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) ) ,
55
+ $$
56
+
57
+ where $\lambda$ controls its contribution to the overall objective. We refer to this as DIP-VAE (for Disentangled Inferred Prior) subsequently.
58
+
59
+ Optimizing (4) directly is not tractable if $D ( \cdot , \cdot )$ is taken to be the KL-divergence $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ , which does not have a closed-form expression. One possibility is use the variational formulation of the KL-divergence (Nguyen et al., 2010; Nowozin et al., 2016) that needs only samples from $q _ { \phi } ( \mathbf { z } )$ and $p ( \mathbf { z } )$ to estimate a lower bound to $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ . However, this would involve optimizing for a third set of parameters $\psi$ for the KL-divergence estimator, and would also change the optimization to a saddle-point (min-max) problem which has its own optimization challenges (e.g., gradient vanishing as encountered in training generative adversarial networks with KL or Jensen-Shannon (JS) divergences (Goodfellow et al., 2014; Arjovsky & Bottou, 2017)). Taking $D$ to be another suitable distance between $q _ { \phi } ( \mathbf { z } )$ and $p ( \mathbf { z } )$ (e.g., integral probability metrics like Wasserstein distance (Sriperumbudur et al., 2009)) might alleviate some of these issues (Arjovsky et al., 2017) but will still involve complicating the optimization to a saddle point problem in three set of parameters3. It should also be noted that using these variational forms of the distances will still leave us with an approximation to the actual distance.
60
+
61
+ We adopt a simpler yet effective alternative of matching the moments of the two distributions. Matching the covariance of the two distributions will amount to decorrelating the dimensions of $\mathbf { z } \sim q _ { \phi } ( \mathbf { z } )$ if $p ( \mathbf { z } )$ is $N ( 0 , I )$ . Let us denote $\begin{array} { r } { \mathrm { C o v } _ { q ( \mathbf { z } ) } [ \mathbf { z } ] : = \mathbb { E } _ { q ( \mathbf { z } ) } \left[ ( \mathbf { z } - \mathbb { E } _ { q ( \mathbf { z } ) } [ \mathbf { \breve { z } } ] ) ( \mathbf { z } - \mathbb { E } _ { q [ \mathbf { z } ] } ( \mathbf { z } ) ) ^ { \top } \right] } \end{array}$ . By the law of total covariance, the covariance of $\mathbf { z } \sim q _ { \phi } ( \mathbf { z } )$ is given by
62
+
63
+ $$
64
+ \mathrm { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { z } ] = \mathbb { E } _ { p ( \mathbf { x } ) } \mathrm { C o v } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathbf { z } ] + \mathrm { C o v } _ { p ( \mathbf { x } ) } \left( \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathbf { z } ] \right) ,
65
+ $$
66
+
67
+ where $\mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathbf { z } ]$ and $\mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathbf { z } ]$ are random variables that are functions of the random variable $\mathbf { x }$ $\mathbf { z }$ is marginalized over). Most existing work on the VAE models uses $q _ { \phi } ( { \bf z } | { \bf x } )$ having the form ${ \cal N } ( { \pmb \mu } _ { \phi } ( { \bf x } ) , { \pmb \Sigma } _ { \phi } ( { \bf x } ) )$ , where $\mu _ { \phi } ( \mathbf { x } )$ and $\Sigma _ { \phi } ( \mathbf { x } )$ are the outputs of a deep neural net parameterized by $\phi$ . In this case Eq. (5) reduces to $\mathrm { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { \bar { z } } ] = \mathbb { E } _ { p ( \mathbf { x } ) } [ \bar { \Sigma } _ { \phi } ( \mathbf { x } ) ] + \mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ , which we want to be close to the Identity matrix. For simplicity, we choose entry-wise squared $\ell _ { 2 }$ -norm as the measure of proximity. Further, $\Sigma _ { \phi } ( \mathbf { x } )$ is commonly taken to be a diagonal matrix which means that cross-correlations (off-diagonals) between the latents are due to only $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ . This suggests two possible options for the disentangling regularizer: (i) regularizing only $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ which we refer as DIP-VAE-I, (ii) regularizing $\mathrm { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { z } ]$ which we refer as DIP-VAE-II. Penalizing just the off-diagonals in both cases will lead to lowering the diagonal entries of $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ as the $i j "$ ’th off-diagonal is really a derived attribute obtained by multiplying the square-roots of $\overrightarrow { \imath } ^ { \prime }$ ’th and $j ^ { ; }$ ’th diagonals (for each example $\mathbf { x } \sim p ( \mathbf { x } )$ , followed by averaging over all examples). This can be compensated in DIP-VAE-I by a regularizer on the diagonal entries of $\mathbf { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ which pulls these towards 1. We opt for two separate hyperparameters controlling the relative importance of the loss on the diagonal and off-diagonal entries as follows:
68
+
69
+ $$
70
+ \operatorname* { m a x } _ { \theta , \phi } \mathrm { E L B O } ( \theta , \phi ) - \lambda _ { o d } \sum _ { i \neq j } \left[ \mathrm { C o v } _ { p ( \mathbf { x } ) } { [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ] } \right] _ { i j } ^ { 2 } - \lambda _ { d } \sum _ { i } \left( \left[ \mathrm { C o v } _ { p ( \mathbf { x } ) } { [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ] } \right] _ { i i } - 1 \right) ^ { 2 } .
71
+ $$
72
+
73
+ The regularization terms involving $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ in the above objective (6) can be efficiently optimized using SGD, where $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ can be estimated using the current minibatch4.
74
+
75
+ For DIP-VAE-II, we have the following optimization problem:
76
+
77
+ $$
78
+ \operatorname* { m a x } _ { \theta , \phi } \mathrm { E L B O } ( \theta , \phi ) - \lambda _ { o d } \sum _ { i \neq j } \left[ \mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { z } ] \right] _ { i j } ^ { 2 } - \lambda _ { d } \sum _ { i } \left( \left[ \mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { z } ] \right] _ { i i } - 1 \right) ^ { 2 } .
79
+ $$
80
+
81
+ As discussed earlier, the term $\mathbb { E } _ { p ( \mathbf { x } ) } \mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } [ \mathbf { z } ]$ contributes only to the diagonals of $\mathrm { C o v } _ { q _ { \phi } ( \mathbf { z } ) } [ \mathbf { z } ]$ Penalizing the off-diagonals of $\mathrm { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ in the Objective (7) will contribute to reduction in the magnitude of its diagonals as discussed earlier. As the regularizer on the diagonals is not directly on $\mathsf { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ]$ , unlike DIP-VAE-I, it will be not be able to keep $[ \mathbf { C o v } _ { p ( \mathbf { x } ) } [ \bar { \pmb { \mu } } _ { \phi } ( \mathbf { x } ) ] ] _ { i i }$ close to 1: the reduction in $[ \mathbf { C o v } _ { p ( \mathbf { x } ) } [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ] ] _ { i i }$ will be accompanied by increase in $[ \mathbb { E } _ { p ( \mathbf { x } ) } \pmb { \Sigma } _ { \phi } ( \mathbf { x } ) ] _ { i i }$ such that their sum remains close to 1. In datasets where the number of generative factors is less than the latent dimension, DIP-VAE-II is more suitable than DIP-VAE-I as keeping all dimensions active might result in splitting of an attribute across multiple dimensions, hurting the goal of disentanglement.
82
+
83
+ It is also possible to match higher order central moments of $q _ { \phi } ( \mathbf { z } )$ and the prior $p ( \mathbf { z } )$ . In particular, third order central moments (and moments) of the zero mean Gaussian prior are zero, hence $\ell _ { 2 }$ norm of third order central moments of $q _ { \phi } ( \mathbf { z } )$ can be penalized.
84
+
85
+ # 2.3 COMPARISON WITH $\beta$ -VAE
86
+
87
+ Recently proposed $\beta$ -VAE (Higgins et al., 2017) proposes to modify the ELBO by upweighting the $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \| p ( \mathbf { z } ) )$ term in order to encourage the inference of disentangled factors:
88
+
89
+ $$
90
+ \begin{array} { r l } & { \underset { \theta , \phi } { \operatorname* { m a x } } \ : \mathbb { E } _ { \mathbf { x } } \left[ \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \beta \mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p ( \mathbf { z } ) ) \right] , } \end{array}
91
+ $$
92
+
93
+ where $\beta$ is taken to be great than 1. Higher $\beta$ is argued to encourage disentanglement at the cost of reconstruction error (the likelihood term in the ELBO). Authors report empirical results with $\beta$ ranging from 4 to 250 depending on the dataset. As already mentioned, most VAE models proposed in the literature, including $\beta$ -VAE, work with ${ \cal N } ( { \bf 0 } , { \bf I } )$ as the prior $p ( \mathbf { z } )$ and ${ \cal N } ( { \pmb \mu } _ { \phi } ( { \bf x } ) , { \pmb \Sigma } _ { \phi } ( { \bf \bar { x } } ) ) ^ { \hat { } }$ with diagonal $\Sigma _ { \phi } ( \mathbf { x } )$ as the approximate posterior $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ . This reduces the objective (8) to
94
+
95
+ $$
96
+ \operatorname* { m a x } _ { \theta , \phi } \mathbb { E } _ { \mathbf { x } } \left[ \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \frac { \beta } { 2 } \left( \sum _ { i } \left( \left[ \boldsymbol { \Sigma } _ { \phi } ( \mathbf { x } ) \right] _ { i i } - \ln \left[ \boldsymbol { \Sigma } _ { \phi } ( \mathbf { x } ) \right] _ { i i } \right) + \left\| \mu _ { \phi } ( \mathbf { x } ) \right\| _ { 2 } ^ { 2 } \right) \right] .
97
+ $$
98
+
99
+ For high values of $\beta$ , $\beta$ -VAE would try to pull $\mu _ { \phi } ( \mathbf { x } )$ towards zero and $\Sigma _ { \phi } ( \mathbf { x } )$ towards the identity matrix (as the minimum of $x - \ln x$ for $x > 0$ is at $x = 1$ ), thus making the approximate posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ insensitive to the observations. This is also reflected in the quality of the reconstructed samples which is worse than VAE $\mathcal { B } = 1 \dot { }$ ), particularly for high values of $\beta$ . Our proposed method does not have such increased tension between the likelihood term and the disentanglement objective, and the sample quality with our method is on par with the VAE.
100
+
101
+ Finally, we note that both $\beta$ -VAE and our proposed method encourage disentanglement of inferred factors by pulling $\mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } ) } ( \mathbf { z } )$ in Eq. (5) towards the identity matrix: $\beta$ -VAE attempts to do it by making $\mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } ( \mathbf { z } )$ close to $\mathbf { I }$ and $\mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } ( \mathbf { z } )$ close to 0 individually for all observations $\mathbf { x }$ , while the proposed method directly works on $\mathbf { C o v } _ { q _ { \phi } ( \mathbf { z } ) } ( \mathbf { z } )$ (marginalizing over the observations $\mathbf { x }$ ) which retains the sensitivity of $q _ { \phi } ( \mathbf { z } | \mathbf { x } )$ to the conditioned-upon observation.
102
+
103
+ # 3 QUANTIFYING DISENTANGLEMENT: SAP SCORE
104
+
105
+ Higgins et al. (2017) propose a metric to evaluate the disentanglement performance of the inference mechanism, assuming that the ground truth generative factors are available. It works by first sampling a generative factor $y$ , followed by sampling $L$ pairs of examples such that for each pair, the sampled generative factor takes the same value. Given the inferred ${ \bf z } _ { x } : = \pmb { \mu } _ { \phi } ( { \bf x } )$ for each example $\mathbf { x }$ , they compute the absolute difference of these vectors for each pair, followed by averaging these difference vectors. This average difference vector is assigned the label of $y$ . By sampling $n$ such minibatches of $L$ pairs, we get $n$ such averaged difference vectors for the factor $y$ . This process is repeated for all generative factors. A low capacity multiclass classifier is then trained on these vectors to predict the identities of the corresponding generative factors. Accuracy of this classifier on the difference vectors for test set is taken to be a measure of disentanglement. We evaluate the proposed method on this metric and refer to this as Z-diff score subsequently.
106
+
107
+ We observe in our experiments that the $\boldsymbol { \mathrm Z }$ -diff score (Higgins et al., 2017) is not correlated well with the qualitative disentanglement at the decoder’s output as seen in the latent traversal plots (obtained by varying only one latent while keeping the other latents fixed). It also depends on the multiclass classifier used to obtain the score. We propose a new metric, referred as Separated Attribute Predictability (SAP) score, that is better aligned with the qualitative disentanglement observed in the latent traversals and also does not involve training any classifier. It is computed as follows: (i) We first construct a $d \times k$ score matrix $S$ (for $d$ latents and $k$ generative factors) whose $i j$ ’th entry is the linear regression or classification score (depending on the generative factor type) of predicting $j ^ { ; }$ ’th factor using only $i$ ’th latent $[ \mu _ { \phi } ( \mathbf { x } ) ] _ { i }$ . For regression, we take this to be the $R ^ { 2 }$ score obtained with fitting a line (slope and intercept) that minimizes the linear regression error (for the test examples). The $R ^ { 2 }$ score is given by $\left( \frac { \mathrm { C o v } ( [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ] _ { i } , \mathbf { y } _ { j } ) } { \sigma _ { [ \pmb { \mu } _ { \phi } ( \mathbf { x } ) ] _ { i } } \sigma _ { \mathbf { y } _ { j } } } \right) ^ { \frac { \gamma } { 2 } }$ 2 and ranges from 0 to 1, with a score of 1 indicating that a linear function of the $i$ ’th inferred latent explains all variability in the $j ^ { \dagger }$ ’th generative factor. For classification, we fit one or more thresholds (real numbers) directly on $i$ ’th inferred latents for the test examples that minimize the balanced classification errors, and take $S _ { i } j$ to be the balanced classification accuracy of the $j$ ’th generative factor. For inactive latent dimensions (having $\sigma _ { [ { \pmb \mu } _ { \phi } ( { \bf x } ) ] _ { i } } = [ { \bf C o v } _ { p ( x ) } [ { \pmb \mu } _ { \phi } ( { \bf x } ) ] ] _ { i i }$ close to 0), we take $S _ { i j }$ to be 0. (ii) For each column of the score matrix $S$ which corresponds to a generative factor, we take the difference of top two entries (corresponding to top two most predictive latent dimensions), and then take the mean of these differences as the final SAP score. Considering just the top scoring latent dimension for each generative factor is not enough as it does not rule out the possibility of the factor being captured by other latents. A high SAP score indicates that each generative factor is primarily captured in only one latent dimension. Note that a high SAP score does not rule out one latent dimension capturing two or more generative factors well, however in many cases this would be due to the generative factors themselves being correlated with each other, which can be verified empirically using ground truth values of the generative factors (when available). Further, a low SAP score does not rule out good disentanglement in cases when two (or more) latent dimensions might be correlated strongly with the same generative factor and poorly with other generative factors. The generated examples using single latent traversals may not be realistic for such models, and DIP-VAE discourages this from happening by enforcing decorrelation of the latents. However, the SAP score computation can be adapted to such cases by grouping the latent dimensions based on correlations and getting the score matrix at group level, which can be fed as input to the second step to get the final SAP score.
108
+
109
+ Table $1 \colon Z$ -diff score Higgins et al. (2017), the proposed SAP score and reconstruction error (per pixel) on the test sets for 2D Shapes and CelebA $( \beta _ { 1 } = 4 , \beta _ { 2 } = 6 0 , \lambda = 1 0 , \lambda _ { 1 } = 5 , \lambda _ { 2 } = 5 0 0$ for 2D Shapes; $\beta _ { 1 } = 4 , \beta _ { 2 } = 3 2 , \lambda = 2 , \lambda _ { 1 } = 1 , \lambda _ { 2 } = 8 0$ for CelebA). For the results on a wider range of hyperparameter values, refer to Fig. 1 and Fig. 2.
110
+
111
+ <table><tr><td rowspan="2">Method</td><td colspan="3">2D Shapes</td><td colspan="3">CelebA</td></tr><tr><td>Z-diff</td><td>SAP</td><td>Reconst. error</td><td>Z-diff</td><td>SAP</td><td>Reconst. error</td></tr><tr><td>VAE</td><td>81.3</td><td>0.0417</td><td>0.0017</td><td>7.5</td><td>0.35</td><td>0.0876</td></tr><tr><td>β-VAE(β=β1)</td><td>80.7</td><td>0.0811</td><td>0.0032</td><td>8.1</td><td>0.48</td><td>0.0937</td></tr><tr><td>β-VAE(β=β2)</td><td>95.7</td><td>0.5503</td><td>0.0113</td><td>6.4</td><td>3.72</td><td>0.1572</td></tr><tr><td>DIP-VAE-I (入od = λ)</td><td>98.7</td><td>0.1889</td><td>0.0018</td><td>14.8</td><td>3.69</td><td>0.0904</td></tr><tr><td>DIP-VAE-II (λod = λ1)</td><td>95.3</td><td>0.2188</td><td>0.0023</td><td>7.1</td><td>2.94</td><td>0.0884</td></tr><tr><td>DIP-VAE-II (入od = λ2)</td><td>98.0</td><td>0.5253</td><td>0.0079</td><td>11.5</td><td>3.93</td><td>0.1477</td></tr></table>
112
+
113
+ # 4 EXPERIMENTS
114
+
115
+ We evaluate our proposed method, DIP-VAE, on three datasets – (i) CelebA (Liu et al., 2015): It consists of 202, 599 RGB face images of celebrities. We use $6 4 \times 6 4 \times 3$ cropped images as used in several earlier works, using $9 0 \%$ for training and $1 0 \%$ for test. (ii) 3D Chairs (Aubry et al., 2014): It consists of 1393 chair CAD models, with each model rendered from 31 azimuth angles and 2 elevation angles. Following earlier work (Yang et al., 2015; Dosovitskiy et al., 2015) that ignores near-duplicates, we use a subset of 809 chair models in our experiments. We use the binary masks of the chairs as the observed data in our experiments following (Higgins et al., 2017). First $8 0 \%$ of the models are used for training and the rest are used for test. (iii) 2D Shapes (Matthey et al., 2017): This is a synthetic dataset of binary 2D shapes generated from the Cartesian product of the shape (heart, oval and square), $x$ -position (32 values), $y$ -position (32 values), scale (6 values) and rotation (40 values). We consider two baselines for the task of unsupervised inference of disentangled factors: (i) VAE (Kingma & Welling, 2013; Rezende et al., 2014), and (ii) the recently proposed $\beta$ -VAE (Higgins et al., 2017). To be consistent with the evaluations in (Higgins et al., 2017), we use the same CNN network architectures (for our encoder and decoder), and same latent dimensions as used in (Higgins et al., 2017) for CelebA, 3D Chairs, 2D Shapes datasets.
116
+
117
+ Hyperparameters. For the proposed DIP-VAE-I, in all our experiments we vary $\lambda _ { o d }$ in the set $\{ 1 , 2 , 5 , 1 0 , 2 0 , 5 0 , 1 0 0 , 5 0 0 \}$ while fixing $\lambda _ { d } = 1 0 \lambda _ { o d }$ for 2D Shapes and 3D Chairs, and $\lambda _ { d } =$ $5 0 \lambda _ { o d }$ for CelebA. For DIP-VAE-II, we fix $\lambda _ { o d } = \lambda _ { d }$ for 2D Shapes, and $\lambda _ { o d } = 2 \lambda _ { d }$ for CelebA. Additionally, for DIP-VAE-II we also penalize the $\ell _ { 2 }$ -norm of third order central moments of $q _ { \phi } ( \mathbf { z } )$ with hyperparameter $\lambda _ { 3 } = 2 0 0$ for 2D Shapes data ( $\lambda _ { 3 } = 0$ for CelebA). For $\beta$ -VAE, we experiment with $\beta = \{ 1 , 2 , 4 , 8 , 1 6 , 2 5 , 3 2 , 6 4 , 1 0 0 , 1 2 8 , 2 0 0 , 2 5 6 \}$ (where $\beta = 1$ corresponds to the VAE). We used a batch size of 400 for all 2D Shapes experiments and 100 for all CelebA experiments. For both CelebA and 2D Shapes, we show the results in terms of the $\textsf { Z }$ -diff score Higgins et al. (2017), the
118
+
119
+ ![](images/e32c59a3570dcc2ce5ec55bd6bdb3ead0a11623f13e8fdfb036f26f5234758ac.jpg)
120
+ Figure 1: Proposed Separated Atomic Predictability (SAP) score and the Z-diff disentanglement score (Higgins et al., 2017) as a function of average reconstruction error (per pixel) on the test set of 2D Shapes data for $\beta$ -VAE and the proposed DIP-VAE. The plots are generated by varying $\beta$ for $\beta$ -VAE, and $\lambda _ { o d }$ for DIP-VAE-I and DIP-VAE-II (the number next to each point is the value of these hyperparameters, respectively).
121
+
122
+ Table 2: Attribute classification accuracy on CelebA: A classifier $\begin{array} { r } { \mathbf { w } ^ { k } = \frac { 1 } { | \mathbf { x } _ { i } : y _ { i } ^ { k } = 1 | } \sum _ { \mathbf { x } _ { i } : y _ { i } ^ { k } = 1 } \mu _ { \phi } ( \mathbf { x } _ { i } ) - } \end{array}$ 1|xi:yk=0| Pxi:yki =0 µφ(xi) is computed for every attribute k using the training set and a bias is learned by minimizing the hinge loss. Accuracy on other attributes stays about same across all methods.
123
+
124
+ <table><tr><td>ponlen</td><td>AAaeergperors</td><td>Aeeie</td><td>ssueg</td><td>Jrraerr</td><td>Jrr puilg</td><td>dnarae faaeg</td><td>P</td><td>wndo ngrigr ginnn</td><td>PPed tr</td><td>J gaam</td><td>wr Biaea</td><td>VansiBegeer</td></tr><tr><td>VAE</td><td>71.8</td><td>73.0</td><td>89.8</td><td>78.0</td><td>88.9</td><td>79.6</td><td>83.9</td><td>76.3</td><td>87.3</td><td>70.2</td><td>95.8</td><td>83.0</td></tr><tr><td>β=2</td><td>71.6</td><td>72.6</td><td>90.6</td><td>79.3</td><td>89.1</td><td>79.3</td><td>83.5</td><td>76.1</td><td>86.9</td><td>67.8</td><td>95.9</td><td>82.4</td></tr><tr><td>β=4</td><td>71.6</td><td>72.6</td><td>90.0</td><td>76.6</td><td>88.9</td><td>77.8</td><td>82.3</td><td>75.7</td><td>85.3</td><td>66.8</td><td>95.8</td><td>80.6</td></tr><tr><td>β=8</td><td>71.6</td><td>71.7</td><td>90.0</td><td>76.0</td><td>87.2</td><td>76.2</td><td>80.5</td><td>73.1</td><td>85.3</td><td>63.7</td><td>95.8</td><td>79.6</td></tr><tr><td>DIP-VAE-I</td><td>73.7</td><td>73.2</td><td>90.9</td><td>80.6</td><td>91.9</td><td>81.5</td><td>85.9</td><td>75.9</td><td>85.3</td><td>71.5</td><td>96.2</td><td>84.7</td></tr></table>
125
+
126
+ proposed SAP score, and reconstruction error. For 3D Chairs data, only two ground truth generative factors are available and the quantitative scores for these are saturated near the peak values, hence we show only the latent traversal plots which we based on our subjective evaluation of the reconstruction quality and disentanglement (shown in Appendix).
127
+
128
+ Disentanglement scores and reconstruction error. For the Z-diff score (Higgins et al., 2017), in all our experiments we use a one-vs-rest linear SVM with weight on the hinge loss $C$ set to 0.01 and weight on the regularizer set to 1. Table 1 shows the Z-diff scores and the proposed SAP scores along with reconstruction error (which directly corresponds to the data likelihood) for the test sets of CelebA and 2D Shapes data. Further we also show the plots of how the Z-diff score and the proposed SAP score change with the reconstruction error as we vary the hyperparameter for both methods ( $\beta$ and $\lambda _ { o d }$ , respectively) in Fig. 1 (for 2D Shapes data) and Fig. 2 (for CelebA data). The proposed DIP-VAE-I gives much higher Z-diff score at little to no cost on the reconstruction error when compared with VAE $\mathbf { \nabla } \beta = 1 \mathbf { \dot { \varepsilon } } ,$ ) and $\beta$ -VAE, for both 2D Shapes and CelebA datasets. However, we observe in the decoder’s output for single latent traversals (varying a single latent while keeping others fixed, shown in Fig. 3 and Fig. 4) that a high $\mathrm { _ { Z } }$ -diff score is not necessarily a good indicator of disentanglement. Indeed, for 2D Shapes data, DIP-VAE-I has a higher $\mathsf { Z }$ -diff score (98.7) and almost an order of magnitude lower reconstruction error than $\beta$ -VAE for $\beta = 6 0$ , however comparing the latent traversals of $\beta$ -VAE in Fig. 3 and DIP-VAE-I in Fig. 4 indicate a better disentanglement for $\beta$ -VAE for $\beta = 6 0$ (though at the cost of much worse reconstruction where every generated sample looks like a hazy blob). On the other hand, we find the proposed SAP score to be correlated well with the qualitative disentanglement seen in the latent traversal plots. This is reflected in the higher SAP score of $\beta$ -VAE for $\beta = 6 0$ than DIP-VAE-I. We also observe that for 2D Shapes data, DIP-VAE-II gives a much better trade-off between disentanglement (measured by the SAP score) and reconstruction error than both DIP-VAE-I and $\beta$ -VAE, as shown quantitatively in Fig. 1 and qualitatively in the latent traversal plots in Fig. 3. The reason is that DIP-VAE-I enforces $[ \bar { \bf C o v } _ { p ( x ) } [ { \pmb \mu } _ { \phi } ( { \bf x } ) ] ] _ { i i }$ to be close to 1 and this may affect the disentanglement adversely by splitting a generative factor across multiple latents for 2D Shapes where the generative factors are much less than the latent dimension. For real datasets having lots of factors with complex generative processes, such as CelebA, DIP-VAE-I is expected to work well which can be seen in Fig. 2 where DIP-AVE-I yields a much lower reconstruction error with a higher SAP score (as well as higher Z-diff scores).
129
+
130
+ ![](images/e32d0583dabe4e4fd3e9384d62df53f8090518a1b80a73aa17ba4945bff30546.jpg)
131
+ Figure 2: The proposed SAP score and the Z-diff score (Higgins et al., 2017) as a function of average reconstruction error (per pixel) on the test set of CelebA data for $\beta$ -VAE and the proposed DIP-VAE. The plots are generated by varying $\beta$ for $\beta$ -VAE, and $\lambda _ { o d }$ for DIP-VAE-I and DIP-VAE-II (the number next to each point is the value of these hyperparameters, respectively).
132
+
133
+ Binary attribute classification for CelebA. We also experiment with predicting the binary attribute values for each test example in CelebA from the inferred $\mu _ { \phi } ( \mathbf { x } )$ . For each attribute $k$ , we compute the attribute vector $\begin{array} { r } { \mathbf { w } ^ { k } = \frac { 1 } { | \mathbf { x } _ { i } : y _ { i } ^ { k } = 1 | } \sum _ { \mathbf { x } _ { i } : y _ { i } ^ { k } = 1 } \mu _ { \phi } ( \mathbf { x } _ { i } ) - \frac { 1 } { | \mathbf { x } _ { i } : y _ { i } ^ { k } = 0 | } \sum _ { \mathbf { x } _ { i } : y _ { i } ^ { k } = 0 } \mu _ { \phi } ( \mathbf { x } _ { i } ) } \end{array}$ from the training set, and project the $\mu _ { \phi } ( \mathbf { x } )$ along these vectors. A bias is learned on these scalars (by minimizing hinge loss) which is then used for classifying the test examples. Table 2 shows the results for the attribute which show the highest change across various methods (most other attribute accuracies do not change). The proposed DIP-VAE outperforms both VAE and $\beta$ -VAE for most attributes. The performance of $\beta$ -VAE gets worse as $\beta$ is increased further.
134
+
135
+ ![](images/437e87b29b32bae915d73a990e7c22134a58009f8737c562f6e0ec208cc2e828.jpg)
136
+ Figure 3: Qualitative results for disentanglement in 2D Shapes dataset (Matthey et al., 2017). SAP scores, Z-diff scores and reconstruction errors for the methods (rows) can be read from Fig. 1.
137
+
138
+ ![](images/5c33ba502ea8e2247acd94096c32f9c18244bf881f7c34607d4122475048f6da.jpg)
139
+ Figure 4: Qualitative results for disentanglement in 2D Shapes dataset (Matthey et al., 2017) for DIP-VAE-I (SAP score 0.1889).
140
+
141
+ # 5 RELATED WORK
142
+
143
+ Adversarial autoencoder (Makhzani et al., 2015) also matches $q _ { \phi } ( z )$ (which is referred as aggregated posterior in their work) to the prior $p ( z )$ . However, adversarial autoencoder does not have the goal of minimizing $\mathrm { K L } ( q _ { \phi } ( \mathbf { z } | \mathbf { x } ) | | p _ { \theta } ( \mathbf { z } | \mathbf { x } ) )$ which is the primary goal of variational inference. It maximizes $\mathbb { E } _ { \mathbf { x } } \left[ \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } \mid \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } \mid \mathbf { z } ) \right] \right] - \lambda D ( q _ { \phi } ( \mathbf { z } ) \| p ( \mathbf { z } ) )$ , where $D$ is the distance induced by a discriminator that tries to classify $\mathbf { z } \sim q _ { \phi } ( \mathbf { z } )$ from $\mathbf { z } \sim p ( \mathbf { z } )$ by optimizing a cross-entropy loss (which induces JS-divergence as $D$ ). This can be contrasted with the objective in (4).
144
+
145
+ Invariance and Equivariance. Disentanglement is closely connected to invariance and equivariance of representations. If $R : { \bf x } { \bf z }$ is a function that maps the observations to the feature representions, equivariance (with respect to $T$ ) implies that a primitive transformation $T$ of the input results in a corresponding transformation $T ^ { \prime }$ of the feature, i.e., $R ( T ( \mathbf { x } ) ) = T ^ { \prime } ( R ( \mathbf { x } ) )$ . Disentanglement requires that $T ^ { \prime }$ acts only on a small subset of dimensions of $R ( \mathbf { x } )$ (a sparse action). In this sense, equivariance is a more general notion encompassing disentanglement as a special case, however this special case carries additional benefits of interpretability, ease of transferrability, etc. Invariance is also a special case of equivariance which requires $T ^ { \prime }$ to be identity for $R$ to be invariant to the action of $T$ on the input observations. However, invariance can obtained more easily from disentangled representations than from equivariant representations by simply marginalizing the appropriate subset of dimensions. There exists a lot of prior work in the literature on equivariant and invariant feature learning, mostly under the supervised setting which assumes the knowledge about the nature of input transformations (e.g., rotations, translations, scaling for images, etc.) (Schmidt & Roth, 2012; Bruna & Mallat, 2013; Anselmi et al., 2014; 2016; Cohen & Welling, 2016; Dieleman et al., 2016; Haasdonk et al., 2005; Mroueh et al., 2015; Raj et al., 2017).
146
+
147
+ # 6 CONCLUDING REMARKS
148
+
149
+ We proposed a principled variational framework to infer disentangled latents from unlabeled observations. Unlike $\beta$ -VAE, our variational objective does not have any conflict between the data log-likelihood and the disentanglement of the inferred latents, which is reflected in the empirical results. We also proposed the SAP disentanglement metric that is much better correlated with the qualitative disentanglement seen in the latent traversals than the Z-diff score Higgins et al. (2017). An interesting direction for future work is to take into account the sampling biases in the generative process, both natural (e.g., sampling the female gender makes it unlikely to sample beard for face images in CelebA) as well as artificial (e.g., a collection of face images that contain much more smiling faces for males than females misleading us to believe $p ( { \mathrm { g e n d e r } } , { \mathrm { s m i l e } } ) \neq p ( { \mathrm { g e n d e r } } ) p ( { \mathrm { s m i l e } } ) )$ , which makes the problem challenging and also somewhat less well defined (at least in the case of natural biases). Effective use of disentangled representations for transfer learning is another interesting direction for future work.
150
+
151
+ # REFERENCES
152
+
153
+ Fabio Anselmi, Joel Z Leibo, Lorenzo Rosasco, Jim Mutch, Andrea Tacchetti, and Tomaso Poggio. Unsupervised learning of invariant representations in hierarchical architectures. arXiv preprint arXiv:1311.4158, 2014.
154
+
155
+ Fabio Anselmi, Lorenzo Rosasco, and Tomaso Poggio. On invariance and selectivity in representation learning. Information and Inference, 2016.
156
+
157
+ Martin Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. In NIPS 2016 Workshop on Adversarial Training. In review for ICLR, volume 2016, 2017.
158
+
159
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
160
+
161
+ Mathieu Aubry, Daniel Maturana, Alexei A Efros, Bryan C Russell, and Josef Sivic. Seeing 3d chairs: exemplar part-based 2d-3d alignment using a large dataset of cad models. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3762–3769, 2014.
162
+
163
+ Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013.
164
+
165
+ David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 2017.
166
+
167
+ 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.
168
+
169
+ Joan Bruna and Stephane Mallat. Invariant scattering convolution networks. IEEE Trans. Pattern Anal. Mach. Intell., 2013.
170
+
171
+ Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2172–2180, 2016.
172
+
173
+ Brian Cheung, Jesse A Livezey, Arjun K Bansal, and Bruno A Olshausen. Discovering hidden factors of variation in deep networks. arXiv preprint arXiv:1412.6583, 2014.
174
+
175
+ Taco Cohen and Max Welling. Learning the irreducible representations of commutative lie groups. In International Conference on Machine Learning, pp. 1755–1763, 2014.
176
+
177
+ Taco Cohen and Max Welling. Group equivariant convolutional networks. In Proceedings of the 33rd International Conference on Machine Learning, 2016.
178
+
179
+ Taco S Cohen and Max Welling. Transformation properties of learned visual representations. In International Conference on Learning Representations, 2015.
180
+
181
+ Emily Denton and Vighnesh Birodkar. Unsupervised learning of disentangled representations from video. arXiv preprint arXiv:1705.10915, 2017.
182
+
183
+ Guillaume Desjardins, Aaron Courville, and Yoshua Bengio. Disentangling factors of variation via generative entangling. arXiv preprint arXiv:1210.5474, 2012.
184
+
185
+ Sander Dieleman, Jeffrey De Fauw, and Koray Kavukcuoglu. Exploiting cyclic symmetry in convolu tional neural networks. ICML, 2016.
186
+
187
+ Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. ¨ arXiv preprint arXiv:1605.09782, 2016.
188
+
189
+ Alexey Dosovitskiy, Jost Tobias Springenberg, and Thomas Brox. Learning to generate chairs with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1538–1546, 2015.
190
+
191
+ Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
192
+
193
+ Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, pp. 258–267. AUAI Press, 2015.
194
+
195
+ Marco Fraccaro, Simon Kamronn, Ulrich Paquet, and Ole Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. arXiv preprint arXiv:1710.05741, 2017.
196
+
197
+ Michael C Fu. Gradient estimation. Handbooks in operations research and management science, 13: 575–616, 2006.
198
+
199
+ Samuel Gershman and Noah Goodman. Amortized inference in probabilistic reasoning. In Proceedings of the Cognitive Science Society, volume 36, 2014.
200
+
201
+ 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.
202
+
203
+ Ross Goroshin, Michael F Mathieu, and Yann LeCun. Learning to linearize under uncertainty. In Advances in Neural Information Processing Systems, pp. 1234–1242, 2015.
204
+
205
+ Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola. A ¨ kernel two-sample test. Journal of Machine Learning Research, 13(Mar):723–773, 2012.
206
+
207
+ Bernard Haasdonk, A Vossen, and Hans Burkhardt. Invariance in kernel methods by haar-integration kernels. In Scandinavian Conference on Image Analysis, pp. 841–851. Springer, 2005.
208
+
209
+ Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. In International Conference on Learning Representations, 2017.
210
+
211
+ Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pp. 44–51. Springer, 2011.
212
+
213
+ Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013.
214
+
215
+ Xianxu Hou, Linlin Shen, Ke Sun, and Guoping Qiu. Deep feature consistent variational autoencoder. In Applications of Computer Vision (WACV), 2017 IEEE Winter Conference on, pp. 1133–1141. IEEE, 2017.
216
+
217
+ Wei-Ning Hsu, Yu Zhang, and James Glass. Unsupervised learning of disentangled latent representations from sequential data. In Advances in neural information processing systems, 2017.
218
+
219
+ Theofanis Karaletsos, Serge Belongie, and Gunnar Ratsch. Bayesian representation learning with ¨ oracle constraints. arXiv preprint arXiv:1506.05011, 2015.
220
+
221
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
222
+
223
+ Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, pp. 2539–2547, 2015.
224
+
225
+ Abhishek Kumar, Prasanna Sattigeri, and P Thomas Fletcher. Semi-supervised learning with GANs: Manifold invariance with improved inference. In Advances in Neural Information Processing Systems, 2017.
226
+
227
+ Brenden M Lake, Tomer D Ullman, Joshua B Tenenbaum, and Samuel J Gershman. Building machines that learn and think like people. Behavioral and Brain Sciences, pp. 1–101, 2016.
228
+
229
+ Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1718–1727, 2015.
230
+
231
+ Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3730–3738, 2015.
232
+
233
+ Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015.
234
+
235
+ Michael F Mathieu, Junbo Jake Zhao, Junbo Zhao, Aditya Ramesh, Pablo Sprechmann, and Yann LeCun. Disentangling factors of variation in deep representation using adversarial training. In Advances in Neural Information Processing Systems, pp. 5040–5048, 2016.
236
+
237
+ Loic Matthey, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentanglement testing sprites dataset. https://github.com/deepmind/dsprites-dataset/, 2017.
238
+
239
+ Yishu Miao, Lei Yu, and Phil Blunsom. Neural variational inference for text processing. In International Conference on Machine Learning, pp. 1727–1736, 2016.
240
+
241
+ Youssef Mroueh, Stephen Voinea, and Tomaso A Poggio. Learning with group invariant features: A kernel perspective. In Advances in Neural Information Processing Systems, pp. 1558–1566, 2015.
242
+
243
+ XuanLong Nguyen, Martin J Wainwright, and Michael I Jordan. Estimating divergence functionals and the likelihood ratio by convex risk minimization. IEEE Transactions on Information Theory, 56(11):5847–5861, 2010.
244
+
245
+ Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
246
+
247
+ Anant Raj, Abhishek Kumar, Youssef Mroueh, P Thomas Fletcher, and Bernhard Schlkopf. Local group invariant representations via orbit embeddings. In AISTATS, 2017.
248
+
249
+ Scott Reed, Kihyuk Sohn, Yuting Zhang, and Honglak Lee. Learning to disentangle factors of variation with manifold interaction. In International Conference on Machine Learning, pp. 1431– 1439, 2014.
250
+
251
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
252
+
253
+ Karl Ridgeway. A survey of inductive biases for factorial representation-learning. arXiv preprint arXiv:1612.05299, 2016.
254
+
255
+ Jurgen Schmidhuber. Learning factorial codes by predictability minimization. Neural computation, 4 (6):863–879, 1992.
256
+
257
+ Uwe Schmidt and Stefan Roth. Learning rotation-aware features: From invariant priors to equivariant descriptors. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, 2012.
258
+
259
+ N Siddharth, Brooks Paige, Van de Meent, Alban Desmaison, Frank Wood, Noah D Goodman, Pushmeet Kohli, Philip HS Torr, et al. Learning disentangled representations with semi-supervised deep generative models. arXiv preprint arXiv:1706.00400, 2017.
260
+
261
+ Bharath K Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Scholkopf, and Gert RG ¨ Lanckriet. On integral probability metrics,\phi-divergences and binary classification. arXiv preprint arXiv:0901.2698, 2009.
262
+
263
+ Andreas Stuhlmuller, Jacob Taylor, and Noah Goodman. Learning stochastic inverses. In ¨ Advances in neural information processing systems, pp. 3048–3056, 2013.
264
+ Tim Van Erven and Peter Harremos. Renyi divergence and kullback-leibler divergence. ´ IEEE Transactions on Information Theory, 60(7):3797–3820, 2014.
265
+ William F Whitney, Michael Chang, Tejas Kulkarni, and Joshua B Tenenbaum. Understanding visual concepts with continuation learning. arXiv preprint arXiv:1602.06822, 2016.
266
+ Jimei Yang, Scott E Reed, Ming-Hsuan Yang, and Honglak Lee. Weakly-supervised disentangling with recurrent transformations for 3d view synthesis. In Advances in Neural Information Processing Systems, pp. 1099–1107, 2015.
267
+ Shengjia Zhao, Jiaming Song, and Stefano Ermon. Towards deeper understanding of variational autoencoding models. arXiv preprint arXiv:1702.08658, 2017.
268
+
269
+ # Appendix
270
+
271
+ # A LATENT TRAVERSALS FOR 2D SHAPES AND CHAIRS DATASET
272
+
273
+ ![](images/8c949aad3501c5661a1b6210c932cabe8e039fbe08187d805d3fd5c79d912e2f.jpg)
274
+ Figure 5: Qualitative results for disentanglement in CelebA dataset.
275
+
276
+ ![](images/50a59c9cf7078fc5c6f29d794697ba9e200a196a325a4ba4e235dc87b8f33e13.jpg)
277
+ Figure 6: Qualitative results for disentanglement in Chairs dataset.
md/train/HkL7n1-0b/HkL7n1-0b.md ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WASSERSTEIN AUTO-ENCODERS
2
+
3
+ Ilya Tolstikhin MPI for Intelligent Systems Tubingen, Germany ¨ ilya@tue.mpg.de
4
+
5
+ Olivier Bousquet
6
+ Google Brain
7
+ Zurich, Switzerland ¨
8
+ obousquet@google.com
9
+ Sylvain Gelly
10
+ Google Brain
11
+ Zurich, Switzerland¨
12
+ sylvaingelly@google.com
13
+
14
+ Bernhard Scholkopf ¨ MPI for Intelligent Systems Tubingen, Germany ¨ bs@tue.mpg.de
15
+
16
+ # ABSTRACT
17
+
18
+ We propose the Wasserstein Auto-Encoder (WAE)—a new algorithm for building a generative model of the data distribution. WAE minimizes a penalized form of the Wasserstein distance between the model distribution and the target distribution, which leads to a different regularizer than the one used by the Variational Auto-Encoder (VAE) (Kingma & Welling, 2014). This regularizer encourages the encoded training distribution to match the prior. We compare our algorithm with several other techniques and show that it is a generalization of adversarial auto-encoders (AAE) (Makhzani et al., 2016). Our experiments show that WAE shares many of the properties of VAEs (stable training, encoder-decoder architecture, nice latent manifold structure) while generating samples of better quality, as measured by the FID score.
19
+
20
+ # 1 INTRODUCTION
21
+
22
+ The field of representation learning was initially driven by supervised approaches, with impressive results using large labelled datasets. Unsupervised generative modeling, in contrast, used to be a domain governed by probabilistic approaches focusing on low-dimensional data. Recent years have seen a convergence of those two approaches. In the new field that formed at the intersection, variational auto-encoders (VAEs) (Kingma & Welling, 2014) constitute one well-established approach, theoretically elegant yet with the drawback that they tend to generate blurry samples when applied to natural images. In contrast, generative adversarial networks (GANs) (Goodfellow et al., 2014) turned out to be more impressive in terms of the visual quality of images sampled from the model, but come without an encoder, have been reported harder to train, and suffer from the “mode collapse” problem where the resulting model is unable to capture all the variability in the true data distribution. There has been a flurry of activity in assaying numerous configurations of GANs as well as combinations of VAEs and GANs. A unifying framework combining the best of GANs and VAEs in a principled way is yet to be discovered.
23
+
24
+ This work builds up on the theoretical analysis presented in Bousquet et al. (2017). Following Arjovsky et al. (2017); Bousquet et al. (2017), we approach generative modeling from the optimal transport (OT) point of view. The OT cost (Villani, 2003) is a way to measure a distance between probability distributions and provides a much weaker topology than many others, including $f$ -divergences associated with the original GAN algorithms (Nowozin et al., 2016). This is particularly important in applications, where data is usually supported on low dimensional manifolds in the input space $\mathcal { X }$ . As a result, stronger notions of distances (such as $f$ -divergences, which capture the density ratio between distributions) often max out, providing no useful gradients for training. In contrast, OT was claimed to have a nicer behaviour (Arjovsky et al., 2017; Gulrajani et al., 2017) although it requires, in its GAN-like implementation, the addition of a constraint or a regularization term into the objective.
25
+
26
+ ![](images/dfbfcc5b3c4f8ecaf5bcf4d077a22aa437f7aa7791df942b76efddc7ab3c527b.jpg)
27
+ Figure 1: Both VAE and WAE minimize two terms: the reconstruction cost and the regularizer penalizing discrepancy between $P _ { Z }$ and distribution induced by the encoder $Q$ . VAE forces $Q ( Z | X = x )$ to match $P _ { Z }$ for all the different input examples $x$ drawn from $P _ { X }$ . This is illustrated on picture (a), where every single red ball is forced to match $P _ { Z }$ depicted as the white shape. Red balls start intersecting, which leads to problems with reconstruction. In contrast, WAE forces the continuous mixture $\begin{array} { r } { \dot { Q _ { Z } } : = \int Q ( Z | X ) \dot { d } P _ { X } } \end{array}$ to match $P _ { Z }$ , as depicted with the green ball in picture (b). As a result latent codes of different examples get a chance to stay far away from each other, promoting a better reconstruction.
28
+
29
+ In this work we aim at minimizing OT $W _ { c } ( P _ { X } , P _ { G } )$ between the true (but unknown) data distribution $P _ { X }$ and a latent variable model $P _ { G }$ specified by the prior distribution $P _ { Z }$ of latent codes $Z \in { \mathcal { Z } }$ and the generative model $P _ { G } ( X | Z )$ of the data points $X \in { \mathcal { X } }$ given $Z$ . Our main contributions are listed below (cf. also Figure 1):
30
+
31
+ • A new family of regularized auto-encoders (Algorithms 1, 2 and Eq. 4), which we call Wasserstein Auto-Encoders (WAE), that minimize the optimal transport $W _ { c } ( P _ { X } , P _ { G } )$ for any cost function $c$ . Similarly to VAE, the objective of WAE is composed of two terms: the $c$ -reconstruction cost and a regularizer $\mathcal { D } _ { Z } ( P _ { Z } , Q _ { Z } )$ penalizing a discrepancy between two distributions in $\mathcal { Z }$ : $P _ { Z }$ and a distribution of encoded data points, i.e. $Q _ { Z } \backslash = \dot { \mathbb { E } } _ { P _ { X } } [ Q ( Z | X ) ]$ . When $c$ is the squared cost and $\mathcal { D } _ { Z }$ is the GAN objective, WAE coincides with adversarial auto-encoders of Makhzani et al. (2016). Empirical evaluation of WAE on MNIST and CelebA datasets with squared cost $c ( x , y ) =$ $\| x - y \| _ { 2 } ^ { 2 }$ . Our experiments show that WAE keeps the good properties of VAEs (stable training, encoder-decoder architecture, and a nice latent manifold structure) while generating samples of better quality, approaching those of GANs.
32
+ • We propose and examine two different regularizers $\mathcal { D } _ { Z } ( P _ { Z } , Q _ { Z } )$ . One is based on GANs and adversarial training in the latent space $\mathcal { Z }$ . The other uses the maximum mean discrepancy, which is known to perform well when matching high-dimensional standard normal distributions $P _ { Z }$ (Gretton et al., 2012). Importantly, the second option leads to a fully adversary-free min-min optimization problem.
33
+ • Finally, the theoretical considerations presented in Bousquet et al. (2017) and used here to derive the WAE objective might be interesting in their own right. In particular, Theorem 1 shows that in the case of generative models, the primal form of $W _ { c } ( P _ { X } , P _ { G } )$ is equivalent to a problem involving the optimization of a probabilistic encoder $Q ( Z | X )$ .
34
+
35
+ The paper is structured as follows. In Section 2 we review a novel auto-encoder formulation for OT between $P _ { X }$ and the latent variable model $P _ { G }$ derived in Bousquet et al. (2017). Relaxing the resulting constrained optimization problem we arrive at an objective of Wasserstein auto-encoders. We propose two different regularizers, leading to WAE-GAN and WAE-MMD algorithms. Section 3 discusses the related work. We present the experimental results in Section 4 and conclude by pointing out some promising directions for future work.
36
+
37
+ # 2 PROPOSED METHOD
38
+
39
+ Our new method minimizes the optimal transport cost $W _ { c } ( P _ { X } , P _ { G } )$ based on the novel auto-encoder formulation (see Theorem 1 below). In the resulting optimization problem the decoder tries to accurately reconstruct the encoded training examples as measured by the cost function $c$ . The encoder tries to simultaneously achieve two conflicting goals: it tries to match the encoded distribution of training examples ${ \dot { Q } } _ { Z } : = \mathbb { E } _ { P _ { X } } [ Q ( Z | X ) ]$ to the prior $P _ { Z }$ as measured by any specified divergence $\mathcal { D } _ { Z } ( Q _ { Z } , P _ { Z } )$ , while making sure that the latent codes provided to the decoder are informative enough to reconstruct the encoded training examples. This is schematically depicted on Fig. 1.
40
+
41
+ # 2.1 PRELIMINARIES AND NOTATIONS
42
+
43
+ We use calligraphic letters (i.e. $\mathcal { X } )$ for sets, capital letters (i.e. $X )$ for random variables, and lower case letters (i.e. $x _ { \mathrm { . } }$ ) for their values. We denote probability distributions with capital letters (i.e. $P ( X ) )$ and corresponding densities with lower case letters (i.e. $p ( x ) )$ ). In this work we will consider several measures of discrepancy between probability distributions $P _ { X }$ and $P _ { G }$ . The class of $f$ -d e & Miescke, 2008) is defined b $\begin{array} { r } { D _ { f } ( P _ { X } \| P _ { G } ) : = \int f \big ( \frac { p _ { X } ( x ) } { p _ { G } ( x ) } \big ) p _ { G } ( x ) d x } \end{array}$ $f \colon ( 0 , \infty ) \to { \mathcal { R } }$ $f ( 1 ) = 0$
44
+ Kullback-Leibler $D _ { \mathrm { K L } }$ and Jensen-Shannon $D _ { \mathrm { J S } }$ divergences.
45
+
46
+ # 2.2 OPTIMAL TRANSPORT AND ITS DUAL FORMULATIONS
47
+
48
+ A rich class of divergences between probability distributions is induced by the optimal transport (OT) problem (Villani, 2003). Kantorovich’s formulation of the problem is given by
49
+
50
+ $$
51
+ W _ { c } ( P _ { X } , P _ { G } ) : = \operatorname* { i n f } _ { \Gamma \in { \mathcal { P } } ( X \sim P _ { X } , Y \sim P _ { G } ) } \mathbb { E } _ { ( X , Y ) \sim \Gamma } [ c ( X , Y ) ] ,
52
+ $$
53
+
54
+ where $c ( x , y ) \colon \mathcal { X } \times \mathcal { X } \to \mathcal { R } _ { + }$ is any measurable cost function and ${ \mathcal { P } } ( X \sim P _ { X } , Y \sim P _ { G } )$ is a set of all joint distributions of $( X , Y )$ with marginals $P _ { X }$ and $P _ { G }$ respectively. A particularly interesting case is when $( \mathcal { X } , d )$ is a metric space and $c ( x , y ) = d ^ { p } ( x , y )$ for $p \geq 1$ . In this case $W _ { p }$ , the $p$ -th root of $W _ { c }$ , is called the $p$ -Wasserstein distance.
55
+
56
+ When $c ( x , y ) = d ( x , y )$ the following Kantorovich-Rubinstein duality holds1:
57
+
58
+ $$
59
+ W _ { 1 } ( P _ { X } , P _ { G } ) = \operatorname* { s u p } _ { f \in { \mathcal { F } } _ { L } } \mathbb { E } _ { X \sim P _ { X } } [ f ( X ) ] - \mathbb { E } _ { Y \sim P _ { G } } [ f ( Y ) ] ,
60
+ $$
61
+
62
+ where $\mathcal { F } _ { L }$ is the class of all bounded 1-Lipschitz functions on $( \mathcal { X } , d )$
63
+
64
+ # 2.3 APPLICATION TO GENERATIVE MODELS: WASSERSTEIN AUTO-ENCODERS
65
+
66
+ One way to look at modern generative models like VAEs and GANs is to postulate that they are trying to minimize certain discrepancy measures between the data distribution $P _ { X }$ and the model $P _ { G }$ . Unfortunately, most of the standard divergences known in the literature, including those listed above, are hard or even impossible to compute, especially when $P _ { X }$ is unknown and $P _ { G }$ is parametrized by deep neural networks. Previous research provides several tricks to address this issue.
67
+
68
+ In case of minimizing the KL-divergence $D _ { \mathrm { K L } } ( P _ { X } , P _ { G } )$ , or equivalently maximizing the marginal log-likelihood $E _ { P _ { X } } [ \bar { \log { p _ { G } ( X ) } } ]$ , the famous variational lower bound provides a theoretically grounded framework successfully employed by VAEs (Kingma & Welling, 2014; Mescheder et al., 2017). More generally, if the goal is to minimize the $f$ -divergence $D _ { f } ( P _ { X } , P _ { G } )$ (with one example being $D _ { \mathrm { K L } } ,$ ), one can resort to its dual formulation and make use of $f$ -GANs and the adversarial training (Nowozin et al., 2016). Finally, OT cost $W _ { c } ( P _ { X } , P _ { G } )$ is yet another option, which can be, thanks to the celebrated Kantorovich-Rubinstein duality (2), expressed as an adversarial objective as implemented by the Wasserstein-GAN (Arjovsky et al., 2017). We include an extended review of all these methods in Supplementary A.
69
+
70
+ In this work we will focus on latent variable models $P _ { G }$ defined by a two-step procedure, where first a code $Z$ is sampled from a fixed distribution $P _ { Z }$ on a latent space $\mathcal { Z }$ and then $Z$ is mapped to the image $X \in \mathcal { X } \overset { = } { = } \mathcal { R } ^ { d }$ with a (possibly random) transformation. This results in a density of the form
71
+
72
+ $$
73
+ p _ { G } ( x ) : = \int _ { \mathcal { Z } } p _ { G } ( x | \boldsymbol { z } ) p _ { z } ( \boldsymbol { z } ) d \boldsymbol { z } , \quad \forall \boldsymbol { x } \in \mathcal { X } ,
74
+ $$
75
+
76
+ assuming all involved densities are properly defined. For simplicity we will focus on non-random decoders, i.e. generative models $P _ { G } ( X | Z )$ deterministically mapping $Z$ to $X = G ( Z )$ for a given map $G \colon { \mathcal { Z } } \to { \mathcal { X } }$ . Similar results for random decoders can be found in Supplementary B.1.
77
+
78
+ It turns out that under this model, the OT cost takes a simpler form as the transportation plan factors through the map $G$ : instead of finding a coupling $\Gamma$ in (1) between two random variables living in the $\mathcal { X }$ space, one distributed according to $P _ { X }$ and the other one according to $P _ { G }$ , it is sufficient to find a conditional distribution $Q ( Z | X )$ such that its $Z$ marginal $Q _ { Z } ( Z ) \setminus : = \mathbb { E } _ { X \sim P _ { X } } \left[ Q ( Z | X ) \right]$ is identical to the prior distribution $P _ { Z }$ . This is the content of the theorem below proved in Bousquet et al. (2017). To make this paper self contained we repeat the proof in Supplementary B.
79
+
80
+ Theorem 1 For $P _ { G }$ as defined above with deterministic $P _ { G } ( X | Z )$ and any function $G \colon { \mathcal { Z } } \to { \mathcal { X } }$
81
+
82
+ $$
83
+ \operatorname* { i n f } _ { \substack { \Gamma \in \mathcal { P } ( X \sim P _ { X } , Y \sim P _ { G } ) } } \mathbb { E } _ { ( X , Y ) \sim \Gamma } \left[ c \big ( X , Y \big ) \right] = \operatorname* { i n f } _ { Q \colon Q z = P _ { Z } } \mathbb { E } _ { P _ { X } } \mathbb { E } _ { Q ( Z | X ) } \left[ c \big ( X , G ( Z ) \big ) \right] ,
84
+ $$
85
+
86
+ where $Q _ { Z }$ is the marginal distribution of $Z$ when $X \sim P _ { X }$ and $Z \sim Q ( Z | X )$
87
+
88
+ This result allows us to optimize over random encoders $Q ( Z | X )$ instead of optimizing over all couplings between $X$ and $Y$ . Of course, both problems are still constrained. In order to implement a numerical solution we relax the constraints on $Q _ { Z }$ by adding a penalty to the objective. This finally leads us to the WAE objective:
89
+
90
+ $$
91
+ D _ { \mathrm { W A E } } ( P _ { X } , P _ { G } ) : = \operatorname* { i n f } _ { Q ( Z | X ) \in \mathcal { Q } } \mathbb { E } _ { P _ { X } } \mathbb { E } _ { Q ( Z | X ) } \left[ c \bigl ( X , G ( Z ) \bigr ) \right] + \lambda \cdot \mathcal { D } _ { Z } ( Q _ { Z } , P _ { Z } ) ,
92
+ $$
93
+
94
+ where $\mathcal { Q }$ is any nonparametric set of probabilistic encoders, $\mathcal { D } _ { Z }$ is an arbitrary divergence between $Q _ { Z }$ and $P _ { Z }$ , and $\lambda > 0$ is a hyperparameter. Similarly to VAE, we propose to use deep neural networks to parametrize both encoders $Q$ and decoders $G$ . Note that as opposed to VAEs, the WAE formulation allows for non-random encoders deterministically mapping inputs to their latent codes.
95
+
96
+ We propose two different penalties $\mathcal { D } _ { Z } ( Q _ { Z } , P _ { Z } )$
97
+
98
+ GAN-based $\mathcal { D } _ { Z }$ . The first option is to choose $\mathcal { D } _ { Z } ( Q _ { Z } , P _ { Z } ) = D _ { \mathrm { J S } } ( Q _ { Z } , P _ { Z } )$ and use the adversarial training to estimate it. Specifically, we introduce an adversary (discriminator) in the latent space $\mathcal { Z }$ trying to separate2 “true” points sampled from $P _ { Z }$ and “fake” ones sampled from $Q _ { Z }$ (Goodfellow et al., 2014). This results in the WAE-GAN described in Algorithm 1. Even though WAE-GAN falls back to the min-max problem, we move the adversary from the input (pixel) space $\mathcal { X }$ to the latent space $\mathcal { Z }$ . On top of that, $P _ { Z }$ may have a nice shape with a single mode (for a Gaussian prior), in which case the task should be easier than matching an unknown, complex, and possibly multi-modal distributions as usually done in GANs. This is also a reason for our second penalty:
99
+
100
+ MMD-based $\mathcal { D } _ { Z }$ . For a positive-definite reproducing kernel $k \colon \mathcal { Z } \times \mathcal { Z } \mathcal { R }$ the following expression is called the maximum mean discrepancy (MMD):
101
+
102
+ $$
103
+ \mathrm { M M D } _ { k } ( P _ { Z } , Q _ { Z } ) = \big \lVert \int _ { \mathcal { Z } } k ( z , \cdot ) d P _ { Z } ( z ) - \int _ { \mathcal { Z } } k ( z , \cdot ) d Q _ { Z } ( z ) \big \rVert _ { \mathcal { H } _ { k } } ,
104
+ $$
105
+
106
+ where $\mathcal { H } _ { k }$ is the RKHS of real-valued functions mapping $\mathcal { Z }$ to $\mathcal { R }$ . If $k$ is characteristic then ${ \mathrm { M M D } } _ { k }$ defines a metric and can be used as a divergence measure. We propose to use $\mathcal { D } _ { Z } ( P _ { Z } , Q _ { Z } ) =$ $\mathrm { M M D } _ { k } ( P _ { Z } , Q _ { Z } )$ . Fortunately, MMD has an unbiased U-statistic estimator, which can be used in conjunction with stochastic gradient descent (SGD) methods. This results in the WAE-MMD described in Algorithm 2. It is well known that the maximum mean discrepancy performs well when matching high-dimensional standard normal distributions (Gretton et al., 2012) so we expect this penalty to work especially well working with the Gaussian prior $P _ { Z }$ .
107
+
108
+ <table><tr><td>ALGORITHM1Wasserstein Auto-Encoder with GAN-based penalty (WAE-GAN).</td><td>ALGORITHM 2Wasserstein Auto-Encoder withMMD-based penalty (WAE-MMD).</td></tr><tr><td>Require:Regularization coefficient 入&gt;0. Initialize the parameters of the encoder Q, decoder Gθ,and latent discriminator Dy. while(,θ) not converged do Sample {x1,...,xn} from the training set Sample {z1,...,zn} from the prior Pz</td><td>Require:Regularization coefficient入&gt; O,char- acteristic positive-definite kernel k. Initialize the parameters of the encoder Q𝜙, decoder Gθ,and latent discriminator D. while (,0) not converged do</td></tr><tr><td>Sample zi from Q(Z|xi) fori=1,...,n Update D, by ascending:</td><td>Sample {x1,...,xn} from the training set Sample {z1,..., zn} from the prior Pz Sample z from Q(Z|xi) fori=1,...,n</td></tr><tr><td>入 n ? logDγ(zi)+log(1-Dγ(i)) n i=1</td><td>Update Q and Ge by descending: 1 n 入</td></tr><tr><td>Update Q and Ge by descending: 1 n c(xi,Ge(zi))-λ·logDγ(zi) n</td><td>c(xi,Gθ(zi)) &gt; k(ze,zj) n(n-1) n i=1 +j</td></tr><tr><td>i=1 end while</td><td>入 2入 &gt; k(2e,) + &gt; k(ze,2j) n</td></tr><tr><td></td><td>n(n-1) l≠j e,j</td></tr></table>
109
+
110
+ We point out once again that the encoders $Q _ { \phi } ( Z | x )$ in Algorithms 1 and 2 can be non-random, i.e. deterministically mapping input points to the latent codes. In this case $Q _ { \phi } ( Z | x ) = \delta _ { \mu _ { \phi } ( x ) }$ fo r a function $\mu _ { \phi } \colon \mathcal { X } \to \mathcal { Z }$ and in order to sample $\tilde { z } _ { i }$ from $Q _ { \phi } ( Z | x _ { i } )$ we just need to return $\mu _ { \phi } ( x _ { i } )$ .
111
+
112
+ # 3 RELATED WORK
113
+
114
+ Literature on auto-encoders Classical unregularized auto-encoders minimize only the reconstruction cost. This results in different training points being encoded into non-overlapping zones chaotically scattered all across the $\mathcal { Z }$ space with “holes” in between where the decoder mapping $P _ { G } ( X | Z )$ has never been trained. Overall, the encoder $Q ( Z | X )$ trained in this way does not provide a useful representation and sampling from the latent space $\mathcal { Z }$ becomes hard (Bengio et al., 2013).
115
+
116
+ Variational auto-encoders (Kingma & Welling, 2014) minimize a variational bound on the KLdivergence $D _ { \mathrm { K L } } ( P _ { X } , P _ { G } )$ which is composed of the reconstruction cost plus the regularizer $\mathbb { E } _ { P _ { X } } \left[ D _ { \mathrm { K L } } ( Q ( Z | X ) , P _ { Z } ) \right]$ . The regularizer captures how distinct the image by the encoder of each training example is from the prior $P _ { Z }$ , which is not guaranteeing that the overall encoded distribution $\mathbb { E } _ { P _ { X } }$ $\mathinner { \langle { Q \mathopen { \left( Z \vert X \right) } } \rvert }$ matches $P _ { Z }$ like WAE does. Also, VAEs require non-degenerate (i.e. nondeterministic) Gaussian encoders and random decoders for which the term $\log p _ { G } ( x | z )$ can be computed and differentiated with respect to the parameters. Later Mescheder et al. (2017) proposed a way to use VAE with non-Gaussian encoders. WAE minimizes the optimal transport $W _ { c } ( P _ { X } , P _ { G } )$ and allows both probabilistic and deterministic encoder-decoder pairs of any kind.
117
+
118
+ The VAE regularizer can be also equivalently written (Hoffman & Johnson, 2016) as a sum of $D _ { \mathrm { K L } } ( Q _ { Z } , P _ { Z } )$ and a mutual information $\mathbb { I } _ { Q } ( X , Z )$ between the images $X$ and latent codes $Z$ jointly distributed according to $P _ { X } \times Q ( Z | X )$ . This observation provides another intuitive way to explain a difference between our algorithm and VAEs: WAEs simply drop the mutual information term $\mathbb { I } _ { Q } ( X , Z )$ in the VAE regularizer.
119
+
120
+ When used with $c ( x , y ) = \| x - y \| _ { 2 } ^ { 2 }$ WAE-GAN is equivalent to adversarial auto-encoders (AAE) proposed by Makhzani et al. (2016). Theory of Bousquet et al. (2017) (and in particular Theorem 1) thus suggests that AAEs minimize the 2-Wasserstein distance between $P _ { X }$ and $P _ { G }$ . This provides the first theoretical justification for AAEs known to the authors. WAE generalizes AAE in two ways: first, it can use any cost function $c$ in the input space $\mathcal { X }$ ; second, it can use any discrepancy measure $\mathcal { D } _ { Z }$ in the latent space $\mathcal { Z }$ (for instance MMD), not necessarily the adversarial one of WAE-GAN.
121
+
122
+ Finally, Zhao et al. (2017b) independently proposed a regularized auto-encoder objective similar to Bousquet et al. (2017) and our (4) based on very different motivations and arguments. Following
123
+
124
+ VAEs their objective (called InfoVAE) defines the reconstruction cost in the image space implicitly through the negative log likelihood term $- \log p _ { G } ( x | z )$ , which should be properly normalized for all $z \in { \mathcal { Z } }$ . In theory VAE and InfoVAE can both induce arbitrary cost functions, however in practice this may require an estimation of the normalizing constant (partition function) which can3 be different for different values of $z$ . WAEs specify the cost $c ( x , y )$ explicitly and don’t constrain it in any way.
125
+
126
+ Literature on OT Genevay et al. (2016) address computing the OT cost in large scale using SGD and sampling. They approach this task either through the dual formulation, or via a regularized version of the primal. They do not discuss any implications for generative modeling. Our approach is based on the primal form of OT, we arrive at regularizers which are very different, and our main focus is on generative modeling.
127
+
128
+ The WGAN (Arjovsky et al., 2017) minimizes the 1-Wasserstein distance $W _ { 1 } ( P _ { X } , P _ { G } )$ for generative modeling. The authors approach this task from the dual form. Their algorithm comes without an encoder and can not be readily applied to any other cost $W _ { c }$ , because the neat form of the Kantorovich-Rubinstein duality (2) holds only for $W _ { 1 }$ . WAE approaches the same problem from the primal form, can be applied for any cost function $c$ , and comes naturally with an encoder.
129
+
130
+ In order to compute the values (1) or (2) of OT we need to handle non-trivial constraints, either on the coupling distribution $\Gamma$ or on the function $f$ being considered. Various approaches have been proposed in the literature to circumvent this difficulty. For $W _ { 1 }$ Arjovsky et al. (2017) tried to implement the constraint in the dual formulation (2) by clipping the weights of the neural network $f$ . Later Gulrajani et al. (2017) proposed to relax the same constraint by penalizing the objective of (2) with a term $\lambda \cdot \mathbb { E } \left( \left\| \nabla f ( X ) \right\| - 1 \right) ^ { 2 }$ which should not be greater than 1 if $f \in \mathcal { F } _ { L }$ . In a more general OT setting of $W _ { c }$ Cuturi (2013) proposed to penalize the objective of (1) with the KLdivergence $\lambda \cdot D _ { \mathrm { K L } } ( \Gamma , P \otimes Q )$ between the coupling distribution and the product of marginals. Genevay et al. (2016) showed that this entropic regularization drops the constraints on functions in the dual formulation as opposed to (2). Finally, in the context of unbalanced optimal transport it has been proposed to relax the constraint in (1) by regularizing the objective with $\lambda \cdot \left( D _ { f } ( \Gamma _ { X } , \mathbf { \bar { \Gamma } } ^ { } P ) + \right.$ $D _ { f } ( \Gamma _ { Y } , Q ) )$ (Chizat et al., 2015; Liero et al., 2015), where $\Gamma _ { X }$ and $\Gamma _ { Y }$ are marginals of $\Gamma$ . In this paper we propose to relax OT in a way similar to the unbalanced optimal transport, i.e. by adding additional divergences to the objective. However, we show that in the particular context of generative modeling, only one extra divergence is necessary.
131
+
132
+ Literature on GANs Many of the GAN variations (including $f$ -GAN and WGAN) come without an encoder. Often it may be desirable to reconstruct the latent codes and use the learned manifold, in which cases these models are not applicable.
133
+
134
+ There have been many other approaches trying to blend the adversarial training of GANs with autoencoder architectures (Zhao et al., $2 0 1 7 \mathrm { a }$ ; Dumoulin et al., 2017; Ulyanov et al., 2017; Berthelot et al., 2017). The approach proposed by Ulyanov et al. (2017) is perhaps the most relevant to our work. The authors use the discrepancy between $Q _ { Z }$ and the distribution $\mathbb { E } _ { Z ^ { \prime } \sim P _ { Z } } [ Q \left( Z | G ( Z ^ { \prime } ) \right) ]$ of auto-encoded noise vectors as the objective for the max-min game between the encoder and decoder respectively. While the authors showed that the saddle points correspond to $P _ { X } = P _ { G }$ , they admit that encoders and decoders trained in this way have no incentive to be reciprocal. As a workaround they propose to include an additional reconstruction term to the objective. WAE does not necessarily lead to a min-max game, uses a different penalty, and has a clear theoretical foundation.
135
+
136
+ Several works used reproducing kernels in context of GANs. Li et al. (2015); Dziugaite et al. (2015) use MMD with a fixed kernel $k$ to match $P _ { X }$ and $P _ { G }$ directly in the input space $\mathcal { X }$ . These methods have been criticised to require larger mini-batches during training: estimating $\mathrm { M M D } _ { k } ( P _ { X } , P _ { G } )$ requires number of samples roughly proportional to the dimensionality of the input space $\mathcal { X }$ (Reddi et al., 2015) which is typically larger than $1 0 ^ { 3 }$ . Li et al. (2017) take a similar approach but further train $k$ adversarially so as to arrive at a meaningful loss function. WAE-MMD uses MMD to match $Q _ { Z }$ to the prior $P _ { Z }$ in the latent space $\mathcal { Z }$ . Typically $\mathcal { Z }$ has no more than 100 dimensions and $P _ { Z }$ is Gaussian, which allows us to use regular mini-batch sizes to accurately estimate MMD.
137
+
138
+ ![](images/ba6eb123cbe974ac8bc98667fc71d8053d7e708a6c4e49eac087dd03ed3734c6.jpg)
139
+ Figure 2: VAE (left column), WAE-MMD (middle column), and WAE-GAN (right column) trained on MNIST dataset. In “test reconstructions” odd rows correspond to the real test points.
140
+
141
+ # 4 EXPERIMENTS
142
+
143
+ In this section we empirically evaluate4 the proposed WAE model. We would like to test if WAE can simultaneously achieve (i) accurate reconstructions of data points, (ii) reasonable geometry of the latent manifold, and (iii) random samples of good (visual) quality. Importantly, the model should generalize well: requirements (i) and (ii) should be met on both training and test data. We trained WAE-GAN and WAE-MMD (Algorithms 1 and 2) on two real-world datasets: MNIST (LeCun et al., 1998) consisting of $7 0 \mathrm { k }$ images and CelebA (Liu et al., 2015) containing roughly 203k images.
144
+
145
+ Experimental setup In all reported experiments we used Euclidian latent spaces $\mathcal { Z } \ = \ \mathcal { R } ^ { d _ { z } }$ for various $d _ { z }$ depending on the complexity of the dataset, isotropic Gaussian prior distributions $P _ { Z } ( Z ) = \mathcal { N } ( Z ; \mathbf { 0 } , \sigma _ { z } ^ { 2 } \cdot I _ { d } )$ over $\mathcal { Z }$ , and a squared cost function $c ( \bar { x } , y ) = \| x - \bar { y } \| _ { 2 } ^ { 2 }$ for data points $x , y \in \mathcal { X } = \mathcal { R } ^ { d _ { x } }$ . We used deterministic encoder-decoder pairs, Adam (Kingma & Lei, 2014) with $\beta _ { 1 } = 0 . 5 , \beta _ { 2 } = 0 . 9 9 9$ , and convolutional deep neural network architectures for encoder mapping $\mu _ { \phi } \colon \mathcal { X } \to \mathcal { Z }$ and decoder mapping $G _ { \theta } \colon { \mathcal { Z } } \to { \mathcal { X } }$ similar to the DCGAN ones reported by Radford et al. (2016) with batch normalization (Ioffe & Szegedy, 2015). We tried various values of $\lambda$ and noticed that $\lambda = 1 0$ seems to work good across all datasets we considered.
146
+
147
+ Since we are using deterministic encoders, choosing $d _ { z }$ larger than intrinsic dimensionality of the dataset would force the encoded distribution $Q _ { Z }$ to live on a manifold in $\mathcal { Z }$ . This would make matching $Q _ { Z }$ to $P _ { Z }$ impossible if $P _ { Z }$ is Gaussian and may lead to numerical instabilities. We use $d _ { z } = 8$ for MNIST and $d _ { z } = 6 4$ for CelebA which seems to work reasonably well.
148
+
149
+ ![](images/5f9154f809ae2eb7b1b03217d0ca3922df4a01f90d50874364f5a3fe74e9b6da.jpg)
150
+ Figure 3: VAE (left column), WAE-MMD (middle column), and WAE-GAN (right column) trained on CelebA dataset. In “test reconstructions” odd rows correspond to the real test points.
151
+
152
+ We also report results of VAEs. VAEs used the same latent spaces as discussed above and standard Gaussian priors $P _ { Z } = \mathcal { N } ( \mathbf { 0 } , I _ { d } )$ . We used Gaussian encoders $Q ( Z | X ) = \mathcal { N } \big ( Z ; \mu _ { \phi } ( X ) , \Sigma ( X ) \big )$ with mean $\mu _ { \phi }$ and diagonal covariance $\Sigma$ . For both MNIST and CelebA we used Bernoulli decoders parametrized by $G _ { \theta }$ . Functions $\mu _ { \phi } , \Sigma$ , and $G _ { \theta }$ were parametrized by deep nets of the same architectures as used in WAE.
153
+
154
+ WAE-GAN and WAE-MMD specifics In WAE-GAN we used discriminator $D$ composed of several fully connected layers with ReLu. We tried WAE-MMD with the RBF kernel but observed that it fails to penalize the outliers of $Q _ { Z }$ because of the quick tail decay. If the codes $\tilde { z } = \mu _ { \phi } ( x )$ for some of the training points $x \in \mathcal { X }$ end up far away from the support of $P _ { Z }$ (which may happen in the early stages of training) the corresponding terms in the U-statistic $k ( z , \tilde { z } ) = e ^ { - \| \tilde { z } - z \| _ { 2 } ^ { 2 } / \sigma _ { k } ^ { 2 } }$ will quickly approach zero and provide no gradient for those outliers. This could be avoided by choosing the kernel bandwidth $\sigma _ { k } ^ { 2 }$ in a data-dependent manner, however in this case per-minibatch U-statistic would not provide an unbiased estimate for the gradient. Instead, we used the inverse multiquadratics kernel $\bar { k } ( x , y ) = C / ( C + \| x - y \| _ { 2 } ^ { 2 } )$ which is also characteristic and has much heavier tails. In all experiments we used $C = 2 d _ { z } \sigma _ { z } ^ { 2 }$ , which is the expected squared distance between two multivariate Gaussian vectors drawn from $P _ { Z }$ . This significantly improved the performance compared to the RBF kernel (even the one with $\sigma _ { k } ^ { 2 } = 2 d _ { z } \sigma _ { z } ^ { 2 }$ ). Trained models are presented in Figures 2 and 3. Further details are presented in Supplementary C.
155
+
156
+ Random samples are generated by sampling $P _ { Z }$ and decoding the resulting noise vectors $z$ into $G _ { \theta } ( z )$ . As expected, in our experiments we observed that for both WAE-GAN and WAE-MMD the quality of samples strongly depends on how accurately $Q _ { Z }$ matches $P _ { Z }$ . To see this, notice that during training the decoder function $G _ { \theta }$ is presented only with encoded versions $\mu _ { \phi } ( X )$ of the data points $X \sim P _ { X }$ . Indeed, the decoder is trained on samples from $Q _ { Z }$ and thus there is no reason to expect good results when feeding it with samples from $P _ { Z }$ . In our experiments we noticed that even slight differences between $Q _ { Z }$ and $P _ { Z }$ may affect the quality of samples. In some cases WAE-GAN seems to lead to a better matching and generates better samples than WAE-MMD. However, due to adversarial training WAE-GAN is highly unstable, while WAE-MMD has a very stable training much like VAE.
157
+
158
+ In order to quantitatively assess the quality of the generated images, we use the Frechet Inception Distance´ introduced by Heusel et al. (2017) and report the results on CelebA in Table 1. These results confirm that the sampled images from WAE are of better quality than from VAE, and WAE-GAN gets a slightly better score than WAEMMD, which correlates with visual inspection of the images.
159
+
160
+ Table 1: FID scores for samples on CelebA (smaller is better).
161
+
162
+ <table><tr><td>Algorithm</td><td>FID</td></tr><tr><td>VAE</td><td>82</td></tr><tr><td>WAE-MMD</td><td>55</td></tr><tr><td>WAE-GAN</td><td>42</td></tr></table>
163
+
164
+ Test reconstructions and interpolations. We take random points $x$ from the held out test set and report their auto-encoded versions $G _ { \theta } ( \mu _ { \phi } ( x ) )$ . Next, pairs $( x , y )$ of different data points are sampled randomly from the held out test set and encoded: $z _ { x } = \mu _ { \phi } ( x )$ , $z _ { y } = \mu _ { \phi } ( y )$ . We linearly interpolate between $z _ { x }$ and $z _ { y }$ with equally-sized steps in the latent space and show decoded images.
165
+
166
+ # 5 CONCLUSION
167
+
168
+ Using the optimal transport cost, we have derived Wasserstein auto-encoders—a new family of algorithms for building generative models. We discussed their relations to other probabilistic modeling techniques. We conducted experiments using two particular implementations of the proposed method, showing that in comparison to VAEs, the images sampled from the trained WAE models are of better quality, without compromising the stability of training and the quality of reconstruction. Future work will include further exploration of the criteria for matching the encoded distribution $Q _ { Z }$ to the prior distribution $P _ { Z }$ , assaying the possibility of adversarially training the cost function $c$ in the input space $\mathcal { X }$ , and a theoretical analysis of the dual formulations for WAE-GAN and WAE-MMD.
169
+
170
+ # ACKNOWLEDGMENTS
171
+
172
+ The authors are thankful to Carl Johann Simon-Gabriel, Mateo Rojas-Carulla, Arthur Gretton, Paul Rubenstein, and Fei Sha for stimulating discussions.
173
+
174
+ # REFERENCES
175
+
176
+ M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein GAN, 2017.
177
+ Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. Pattern Analysis and Machine Intelligence, 35, 2013.
178
+ D. Berthelot, T. Schumm, and L. Metz. Began: Boundary equilibrium generative adversarial networks, 2017.
179
+ O. Bousquet, S. Gelly, I. Tolstikhin, C. J. Simon-Gabriel, and B. Scholkopf. From optimal transport ¨ to generative modeling: the VEGAN cookbook, 2017.
180
+ Lenaic Chizat, Gabriel Peyre, Bernhard Schmitzer, and Franc¸ois-Xavier Vialard. Unbalanced opti- ´ mal transport: geometry and kantorovich formulation. arXiv preprint arXiv:1508.05216, 2015.
181
+ M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, pp. 2292–2300, 2013.
182
+ V. Dumoulin, I. Belghazi, B. Poole, A. Lamb, M. Arjovsky, O. Mastropietro, and A. Courville. Adversarially learned inference. In ICLR, 2017.
183
+
184
+ G. K. Dziugaite, D. M. Roy, and Z. Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. In UAI, 2015.
185
+
186
+ A. Genevay, M. Cuturi, G. Peyre, and F. R. Bach. Stochastic optimization for large-scale optimal ´ transport. In Advances in Neural Information Processing Systems, pp. 3432–3440, 2016.
187
+
188
+ Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pp. 2672–2680, 2014.
189
+
190
+ A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Scholkopf, and A. J. Smola. A kernel two-sample ¨ test. Journal of Machine Learning Research, 13:723–773, 2012.
191
+
192
+ I. Gulrajani, F. Ahmed, M. Arjovsky, V. Domoulin, and A. Courville. Improved training of wasserstein GANs, 2017.
193
+
194
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, Gunter Klambauer, and ¨ Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a nash equilibrium. arXiv preprint arXiv:1706.08500, 2017.
195
+
196
+ M. D. Hoffman and M. Johnson. Elbo surgery: yet another way to carve up the variational evidence lower bound. In NIPS Workshop on Advances in Approximate Bayesian Inference, 2016.
197
+
198
+ S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift, 2015.
199
+
200
+ D. P. Kingma and J. Lei. Adam: A method for stochastic optimization, 2014.
201
+
202
+ D. P. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014.
203
+
204
+ Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, volume 86(11), pp. 2278–2324, 1998.
205
+
206
+ C. L. Li, W. C. Chang, Y. Cheng, Y. Yang, and B. Poczos. Mmd gan: Towards deeper understanding of moment matching network, 2017.
207
+
208
+ Y. Li, K. Swersky, and R. Zemel. Generative moment matching networks. In ICML, 2015.
209
+
210
+ Matthias Liero, Alexander Mielke, and Giuseppe Savare. Optimal entropy-transport problems and a ´ new hellinger-kantorovich distance between positive measures. arXiv preprint arXiv:1508.07941, 2015.
211
+
212
+ F. Liese and K.-J. Miescke. Statistical Decision Theory. Springer, 2008.
213
+
214
+ 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), 2015.
215
+
216
+ A. Makhzani, J. Shlens, N. Jaitly, and I. Goodfellow. Adversarial autoencoders. In ICLR, 2016.
217
+
218
+ L. Mescheder, S. Nowozin, and A. Geiger. Adversarial variational bayes: Unifying variational autoencoders and generative adversarial networks, 2017.
219
+
220
+ Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-GAN: Training generative neural samplers using variational divergence minimization. In NIPS, 2016.
221
+
222
+ B. Poole, A. Alemi, J. Sohl-Dickstein, and A. Angelova. Improved generator objectives for GANs, 2016.
223
+
224
+ A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016.
225
+
226
+ R. Reddi, A. Ramdas, A. Singh, B. Poczos, and L. Wasserman. On the high-dimensional power of a linear-time two sample test under mean-shift alternatives. In AISTATS, 2015.
227
+
228
+ D. Ulyanov, A. Vedaldi, and V. Lempitsky. It takes (only) two: Adversarial generator-encoder networks, 2017.
229
+
230
+ C. Villani. Topics in Optimal Transportation. AMS Graduate Studies in Mathematics, 2003.
231
+
232
+ J. Zhao, M. Mathieu, and Y. LeCun. Energy-based generative adversarial network. In ICLR, 2017a.
233
+
234
+ S. Zhao, J. Song, and S. Ermon. InfoVAE: Information maximizing variational autoencoders, 2017b.
235
+
236
+ # A IMPLICIT GENERATIVE MODELS: A SHORT TOUR OF GANS AND VAES
237
+
238
+ Even though GANs and VAEs are quite different—both in terms of the conceptual frameworks and empirical performance—they share important features: (a) both can be trained by sampling from the model $P _ { G }$ without knowing an analytical form of its density and (b) both can be scaled up with SGD. As a result, it becomes possible to use highly flexible implicit models $P _ { G }$ defined by a twostep procedure, where first a code $Z$ is sampled from a fixed distribution $P _ { Z }$ on a latent space $\mathcal { Z }$ and then $Z$ is mapped to the image $G ( Z ) \in \mathcal { X } = \mathcal { R } ^ { d }$ with a (possibly random) transformation $G \colon { \mathcal { Z } } \to { \mathcal { X } }$ . This results in latent variable models $P _ { G }$ of the form (3).
239
+
240
+ These models are indeed easy to sample and, provided $G$ can be differentiated analytically with respect to its parameters, $P _ { G }$ can be trained with SGD. The field is growing rapidly and numerous variations of VAEs and GANs are available in the literature. Next we introduce and compare several of them.
241
+
242
+ The original generative adversarial network (GAN) Goodfellow et al. (2014) approach minimizes
243
+
244
+ $$
245
+ D _ { \mathrm { G A N } } ( P _ { X } , P _ { G } ) = \operatorname* { s u p } _ { T \in { \mathcal T } } \mathbb { E } _ { X \sim P _ { X } } [ \log T ( X ) ] + \mathbb { E } _ { Z \sim P _ { Z } } [ \log \left( 1 - T ( G ( Z ) ) \right) ]
246
+ $$
247
+
248
+ with respect to a deterministic decoder $G \colon { \mathcal { Z } } \to { \mathcal { X } }$ , where $\tau$ is any non-parametric class of choice. It is known that $D _ { \mathrm { G A N } } ( P _ { X } , P _ { G } ) \leq 2 \cdot D _ { \mathrm { J S } } ( P _ { X } , P _ { G } ) - \log ( 4 )$ and the inequality turns into identity in the nonparametric limit, that is when the class $\tau$ becomes rich enough to represent all functions mapping $\mathcal { X }$ to $( 0 , 1 )$ . Hence, GANs are minimizing a lower bound on the JS-divergence. However, GANs are not only linked to the JS-divergence: the $f$ -GAN approach Nowozin et al. (2016) showed that a slight modification $D _ { \mathrm { f , G A N } }$ of the objective (5) allows to lower bound any desired $f$ -divergence in a similar way. In practice, both decoder $G$ and discriminator $T$ are trained in alternating SGD steps. Stopping criteria as well as adequate evaluation of the trained GAN models remain open questions.
249
+
250
+ Recently, the authors of Arjovsky et al. (2017) argued that the 1-Wasserstein distance $W _ { 1 }$ , which is known to induce a much weaker topology than $D _ { \mathrm { J S } }$ , may be better suited for generative modeling. When $P _ { X }$ and $P _ { G }$ are supported on largely disjoint low-dimensional manifolds (which may be the case in applications), $D _ { \mathrm { K L } } , D _ { \mathrm { J S } }$ , and other strong distances between $P _ { X }$ and $P _ { G }$ max out and no longer provide useful gradients for $P _ { G }$ . This “vanishing gradient” problem necessitates complicated scheduling between the $G / T$ updates. In contrast, $W _ { 1 }$ is still sensible in these cases and provides stable gradients. The Wasserstein GAN (WGAN) minimizes
251
+
252
+ $$
253
+ D _ { \mathrm { W G A N } } ( P _ { X } , P _ { G } ) = \operatorname* { s u p } _ { T \in \mathcal { W } } \mathbb { E } _ { X \sim P _ { X } } [ T ( X ) ] - \mathbb { E } _ { Z \sim P _ { Z } } \left[ T ( G ( Z ) ) \right] ,
254
+ $$
255
+
256
+ where $\mathcal { W }$ is any subset of 1-Lipschitz functions on $\mathcal { X }$ . It follows from (2) that $D _ { \mathrm { W G A N } } ( P _ { X } , P _ { G } ) \leq$ $W _ { 1 } ( P _ { X } , P _ { G } )$ and thus WGAN is minimizing a lower bound on the 1-Wasserstein distance.
257
+
258
+ Variational auto-encoders (VAE) Kingma & Welling (2014) utilize models $P _ { G }$ of the form (3) and minimize
259
+
260
+ $$
261
+ D _ { \mathrm { V A E } } \big ( P _ { X } , P _ { G } \big ) = \operatorname* { i n f } _ { Q ( Z | X ) \in \mathcal { Q } } \mathbb { E } _ { P _ { X } } \left[ D _ { \mathrm { K L } } \big ( Q ( Z | X ) , P _ { Z } \big ) - \mathbb { E } _ { Q ( Z | X ) } [ \log p _ { G } ( X | Z ) ] \right]
262
+ $$
263
+
264
+ with respect to a random decoder mapping $P _ { G } ( X | Z )$ . The conditional distribution $P _ { G } ( X | Z )$ is often parametrized by a deep net $G$ and can have any form as long as its density $p _ { G } ( x | z )$ can be computed and differentiated with respect to the parameters of $G$ . A typical choice is to use Gaussians $P _ { G } ( X | Z ) = \mathcal { N } ( X ; G ( Z ) , \sigma ^ { \hat { 2 } } \cdot I )$ . If $\mathcal { Q }$ is the set of all conditional probability distributions $Q ( Z | X )$ , the objective of VAE coincides with the negative marginal log-likelihood $D _ { \mathrm { V A E } } ( P _ { X } , P _ { G } ) = - \mathbb { E } _ { P _ { X } } [ \log P _ { G } ( X ) ]$ . However, in order to make the $D _ { \mathrm { K L } }$ term of (6) tractable in closed form, the original implementation of VAE uses a standard normal $P _ { Z }$ and restricts $\mathcal { Q }$ to a class of Gaussian distributions $Q ( Z | X ) = { \mathcal { N } } { \big ( } Z ; \mu ( X ) , \Sigma ( X ) { \big ) }$ with mean $\mu$ and diagonal covariance $\Sigma$ parametrized by deep nets. As a consequence, VAE is minimizing an upper bound on the negative log-likelihood or, equivalently, on the KL-divergence $D _ { \mathrm { K L } } ( P _ { X } , P _ { G } )$ .
265
+
266
+ One possible way to reduce the gap between the true negative log-likelihood and the upper bound provided by $D _ { \mathrm { V A E } }$ is to enlarge the class $\mathcal { Q }$ . Adversarial variational Bayes (AVB) Mescheder et al. (2017) follows this argument by employing the idea of GANs. Given any point $x \in \mathcal { X }$ , a noise $\epsilon \sim \mathcal { N } ( 0 , 1 )$ , and any fixed transformation $e \colon \mathcal { X } \times \mathcal { R } \mathcal { Z }$ , a random variable $e ( x , \epsilon )$
267
+
268
+ implicitly defines one particular conditional distribution $Q _ { e } ( Z | X = x )$ . AVB allows $\mathcal { Q }$ to contain all such distributions for different choices of $e$ , replaces the intractable term $D _ { \mathrm { K L } } \big ( Q _ { e } ( Z | X ) , P _ { Z } \big )$ in (6) by the adversarial approximation $D _ { \mathrm { f , G A N } }$ corresponding to the KL-divergence, and proposes to minimize5
269
+
270
+ $$
271
+ D _ { \mathrm { A V B } } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { Q _ { \epsilon } ( Z | X ) \in \mathcal { Q } } \mathbb { E } _ { P _ { X } } \left[ D _ { \mathrm { f } , \operatorname { G A N } } \big ( Q _ { e } ( Z | X ) , P _ { Z } \big ) - \mathbb { E } _ { Q _ { \epsilon } ( Z | X ) } [ \log p _ { G } ( X | Z ) ] \right] .
272
+ $$
273
+
274
+ The $D _ { \mathrm { K L } }$ term in (6) may be viewed as a regularizer. Indeed, VAE reduces to the classical unregularized auto-encoder if this term is dropped, minimizing the reconstruction cost of the encoder-decoder pair $Q ( Z | X ) , P _ { G } ( X | Z )$ . This often results in different training points being encoded into nonoverlapping zones chaotically scattered all across the $\mathcal { Z }$ space with “holes” in between where the decoder mapping $P _ { G } ( X | Z )$ has never been trained. Overall, the encoder $Q ( Z | X )$ trained in this way does not provide a useful representation and sampling from the latent space $\mathcal { Z }$ becomes hard Bengio et al. (2013).
275
+
276
+ Adversarial auto-encoders (AAE) Makhzani et al. (2016) replace the $D _ { \mathrm { K L } }$ term in (6) with another regularizer:
277
+
278
+ $$
279
+ D _ { \mathrm { A A E } } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { Q ( Z | X ) \in Q } D _ { \mathrm { G A N } } ( Q _ { Z } , P _ { Z } ) - \mathbb { E } _ { P _ { X } } \mathbb { E } _ { Q ( Z | X ) } [ \log p _ { G } ( X | Z ) ] ,
280
+ $$
281
+
282
+ where $Q _ { Z }$ is the marginal distribution of $Z$ when first $X$ is sampled from $P _ { X }$ and then $Z$ is sampled from $Q ( Z | X )$ , also known as the aggregated posterior Makhzani et al. (2016). Similarly to AVB, there is no clear link to log-likelihood, as $D _ { \mathrm { A A E } } \leq D _ { \mathrm { A V B } }$ . The authors of Makhzani et al. (2016) argue that matching $Q _ { Z }$ to $P _ { Z }$ in this way ensures that there are no “holes” left in the latent space $\mathcal { Z }$ and $P _ { G } ( X | Z )$ generates reasonable samples whenever $Z \sim P _ { Z }$ . They also report an equally good performance of different types of conditional distributions $Q ( Z | X )$ , including Gaussians as used in VAEs, implicit models $Q _ { e }$ as used in AVB, and deterministic encoder mappings, i.e. $Q ( Z | X ) =$ $\delta _ { \mu ( X ) }$ with $\mu \colon \mathcal X \to \mathcal Z$ .
283
+
284
+ # B PROOF OF THEOREM 1 AND FURTHER DETAILS
285
+
286
+ We will consider certain sets of joint probability distributions of three random variables $( X , Y , Z ) \in$ $\mathcal { X } \times \mathcal { X } \times \mathcal { Z }$ . The reader may wish to think of $X$ as true images, $Y$ as images sampled from the model, and $Z$ as latent codes. We denote by $P _ { G , Z } ( Y , Z )$ a joint distribution of a variable pair $( Y , Z )$ , where $Z$ is first sampled from $P _ { Z }$ and next $Y$ from $P _ { G } ( Y | Z )$ . Note that $P _ { G }$ defined in (3) and used throughout this work is the marginal distribution of $Y$ when $( Y , Z ) \sim P _ { G , Z }$ .
287
+
288
+ In the optimal transport problem (1), we consider joint distributions $\Gamma ( X , Y )$ which are called couplings between values of $X$ and $Y$ . Because of the marginal constraint, we can write $\Gamma ( X , Y ) =$ $\bar { \Gamma } ( \bar { Y ( X ) } P _ { X } ( X )$ and we can consider $\Gamma ( Y | X )$ as a non-deterministic mapping from $X$ to $Y$ . Theorem 1. shows how to factor this mapping through $\mathcal { Z }$ , i.e., decompose it into an encoding distribution $Q ( Z | X )$ and the generating distribution $P _ { G } ( Y | Z )$ .
289
+
290
+ As in Section 2.2, $\mathcal { P } ( X \sim P _ { X } , Y \sim P _ { G } )$ denotes the set of all joint distributions of $( X , Y )$ with marginals $P _ { X } , P _ { G }$ , and likewise for $\mathcal { P } ( X \sim P _ { X } , Z \sim P _ { Z } )$ . The set of all joint distributions of $( X , Y , Z )$ such that $X \sim P _ { X }$ , $( Y , Z ) \sim P _ { G , Z }$ , and $( Y \perp \perp X ) | Z$ will be denoted by ${ \mathcal { P } } _ { X , Y , Z }$ . Finally, we denote by $\mathcal { P } _ { X , Y }$ and $\mathcal { P } _ { X , Z }$ the sets of marginals on $( X , Y )$ and $( X , Z )$ (respectively) induced by distributions in ${ \mathcal { P } } _ { X , Y , Z }$ . Note that $\mathcal { P } ( P _ { X } , P _ { G } )$ , ${ \mathcal { P } } _ { X , Y , Z }$ , and $\mathcal { P } _ { X , Y }$ depend on the choice of conditional distributions $P _ { G } ( Y | Z )$ , while $\mathcal { P } _ { X , Z }$ does not. In fact, it is easy to check that $\mathcal { P } _ { X , Z } =$ $\mathcal { P } ( X \sim P _ { X } , Z \sim P _ { Z } )$ . From the definitions it is clear that $\mathcal { P } _ { X , Y } \subseteq \mathcal { P } ( P _ { X } , P _ { G } )$ and we immediately get the following upper bound:
291
+
292
+ $$
293
+ W _ { c } ( P _ { X } , P _ { G } ) \leq W _ { c } ^ { \dagger } ( P _ { X } , P _ { G } ) : = \operatorname* { i n f } _ { P \in \mathcal { P } _ { X , Y } } \mathbb { E } _ { ( X , Y ) \sim P } \left[ c ( X , Y ) \right] .
294
+ $$
295
+
296
+ If $P _ { G } ( Y | Z )$ are Dirac measures (i.e., $Y = G ( Z ) )$ , it turns out that $\mathcal { P } _ { X , Y } = \mathcal { P } ( P _ { X } , P _ { G } )$ :
297
+
298
+ Lemma 1 $\mathcal { P } _ { X , Y } \subseteq \mathcal { P } ( P _ { X } , P _ { G } )$ with identity $i f ^ { 6 } ~ P _ { G } ( Y | Z = z )$ are Dirac for all $z \in { \mathcal { Z } }$ .
299
+
300
+ Proof The first assertion is obvious. To prove the identity, note that when $Y$ is a deterministic function of $Z$ , for any $A$ in the sigma-algebra induced by $Y$ we have $\mathbb { E } \left[ \mathbb { 1 } _ { [ Y \in A ] } | X , Z \right] = \mathbb { E } \left[ \mathbb { 1 } _ { [ Y \in A ] } | Z \right]$ . This implies $( Y \perp \perp X ) | Z$ and concludes the proof.
301
+
302
+ We are now in place to prove Theorem 1. Lemma 1 obviously leads to
303
+
304
+ $$
305
+ W _ { c } ( P _ { X } , P _ { G } ) = W _ { c } ^ { \dagger } ( P _ { X } , P _ { G } ) .
306
+ $$
307
+
308
+ The tower rule of expectation, and the conditional independence property of ${ \mathcal { P } } _ { X , Y , Z }$ implies
309
+
310
+ $$
311
+ \begin{array} { r l } & { W _ { c } ^ { \dagger } ( P _ { X } , P _ { G } ) = \underset { P \in \mathcal { P } _ { X , Y , Z } } { \operatorname* { i n f } } \mathbb { E } _ { ( X , Y , Z ) \sim P } \left[ c ( X , Y ) \right] } \\ & { \quad \quad \quad = \underset { P \in \mathcal { P } _ { X , Y , Z } } { \operatorname* { i n f } } \mathbb { E } _ { P _ { Z } } \mathbb { E } _ { X \sim P ( X \mid Z ) } \mathbb { E } _ { Y \sim P ( Y \mid Z ) } [ c ( X , Y ) ] } \\ & { \quad \quad \quad = \underset { P \in \mathcal { P } _ { X , Y , Z } } { \operatorname* { i n f } } \mathbb { E } _ { P _ { Z } } \mathbb { E } _ { X \sim P ( X \mid Z ) } \left[ c \left( X , G ( Z ) \right) \right] } \\ & { \quad \quad \quad = \underset { P \in \mathcal { P } _ { X , Z } } { \operatorname* { i n f } } \mathbb { E } _ { ( X , Z ) \sim P } \left[ c \left( X , G ( Z ) \right) \right] . } \end{array}
312
+ $$
313
+
314
+ It remains to notice that $\mathcal { P } _ { X , Z } = \mathcal { P } ( X \sim P _ { X } , Z \sim P _ { Z } )$ as stated earlier.
315
+
316
+ # B.1 RANDOM DECODERS $P _ { G } ( Y | Z )$
317
+
318
+ If the decoders are non-deterministic, Lemma 1 provides only the inclusion of sets $\mathcal { P } _ { X , Y } \subseteq \mathcal { P } ( P _ { X } , P _ { G } )$ and we get the following upper bound on the OT:
319
+
320
+ Corollary 1 Let $\mathcal { X } ~ = ~ \mathcal { R } ^ { d }$ and assume the conditional distributions $P _ { G } ( Y | Z = z )$ have mean values $G ( z ) \in \mathcal { R } ^ { d }$ and marginal variances $\sigma _ { 1 } ^ { 2 } , \ldots , \sigma _ { d } ^ { 2 } \geq 0$ for all $z \in { \mathcal { Z } }$ , where $G \colon { \mathcal { Z } } \to { \mathcal { X } }$ . Take $c ( x , y ) = \| x - y \| _ { 2 } ^ { 2 }$ . Then
321
+
322
+ $$
323
+ W _ { c } ( P _ { X } , P _ { G } ) \leq W _ { c } ^ { \dagger } ( P _ { X } , P _ { G } ) = \sum _ { i = 1 } ^ { d } \sigma _ { i } ^ { 2 } + \operatorname* { i n f } _ { P \in \mathcal { P } ( X \setminus P _ { X } , Z \sim P _ { Z } ) } \mathbb { E } _ { ( X , Z ) \sim P } \big [ \| X - G ( Z ) \| ^ { 2 } \big ] .
324
+ $$
325
+
326
+ Proof First inequality follows from (9). For the identity we proceed similarly to the proof of Theorem 1 and write
327
+
328
+ $$
329
+ W _ { c } ^ { \dagger } ( P _ { X } , P _ { G } ) = \operatorname* { i n f } _ { P \in \mathcal { P } _ { X , Y , Z } } \mathbb { E } _ { P _ { Z } } \mathbb { E } _ { X \sim P ( X \mid Z ) } \mathbb { E } _ { Y \sim P ( Y \mid Z ) } \left[ \left\| X - Y \right\| ^ { 2 } \right] .
330
+ $$
331
+
332
+ Note that
333
+
334
+ $$
335
+ \begin{array} { l } { \mathbb { E } _ { Y \sim P ( Y \vert Z ) } \big [ \| X - Y \| ^ { 2 } \big ] = \mathbb { E } _ { Y \sim P ( Y \vert Z ) } \big [ \| X - G ( Z ) + G ( Z ) - Y \| ^ { 2 } \big ] } \\ { = \| X - G ( Z ) \| ^ { 2 } + \mathbb { E } _ { Y \sim P ( Y \vert Z ) } \big [ \langle X - G ( Z ) , G ( Z ) - Y \rangle \big ] + \mathbb { E } _ { Y \sim P ( Y \vert Z ) } \| G ( Z ) - Y \| ^ { 2 } } \\ { = \| X - G ( Z ) \| ^ { 2 } + \displaystyle \sum _ { i = 1 } ^ { d } \sigma _ { i } ^ { 2 } . } \end{array}
336
+ $$
337
+
338
+ Together with (11) and the fact that $\mathcal { P } _ { X , Z } = \mathcal { P } ( X \sim P _ { X } , Z \sim P _ { Z } )$ this concludes the proof.
339
+
340
+ # C FURTHER DETAILS ON EXPERIMENTS
341
+
342
+ # C.1 MNIST
343
+
344
+ We use mini-batches of size 100 and trained the models for 100 epochs. We used $\lambda = 1 0$ and $\sigma _ { z } ^ { 2 } = 1$ . For the encoder-decoder pair we set $\alpha = 1 0 ^ { - 3 }$ for Adam in the beginning and for the
345
+
346
+ adversary in WAE-GAN to $\alpha = 5 \times 1 0 ^ { - 4 }$ . After 30 epochs we decreased both by factor of 2, and after first 50 epochs further by factor of 5.
347
+
348
+ Both encoder and decoder used fully convolutional architectures with 4x4 convolutional filters.
349
+
350
+ Encoder architecture:
351
+
352
+ $$
353
+ \begin{array} { r l } { x \in \mathcal { R } ^ { 2 8 \times 2 8 } \mathrm { C o n v _ { 1 2 8 } } \mathrm { B N } \mathrm { R e L U } } & { } \\ { \mathrm { C o n v _ { 2 5 6 } } \mathrm { B N } \mathrm { R e L U } } & { } \\ { \mathrm { C o n v _ { 5 1 2 } } \mathrm { B N } \mathrm { R e L U } } & { } \\ { \mathrm { C o n v _ { 1 0 2 4 } } \mathrm { B N } \mathrm { R e L U } \mathrm { F C } _ { 8 } } \end{array}
354
+ $$
355
+
356
+ Decoder architecture:
357
+
358
+ $$
359
+ \begin{array} { r l } & { z \in \mathcal { R } ^ { 8 } \mathrm { F C } _ { 7 \times 7 \times 1 0 2 4 } } \\ & { \qquad \mathrm { F S C o n v } _ { 5 1 2 } \mathrm { B N } \mathrm { R e L U } } \\ & { \qquad \mathrm { F S C o n v } _ { 2 5 6 } \mathrm { B N } \mathrm { R e L U } \mathrm { F S C o n v } _ { 1 } } \end{array}
360
+ $$
361
+
362
+ Adversary architecture for WAE-GAN:
363
+
364
+ $$
365
+ \begin{array} { r l } & { z \in \mathcal { R } ^ { 8 } \mathrm { F C } _ { 5 1 2 } \mathrm { R e L U } } \\ & { ~ \mathrm { F C } _ { 5 1 2 } \mathrm { R e L U } } \\ & { ~ \mathrm { F C } _ { 5 1 2 } \mathrm { R e L U } } \\ & { ~ \mathrm { F C } _ { 5 1 2 } \mathrm { R e L U } \mathrm { F C } _ { 1 } } \end{array}
366
+ $$
367
+
368
+ Here $\operatorname { C o n v } _ { k }$ stands for a convolution with $k$ filters, $\mathrm { F S C o n v } _ { k }$ for the fractional strided convolution with $k$ filters (first two of them were doubling the resolution, the third one kept it constant), BN for the batch normalization, ReLU for the rectified linear units, and $\mathrm { F C } _ { \mathrm { k } }$ for the fully connected layer mapping to $\mathcal { R } ^ { k }$ . All the convolutions in the encoder used vertical and horizontal strides 2 and SAME padding.
369
+
370
+ Finally, we used two heuristics. First, we always pretrained separately the encoder for several minibatch steps before the main training stage so that the sample mean and covariance of $Q _ { Z }$ would try to match those of $P _ { Z }$ . Second, while training we were adding a pixel-wise Gaussian noise truncated at 0.01 to all the images before feeding them to the encoder, which was meant to make the encoders random. We played with all possible ways of combining these two heuristics and noticed that together they result in slightly (almost negligibly) better results compared to using only one or none of them.
371
+
372
+ Our VAE model used cross-entropy loss (Bernoulli decoder) and otherwise same architectures and hyperparameters as listed above.
373
+
374
+ # C.2 CELEBA
375
+
376
+ We pre-processed CelebA images by first taking a $1 4 0 \mathrm { x } 1 4 0$ center crops and then resizing to the $6 4 \mathrm { x } 6 4$ resolution. We used mini-batches of size 100 and trained the models for various number of epochs (up to 250). All reported WAE models were trained for 55 epochs and VAE for 68 epochs. For WAE-MMD we used $\lambda = 1 0 0$ and for WAE-GAN $\lambda = 1$ . Both used $\sigma _ { z } ^ { 2 } = 2$ .
377
+
378
+ For WAE-MMD the learning rate of Adam was initially set to $\alpha = 1 0 ^ { - 3 }$ . For WAE-GAN the learning rate of Adam for the encoder-decoder pair was initially set to $\alpha = 3 \times 1 0 ^ { - 4 }$ and for the adversary to $1 0 ^ { - 3 }$ . All learning rates were decreased by factor of 2 after 30 epochs, further by factor of 5 after 50 first epochs, and finally additional factor of 10 after 100 first epochs.
379
+
380
+ Both encoder and decoder used fully convolutional architectures with $5 \mathrm { x } 5$ convolutional filters.
381
+
382
+ Encoder architecture:
383
+
384
+ $$
385
+ \begin{array} { r l } & { x \in \mathcal { R } ^ { 6 4 \times 6 4 \times 3 } \to \mathrm { C o n v _ { 1 2 8 } } \to \mathrm { B N } \to \mathrm { R e L U } } \\ & { \qquad \to \mathrm { C o n v _ { 2 5 6 } } \to \mathrm { B N } \to \mathrm { R e L U } } \\ & { \qquad \to \mathrm { C o n v _ { 5 1 2 } } \to \mathrm { B N } \to \mathrm { R e L U } } \\ & { \qquad \to \mathrm { C o n v _ { 1 0 2 4 } } \to \mathrm { B N } \to \mathrm { R e L U } \to \mathrm { F C } _ { 6 4 } } \end{array}
386
+ $$
387
+
388
+ Decoder architecture:
389
+
390
+ $$
391
+ \begin{array} { r l } { z \in \mathcal { R } ^ { 6 4 } \mathrm { F C } _ { 8 \times 8 \times 1 0 2 4 } } & { } \\ { \mathrm { F S C o n v } _ { 5 1 2 } \mathrm { B N } \mathrm { R e L U } } \\ { \mathrm { F S C o n v } _ { 2 5 6 } \mathrm { B N } \mathrm { R e L U } } & { } \\ { \mathrm { F S C o n v } _ { 1 2 8 } \mathrm { B N } \mathrm { R e L U } \mathrm { F S C o n v } _ { 1 } } \end{array}
392
+ $$
393
+
394
+ Adversary architecture for WAE-GAN:
395
+
396
+ $$
397
+ \begin{array} { r l } { z \in \mathcal { R } ^ { 6 4 } \to \mathrm { F C } _ { 5 1 2 } \to \mathrm { R e L U } } \\ { \to \mathrm { F C } _ { 5 1 2 } \to \mathrm { R e L U } } \\ { \to \mathrm { F C } _ { 5 1 2 } \to \mathrm { R e L U } } \\ { \to \mathrm { F C } _ { 5 1 2 } \to \mathrm { R e L U } \to \mathrm { F C } _ { 1 } } \end{array}
398
+ $$
399
+
400
+ For WAE-GAN we used a heuristic proposed in Supplementary $\mathrm { I V }$ of Mescheder et al. (2017). Notice that the theoretically optimal discriminator would result in $D ^ { * } ( z ) = \log p _ { Z } ( z ) - \log q _ { Z } ( z )$ , where $p _ { Z }$ and $q _ { Z }$ are densities of $P _ { Z }$ and $Q _ { Z }$ respectively. In our experiments we added the log prior $\log p _ { Z } ( z )$ explicitly to the adversary output as we know it analytically. This should hopefully make it easier for the adversary to learn the remaining $Q _ { Z }$ density term.
401
+
402
+ Our VAE model used a cross-entropy reconstruction loss (Bernoulli decoder) and $\alpha = 1 0 ^ { - 4 }$ as the initial Adam learning rate and the same decay schedule as explained above. Otherwise all the architectures and hyperparameters were as explained above.
md/train/JkfYjnOEo6M/JkfYjnOEo6M.md ADDED
The diff for this file is too large to render. See raw diff
 
md/train/Owggnutk6lE/Owggnutk6lE.md ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Alias-Free Generative Adversarial Networks
2
+
3
+ Tero Karras NVIDIA tkarras@nvidia.com
4
+
5
+ Miika Aittala NVIDIA maittala@nvidia.com
6
+
7
+ Samuli Laine NVIDIA slaine@nvidia.com
8
+
9
+ Erik Härkönen∗ Aalto University and NVIDIA erik.harkonen@aalto.fi
10
+
11
+ Janne Hellsten NVIDIA jhellsten@nvidia.com
12
+
13
+ Jaakko Lehtinen NVIDIA and Aalto University jlehtinen@nvidia.com
14
+
15
+ Timo Aila NVIDIA taila@nvidia.com
16
+
17
+ # Abstract
18
+
19
+ We observe that despite their hierarchical convolutional nature, the synthesis process of typical generative adversarial networks depends on absolute pixel coordinates in an unhealthy manner. This manifests itself as, e.g., detail appearing to be glued to image coordinates instead of the surfaces of depicted objects. We trace the root cause to careless signal processing that causes aliasing in the generator network. Interpreting all signals in the network as continuous, we derive generally applicable, small architectural changes that guarantee that unwanted information cannot leak into the hierarchical synthesis process. The resulting networks match the FID of StyleGAN2 but differ dramatically in their internal representations, and they are fully equivariant to translation and rotation even at subpixel scales. Our results pave the way for generative models better suited for video and animation.
20
+
21
+ # 1 Introduction
22
+
23
+ The resolution and quality of images produced by generative adversarial networks (GAN) [19] have seen rapid improvement recently [27, 11, 29, 30]. They have been used for a variety of applications, including image editing [42, 47, 37, 20, 34, 3], domain translation [62, 32, 53, 36], and video generation [49, 15, 21]. While several ways of controlling the generative process have been found [8, 26, 10, 36, 22, 2, 7, 41, 6], the foundations of the synthesis process remain only partially understood.
24
+
25
+ In the real world, details of different scale tend to transform hierarchically. For instance, moving a head causes the nose to move, which in turn moves the skin pores on it. The structure of a typical GAN generator is analogous: coarse, low-resolution features are hierarchically refined by upsampling layers, locally mixed by convolutions, and new detail is introduced through nonlinearities. We observe that despite this superficial similarity, current GAN architectures do not synthesize images in a natural hierarchical manner: the coarse features mainly control the presence of finer features, but not their precise positions. Instead, much of the fine detail appears to be fixed in pixel coordinates. This disturbing “texture sticking” is clearly visible in latent interpolations (see Figure 1 and our accompanying videos on the project page https://nvlabs.github.io/stylegan3), breaking the illusion of a solid and coherent object moving in space. Our goal is an architecture that exhibits a more natural transformation hierarchy, where the exact sub-pixel position of each feature is exclusively inherited from the underlying coarse features.
26
+
27
+ ![](images/fcc935c7c154ec662c31cc9f6bf386dee1e70d65e649b453116c3006c116b6ae.jpg)
28
+ Figure 1: Examples of “texture sticking”. Left: The average of images generated from a small neighborhood around a central latent (top row). The intended result is uniformly blurry because all details should move together. However, with StyleGAN2 many details (e.g., fur) stick to the same pixel coordinates, showing unwanted sharpness. Right: From a latent space interpolation (top row), we extract a short vertical segment of pixels from each generated image and stack them horizontally (bottom). The desired result is hairs moving in animation, creating a time-varying field. With StyleGAN2 the hairs mostly stick to the same coordinates, creating horizontal streaks instead.
29
+
30
+ It turns out that current networks can partially bypass the ideal hierarchical construction by drawing on unintentional positional references available to the intermediate layers through image borders [25, 31, 58], per-pixel noise inputs [29] and positional encodings, and aliasing [5, 61]. Aliasing, despite being a subtle and critical issue [38], has received little attention in the GAN literature. We identify two sources for it: 1) faint after-images of the pixel grid resulting from non-ideal upsampling filters2 such as nearest, bilinear, or strided convolutions, and 2) the pointwise application of nonlinearities such as ReLU [52] or swish [40]. We find that the network has the means and motivation to amplify even the slightest amount of aliasing and combining it over multiple scales allows it to build a basis for texture motifs that are fixed in screen coordinates. This holds for all filters commonly used in deep learning [61, 51], and even high-quality filters used in image processing.
31
+
32
+ How, then, do we eliminate the unwanted side information and thereby stop the network from using it? While borders can be solved by simply operating on slightly larger images, aliasing is much harder. We begin by noting that aliasing is most naturally treated in the classical Shannon-Nyquist signal processing framework, and switch focus to bandlimited functions on a continuous domain that are merely represented by discrete sample grids. Now, successful elimination of all sources of positional references means that details can be generated equally well regardless of pixel coordinates, which in turn is equivalent to enforcing continuous equivariance to sub-pixel translation (and optionally rotation) in all layers. To achieve this, we describe a comprehensive overhaul of all signal processing aspects of the StyleGAN2 generator [30]. Our contributions include the surprising finding that current upsampling filters are simply not aggressive enough in suppressing aliasing, and that extremely high-quality filters with over 100dB attenuation are required. Further, we present a principled solution to aliasing caused by pointwise nonlinearities [5] by considering their effect in the continuous domain and appropriately low-pass filtering the results. We also show that after the overhaul, a model based on $1 \times 1$ convolutions yields a strong, rotation equivariant generator.
33
+
34
+ Once aliasing is adequately suppressed to force the model to implement more natural hierarchical refinement, its mode of operation changes drastically: the emergent internal representations now include coordinate systems that allow details to be correctly attached to the underlying surfaces. This promises significant improvements to models that generate video and animation. The new StyleGAN3 generator matches StyleGAN2 in terms of FID [23], while being slightly heavier computationally. Our implementation and pre-trained models are available at https://github.com/NVlabs/stylegan3
35
+
36
+ Several recent works have studied the lack of translation equivariance in CNNs, mainly in the context of classification [25, 31, 58, 5, 33, 61, 12, 63, 51]. We significantly expand upon the antialiasing measures in this literature and show that doing so induces a fundamentally altered image generation behavior. Group-equivariant CNNs aim to generalize the efficiency benefits of translational weight sharing to, e.g., rotation [16, 57, 55, 54] and scale [56]. Our $1 \times 1$ convolutions can be seen an instance of a continuously E(2)-equivariant model [54] that remains compatible with, e.g., channel-wise ReLU nonlinearities and modulation. Dey et al. [17] apply $9 0 °$ rotation-and-flip equivariant CNNs [16] to GANs and show improved data efficiency. Our work is complementary, and not motivated by efficiency. Recent implicit network [45, 48, 13] based GANs [4, 46] generate each pixel independently via similar $1 \times 1$ convolutions. While equivariant, these models do not help with texture sticking, as they do not use an upsampling hierarchy or implement a shallow non-antialiased one.
37
+
38
+ ![](images/259d5689aa2cd9a26ad3654d37605318c1b158551e66cb76ae5d2f6f6b0e113e.jpg)
39
+ Figure 2: Left: Discrete representation $Z$ and continuous representation $z$ are related to each other via convolution with ideal interpolation filter $\phi _ { s }$ and pointwise multiplication with Dirac comb $\mathrm { I I I } _ { s }$ . Right: Nonlinearity $\sigma$ , ReLU in this example, may produce arbitrarily high frequencies in the continuous-domain $\sigma ( z )$ . Low-pass filtering via $\phi _ { s }$ is necessary to ensure that $Z ^ { \prime }$ captures the result.
40
+
41
+ # 2 Equivariance via continuous signal interpretation
42
+
43
+ To begin our analysis of equivariance in CNNs, we shall first rethink our view of what exactly is the signal that flows through a network. Even though data may be stored as values in a pixel grid, we cannot naïvely hold these values to directly represent the signal. Doing so would prevent us from considering operations as trivial as translating the contents of a feature map by half a pixel.
44
+
45
+ According to the Nyquist–Shannon sampling theorem [44], a regularly sampled signal can represent any continuous signal containing frequencies between zero and half of the sampling rate. Let us consider a two-dimensional, discretely sampled feature map $Z [ { \pmb x } ]$ that consists of a regular grid of Dirac impulses of varying magnitudes, spaced $1 / s$ units apart where $s$ is the sampling rate. This is analogous to an infinite two-dimensional grid of values.
46
+
47
+ Given $Z [ { \pmb x } ]$ and $s$ , the Whittaker–Shannon interpolation formula [44] states that the corresponding continuous representation $z ( \pmb { x } )$ is obtained by convolving the discretely sampled Dirac grid $Z [ { \pmb x } ]$ with an ideal interpolation filter $\phi _ { s }$ , i.e., $z ( \pmb { x } ) = \big ( \phi _ { s } * Z \big ) ( \pmb { x } )$ , where $^ *$ denotes continuous convolution and $\phi _ { s } ( \pmb { x } ) = \mathrm { s i n c } ( s x _ { 0 } ) \cdot \mathrm { s i n c } ( s x _ { 1 } )$ using the signal processing convention of defining $\operatorname { s i n c } ( x ) =$ $\sin ( \pi x ) / ( \pi x )$ . $\phi _ { s }$ has a bandlimit of $s / 2$ along the horizontal and vertical dimensions, ensuring that the resulting continuous signal captures all frequencies that can be represented with sampling rate $s$
48
+
49
+ Conversion from the continuous to the discrete domain corresponds to sampling the continuous signal $z ( \pmb { x } )$ at the sampling points of $Z [ { \pmb x } ]$ that we define to be offset by half the sample spacing to lie at the “pixel centers”, see Figure 2, left. This can be expressed as a pointwise multiplication with a two-dimensional Dirac comb $\begin{array} { r } { \operatorname { I I I } _ { s } ( \pmb { x } ) = \sum _ { X \in \mathbb { Z } ^ { 2 } } \delta \big ( \pmb { x } - ( X + \frac { 1 } { 2 } ) / s \big ) } \end{array}$ .
50
+
51
+ We earmark the unit square $\pmb { x } \in [ 0 , 1 ] ^ { 2 }$ in $z ( \pmb { x } )$ as our canvas for the signal of interest. In $Z [ { \pmb x } ]$ there are $s ^ { 2 }$ discrete samples in this region, but the above convolution with $\phi _ { s }$ means that values of $Z [ \pmb { x } ]$ outside the unit square also influence $z ( \pmb { x } )$ inside it. Thus storing an $s \times s$ -pixel feature map is not sufficient; in theory, we would need to store the entire infinite $Z [ { \pmb x } ]$ . As a practical solution, we store $Z [ { \pmb x } ]$ as a two-dimensional array that covers a region slightly larger than the unit square (Section 3.2).
52
+
53
+ Having established correspondence between bandlimited, continuous feature maps $z ( \pmb { x } )$ and discretely sampled feature maps $Z [ { \pmb x } ]$ , we can shift our focus away from the usual pixel-centric view of the signal. In the remainder of this paper, we shall interpret $z ( \pmb { x } )$ as being the actual signal being operated on, and the discretely sampled feature map $Z [ { \pmb x } ]$ as merely a convenient encoding for it.
54
+
55
+ Discrete and continuous representation of network layers Practical neural networks operate on the discretely sampled feature maps. Consider operation $\mathbf { F }$ (convolution, nonlinearity, etc.) operating on a discrete feature map: $Z ^ { \prime } = \mathbf { F } ( Z )$ . The feature map has a corresponding continuous counterpart, so we also have a corresponding mapping in the continuous domain: $z ^ { \prime } = \mathbf { f } ( z )$ . Now, an operation specified in one domain can be seen to perform a corresponding operation in the other domain:
56
+
57
+ $$
58
+ \mathbf { f } ( z ) = \phi _ { s ^ { \prime } } * \mathbf { F } ( \operatorname { I I I } _ { s } \odot z ) , \qquad \mathbf { F } ( Z ) = \operatorname { I I I } _ { s ^ { \prime } } \odot \mathbf { f } ( \phi _ { s } * Z ) ,
59
+ $$
60
+
61
+ where $\odot$ denotes pointwise multiplication and $s$ and $s ^ { \prime }$ are the input and output sampling rates. Note that in the latter case f must not introduce frequency content beyond the output bandlimit $s ^ { \prime } / 2$ .
62
+
63
+ # 2.1 Equivariant network layers
64
+
65
+ Operation f is equivariant with respect to a spatial transformation t of the 2D plane if it commutes with it in the continuous domain: $\mathbf { t } \circ \mathbf { f } = \mathbf { f } \circ \mathbf { t }$ . We note that when inputs are bandlimited to $s / 2$ , an equivariant operation must not generate frequency content above the output bandlimit of $s ^ { \prime } / 2$ , as otherwise no faithful discrete output representation exists.
66
+
67
+ We focus on two types of equivariance in this paper: translation and rotation. In the case of rotation the spectral constraint is somewhat stricter — rotating an image corresponds to rotating the spectrum, and in order to guarantee the bandlimit in both horizontal and vertical direction, the spectrum must be limited to a disc with radius $s / 2$ . This applies to both the initial network input as well as the bandlimiting filters used for downsampling, as will be described later.
68
+
69
+ We now consider the primitive operations in a typical generator network: convolution, upsampling, downsampling, and nonlinearity. Without loss of generality, we discuss the operations acting on a single feature map: pointwise linear combination of features has no effect on the analysis.
70
+
71
+ Convolution Consider a standard convolution with a discrete kernel $K$ . We can interpret $K$ as living in the same grid as the input feature map, with sampling rate $s$ . The discrete-domain operation is simply ${ \bf F } _ { \mathrm { c o n v } } ( Z ) = K * Z$ , and we obtain the corresponding continuous operation from Eq. 1:
72
+
73
+ $$
74
+ \mathbf { f } _ { \mathrm { c o n v } } ( z ) = \phi _ { s } * \bigl ( K * ( \operatorname { I I I } _ { s } \odot z ) \bigr ) = K * \bigl ( \phi _ { s } * ( \operatorname { I I I } _ { s } \odot z ) \bigr ) = K * z
75
+ $$
76
+
77
+ due to commutativity of convolution and the fact that discretization followed by convolution with ideal low-pass filter, both with same sampling rate $s$ , is an identity operation, i.e., $\phi _ { s } * ( \mathrm { I I I } _ { s } \odot z ) = z$ In other words, the convolution operates by continuously sliding the discretized kernel over the continuous representation of the feature map. This convolution introduces no new frequencies, so the bandlimit requirements for both translation and rotation equivariance are trivially fulfilled.
78
+
79
+ Convolution also commutes with translation in the continuous domain, and thus the operation is equivariant to translation. For rotation equivariance, the discrete kernel $K$ needs to be radially symmetric. We later show in Section 3.2 that trivially symmetric $1 \times 1$ convolution kernels are, despite their simplicity, a viable choice for rotation equivariant generative networks.
80
+
81
+ Upsampling and downsampling Ideal upsampling does not modify the continuous representation. Its only purpose is to increase the output sampling rate $( s ^ { \prime } > s )$ to add headroom in the spectrum where subsequent layers may introduce additional content. Translation and rotation equivariance follow directly from upsampling being an identity operation in the continuous domain. With $\mathbf { f } _ { \mathrm { u p } } ( z ) = z$ , the discrete operation according to Eq. 1 is $\mathbf { F } _ { \mathrm { u p } } ( \bar { Z } ) = \mathrm { I I I } _ { s ^ { \prime } } \odot ( \phi _ { s } * Z )$ . If we choose $s ^ { \prime } = n \dot { s }$ with integer $n$ , this operation can be implemented by first interleaving $Z$ with zeros to increase its sampling rate and then convolving it with a discretized filter $\coprod _ { s ^ { \prime } } \odot \phi _ { s }$ .
82
+
83
+ In downsampling, we must low-pass filter $z$ to remove frequencies above the output bandlimit, so that the signal can be represented faithfully in the coarser discretization. The operation in continuous domain is $\mathbf { f } _ { \mathrm { d o w n } } ( z ) = \psi _ { s ^ { \prime } } * z$ , where an ideal low-pass filter $\psi _ { s } : = s ^ { 2 } \cdot \phi _ { s }$ is simply the corresponding interpolation filter normalized to unit mass. The discrete counterpart is $\mathbf { F } _ { \mathrm { d o w n } } ( \bar { Z } ) =$ $\Pi \Pi _ { s ^ { \prime } } \odot \left( \psi _ { s ^ { \prime } } * \left( \phi _ { s } * Z \right) \right) = 1 / s ^ { 2 } \cdot \Pi \Pi _ { s ^ { \prime } } \odot \left( \psi _ { s ^ { \prime } } * \psi _ { s } * Z \right) = ( s ^ { \prime } / s ) ^ { 2 } \cdot \Pi \Pi _ { s ^ { \prime } } \odot \left( \phi _ { s ^ { \prime } } * Z \right)$ . The latter equality follows from $\psi _ { s } * \psi _ { s ^ { \prime } } = \psi _ { \mathrm { m i n } ( s , s ^ { \prime } ) }$ . Similar to upsampling, downsampling by an integer fraction can be implemented with a discrete convolution followed by dropping sample points. Translation equivariance follows automatically from the commutativity of $\mathbf { f } _ { \mathrm { d o w n } } ( z )$ with translation, but for rotation equivariance we must replace $\phi _ { s ^ { \prime } }$ with a radially symmetric filter with disc-shaped frequency response. The ideal such filter [9] is given by $\phi _ { s } ^ { \circ } ( \pmb { x } ) = \mathrm { j i n c } ( s \| \pmb { x } \| ) = 2 J _ { 1 } ( \pi s \| \pmb { x } \| ) / ( \pi s \| \pmb { x } \| )$ , where $J _ { 1 }$ is the first order Bessel function of the first kind.
84
+
85
+ Figure 3: Results for FFHQ-U (unaligned FFHQ) at $2 5 6 ^ { 2 }$ . Left: Training configurations. FID is computed between 50k generated images and all training images [23, 28]; lower is better. EQ-T and EQ-R are our equivariance metrics in decibels (dB); higher is better. Right: Parameter ablations using our final configuration (R) for the filter’s support, magnification around nonlinearities, and the minimum stopband frequency at the first layer. \* indicates our default choices.
86
+
87
+ <table><tr><td></td><td>Configuration</td><td>FID↓ EQ-T↑</td><td>EQ-R↑</td><td>Parameter</td><td>FID↓</td><td>EQ-T↑</td><td>EQ-R↑</td><td>Time</td><td>Mem.</td></tr><tr><td></td><td>AStyleGAN2</td><td>5.14 1</td><td>1</td><td>Filter size n = 4</td><td>4.72</td><td>57.49</td><td>39.70</td><td>0.84×</td><td>0.99×</td></tr><tr><td></td><td>B+Fourier features</td><td>4.79</td><td>16.23 10.81</td><td>* Filter size n = 6</td><td>4.50</td><td>66.65</td><td>40.48</td><td>1.00×</td><td>1.00×</td></tr><tr><td></td><td>C+No noise inputs</td><td>4.54</td><td>15.81 10.84</td><td>Filter size n =8</td><td>4.66</td><td>65.57</td><td>42.09</td><td>1.18×</td><td>1.01×</td></tr><tr><td></td><td>D + Simplified generator</td><td>5.21</td><td>19.47 10.41</td><td>Upsampling m=1</td><td>4.38</td><td>39.96</td><td>36.42</td><td>0.65×</td><td>0.87×</td></tr><tr><td></td><td>E+Boundaries &amp; upsampling</td><td>6.02</td><td>24.62 10.97</td><td>* Upsampling m = 2</td><td>4.50</td><td>66.65</td><td>40.48</td><td>1.00×</td><td>1.00×</td></tr><tr><td></td><td>F+ Filtered nonlinearities</td><td>6.35</td><td>30.60 10.81</td><td>Upsampling m = 4</td><td>4.57</td><td>74.21</td><td>40.97</td><td>2.31×</td><td>1.62×</td></tr><tr><td></td><td>G+ Non-critical sampling</td><td>4.78</td><td>43.90 10.84</td><td>Stopband ft,0 = 21.5</td><td></td><td>51.10</td><td>29.14</td><td>0.86×</td><td></td></tr><tr><td></td><td>H + Transformed Fourier features</td><td>4.64</td><td>45.20 10.61</td><td></td><td>4.62</td><td></td><td></td><td></td><td>0.90×</td></tr><tr><td></td><td>T+Flexible layers (StyleGAN3-T)</td><td>4.62</td><td>63.01 13.12</td><td>* Stopband ft,0 = 22.1</td><td>4.50</td><td>66.65</td><td>40.48</td><td>1.00×</td><td>1.00×</td></tr><tr><td></td><td>R + Rotation equiv. (StyleGAN3-R)</td><td>4.50</td><td>66.65 40.48</td><td>Stopband ft,0 = 23.1</td><td>4.68</td><td>73.13</td><td>41.63</td><td>1.36×</td><td>1.25×</td></tr></table>
88
+
89
+ Nonlinearity Applying a pointwise nonlinearity $\sigma$ in the discrete domain does not commute with fractional translation or rotation. However, in the continuous domain, any pointwise function commutes trivially with geometric transformations and is thus equivariant to translation and rotation. Fulfilling the bandlimit constraint is another question — applying, e.g., ReLU in the continuous domain may introduce arbitrarily high frequencies that cannot be represented in the output.
90
+
91
+ A natural solution is to eliminate the offending high-frequency content by convolving the continuous result with the ideal low-pass filter $\psi _ { s }$ . Then, the continuous representation of the nonlinearity becomes $\mathbf { f } _ { \sigma } ( z ) = \psi _ { s } * \sigma ( \bar { z } ) = s ^ { 2 } \cdot \phi _ { s } * \sigma ( z )$ and the discrete counterpart is $\mathbf { F } _ { \sigma } ( Z ) = s ^ { 2 } \cdot \operatorname { I I I } _ { s } \dot { \odot }$ $( \phi _ { s } * \sigma ( \phi _ { s } * Z ) )$ (see Figure 2, right). This discrete operation cannot be realized without temporarily entering the continuous representation. We approximate this by upsampling the signal, applying the nonlinearity in the higher resolution, and downsampling it afterwards. Even though the nonlinearity is still performed in the discrete domain, we have found that only a $2 \times$ temporary resolution increase is sufficient for high-quality equivariance. For rotation equivariance, we must use the radially symmetric interpolation filter $\phi _ { s } ^ { \circ }$ in the downsampling step, as discussed above.
92
+
93
+ Note that nonlinearity is the only operation capable of generating novel frequencies in our formulation, and that we can limit the range of these novel frequencies by applying a reconstruction filter with a lower cutoff than $s / 2$ before the final discretization operation. This gives us precise control over how much new information is introduced by each layer of a generator network (Section 3.2).
94
+
95
+ # 3 Practical application to generator network
96
+
97
+ We will now apply the theoretical ideas from the previous section in practice, by converting the well-established StyleGAN2 [30] generator to be fully equivariant to translation and rotation. We will introduce the necessary changes step-by-step, evaluating their impact in Figure 3. The discriminator remains unchanged in our experiments.
98
+
99
+ The StyleGAN2 generator consists of two parts. First, a mapping network transforms an initial, normally distributed latent to an intermediate latent code w $\sim \ w \ w \ w$ . Then, a synthesis network $\mathbf { G }$ starts from a learned $4 \times 4 \times 5 1 2$ constant $Z _ { 0 }$ and applies a sequence of $N$ layers — consisting of convolutions, nonlinearities, upsampling, and per-pixel noise — to produce an output image $Z _ { N } = \mathbf { G } ( Z _ { 0 } ; \mathbf { w } )$ . The intermediate latent code w controls the modulation of the convolution kernels in G. The layers follow a rigid $2 \times$ upsampling schedule, where two layers are executed at each resolution and the number of feature maps is halved after each upsampling. Additionally, StyleGAN2 employs skip connections, mixing regularization [29], and path length regularization.
100
+
101
+ Our goal is to make every layer of $\mathbf { G }$ equivariant w.r.t. the continuous signal, so that all finer details transform together with the coarser features of a local neighborhood. If this succeeds, the entire network becomes similarly equivariant. In other words, we aim to make the continuous operation g of the synthesis network equivariant w.r.t. transformations $\mathbf { t }$ (translations and rotations) applied on the continuous input $z _ { 0 }$ : $\mathbf { g } ( \mathbf { \bar { t } } [ z _ { 0 } ] ; \mathbf { w } ) = \mathbf { t } [ \mathbf { g } ( z _ { 0 } ; \mathbf { w } ) ]$ . To evaluate the impact of various architectural changes and practical approximations, we need a way to measure how well the network implements the equivariances. For translation equivariance, we report the peak signal-to-noise ratio (PSNR) in decibels (dB) between two sets of images, obtained by translating the input and output of the synthesis network by a random amount, resembling the definition by Zhang [61]:
102
+
103
+ $$
104
+ \begin{array} { r } { \mathrm { E Q - T } = 1 0 \cdot \log _ { 1 0 } \left( I _ { m a x } ^ { 2 } \big / \mathbb { E } _ { \mathbf { w } \sim \mathcal { W } , x \sim \mathcal { X } ^ { 2 } , p \sim \mathcal { V } , c \sim \mathcal { L } } \left[ \big ( \mathbf { g } ( \mathbf { t } _ { x } [ z _ { 0 } ] ; \mathbf { w } ) _ { c } ( p ) - \mathbf { t } _ { x } [ \mathbf { g } ( z _ { 0 } ; \mathbf { w } ) ] _ { c } ( p ) \big ) ^ { 2 } \right] \right) } \end{array}
105
+ $$
106
+
107
+ Each pair of images, corresponding to a different random choice of $\mathbf { w }$ , is sampled at integer pixel locations $p$ within their mutually valid region $\nu$ . Color channels $c$ are processed independently, and the intended dynamic range of generated images $- 1 \ldots + 1$ gives $I _ { m a x } = 2$ . Operator $\mathbf { t } _ { x }$ implements spatial translation with 2D offset $x$ , here drawn from distribution $\mathcal { X } ^ { 2 }$ of integer offsets. We define an analogous metric EQ-R for rotations, with the rotation angles drawn from $\mathcal { U } ( 0 ^ { \circ } , 3 6 0 ^ { \circ } )$ . Appendix E in the Supplement gives implementation details and our accompanying videos highlight the practical relevance of different dB values.
108
+
109
+ # 3.1 Fourier features and baseline simplifications (configs B–D)
110
+
111
+ To facilitate exact continuous translation and rotation of the input $z _ { \mathrm { 0 } }$ , we replace the learned input constant in StyleGAN2 with Fourier features [48, 58], which also has the advantage of naturally defining a spatially infinite map. We sample the frequencies uniformly within the circular frequency band $f _ { c } = 2$ , matching the original $4 \times 4$ input resolution, and keep them fixed over the course of training. This change (configs A and B in Figure 3, left) slightly improves FID and, crucially, allows us to compute the equivariance metrics without having to approximate the operator t. This baseline architecture is far from being equivariant; our accompanying videos show that the output images deteriorate drastically when the input features are translated or rotated from their original position.
112
+
113
+ Next, we remove the per-pixel noise inputs because they are strongly at odds with our goal of a natural transformation hierarchy, i.e., that the exact sub-pixel position of each feature is exclusively inherited from the underlying coarse features. While this change (config C) is approximately FID-neutral, it fails to improve the equivariance metrics when considered in isolation.
114
+
115
+ To further simplify the setup, we decrease the mapping network depth as recommended by Karras et al. [28] and disable mixing regularization and path length regularization [30]. Finally, we also eliminate the output skip connections. We hypothesize that their benefit is mostly related to gradient magnitude dynamics during training and address the underlying issue more directly using a simple normalization before each convolution. We track the exponential moving average √ $\sigma ^ { 2 } = \mathbb { E } [ x ^ { 2 } ]$ over all pixels and feature maps during training, and divide the feature maps by $\scriptstyle { \sqrt { \sigma ^ { 2 } } }$ . In practice, we bake the division into the convolution weights to improve efficiency. These changes (config D) bring FID back to the level of original StyleGAN2, while leading to a slight improvement in translation equivariance.
116
+
117
+ # 3.2 Step-by-step redesign motivated by continuous interpretation
118
+
119
+ Boundaries and upsampling (config E) Our theory assumes an infinite spatial extent for the feature maps, which we approximate by maintaining a fixed-size margin around the target canvas, cropping to this extended canvas after each layer. This explicit extension is necessary as border padding is known to leak absolute image coordinates into the internal representations [25, 31, 58]. In practice, we have found a 10-pixel margin to be enough; further increase has no noticeable effect on the results.
120
+
121
+ Motivated by our theoretical model, we replace the bilinear $2 \times$ upsampling filter with a better approximation of the ideal low-pass filter. We use a windowed sinc filter with a relatively large Kaiser window [35] of size $n = 6$ , meaning that each output pixel is affected by 6 input pixels in upsampling and each input pixel affects 6 output pixels in downsampling. Kaiser window is a particularly good choice for our purposes, because it offers explicit control over the transition band and attenuation (Figure 4a). In the remainder of this section, we specify the transition band explicitly and compute the remaining parameters using Kaiser’s original formulas (Appendix C). For now, we choose to employ critical sampling and set the filter cutoff √ $f _ { c } = s / 2$ , i.e., exactly at the bandlimit, and transition band half-width $\dot { f } _ { h } = ( \sqrt { 2 } - 1 ) ( s / 2 )$ . Recall that sampling rate $s$ equals the width of the canvas in pixels, given our definitions in Section 2.
122
+
123
+ The improved handling of boundaries and upsampling (config E) leads to better translation equivariance. However, FID is compromised by $16 \%$ , probably because we started to constrain what the feature maps can contain. In a further ablation (Figure 3, right), smaller resampling filters ${ ( n = 4 ) }$ ) hurt translation equivariance, while larger filters $( n = 8$ ) mainly increase training time.
124
+
125
+ Filtered nonlinearities (config F) Our theoretical treatment of nonlinearities calls for wrapping each leaky ReLU (or any other commonly used non-linearity) between $m \times$ upsampling and $m \times$ downsampling, for some magnification factor $m$ . We further note that the order of upsampling and convolution can be switched by virtue of the signal being bandlimited, allowing us to fuse the regular $2 \times$ upsampling and a subsequent $m \times$ upsampling related to the nonlinearity into a single $2 m \times$ upsampling. In practice, we find $m = 2$ to be sufficient (Figure 3, right), again improving EQ-T (config F). Implementing the upsample-LReLU-downsample sequence is not efficient using the primitives available in current deep learning frameworks [1, 39], and thus we implement a custom CUDA kernel (Appendix D) that combines these operations (Figure 4b), leading to $1 0 \times$ faster training and considerable memory savings.
126
+
127
+ ![](images/f46886d986017e336472da1f6aa3acce828eb836308c48f939f2f895b31041eb.jpg)
128
+ Figure 4: (a) 1D example of a $2 \times$ upsampling filter with $n = 6$ , $s = 2$ , $f _ { c } = 1$ , and $f _ { h } = 0 . 4$ (blue). Setting $f _ { h } = 0 . 6$ makes the transition band wider (green), which reduces the unwanted stopband ripple and thus leads to stronger attenuation. (b) Our alias-free generator, corresponding to configs T and R in Figure 3. The main datapath consists of Fourier features and normalization (Section 3.1), modulated convolutions [30], and filtered nonlinearities (Section 3.2). (c) Flexible layer specifications (config T) with $N = 1 4$ and $s _ { N } = 1 0 2 4$ . Cutoff $f _ { c }$ (blue) and minimum acceptable stopband frequency $f _ { t }$ (orange) obey geometric progression over the layers; sampling rate $s$ (red) and actual stopband $f _ { c } + f _ { h }$ (green) are computed according to our design constraints.
129
+
130
+ Non-critical sampling (config G) The critical sampling scheme — where filter cutoff is set exactly at the bandlimit — is ideal for many image processing applications as it strikes a good balance between antialiasing and the retention of high-frequency detail [50]. However, our goals are markedly different because aliasing is highly detrimental for the equivariance of the generator. While highfrequency detail is important in the output image and thus in the highest-resolution layers, it is less important in the earlier ones given that their exact resolutions are somewhat arbitrary to begin with.
131
+
132
+ To suppress aliasing, we can simply lower the cutoff frequency to $f _ { c } = s / 2 - f _ { h }$ , which ensures that all alias frequencies (above $s / 2$ ) are in the stopband.3 For example, lowering the cutoff of the blue filter in Figure 4a would move its frequency response left so that the the worst-case attenuation of alias frequencies improves from $6 \mathrm { d B }$ to $4 0 \mathrm { d B }$ . This oversampling can be seen as a computational cost of better antialiasing, as we now use the same number of samples to express a slower-varying signal than before. In practice, we choose to lower $f _ { c }$ on all layers except the highest-resolution ones, because in the end the generator must be able to produce crisp images to match the training data. As the signals now contain less spatial information, we modify the heuristic used for determining the number of feature maps to be inversely proportional to $f _ { c }$ instead of the sampling rate $s$ . These changes (config G) further improve translation equivariance and push FID below the original StyleGAN2.
133
+
134
+ Transformed Fourier features (config H) Equivariant generator layers are well suited for modeling unaligned and arbitrarily oriented datasets, because any geometric transformation introduced to the intermediate features $z _ { i }$ will directly carry over to the final image $z _ { N }$ . Due to the limited capability of the layers themselves to introduce global transformations, however, the input features $z _ { \mathrm { 0 } }$ play a crucial role in defining the global orientation of $z _ { N }$ . To let the orientation vary on a per-image basis, the generator should have the ability to transform $z _ { 0 }$ based on w. This motivates us to introduce a learned affine layer that outputs global translation and rotation parameters for the input Fourier features (Figure 4b and Appendix F). The layer is initialized to perform an identity transformation, but learns to use the mechanism over time when beneficial; in config H this improves the FID slightly.
135
+
136
+ Flexible layer specifications (config T) Our changes have improved the equivariance quality considerably, but some visible artifacts still remain as our accompanying videos demonstrate. On closer inspection, it turns out that the attenuation of our filters (as defined for config G) is still insufficient for the lowest-resolution layers. These layers tend to have rich frequency content near their bandlimit, which calls for extremely strong attenuation to completely eliminate aliasing.
137
+
138
+ So far, we have used the rigid sampling rate progression from StyleGAN2, coupled with simplistic choices for filter cutoff $f _ { c }$ and half-width $f _ { h }$ , but this need not be the case; we are free to specialize these parameters on a per-layer basis. In particular, we would like $f _ { h }$ to be high in the lowestresolution layers to maximize attenuation in the stopband, but low in the highest-resolution layers to allow matching high-frequency details of the training data.
139
+
140
+ Figure 4c illustrates an example progression of filter parameters in a 14-layer generator with two critically sampled full-resolution layers at the end. The cutoff frequency grows geometrically from $f _ { c } = 2$ in the first layer to $f _ { c } = s _ { N } / 2$ in the first critically sampled layer. We choose the minimum acceptable stopband frequency to start at $f _ { t , 0 } = 2 ^ { 2 . 1 }$ , and it grows geometrically but slower than the cutoff frequency. In our tests, the stopband target at the last layer is $\overline { { f } } _ { t } = f _ { c } \cdot 2 ^ { 0 . 3 }$ , but the progression is halted at the first critically sampled layer. Next, we set the sampling rate $s$ for each layer so that it accommodates frequencies up to $f _ { t }$ , rounding up to the next power of two without exceeding the output resolution. Finally, to maximize the attenuation of aliasing frequencies, we set the transition band half-width to $f _ { h } = \operatorname* { m a x } ( s / 2 , f _ { t } ) - f _ { c }$ , i.e., making it as wide as possible within the limits of the sampling rate, but at least wide enough to reach $f _ { t }$ . The resulting improvement depends on how much slack is left between $f _ { t }$ and $s / 2$ ; as an extreme example, the first layer stopband attenuation improves from $4 2 \mathrm { d B }$ to $4 8 0 \mathrm { d B }$ using this scheme.
141
+
142
+ The new layer specifications again improve translation equivariance (config T), eliminating the remaining artifacts. A further ablation (Figure 3, right) shows that $f _ { t , 0 }$ provides an effective way to trade training speed for equivariance quality. Note that the number of layers is now a free parameter that does not directly depend on the output resolution. In fact, we have found that a fixed choice of $N$ works consistently across multiple output resolutions and makes other hyperparameters such as learning rate behave more predictably. We use $N = 1 4$ in the remainder of this paper.
143
+
144
+ Rotation equivariance (config R) We obtain a rotation equivariant version of the network with two changes. First, we replace the $3 \times 3$ convolutions with $1 \times 1$ on all layers and compensate for the reduced capacity by doubling the number of feature maps. Only the upsampling and downsampling operations spread information between pixels in this config. Second, we replace the sinc-based downsampling filter with a radially symmetric jinc-based one that we construct using the same Kaiser scheme (Appendix C). We do this for all layers except the two critically sampled ones, where it is important to match the potentially non-radial spectrum of the training data. These changes (config R) improve EQ-R without harming FID, even though each layer has $56 \%$ fewer trainable parameters.
145
+
146
+ We also employ an additional stabilization trick in this configuration. Early on in the training, we blur all images the discriminator sees using a Gaussian filter. We start with $\sigma = 1 0$ pixels, which we ramp to zero over the first $2 0 0 \mathrm { k }$ images. This prevents the discriminator from focusing too heavily on high frequencies early on. Without this trick, config R is prone to early collapses because the generator sometimes learns to produce high frequencies with a small delay, trivializing the discriminator’s task.
147
+
148
+ # 4 Results
149
+
150
+ Figure 5 gives results for six datasets using StyleGAN2 [30] as well as our alias-free StyleGAN3-T and StyleGAN3-R generators. In addition to the standard FFHQ [29] and METFACES [28], we created unaligned versions of them. We also created a properly resampled version of AFHQ [14] and collected a new BEACHES dataset. Appendix B describes the datasets in detail. The results show that our FID remains competitive with StyleGAN2. StyleGAN3-T and StyleGAN3-R perform equally well in terms of FID, and both show a very high level of translation equivariance. As expected, only the latter provides rotation equivariance. In FFHQ $( 1 0 2 4 \times 1 0 2 4 )$ the three generators had 30.0M, 22.3M and $1 5 . 8 \mathbf { M }$ parameters, while the training times were 1106, 1576 $( + 4 2 \% )$ and 2248 $( + 1 0 3 \% )$ GPU hours. Our accompanying videos show side-by-side comparisons with StyleGAN2, demonstrating visually that the texture sticking problem has been solved. The resulting motion is much more natural, better sustaining an illusion that there is a coherent 3D scene being imaged.
151
+
152
+ Figure 5: Left: Results for six datasets. We use adaptive discriminator augmentation (ADA) [28] for the smaller datasets. “StyleGAN2” corresponds to our baseline config B with Fourier features. Right: Ablations and comparisons for FFHQ-U (unaligned FFHQ) at $2 5 6 ^ { 2 }$ . \* indicates our default choices.
153
+
154
+ <table><tr><td>Dataset</td><td>Config</td><td>FID↓</td><td>EQ-T↑ EQ-R↑</td><td>Ablation</td><td colspan="2">Translation eq.</td><td colspan="3">+ Rotation eq.</td></tr><tr><td>FFHQ-U</td><td>StyleGAN2</td><td>3.79</td><td>15.89 10.79</td><td></td><td>FID↓</td><td>EQ-T↑</td><td>FID↓</td><td>EQ-T↑</td><td>EQ-R↑</td></tr><tr><td>70000img,10242</td><td>StyleGAN3-T(ours)</td><td>3.67</td><td>61.69 13.95</td><td>*Main configuration</td><td>4.62</td><td>63.01</td><td>4.50</td><td>66.65</td><td>40.48</td></tr><tr><td>Train from scratch</td><td>StyleGAN3-R (ours)</td><td>3.66</td><td>64.78 47.64</td><td>With mixing reg.</td><td>4.60</td><td>63.48</td><td>4.67</td><td>63.59</td><td>40.90</td></tr><tr><td>FFHQ</td><td>StyleGAN2</td><td>2.70</td><td>13.58 10.22</td><td>With noise inputs</td><td>4.96</td><td>24.46</td><td>5.79</td><td>26.71</td><td>26.80</td></tr><tr><td>70000 img,10242</td><td>StyleGAN3-T (ours)</td><td>2.79</td><td>61.21 13.82</td><td>Without flexible layers</td><td>4.64</td><td>45.20</td><td>4.65</td><td>44.74</td><td>22.52</td></tr><tr><td>Train from scratch</td><td>StyleGAN3-R (ours)</td><td>3.07</td><td>64.76 46.62</td><td>Fixed Fourier features</td><td>5.93</td><td>64.57</td><td>6.48</td><td>66.20</td><td>41.77</td></tr><tr><td>METFACES-U</td><td>StyleGAN2</td><td>18.98</td><td>18.77 13.19</td><td>With path length reg.</td><td>5.00</td><td>68.36</td><td>5.98</td><td>71.64</td><td>42.18</td></tr><tr><td>1336 img,10242</td><td>StyleGAN3-T (ours)</td><td>18.75</td><td>64.11 16.63</td><td>0.5×capacity</td><td>7.43</td><td>63.14</td><td>6.52</td><td>63.08</td><td>39.89</td></tr><tr><td>ADA, from FFHQ-U</td><td>StyleGAN3-R (ours)</td><td>18.75</td><td>66.34 48.57</td><td>* 1.0× capacity</td><td>4.62</td><td>63.01</td><td>4.50</td><td>66.65</td><td>40.48</td></tr><tr><td>METFACES</td><td>StyleGAN2</td><td>15.22</td><td>16.39 12.89</td><td>2.0× capacity</td><td>3.80</td><td>66.61</td><td>4.18</td><td>70.06</td><td>42.51</td></tr><tr><td>1336 img,10242</td><td>StyleGAN3-T(ours)</td><td>15.11</td><td>65.23 16.82</td><td>*Kaiser filter,n =6</td><td>4.62</td><td>63.01</td><td>4.50</td><td>66.65</td><td>40.48</td></tr><tr><td>ADA, from FFHQ</td><td>StyleGAN3-R (ours)</td><td>15.33</td><td>64.86 46.81</td><td>Lanczos filter, α = 2</td><td>4.69</td><td>51.93</td><td>4.44</td><td>57.70</td><td>25.25</td></tr><tr><td>AFHQv2</td><td>StyleGAN2</td><td>4.62</td><td>13.83 11.50</td><td>Gaussian filter,σ = 0.4</td><td>5.91</td><td>56.89</td><td>5.73</td><td>59.53</td><td>39.43</td></tr><tr><td>15803 img,5122</td><td>StyleGAN3-T(ours)</td><td>4.04</td><td>60.15 13.51</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ADA, from scratch</td><td>StyleGAN3-R (ours)</td><td>4.40</td><td>64.89 40.34</td><td>G-CNN comparison</td><td>FID↓</td><td>EQ-T个</td><td>EQ-R↑</td><td>Params</td><td>Time</td></tr><tr><td>BEACHES</td><td>StyleGAN2</td><td>5.03</td><td>15.73 12.69</td><td>* StyleGAN3-T(ours)</td><td>4.62</td><td>63.01</td><td>13.12</td><td>23.3M</td><td>1.00×</td></tr><tr><td>20155img,5122</td><td>StyleGAN3-T (ours)</td><td>4.32</td><td>59.33 15.88</td><td>+ p4 symmetry [16]</td><td>4.69</td><td>61.90</td><td>17.07</td><td>21.8M</td><td>2.48×</td></tr><tr><td>ADA, from scratch</td><td>StyleGAN3-R (ours)</td><td>4.57</td><td>63.66 37.42</td><td>* StyleGAN3-R (ours)</td><td>4.50</td><td>66.65</td><td>40.48</td><td>15.8M</td><td>1.37×</td></tr></table>
155
+
156
+ Ablations and comparisons In Section 3.1 we disabled a number of StyleGAN2 features. We can now turn them on one by one to gauge their effect on our generators (Figure 5, right). While mixing regularization can be re-enabled without any ill effects, we also find that styles can be mixed quite reliably even without this explicit regularization (Appendix A). Re-enabling noise inputs or relying on StyleGAN2’s original layer specifications compromises equivariances significantly, and using fixed Fourier features or re-enabling path length regularization harms FID. Path length regularization is in principle at odds with translation equivariance, as it penalizes image changes upon latent space walk and thus encourages texture sticking. We suspect that the counterintuitive improvement in equivariance may come from slightly blurrier generated images, at a cost of poor FID.
157
+
158
+ In a scaling test we tried changing the number of feature maps, observing that equivariances remain at a high level, but FID suffers considerably when the capacity is halved. Doubling the capacity improves result quality in terms of FID, at the cost of almost $4 \times$ training time. Finally, we consider alternatives for our windowed Kaiser filter. Lanczos is competitive in terms of FID, but as a separable filter it compromises rotation equivariance in particular. Gaussian leads to clearly worse FIDs.
159
+
160
+ We compare StyleGAN3-R to an alternative where the rotation part is implemented using $p 4$ symmetric G-CNN [16, 17] on top of our StyleGAN3-T. This approach provides only modest rotation equivariance while being slower to train. Steerable filters [55] could theoretically provide competitive EQ-R, but the memory and training time requirements proved infeasible with generator networks of this size.
161
+
162
+ Appendix A demonstrates that the spectral properties of generated images closely match training data, comparing favorably to several earlier architectures.
163
+
164
+ Internal representations Figure 6 visualizes typical internal representations from the networks. While in StyleGAN2 all feature maps seem to encode signal magnitudes, in our networks some of the maps take a different role and encode phase information instead. Clearly this is something that is needed when the network synthesizes detail on the surfaces; it needs to invent a coordinate system. In StyleGAN3-R, the emergent positional encoding patterns appear to be somewhat more well-defined. We believe that the existence of a coordinate system that allows precise localization on the surfaces of objects will prove useful in various applications, including advanced image and video editing.
165
+
166
+ # 5 Limitations, discussion, and future work
167
+
168
+ In this work we modified only the generator, but it seems likely that further benefits would be available by making the discriminator equivariant as well. For example, in our FFHQ results the teeth do not move correctly when the head turns, and we suspect that this is caused by the discriminator accidentally preferring to see the front teeth at certain pixel locations. Concurrent work has identified that aliasing is detrimental for such generalization [51].
169
+
170
+ ![](images/b617e9fc75233f4ba35ddc487bcc878ceb52d54ee9e105bdd5d8128e41219bc4.jpg)
171
+ Figure 6: Example internal representations (3 feature maps as RGB) in StyleGAN2 and our generators.
172
+
173
+ Our alias-free generator architecture contains implicit assumptions about the nature of the training data, and violating these may cause training difficulties. Let us consider an example. Suppose we have black-and-white cartoons as training data that we (incorrectly) pre-process using point sampling [38], leading to training images where almost all pixels are either black or white and the edges are jagged. This kind of badly aliased training data is difficult for GANs in general, but it is especially at odds with equivariance: on the one hand, we are asking the generator to be able to translate the output smoothly by subpixel amounts, but on the other hand, edges must still remain jagged and pixels only black/white, to remain faithful to the training data. The same issue can also arise with letterboxing of training images, low-quality JPEGs, or retro pixel graphics, where the jagged stair-step edges are a defining feature of the aesthetic. In such cases it may be beneficial for the generator to be aware of the pixel grid.
174
+
175
+ In future, it might be interesting to re-introduce noise inputs (stochastic variation) in a way that is consistent with hierarchical synthesis. A better path length regularization would encourage neighboring features to move together, not discourage them from moving at all. It might be beneficial to try to extend our approach to equivariance w.r.t. scaling, anisotropic scaling, or even arbitrary homeomorphisms. Finally, it is well known that antialiasing should be done before tone mapping. So far, all GANs — including ours — have operated in the sRGB color space (after tone mapping).
176
+
177
+ Attention layers in the middle of a generator [60] could likely be dealt with similarly to non-linearities by temporarily switching to higher resolution – although the time complexity of attention layers may make this somewhat challenging in practice. Recent attention-based GANs that start with a tokenizing transformer (e.g., VQGAN [18]) may be at odds with equivariance. Whether it is possible to make them equivariant is an important open question.
178
+
179
+ Potential negative societal impacts of (image-producing) GANs include many forms of disinformation, from fake portraits in social media [24] to propaganda videos of world leaders [43]. Our contribution eliminates certain characteristic artifacts from videos, potentially making them more convincing or deceiving, depending on the application. Viable solutions include model watermarking [59] along with large-scale authenticity assessment in major social media sites. This entire project consumed 92 GPU years and 225 MWh of electricity on an in-house cluster of NVIDIA V100s. The new StyleGAN3 generator is only marginally costlier to train or use than that of StyleGAN2.
180
+
181
+ # 6 Acknowledgments
182
+
183
+ We thank David Luebke, Ming-Yu Liu, Koki Nagano, Tuomas Kynkäänniemi, and Timo Viitanen for reviewing early drafts and helpful suggestions. Frédo Durand for early discussions. Tero Kuosmanen for maintaining our compute infrastructure. AFHQ authors for an updated version of their dataset. Getty Images for the training images in the BEACHES dataset. We did not receive external funding or additional revenues for this project.
184
+
185
+ # References
186
+
187
+ [1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and X. Zheng. TensorFlow: A system for large-scale machine learning. In Proc. 12th USENIX Conference on Operating Systems Design and Implementation, OSDI’16, pages 265–283, 2016. [2] R. Abdal, P. Zhu, N. J. Mitra, and P. Wonka. StyleFlow: Attribute-conditioned exploration of StyleGANgenerated images using conditional continuous normalizing flows. ACM Trans. Graph., 40(3), 2021. [3] Y. Alaluf, O. Patashnik, and D. Cohen-Or. Only a matter of style: Age transformation using a style-based regression model. CoRR, abs/2102.02754, 2021.
188
+ [4] I. Anokhin, K. Demochkin, T. Khakhulin, G. Sterkin, V. Lempitsky, and D. Korzhenkov. Image generators with conditionally-independent pixel synthesis. In Proc. CVPR, 2021.
189
+ [5] A. Azulay and Y. Weiss. Why do deep convolutional networks generalize so poorly to small image transformations? Journal of Machine Learning Research, 20(184):1–25, 2019. [6] D. Bau, A. Andonian, A. Cui, Y. Park, A. Jahanian, A. Oliva, and A. Torralba. Paint by word. CoRR, abs/2103.10951, 2021.
190
+ [7] D. Bau, S. Liu, T. Wang, J.-Y. Zhu, and A. Torralba. Rewriting a deep generative model. In Proc. ECCV, 2020.
191
+ [8] D. Bau, J. Zhu, H. Strobelt, B. Zhou, J. B. Tenenbaum, W. T. Freeman, and A. Torralba. GAN dissection: Visualizing and understanding generative adversarial networks. In Proc. ICLR, 2019.
192
+ [9] R. E. Blahut. Theory of remote image formation. Cambridge University Press, 2004.
193
+ [10] T. Broad, F. F. Leymarie, and M. Grierson. Network bending: Expressive manipulation of deep generative models. In Proc. EvoMUSART, pages 20–36, 2021.
194
+ [11] A. Brock, J. Donahue, and K. Simonyan. Large scale GAN training for high fidelity natural image synthesis. In Proc. ICLR, 2019.
195
+ [12] A. Chaman and I. Dokmanic. Truly shift-invariant convolutional neural networks. In ´ Proc. CVPR, 2021.
196
+ [13] Y. Chen, S. Liu, and X. Wang. Learning continuous image representation with local implicit image function. In Proc. CVPR, 2021.
197
+ [14] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha. StarGAN v2: Diverse image synthesis for multiple domains. In Proc. CVPR, 2020.
198
+ [15] M. Chu, Y. Xie, J. Mayer, L. Leal-Taixé, and N. Thuerey. Learning temporal coherence via self-supervision for GAN-based video generation. ACM Trans. Graph., 39(4), 2020.
199
+ [16] T. S. Cohen and M. Welling. Group equivariant convolutional networks. In Proc. ICML, 2016.
200
+ [17] N. Dey, A. Chen, and S. Ghafurian. Group equivariant generative adversarial networks. In Proc. ICLR, 2021.
201
+ [18] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. In Proc. CVPR, 2021.
202
+ [19] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. In Proc. NIPS, 2014.
203
+ [20] J. Gu, Y. Shen, and B. Zhou. Image processing using multi-code GAN prior. In Proc. CVPR, 2020.
204
+ [21] Z. Hao, A. Mallya, S. J. Belongie, and M. Liu. GANcraft: Unsupervised 3D neural rendering of minecraft worlds. CoRR, abs/2104.07659, 2021.
205
+ [22] E. Härkönen, A. Hertzmann, J. Lehtinen, and S. Paris. GANSpace: Discovering interpretable GAN controls. In Proc. NeurIPS, 2020.
206
+ [23] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Proc. NIPS, 2017.
207
+ [24] K. Hill and J. White. Designed to deceive: Do these people look real to you? The New York Times, 11 2020.
208
+ [25] M. A. Islam, S. Jia, and N. D. B. Bruce. How much position information do convolutional neural networks encode? In Proc. ICLR, 2020.
209
+ [26] A. Jahanian, L. Chai, and P. Isola. On the "steerability" of generative adversarial networks. In Proc. ICLR, 2020.
210
+ [27] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. In Proc. ICLR, 2018.
211
+ [28] T. Karras, M. Aittala, J. Hellsten, S. Laine, J. Lehtinen, and T. Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020.
212
+ [29] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In Proc. CVPR, 2018.
213
+ [30] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila. Analyzing and improving the image quality of StyleGAN. In Proc. CVPR, 2020.
214
+ [31] O. S. Kayhan and J. C. van Gemert. On translation invariance in CNNs: Convolutional layers can exploit absolute spatial location. In Proc. CVPR, 2020.
215
+ [33] M. Manfredi and Y. Wang. Shift equivariance in object detection. In Proc. ECCV 2020 Workshops, 2020.
216
+ [34] S. Menon, A. Damian, S. Hu, N. Ravi, and C. Rudin. PULSE: Self-supervised photo upsampling via latent space exploration of generative models. In Proc. CVPR, 2020.
217
+ [35] A. V. Oppenheim and R. W. Schafer. Discrete-Time Signal Processing. Prentice Hall Press, USA, 3rd edition, 2009.
218
+ [36] T. Park, M. Liu, T. Wang, and J. Zhu. Semantic image synthesis with spatially-adaptive normalization. In Proc. CVPR, 2019.
219
+ [37] T. Park, J.-Y. Zhu, O. Wang, J. Lu, E. Shechtman, A. A. Efros, and R. Zhang. Swapping autoencoder for deep image manipulation. In Proc. NeurIPS, 2020.
220
+ [38] G. Parmar, R. Zhang, and J. Zhu. On buggy resizing libraries and surprising subtleties in FID calculation. CoRR, abs/2104.11222, 2021.
221
+ [39] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. PyTorch: An imperative style, high-performance deep learning library. In Proc. NeurIPS, 2019.
222
+ [40] P. Ramachandran, B. Zoph, and Q. V. Le. Swish: a self-gated activation function. CoRR, abs/1710.05941, 2017.
223
+ [41] A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever. Zero-shot text-to-image generation. CoRR, abs/2102.12092, 2021.
224
+ [42] E. Richardson, Y. Alaluf, O. Patashnik, Y. Nitzan, Y. Azar, S. Shapiro, and D. Cohen-Or. Encoding in style: A StyleGAN encoder for image-to-image translation. In Proc. CVPR, 2021.
225
+ [43] M. Seymour. Canny AI: Imagine world leaders singing. fxguide, 4 2019.
226
+ [44] C. E. Shannon. Communication in the presence of noise. Proc. Institute of Radio Engineers, 37(1):10–21, 1949.
227
+ [45] V. Sitzmann, J. N. Martel, A. W. Bergman, D. B. Lindell, and G. Wetzstein. Implicit neural representations with periodic activation functions. In Proc. NeurIPS, 2020.
228
+ [46] I. Skorokhodov, S. Ignatyev, and M. Elhoseiny. Adversarial generation of continuous images. In Proc. CVPR, 2021.
229
+ [47] R. Suzuki, M. Koyama, T. Miyato, T. Yonetsuji, and H. Zhu. Spatially controllable image synthesis with internal representation collaging. CoRR, abs/1811.10153, 2019.
230
+ [48] M. Tancik, P. P. Srinivasan, B. Mildenhall, S. Fridovich-Keil, N. Raghavan, U. Singhal, R. Ramamoorthi, J. T. Barron, and R. Ng. Fourier features let networks learn high frequency functions in low dimensional domains. In Proc. NeurIPS, 2020.
231
+ [49] S. Tulyakov, M. Liu, X. Yang, and J. Kautz. MoCoGAN: Decomposing motion and content for video generation. In Proc. CVPR, 2018.
232
+ [50] K. Turkowski. Filters for Common Resampling Tasks, pages 147–165. Academic Press Professional, Inc., USA, 1990.
233
+ [51] C. Vasconcelos, H. Larochelle, V. Dumoulin, R. Romijnders, N. L. Roux, and R. Goroshin. Impact of aliasing on generalization in deep convolutional networks. In ICCV, 2021.
234
+ [52] C. von der Malsburg. Self-organization of orientation sensitive cells in striate cortex. Biological Cybernetics, 14(2):85–100, 1973.
235
+ [53] T. Wang, M. Liu, J. Zhu, A. Tao, J. Kautz, and B. Catanzaro. High-resolution image synthesis and semantic manipulation with conditional GANs. In Proc. CVPR, 2018.
236
+ [54] M. Weiler and G. Cesa. General E(2)-equivariant steerable CNNs. In Proc. NeurIPS, 2019.
237
+ [55] M. Weiler, F. A. Hamprecht, and M. Storath. Learning steerable filters for rotation equivariant CNNs. In Proc. CVPR, 2018.
238
+ [56] D. Worrall and M. Welling. Deep scale-spaces: Equivariance over scale. In Proc. NeurIPS, 2019.
239
+ [57] D. E. Worrall, S. J. Garbin, D. Turmukhambetov, and G. J. Brostow. Harmonic networks: Deep translation and rotation equivariance. In Proc. CVPR, 2017.
240
+ [58] R. Xu, X. Wang, K. Chen, B. Zhou, and C. C. Loy. Positional encoding as spatial inductive bias in GANs. In Proc. CVPR, 2021.
241
+ [59] N. Yu, V. Skripniuk, S. Abdelnabi, and M. Fritz. Artificial fingerprinting for generative models: Rooting deepfake attribution in training data. CoRR, abs/2007.08457, 2021.
242
+ [60] H. Zhang, I. Goodfellow, D. Metaxas, and A. Odena. Self-attention generative adversarial networks. In Proc. ICML, 2019.
243
+ [61] R. Zhang. Making convolutional networks shift-invariant again. In Proc. ICML, 2019.
244
+ [62] J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proc. ICCV, 2017.
245
+ [63] X. Zou, F. Xiao, Z. Yu, and Y. J. Lee. Delving deeper into anti-aliasing in ConvNets. In Proc. BMVC, 2020.
md/train/PxMfDdPnTfV/PxMfDdPnTfV.md ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Overparameterization Improves Robustness to Covariate Shift in High Dimensions
2
+
3
+ Nilesh Tripuraneni⇤ U.C. Berkeley† nilesh_tripuraneni@berkeley.edu
4
+
5
+ Ben Adlam⇤ Brain Team, Google Research adlam@google.com
6
+
7
+ Jeffrey Pennington⇤ Brain Team, Google Research jpennin@google.com
8
+
9
+ # Abstract
10
+
11
+ A significant obstacle in the development of robust machine learning models is covariate shift, a form of distribution shift that occurs when the input distributions of the training and test sets differ while the conditional label distributions remain the same. Despite the prevalence of covariate shift in real-world applications, a theoretical understanding in the context of modern machine learning has remained lacking. In this work, we examine the exact high-dimensional asymptotics of random feature regression under covariate shift and present a precise characterization of the limiting test error, bias, and variance in this setting. Our results motivate a natural partial order over covariate shifts that provides a sufficient condition for determining when the shift will harm (or even help) test performance. We find that overparameterized models exhibit enhanced robustness to covariate shift, providing one of the first theoretical explanations for this ubiquitous empirical phenomenon. Additionally, our analysis reveals an exact linear relationship between the in-distribution and out-of-distribution generalization performance, offering an explanation for this surprising recent observation.
12
+
13
+ # 1 Introduction
14
+
15
+ Theoretical justification for almost all machine learning methods relies upon the equality of the distributions from which the training and test data are drawn. Nevertheless, in many real-world applications, this equality is violated—naturally-occurring distribution shift between the training data and the data encountered during deployment is the rule, not the exception [31]. Even non-adversarial changes in distributions can uncover the surprising fragility of modern machine learning models [55, 56, 43, 26, 12, 50]. Such shifts are distinct from adversarial examples, which require explicit poisoning attacks $\pmb { \left[ 2 2 \right] }$ ; rather, they can result from mild corruptions, ranging from changes of camera angle or blur $\pmb { \left. 2 6 \right. }$ , to subtle, unintended changes in data acquisition procedures [56]. Moreover, this fragility limits the application of deep learning in certain safety-critical areas [31]
16
+
17
+ Empirical studies of distribution shift have observed several intriguing phenomena, including linear trends between model performance on shifted and unshifted test distributions [56, 26, 31], dramatic degradation in calibration $\mathbb { \left[ \left. 5 0 \right\| \right. }$ , and surprising spurious inductive biases $\pmb { \mathbb { I } } \pmb { \mathcal { 2 } } \Vert$ . Theoretical understanding of why such patterns occur across a variety of real-world domains is scant. Even basic questions such as what makes a certain distribution shift likely to hurt (or help) a model’s performance, and by how much, are not understood. One reason that these phenomena have eluded theoretical understanding is that there is often a strong coupling between model and distribution, implying that the effect of a given shift cannot usually be understood in a model-agnostic way. Another reason that satisfactory explanations have remained lacking is that the go-to formalism for studying generalization in classical models, namely uniform convergence theory (see e.g. $\begin{array} { r } { \left[ 6 6 \right] ^ { \cdot } } \end{array}$ ), may be insufficient to explain the behavior of modern deep learning methods (even in the absence of distribution shift) [47, 68]. Indeed, classical measures of model complexity, such as various norms of the parameters, have been found to lead to ambiguous conclusions [49].
18
+
19
+ In this paper, we follow a different approach: instead of focusing on worst-case bounds for generic distributions, we study average-case behavior for narrowly specified distributions. While this change in perspective sacrifices generality, it allows us to derive more precise predictions, which we believe are necessary to fully capture the relevant phenomenology. We study a specific type of distribution shift called covariate shift, in which the distributions of the training and test covariates differ, while the conditional distribution of the labels given the covariates remains fixed. Using random matrix theory, we perform an asymptotically exact computation of the generalization error of random feature regression under covariate shift. The random feature model provides a useful testbed to (1) investigate the interplay between various factors such as model complexity, label noise, bias, variance, and covariate shift; (2) rigorously define a model-agnostic notion for the strength of covariate shift; and (3) provide a theoretical explanation for the linear relationships recently observed between in-distribution and out-of-distribution generalization performance [55, 56, 27].
20
+
21
+ # 1.1 Contributions
22
+
23
+ Our primary contributions are to:
24
+
25
+ 1. Provide a model-agnostic partial order over covariate shifts that is sufficient to determine when a shift will increase or decrease the test error in random feature regression (see Def. 4.1)
26
+ 2. Compute the test error, bias, and variance of random feature regression for general multivariate Gaussian covariates under covariate shift in the high-dimensional limit (see Sec. 5.1);
27
+ 3. Prove that overparameterization enhances robustness to covariate shift, and that the error, bias, and variance are nonincreasing functions of the number of excess parameters (see Sec. 5.3);
28
+ 4. Deduce an exact linear relationship between in-distribution and out-of-distribution generalization performance, offering an explanation for this surprising recent empirical observation (see Sec. 5.4).
29
+
30
+ # 1.2 Related work
31
+
32
+ There is extensive literature on the empirical analysis of distribution shift in all of its myriad forms, ranging from domain adaptation $[ \overline { { { \left\| 6 2 \right\| } } } , \overline { { { \left\| 2 0 \right\| } } } , \overline { { { \left\| 8 \right\| } } } , \overline { { { \left. 7 0 \right\| } } } , \overline { { { \left. 6 9 \right\| } } } , \overline { { { \left. 3 7 \right\| } } } , \overline { { { \left. 3 6 \right\| } } } ]$ to defenses against adversarial attacks $\bar { \mathbb { B 9 } } \bar { \mathbb { 6 0 } }$ to distributionally robust optimization [59, 15, 16], among many others. Interestingly, for naturally occurring distribution shifts $[ \sqrt { 3 1 } , \sqrt { 2 6 } ]$ , standard robustness interventions provide little protection $[ \overline { { 1 5 6 } } , \overline { { 6 3 } } ]$ . Indeed, empirical risk minimization on clean, unshifted training data often performs better on out-of-distribution benchmarks than more sophisticated methods $\bar { \bigtriangledown } 3 \bar { \bigtriangledown }$ . One of the most striking observations in the context of natural distribution shifts is that model robustness improves with the classifier’s accuracy [56, 63, 26, 43]. For example, if a classifier’s accuracy increases by $1 . 0 \%$ on the unshifted CIFAR-10 test set, this tends to increase its accuracy by $1 . 7 \%$ on the CIFAR-10.1 dataset (a dataset with natural distribution shift) $\mathbb { \boldsymbol { 6 } }$ . Moreover, such linear trends between the unshifted and shifted measures of error have now been observed in several contexts [56, 63, 43, 40, 44].
33
+
34
+ The number of theoretical works studying the impact of distribution shift on generalization is far smaller. One pioneering work provides VC-dimension-based error bounds for classification that are augmented by a discrepancy measure between source and target domains $\mathbb { I m }$ , while another demonstrates a similar class of uniform convergence-based results in the setting of kernel regression $\mathbb { m }$ . Recent work shows that learning domain-invariant features is insufficient to guarantee generalization when the class-conditional distributions of features may shift $\lVert \overline { { 6 9 } } \rVert$ . When the source domain gradually shifts toward the target domain, non-vacuous margin-based bounds for self-training can be established $\lVert \overline { { 3 2 } } \rVert$ . In $\mathbb { H O }$ , assumptions based on model similarity are used to help explain why classifiers exhibit linear trends between their accuracies on shifted and unshifted test sets [56, 43].
35
+
36
+ Our technical tools build on a series of works that have studied the exact high-dimensional limit of the test error for a growing class of model families and data distributions. In the context of linear models, recent work analyzes ridge regression for general covariances and a general non-isotropic source condition on the parameters which generate the targets $ { \mathbb { I } } ^ { { \left[ 5 7 \right] } }$ , extending earlier work studying minimum-norm interpolated least squares and ridge regression in the random design setting [9, 14, 24]. The non-isotropy of source parameter effectively induces a shift on the bias term of this model, but the phenomenon is distinct from the covariate shifts we study here. Beyond linear regression, random feature models provide a rich but tractable class of models to gain further insight into generalization phenomena [2, 3, 41, 35]. These methods are of particular interest because of their connection to neural networks, with the number of random features corresponding to the network width (or model complexity) [48, 33, 29], and because they serve as a practical method for data analysis in their own right $\pm \sqrt { 5 4 } \sqrt { 6 1 }$ . In this context, a precise characterization of the gaps between uniform convergence and the (asymptotic) exact test error as a function of the sample size and number of random features can be derived $[ \bar { 1 6 8 } ]$ . Since this paper’s publication, we released follow-up work considering unequal scales in the training and test distributions and optimal regularization $\dot { \left[ 6 4 \right] }$ . From the technical perspective, our analytic techniques build upon these works and a series of recent results stemming from the literature on random matrix theory and free probability [53, 52, 1, 2, 38, 51, 19, 45].
37
+
38
+ # 2 Preliminaries
39
+
40
+ # 2.1 Problem setup and notation
41
+
42
+ As in prior work studying random feature regression [24, 41, 2, 1], we compute the test error in the high-dimensional, proportional asymptotics where the dataset size $m$ , input feature dimension $n _ { 0 }$ , and hidden layer size $n _ { 1 }$ all tend to infinity at the same rate, with $\phi : = n _ { 0 } / m$ and $\psi : = n _ { 0 } / n _ { 1 }$ held fixed. We refer to $\phi / \psi$ as the overparameterization ratio, which is the limit of $n _ { 1 } / m$ and characterizes the normalized complexity of the (random) feature model.
43
+
44
+ Interestingly, in this high-dimensional limit, the conditional distribution of a linear labeling function is asymptotically equivalent to a wide class of nonlinear teacher functions (see [41, 2] for more details). With this in mind, we consider the task of learning an unknown function from $m$ i.i.d. samples $( \mathbf { x } _ { i } , y _ { i } ) \in \mathbb { R } ^ { n _ { 0 } } \times \mathbb { R }$ for $i \in \{ 1 , \ldots , m \}$ , where the covariates are Gaussian, $\mathbf { x } _ { i } \sim \mathcal { N } ( 0 , \Sigma )$ with positive definite covariance matrix $\Sigma$ , and the labels are generated by a linear function parameterized by $\beta \in \mathbb { R } ^ { n _ { 0 } }$ , drawn from $\mathcal { N } ( 0 , I _ { n _ { 0 } } )$ . In particular
45
+
46
+ $$
47
+ y ( \mathbf { x } _ { i } ) = { \boldsymbol { \beta } } ^ { \top } \mathbf { x } _ { i } / \sqrt { n _ { 0 } } + \epsilon _ { i } ,
48
+ $$
49
+
50
+ where $\epsilon _ { i } \sim \mathcal { N } ( 0 , \sigma _ { \epsilon } ^ { 2 } )$ is additive label noise on the training points.
51
+
52
+ We study the class of prediction models defined by kernel ridge regression using unstructured random feature maps $\pmb { \Vert 5 4 \Vert }$ . The random features are given by a single-layer, fully-connected neural network with random weights. Given a set of training data $X = [ \mathbf { x } _ { 1 } , \ldots \mathbf { , x } _ { m } ]$ and a prospective test point $\mathbf { x }$ the random features embeddings of the training and test data are given by
53
+
54
+ $$
55
+ F : = \sigma ( W X / \sqrt { n _ { 0 } } ) \quad \mathrm { a n d } \quad f : = \sigma ( W \mathbf { x } / \sqrt { n _ { 0 } } ) ,
56
+ $$
57
+
58
+ for a random weight matrix $W \in \mathbb { R } ^ { n _ { 1 } \times n _ { 0 } }$ with i.i.d. standard Gaussian entries and an activation function $\sigma : \mathbb { R } \mathbb { R }$ applied elementwise. The induced kernel is
59
+
60
+ $$
61
+ K ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) : = \frac { 1 } { n _ { 1 } } \sigma ( W \mathbf { x } _ { 1 } / \sqrt { n _ { 0 } } ) ^ { \top } \sigma ( W \mathbf { x } _ { 2 } / \sqrt { n _ { 0 } } ) ,
62
+ $$
63
+
64
+ and the model’s predictions are given by $\hat { y } ( \mathbf x ) = Y K ^ { - 1 } K _ { \mathbf x }$ , where $Y : = [ y ( \mathbf { x } _ { 1 } ) , \dots , y ( \mathbf { x } _ { m } ) ]$ , $K : = K ( X , X ) \bar { + } \gamma I _ { m } , K _ { \mathbf { x } } : = K \bar { ( } X , \mathbf { x ) }$ , and $\gamma \geq 0$ is a ridge regularization constant1. Owing to the implicit regularization effect of the nonlinear feature maps $\bar { \bigtriangledown } \bar { \bigtriangledown }$ , in low noise settings the optimal value of $\gamma$ can sometimes be negative $\textcircled { \lvert 3 0 \rvert }$ . For simplicity, we nevertheless make the standard assumption that $\gamma \geq 0$ , though we emphasize our techniques readily accommodate negative values.
65
+
66
+ Our central object of study is the expected test loss for a datapoint $\mathbf { x } \sim \mathcal { N } ( 0 , \Sigma ^ { * } )$ where $\Sigma ^ { * }$ may be different from the training covariance $\Sigma$ . The test error (without label noise on the test point) is
67
+
68
+ $$
69
+ \begin{array} { r l } & { E _ { \Sigma ^ { * } } = \mathbb { E } [ ( \beta ^ { \top } { \mathbf x } / \sqrt { n _ { 0 } } - Y K ^ { - 1 } K _ { \mathbf x } ) ^ { 2 } ] } \\ & { \qquad = \underbrace { \mathbb { E } _ { \mathbf { x } , \beta } [ ( \mathbb { E } [ \hat { y } ( { \mathbf x } ) ] - y ( { \mathbf x } ) ) ^ { 2 } ] } _ { B _ { \Sigma ^ { * } } } + \underbrace { \mathbb { E } _ { \mathbf { x } , \beta } [ \mathbb { V } [ \hat { y } ( { \mathbf x } ) ] ] } _ { V _ { \Sigma ^ { * } } } , } \end{array}
70
+ $$
71
+
72
+ where the inner expectations defining the bias and variance are comdecompose the training and test covariance matrices into eigenbases as $W , X$ nd an $Y$ $\begin{array} { r } { \dot { \boldsymbol { \Sigma } } = \sum _ { i = 1 } ^ { n _ { 0 } } \lambda _ { i } \mathbf { v } _ { i } \mathbf { v } _ { i } ^ { \top } } \end{array}$ $\Sigma ^ { * } =$ ${ \textstyle \sum } _ { i = 1 } ^ { n _ { 0 } } \lambda _ { i } ^ { * } \mathbf { v } _ { i } ^ { * } \mathbf { v } _ { i } ^ { * } { } ^ { \top }$ e eigenvalues are in nondecreasing magnitude, i.e. . We define the overlap coefficients $\lambda _ { 1 } \leq \lambda _ { 2 } \leq . . . \leq \lambda _ { n _ { 0 } }$ $\lambda _ { 1 } ^ { * } \leq \lambda _ { 2 } ^ { * } \leq . . . \leq \lambda _ { n _ { 0 } } ^ { * }$
73
+
74
+ $$
75
+ r _ { i } : = \mathbf { v } _ { i } ^ { \top } \Sigma ^ { * } \mathbf { v } _ { i } = \sum _ { j = 1 } ^ { n _ { 0 } } ( \mathbf { v } _ { j } ^ { * } \cdot \mathbf { v } _ { i } ) ^ { 2 } \lambda _ { j } ^ { * }
76
+ $$
77
+
78
+ to measure the alignment of $\Sigma ^ { * }$ with the $i$ th eigendirection of $\Sigma$ . In particular, $r _ { i }$ is the induced norm of $\mathbf { v } _ { i }$ with respect to $\Sigma ^ { * }$ . We use $\bar { \mathrm { t r } }$ to denote the dimension-normalized trace: for a matrix $A \in \mathbb { R } ^ { n \times n }$ , $\textstyle { \bar { \operatorname { t r } } } ( A ) = { \frac { 1 } { n } } \operatorname { t r } ( A )$ . We use $\| A \| _ { \infty }$ and $\| A \| _ { F }$ to denote the operator norm and Frobenius norm of matrix $A$ respectively. Finally, we use $\delta _ { \mathbf { x } }$ to denote the Dirac delta function centered at $\mathbf { x }$ .
79
+
80
+ # 2.2 Assumptions
81
+
82
+ Regularity assumptions on the spectra of $\Sigma$ and $\Sigma ^ { * }$ are necessary to state the limiting behavior of this system. As in $\dot { \left. \overline { { { \left. 6 \overline { { { 7 } } } } } } \\right.right. }$ , it is not sufficient to consider the spectra of these matrices individually; they must be considered jointly. We do this in an eigenbasis of $\Sigma$ .
83
+
84
+ Assumption 1. We define the empirical joint spectral distribution (EJSD) as
85
+
86
+ $$
87
+ \mu _ { n _ { 0 } } : = \frac { 1 } { n _ { 0 } } \sum _ { i = 1 } ^ { n _ { 0 } } \delta _ { ( \lambda _ { i } , r _ { i } ) }
88
+ $$
89
+
90
+ and assume it converges in distribution to some $\mu _ { ; }$ , a distribution on $\mathbb { R } _ { + } ^ { 2 }$ as $n _ { 0 } \infty$ . We refer to $\mu$ as the limiting joint spectral distribution (LJSD), and emphasize that this defines the relevant limiting properties of the train and test distributions2. Additionally, we require that $\begin{array} { r } { \operatorname* { l i m } \operatorname* { s u p } _ { n _ { 0 } } \operatorname* { m a x } ( \| \Sigma \| _ { \infty } , \| \Sigma ^ { * } \| _ { \infty } ) \leq C } \end{array}$ for a constant $C$ .
91
+
92
+ Often we use $( \lambda , r )$ for random variables sampled jointly from $\mu$ and denote the marginal of $\lambda$ under $\mu$ with $\mu _ { \mathrm { { t r a i n } } }$ . The conditional expectation $\mathbb { E } [ r | \lambda ]$ is an important object in our study. We frequently overload the notation $\mathbb { E } [ r | \lambda ]$ to view it as a function of $\lambda$ , and we assume the following for simplicity.
93
+
94
+ Assumption 2. $\mu$ is either absolutely continuous or a finite sum of delta masses. Moreover, the expectations of $\lambda$ and $r$ are finite.
95
+
96
+ When the eigenspaces of $\Sigma$ and $\Sigma ^ { * }$ are aligned and $r _ { i } = \lambda _ { i } ^ { * } = \Phi ( \lambda _ { i } )$ for some smooth function $\Phi$ , the support of the LJSD degenerates. Here, Assump. $\perp$ is essentially equivalent to assuming the empirical spectral distribution of $\Sigma$ converges in distribution to some $\mu _ { \mathrm { { t r a i n } } }$ , which is a standard assumption in the regression literature [14, 41]. One special case of note is when there is no shift, i.e. $\Phi$ is the identity, in which case the LJSD degenerates to $\mu _ { \emptyset }$ defined by
97
+
98
+ $$
99
+ \mu _ { \emptyset } ( \lambda , r ) : = \mu _ { \operatorname { t r a i n } } ( \lambda ) \delta _ { \lambda } ( r ) , \quad i . e . \quad ( \lambda , \lambda ) \sim \mu _ { \emptyset } \mathrm { f o r } \lambda \sim \mu _ { \operatorname { t r a i n } } .
100
+ $$
101
+
102
+ As our analysis will eventually take place in the high-dimensional limit, we further define the asymptotic scales of the training and test covariances as $s : = \operatorname* { l i m } _ { n _ { 0 } \to \infty } \operatorname { t r } ( \Sigma ) = \mathbb { E } _ { \mu } [ \lambda ]$ and $s _ { * } : = \bar { \operatorname* { l i m } _ { n _ { 0 } \to \infty } \operatorname { t r } ( \Sigma ^ { * } ) } = \mathbb { E } _ { \mu } [ r ]$ under the limiting behavior specified in Assump. 1.
103
+
104
+ Throughout this paper, we also enforce the following standard regularity assumptions on the activation functions to ensure the existence of the moments and derivatives we compute.
105
+
106
+ Assumption 3. The activation function $\sigma : \mathbb { R } \mathbb { R }$ is assumed to be differentiable almost everywhere.
107
+ We assume that, $| \sigma ( x ) | , | \sigma ^ { \prime } ( x ) | \leq c _ { 0 } \exp ( c _ { 1 } x )$ for constants $c _ { 0 } , c _ { 1 }$ .
108
+
109
+ # 2.3 A simple family of diatomic distributions
110
+
111
+ As the above assumptions allow such a general class of covariance structures, it is useful to consider our results in the context of a simple family of distributions that readily admits a simple interpretation.
112
+
113
+ Definition 2.1. For $\alpha \geq 1$ and $\theta \in \mathbb { R } ,$ , we define the family of $( \alpha , \theta )$ -diatomic LJSDs with $\theta$ -powerlaw shifts as
114
+
115
+ $$
116
+ \mu _ { \alpha , \theta } ^ { d i a t o m i c } : = \frac { 1 } { \alpha + 1 } \delta _ { ( \alpha , C \alpha ^ { \theta } ) } + \frac { \alpha } { \alpha + 1 } \delta _ { ( \alpha ^ { - 1 } , C \alpha ^ { - \theta } ) } ,
117
+ $$
118
+
119
+ where $C$ is a normalization constant chosen so that $\mathbb { E } _ { \mu _ { \alpha , \theta } ^ { d i a t o m i c } } [ r ] = 1$ . Note that $\mu _ { \alpha , \theta } ^ { d i a t o m i c }$ is the limit of
120
+
121
+ $$
122
+ \Sigma _ { i j } : = \left\{ \begin{array} { l l } { \alpha } & { i f i = j a n d i \leq \left\lfloor \frac { n _ { 0 } } { 1 + \alpha } \right\rfloor } \\ { \alpha ^ { - 1 } } & { i f i = j a n d i > \left\lfloor \frac { n _ { 0 } } { 1 + \alpha } \right\rfloor } \\ { 0 } & { i f i \neq j } \end{array} \right. \qquad a n d \quad \Sigma ^ { * } : = \frac { 1 } { \overline { { \operatorname { t r } } } \left( \Sigma ^ { \theta } \right) } \Sigma ^ { \theta } .
123
+ $$
124
+
125
+ This simple two-parameter family of distributions captures the fast eigenvalue decay observed in many datasets in machine learning, for which the covariance spectra are often dominated by several large eigenvalues and exhibit a long tail of many small eigenvalues $\textcircled { 1 3 4 } \textcircled { 1 }$ . Note that the trivial case of $\alpha = 1$ yields an identity covariance with no shift. For the nontrivial setting $\alpha > 1$ , the exponent $\theta$ parameterizes the strength of the shift in an intuitive way: when $\theta = 1$ , there is no shift; when $\theta < 1$ , $\overset { \cdot } { \alpha } { } ^ { \theta } < \alpha$ , so the large eigendirections of the training distribution are suppressed in the test distribution, suggesting that the shift makes learning harder; when $\theta > 1$ , $\alpha ^ { \theta } > \alpha$ , so the large eigendirections of the training distribution are further emphasized in the test distribution, suggesting that the shift makes learning easier. We will return to the notion of shift strength in Secs. 3 and 4.
126
+
127
+ # 3 Motivating example: linear regression
128
+
129
+ We first consider the relatively simple case of ridgeless linear regression (LR), which will help build some intuition for the more general analysis of random feature regression in Sec. 5.1. Assuming the labels are generated by the linear model defined above, i.e. $y _ { i } = { \beta ^ { \top } } { \bf { x } } _ { i } / { \sqrt { n _ { 0 } } } + \varepsilon _ { i }$ , the estimator is given by ${ \hat { \beta } } = ( X X ^ { \top } ) ^ { - 1 } X Y$ , and the test risk (see Eq. $( 4 ) \dot { }$ ) has the following simple form.
130
+
131
+ Proposition 3.1. For fixed dimension $n _ { 0 }$ and sample size $m > n _ { 0 } + 1$ , the test error of $L R$ is given by
132
+
133
+ $$
134
+ E _ { \Sigma ^ { * } } ^ { L R } = \sigma _ { \epsilon } ^ { 2 } \frac { n _ { 0 } } { m - n _ { 0 } - 1 } \bar { \mathrm { t r } } \bigl ( \Sigma ^ { * } \Sigma ^ { - 1 } \bigr ) = \sigma _ { \epsilon } ^ { 2 } \frac { n _ { 0 } } { m - n _ { 0 } - 1 } \frac { 1 } { n _ { 0 } } \sum _ { i = 1 } ^ { n _ { 0 } } \frac { r _ { i } } { \lambda _ { i } } .
135
+ $$
136
+
137
+ Under Assump. 1, as $n _ { 0 } , m \infty$ with $\phi = n _ { 0 } / m$ fixed, $E _ { \Sigma ^ { * } } ^ { L R } \to E _ { \mu } ^ { L R } = \sigma _ { \epsilon } ^ { 2 } \phi / ( 1 - \phi ) \mathbb { E } _ { \mu } [ r / \lambda ] .$
138
+
139
+ One immediate question is whether a given shift will increase or decrease the test error relative to $E _ { \Sigma } ^ { \mathrm { L R } }$ . While the precise answer is of course determined by the value of $\bar { \mathrm { t r } } ( \Sigma ^ { * } \Sigma ^ { - 1 } )$ , it useful for the subsequent analysis to develop an understanding of the individual contributions to this term. Similar decompositions of the test error into eigenspaces have proved useful in a variety of other contexts, e.g. [42, 4]. We begin with a specific example in the setting of the finite-dimensional analog of Def. 2.1.
140
+
141
+ Example 3.1. For the finite form of the $( \alpha , \theta )$ -diatomic density defined in Eq. $( 1 0 )$ , the test error of $L R$ is given by
142
+
143
+ $$
144
+ E _ { \Sigma ^ { * } } ^ { L R } = \sigma _ { \epsilon } ^ { 2 } { \frac { n _ { 0 } } { m - n _ { 0 } - 1 } } { \frac { \alpha + w ( \alpha ^ { 2 \theta - 1 } - \alpha ) } { 1 + w ( \alpha ^ { 2 \theta } - 1 ) } } \quad f o r \quad w = { \frac { 1 } { n _ { 0 } } } \left\lfloor { \frac { n _ { 0 } } { 1 + \alpha } } \right\rfloor ,
145
+ $$
146
+
147
+ and so $\begin{array} { r } { \frac { \partial } { \partial \theta } E _ { \Sigma ^ { * } } ^ { L R } = \sigma _ { \epsilon } ^ { 2 } \frac { n _ { 0 } } { m - n _ { 0 } - 1 } \frac { 2 ( 1 - w ) w \alpha ^ { 2 \theta - 1 } ( 1 - \alpha ^ { 2 } ) \log ( \alpha ) } { ( 1 + w ( \alpha ^ { 2 \theta } - 1 ) ) ^ { 2 } } \leq 0 } \end{array}$ , which implies $E _ { \Sigma _ { 1 } ^ { * } } ^ { L R } \leq E _ { \Sigma _ { 2 } ^ { * } } ^ { L R }$ whenever $\theta _ { 1 } \geq \theta _ { 2 }$ , in accordance with the discussion in Sec. 2.3. It follows from Eq. $\underline { { \lVert \boldsymbol { 0 } \rVert } }$ that the condition $\theta _ { 1 } \geq \theta _ { 2 }$ not only implies $\bar { \mathrm { t r } } ( \Sigma _ { 1 } ^ { * } \Sigma ^ { - 1 } ) \le \bar { \mathrm { t r } } ( \Sigma _ { 2 } ^ { * } \Sigma ^ { - 1 } )$ , but also that the ratios of overlap coefficients $r _ { i , 1 } / r _ { i , 2 }$ form a nondecreasing sequence. It is this condition involving all the eigendirections that will generalize to the nonlinear random feature setting in Sec. 4.
148
+
149
+ The following proposition captures the essence of these considerations in the context of linear regression. See Sec. $\boxed { \mathbf { A } 4 }$ for the proof.
150
+
151
+ Proposition 3.2. Let ${ \boldsymbol { r } } _ { i , 1 }$ and ${ r } _ { i , 2 }$ denote the overlap coefficients3 of $\Sigma _ { 1 } ^ { * }$ and $\Sigma _ { 2 } ^ { * }$ relative to $\Sigma$ . If $\mathrm { t r } ( \bar { \Sigma } _ { 2 } ^ { * } ) \geq \mathrm { t r } ( \Sigma _ { 1 } ^ { * } )$ and the ratios $r _ { i , 1 } / r _ { i , 2 }$ form a nondecreasing sequence, then in the setting of Prop. 3.1 , $E _ { \Sigma _ { 2 } ^ { * } } ^ { L R } \geq E _ { \Sigma _ { 1 } ^ { * } } ^ { L R }$ .
152
+
153
+ Whereas the $( \alpha , \theta )$ -diatomic LJSDs explicitly enforce the trace normalizations $\mathrm { t r } ( \Sigma ) = \mathrm { t r } ( \Sigma _ { 1 } ^ { * } ) = \mathrm { t r } ( \Sigma _ { 2 } ^ { * } ) = 1$ , Prop. $3 . 2$ provides sufficient conditions for the ordering of test errors for non-unit traces. The fact that $E _ { \Sigma ^ { * } } ^ { \mathrm { L R } }$ scales linearly with the overall scale of $\Sigma ^ { * }$ is a unique feature of linear regression and does not generalize to the nonlinear random feature setting. We return to this issue in Sec. 4.
154
+
155
+ # 4 Definition of shift strength
156
+
157
+ Deriving conditions on whether a shift will hurt or help a model’s performance is crucial to building an understanding of covariate shift. Motivated in part by the above results for linear regression, and in part by the results for random feature regression that we present in $\mathrm { S e c . } \underline { { \bar { 5 . 3 } } }$ we introduce the following definition of shift strength, which is a direct generalization of the conditions of Prop. 3.2:
158
+
159
+ Definition 4.1. Let $\mu _ { 1 }$ and $\mu _ { 2 }$ be LJSDs with the same marginal distribution of $\lambda ,$ , denoted $\mu _ { t r a i n }$ . If the asymptotic overlap coefficients are such that $\mathbb { E } _ { \mu _ { 1 } } [ r | \lambda ] / \mathbb { E } _ { \mu _ { 2 } } [ r | \lambda ]$ is nondecreasing as a function of $\lambda$ on the support of $\mu _ { t r a i n }$ and $\mathbb { E } _ { \mu _ { 1 } } [ r ] \le \mathbb { E } _ { \mu _ { 2 } } [ r ]$ , we say $\mu _ { 1 }$ is easier than $\mu _ { 2 }$ (or $\mu _ { 2 }$ is harder than $\mu _ { 1 . }$ ), and write $\mu _ { 1 } \leq \mu _ { 2 }$ . Comparing against the case of no shift $\mu _ { \emptyset }$ , we say $\mu _ { 1 }$ is easy when $\mu _ { 1 } \leq \mu _ { \emptyset }$ and hard when µ1 µ .
160
+
161
+ A priori, there is little reason to hope that such a model-independent definition of shift strength would adequately characterize a shift’s impact on the total error, bias, or variance of a given model. Even for the relatively simple case of random feature kernel regression, the nonlinear feature maps of Eq. $\mathbb { Q } )$ would seem to inextricably couple the covariance distribution to the model.
162
+
163
+ Nevertheless, as we show in $\mathrm { S e c . } \big | 5 . 1 \big | ,$ the coupling between model and shift simplifies considerably in the high-dimensional proportional asymptotics. It is characterized by a handful of constants that depend solely on the overall covariance scale $\mathbb { E } _ { \mu } [ r ]$ and a collection of functionals of $\mu$ , whose magnitudes can be bounded in terms of the ratio $\dot { { \mathbb E } } _ { \mu } [ r | \lambda ] / { \mathbb E } _ { \mu _ { \emptyset } } [ r | \lambda ]$ . The conditions that Def. 4.1 places on $\mathbb { E } _ { \mu } [ r ]$ and $\mathbb { E } _ { \mu } [ r | \lambda ] / \mathbb { E } _ { \mu _ { \emptyset } } [ r | \lambda ]$ can be augmented by various constraints on the model to derive bounds on how the total error and bias will respond to a shift of a given strength. This perspective introduces considerable complexity and we present the details of this analysis elsewhere.
164
+
165
+ In this work, we focus on a simpler, surprising result: by merely normalizing the scales of the covariate distributions (i.e. enforcing $s = s _ { * }$ ), Def. $\boxed { 4 . 1 }$ provides a model-independent definition of shift strength that determines how random feature models respond to shifts of different strength. This observation motivates the following assumption.
166
+
167
+ Assumption 4. The training and test covariance scales are equal, $\mathbb { E } _ { \mu } [ \lambda ] = \mathbb { E } _ { \mu } [ r ]$ , i.e. $s = s _ { \ast }$
168
+
169
+ We emphasize that Assump. 4 reflects common practice for many models and data modalities, as preprocessing techniques such as standardization are ubiquitous and many architectural components such as layer- or batch-normalization achieve a similar effect [21, 28, 46].
170
+
171
+ # 5 Covariate shift in random feature kernel regression
172
+
173
+ # 5.1 Main results
174
+
175
+ Our main results characterize the high-dimensional limits of the test error, bias, and variance of the nonlinear random feature model of Sec. $2 .$ Before stating them, we first introduce some additional constants that capture the effect of the nonlinearity $\sigma$ . For $z \sim \mathcal { N } ( 0 , s )$ , define
176
+
177
+ $$
178
+ \begin{array} { r } { \eta : = \mathbb { V } [ \sigma ( z ) ] \ : , \ : \ : \rho : = ( \frac { 1 } { s } \mathbb { E } [ z \sigma ( z ) ] ) ^ { 2 } \ : , \ : \ : \zeta : = s \rho \ : , \ : \ : \ : \mathrm { ~ a n d ~ } \ : \ : \ : \omega : = s ( \eta / \zeta - 1 ) \ : . } \end{array}
179
+ $$
180
+
181
+ Our results also depend on the covariance spectra through two sets of functionals of $\mu$ ,
182
+
183
+ $$
184
+ \begin{array} { r } { \mathcal { T } _ { a , b } \left( x \right) : = \phi \mathbb { E } _ { \mu } \left( \lambda ^ { a } \left( \phi + x \lambda \right) ^ { - b } \right) \quad \mathrm { ~ a n d ~ } \quad \mathcal { T } _ { a , b } ^ { * } \left( x \right) : = \phi \mathbb { E } _ { \mu } \left( r \lambda ^ { a - 1 } \left( \phi + x \lambda \right) ^ { - b } \right) . } \end{array}
185
+ $$
186
+
187
+ ![](images/16406aa9c54eafbda06548093a3ffd192be3f07da1d914556ff9fecc446814d9.jpg)
188
+ Figure 1: The asymptotic predictions of Thm. $\boxed { 5 . 1 }$ as a function of the overparameterization ratio $( \phi / \psi = n _ { 1 } / m )$ and the shift power $\left( \theta \right)$ for the $( { \bar { 2 } } , \theta )$ -diatomic LJSD (Eq. $\textcircled { 9 }$ ) with $\phi = n _ { 0 } / m = 0 . 5$ , $\sigma = \mathrm { R e L U }$ , $\gamma = 0 . 0 0 1$ , and $\stackrel { \cdot } { \sigma } _ { \varepsilon } ^ { 2 } = 0 . 1$ . (a) The test error exhibits the characteristic double descent behavior for all shift powers. (b) The bias is a nonincreasing function of $\phi / \psi$ for all shift powers, as in Prop. $\overline { { 5 . 2 } } \Vert$ (c) The variance is the source of the double-descent peak, and is a nonincreasing function of ${ \overline { { \phi / } } } \psi$ for all shift powers in the overparameterized regime, as in Prop. $5 . 3 .$ In (a,b), the total error and bias are nonincreasing functions of $\theta$ , as in Prop. 5.1. (d) 1D horizontal slices of (a,b,c) demonstrate the monotonicity in $\phi / \psi$ predicted by Props. $5 . 2 \AA$ and $\boxed { 5 . 3 }$ (e) 1D vertical slices of (a,b,c) demonstrate the monotonicity in $\theta$ predicted by Prop. 5.1 (the variance also appears monotonic, but it need not be in general). (f) The generalization gap between the error on shifted and unshifted distributions is a nonincreasing function of $\phi / \psi$ in the overparameterized regime, as in Prop. 5.4. Markers in (d,e,f) show simulations for $n _ { 0 } = 5 1 2$ and agree well with the asymptotic predictions.
189
+
190
+ Theorem 5.1. Under Assumps. $\mathbb { Z } , \perp , \perp a n d \perp ,$ as $n _ { 0 } , n _ { 1 } , m \infty$ the test error $E _ { \Sigma ^ { * } }$ converges to $E _ { \mu } = B _ { \mu } + V _ { \mu }$ , with the bias $B _ { \mu }$ and variance $V _ { \mu }$ given by
191
+
192
+ $$
193
+ \begin{array} { l } { { \displaystyle B _ { \mu } = \phi \mathcal { T } _ { 1 , 2 } ^ { * } } } \\ { { \displaystyle V _ { \mu } = - \rho \frac { \psi } { \phi } \frac { \partial x } { \partial \gamma } \bigg ( \mathcal { T } _ { 1 , 1 } ( \omega + \phi \mathcal { T } _ { 1 , 2 } ) ( \omega + \mathcal { T } _ { 1 , 1 } ^ { * } ) + \frac { \phi ^ { 2 } } { \psi } \gamma \bar { \tau } \mathcal { T } _ { 1 , 2 } \mathcal { T } _ { 2 , 2 } ^ { * } } } \\ { { \displaystyle \quad \quad + \gamma \tau \mathcal { T } _ { 2 , 2 } ( \omega + \phi \mathcal { T } _ { 1 , 2 } ^ { * } ) + \sigma _ { \varepsilon } ^ { 2 } \Big ( ( \omega + \phi \mathcal { T } _ { 1 , 2 } ) ( \omega + \mathcal { T } _ { 1 , 1 } ^ { * } ) + \frac { \phi } { \psi } \gamma \bar { \tau } \mathcal { T } _ { 2 , 2 } ^ { * } \Big ) \bigg ) , } } \end{array}
194
+ $$
195
+
196
+ where x is the unique nonnegative real root of x = 1⌧!+I1,1 , @x@ $\begin{array} { r } { \frac { 1 - \gamma \tau } { \omega + \mathcal { T } _ { 1 , 1 } } , \frac { \partial x } { \partial \gamma } = - \frac { x } { \gamma + \rho \gamma ( \tau \psi / \phi + \bar { \tau } ) ( \omega + \phi \mathcal { T } _ { 1 , 2 } ) } } \end{array}$ , and
197
+
198
+ $$
199
+ \tau = \frac { \sqrt { ( \psi - \phi ) ^ { 2 } + 4 x \psi \phi \gamma / \rho } + \psi - \phi } { 2 \psi \gamma } a n d \bar { \tau } = \frac { 1 } { \gamma } + \frac { \psi } { \phi } \bigl ( \tau - \frac { 1 } { \gamma } \bigr ) .
200
+ $$
201
+
202
+ Numerical predictions from Thm. $\underline { { \boldsymbol { \mathsf { F . 1 } } } }$ can be obtained by first solving the self-consistent equation for $x$ by fixed-point iteration, $\begin{array} { r } { x \mapsto \frac { 1 - \gamma \tau } { \omega + \mathcal { T } _ { 1 , 1 } } } \end{array}$ , and then plugging the result into the remaining terms. Fig. 1 shows excellent agreement between these asymptotic predictions and finite-size simulations.
203
+
204
+ At times we will find it convenient to consider the ridgeless limit of Thm. $5 . 1 .$ By carefully expanding $x$ and $\tau$ for small $\gamma$ , it is straightforward to obtain the following corollary.
205
+
206
+ Corollary 5.1. In the setting of Thm. $\underline { { \boldsymbol { \sqrt { 5 . I } } } }$ as the ridge regularization constant $\gamma 0$ , $E _ { \mu } = B _ { \mu } + V _ { \mu }$ with $B _ { \mu }$ given in Eq. $( 1 5 )$ and $V _ { \mu }$ given by
207
+
208
+ $$
209
+ V _ { \mu } = \frac { \psi } { \left| \phi - \psi \right| } x ( \sigma _ { \varepsilon } ^ { 2 } + \mathcal { T } _ { 1 , 1 } ) ( \omega + \mathcal { T } _ { 1 , 1 } ^ { * } ) + \left\{ \begin{array} { l l } { x \Big ( 1 - \frac { x ( \omega - \sigma _ { \varepsilon } ^ { 2 } ) } { 1 - x ^ { 2 } \mathcal { T } _ { 2 , 2 } } \Big ) \mathcal { T } _ { 2 , 2 } ^ { * } } & { \phi \geq \psi } \\ { \frac { x ^ { 2 } \psi \mathcal { T } _ { 2 , 2 } } { \phi - x ^ { 2 } \psi \mathcal { T } _ { 2 , 2 } } \big ( \omega + \phi \mathcal { T } _ { 1 , 2 } ^ { * } \big ) } & { \phi < \psi } \end{array} \right. ,
210
+ $$
211
+
212
+ where x is the unique positive real root of $\begin{array} { r } { x = \frac { \operatorname* { m i n } ( 1 , \phi / \psi ) } { \omega + { \mathcal { T } _ { 1 , 1 } } } } \end{array}$ .
213
+
214
+ Taking $\sigma ( x ) = x$ and $\psi \to 0$ in Cor. $5 . 1$ yields an expression for the test error of ridgeless linear regression that agrees with $\pm \pmb { \Vert 2 4 \Vert }$ and with the asymptotic form of Prop. 3.1 (see Sec. A4.2).
215
+
216
+ # 5.2 Harder shifts increase the bias and test error
217
+
218
+ The bias and variance in Thm. 5.1 depend on the covariate shift exclusively through $\mathcal { T } _ { a , b } ^ { * }$ — all other terms such as $x , \tau , \bar { \tau }$ , and $\mathcal { T } _ { a , b }$ only depend on the marginal of $\lambda$ under $\mu$ . The functionals $\mathcal { T } _ { a , b } ^ { * }$ generalize the simple ratio of overlap coefficients to eigenvalues, $\mathbb { E } _ { \mu } [ r / \lambda ]$ , that characterizes the error for linear regression (indeed, $\mathcal { T } _ { 0 , 0 } ^ { * } = \tilde { \phi } \mathbb { E } _ { \mu } [ r / \lambda ] \mathrm { , }$ ). In contrast, the error in the random feature setting is a combination of multiple such terms. Nevertheless, Def. $4 . 1$ enables comparisons of the individual $\mathcal { T } _ { a , b } ^ { * }$ functionals, which provide sufficient conditions to order the error and bias.
219
+
220
+ Proposition 5.1. Consider two LJSDs such that $\mu _ { 1 } \leq \mu _ { 2 }$ (see Def. 4.1) Then, in the setting of Thm. 5.1, $B _ { \mu _ { 1 } } \leq B _ { \mu _ { 2 } }$ and, if $\sigma _ { \varepsilon } ^ { 2 } \leq \omega$ , $E _ { \mu _ { 1 } } \leq E _ { \mu _ { 2 } }$ .
221
+
222
+ Prop. 5.1 shows that Def. $\boxed { 4 . 1 }$ provides an essentially model-independent condition to determine the impact of covariate shift on the test error4. Interestingly, both the bias (which arises from both regularization and model misspecification) and the total error (which has additional variance contributions from the randomness induced by $W$ , $X$ , and $\epsilon$ ) respond to shifts in tandem in the regime of small label noise. (For large label noise, the variance can dominate the error and cause violations of monotonicity; see $\sec . { 5 . 5 } .$ Prop. $5 . 1$ is illustrated for the $( \alpha , \theta )$ -diatomic LJSD in Fig. 1: following the vertical lines upward in (a), (b), or the $\mathbf { X }$ -axis rightward in (e) yields easier shifts and a corresponding decrease in the bias and total error.
223
+
224
+ # 5.3 The benefit of overparameterization
225
+
226
+ While Prop. 5.1 shows that harder shifts increase the error, it is natural to wonder whether this increase can be mitigated by judicious model selection. In practice, empirical investigations have shown that the performance of large, overparameterized models tends to deteriorate less under distribution shift than their smaller counterparts $\overline { { \lVert \mathscr { Q } \boldsymbol { 6 } \rVert } }$ . We obtain a number of theoretical results that formally prove the benefit of overparameterization in our random feature setting.
227
+
228
+ First, we show that the bias decreases (or stays constant) when additional random features are added, which increases the model capacity and accords with the intuition of the bias as a measure of the model’s ability to fit the data.
229
+
230
+ Proposition 5.2. In the setting of Thm. $\boxed { 5 . I }$ the bias $B _ { \mu }$ is a nonincreasing function of the overparameterization ratio $\phi / \psi$ .
231
+
232
+ In contrast to the bias, which is monotonic for all overparameterization ratios, the variance can exhibit nonmonotonic behavior in the underparameterized regime. On the other hand, the following proposition shows that in the overparameterized regime, the variance is also nonincreasing. Note that our proof requires the setting of ridgeless regression $( \gamma = 0$ ), but numerical investigation suggests this condition may not be necessary (see Fig. 1).
233
+
234
+ Proposition 5.3. In the setting of Cor. $\boxed { 5 . I }$ and in the overparameterized regime (i.e. $\psi < \phi ,$ ), the variance $V _ { \mu }$ is a nonincreasing function of the overparameterization ratio $\phi / \psi$ .
235
+
236
+ The explosion of variance at the interpolation threshold and then its subsequent decay have been demonstrated in previous exact asymptotic studies of random feature regression in the absence of covariate shift, in stark contrast to what classical theory would suggest [2, 41]. Prop. 5.3 confirms the existence of analogous behavior under covariate shift.
237
+
238
+ Taken together, Props. $\boldsymbol { \left. 5 . 2 \right. }$ and $5 . 3$ imply that some of the benefits of overparameterization extend to models evaluated out-of-distribution. An additional benefit is that overparameterized models are more robust: the difference in error between unshifted and shifted test distributions is smaller for larger models. A formal statement of this enhanced robustness is given in the following result.
239
+
240
+ Proposition 5.4. Consider two LJSDs such that $\mu _ { 1 } \leq \mu _ { 2 }$ (see Def. $\boxed { 4 . 7 }$ . Then, in the setting of Cor. 5.1 and in the overparameterized regime (i.e. $\psi < \phi ,$ ), the generalization gap $E _ { \mu _ { 2 } } - E _ { \mu _ { 1 } }$ is a nonincreasing function of the overparameterization ratio $\phi / \psi$ .
241
+
242
+ ![](images/bad57c16e13135a0864dec947190c2dd836185bfe52474affd98050f435e79e4.jpg)
243
+ Figure 2: Linear relationship between in-distribution and out-of-distribution generalization error. (a) Asymptotic predictions for shifted versus unshifted error for models with varying degrees of overparameterization $\phi / \psi > 1$ , obtained via Cor. 5.1 for the $( 3 , \theta )$ -diatomic LJSD (Eq. $( { \bar { 9 } } )$ ) with $\phi = \overline { { n _ { 0 } / m } } = 0 . 5$ , $\sigma = \mathrm { R e L U }$ , $\sigma _ { \varepsilon } ^ { 2 } = 0 . 0 1$ and two different values of the shift-power $\theta$ . Markers represent simulations for $n _ { 0 } = 5 1 2$ . The negated errors are plotted so that performance improves left to right and bottom to top, in order to match the behavior of the accuracy metric. (b) Reproduction of the empirical results of $\mathbb { B } 6 \mathbb { K } \mathbb { 3 } \mathbb { I }$ , showing the relationship between the classification accuracy of various models on the original ImageNet test set and two shifted ImageNet datasets: a “hard" dataset with greyscale corruptions, Grey, and an “easy" dataset with high inter-annotator agreement, TopImgs. In both (a) and $\mathbf { ( b ) }$ , the slope is greater than one for the hard shift and less than one for the easy shift, in accordance with Prop. 5.5.
244
+
245
+ In Fig. 1, Props. 5.2, 5.3 and $\underline { { \boldsymbol { \mathsf { F . 4 } } } }$ are illustrated. Following the horizontal lines rightward in (a), (b), and (c) or the $\mathbf { X }$ -axis rightward in (d) and (f) leads to models with more parameters. The monotonicity of the bias across the whole range of parameterization is evident, as is the necessity of considering the monotonicity of the variance and generalization gap only when $\phi > \psi$ .
246
+
247
+ # 5.4 Linear trends between in-distribution and out-of-distribution generalization
248
+
249
+ We have discussed how overparameterization yields improvements on both unshifted and shifted test distributions, which hints that these two quantities are positively correlated. Indeed, recent work has suggested increasing model size as a path to increased robustness $\pmb { \mathbb { D } 6 }$ . Additional empirical studies have further refined this observation by discovering a linear relationship between the performance of models of varying complexity on unshifted and shifted data $\mathbb { 1 5 6 , 6 3 }$ . In the context of ridgeless random feature regression, we provide a formal proof of this linear relationship.
250
+
251
+ Proposition 5.5. In the setting of Cor. 5.1 and in the overparameterized regime (i.e. $\psi < \phi ,$ ),
252
+
253
+ $$
254
+ E _ { \mu } = E _ { 0 } + \underbrace { \left( { \frac { \omega + { \mathcal { T } } _ { 1 , 1 } ^ { * } } { \omega + { \mathcal { T } } _ { 1 , 1 } } } \right) } _ { \mathrm { S L O P E } } E _ { \mu _ { \emptyset } } ,
255
+ $$
256
+
257
+ parametrically in the overparameterization ratio $\phi / \psi$ , where $E _ { 0 }$ and SLOPE are constants independent of $\phi / \psi$ , and $E _ { \mu _ { \emptyset } }$ is the error on the unshifted distribution. Moreover, SLOPE $\geq 1$ when $\mu$ is hard and SLOPE $\leq 1$ when $\mu$ is easy.
258
+
259
+ Eq. $( 1 9 )$ implies a parametrically linear relationship between $E _ { \mu }$ and $E _ { \mu _ { \emptyset } }$ by varying $\phi / \psi$ . Prop. 5.5 also makes the nontrivial prediction that an improvement on the unshifted distribution leads to a relatively greater improvement on the shifted distribution when the shift is hard, and to a relatively smaller improvement when the shift is easy. This prediction is corroborated qualitatively in the data from $\boxed { 5 5 } \boxed { 5 6 } \boxed { 4 3 }$ . We plot this linear behavior in Fig. $^ { 2 , }$ where (a) shows the random feature model and (b) shows an example of data from $\pm \pm \boxed { 5 6 } \boxed { 6 3 } \parallel$ . The striking similarity in these plots is evident.
260
+
261
+ # 5.5 Importance of assumptions
262
+
263
+ Props. 5.1, 5.2, 5.3, 5.4 and $5 . 5$ rely on a number of assumptions and conditions; here we show the necessity of some of these prerequisites for our results.
264
+
265
+ ![](images/1b700469dd6c39a82f40cf037ce3fac94f07b3ef7c43cc915e15b892f6e01e07.jpg)
266
+ Figure 3: Relaxing the assumptions and conditions can lead to counterexamples to the propositions. (a) Asymptotic predictions (solid lines) and simulations with $n _ { 0 } = 4 0 9 6$ (markers) for the total error, bias, and variance for the $( 4 , \theta )$ -diatomic LJSD with $\phi = 4$ , $\psi = 0 . 2 5$ , $\gamma = 1 0 ^ { - 4 }$ , and $\sigma = \mathrm { R e L U }$ (implying $\begin{array} { r } { \omega = 1 - \frac { 2 } { \pi } \approx \dot { 0 } . 3 6 ) } \end{array}$ as a function of increasing shift power $\theta$ . When $\sigma _ { \varepsilon } ^ { 2 } < \omega$ (dashed curves), the bias and total error are nonincreasing, as predicted by Prop. $\underline { { \boldsymbol { \mathsf { F . 1 } } } } \big \|$ though the variance is not. When $\sigma _ { \varepsilon } ^ { 2 } > \omega$ (solid curves), the total error is no longer nonincreasing. $\mathbf { ( b ) }$ Asymptotic predictions (solid lines) and simulations with $n _ { 0 } = 2 5 6$ (markers) for the total error with $\phi = 0 . 5$ , $\gamma = 0 . 1$ , $\sigma = \mathrm { R e L U }$ and $\sigma _ { \varepsilon } ^ { 2 } = 0 . 0 1$ as a function of the overparameterization ratio $\phi / \psi$ for four different LJSDs $\mu _ { 1 } , \ldots , \mu _ { 4 }$ , chosen such that the only comparable pairs of LJSDs under the partial order in Def. $\boxed { 4 . 1 }$ are $\mu _ { 1 } \geq \mu _ { 4 }$ and $\mu _ { 2 } \geq \mu _ { 4 }$ , and the strict ordering of the error for those pairs is seen for all values of $\phi / \psi$ . The orange $\left( \mu _ { 2 } \right)$ and green $\left( \mu _ { 3 } \right)$ curves cross one another, illustrating how nonmonotonicity of overlap ratios in Def. $\boxed { 4 . 1 }$ can induce model-dependence in the ordering of the error. (c) Asymptotic predictions (solid lines) and simulations for $n _ { 0 } = 5 1 2$ (markers) for shifted versus unshifted error for models with varying values of the overparameterization ratio $\phi / \psi$ , obtained via Thm. 5.1 for the $( 3 , - 1 / 2 )$ -diatomic LJSD with $\phi = 0 . 5$ , $\sigma = \mathrm { R e L U }$ , $\sigma _ { \varepsilon } ^ { 2 } = 0 . 0 1$ , and $\gamma = 0 . 0 0 5$ . While the relationship is nearly linear in the overparameterized regime, it is markedly nonlinear in the underparameterized regime, highlighting the importance of overparameterization in Prop. 5.5.
267
+
268
+ Prop. 5.1 relies on a small label-noise condition $( \sigma _ { \varepsilon } ^ { 2 } \leq \omega )$ ) to ensure that the total error is ordered with respect to shift strength. The reason this condition is necessary is that the variance can actually increase as shifts become easier. While Fig. $\bigstar$ presented a configuration for which the bias, variance, and error all decrease for easier shifts, Fig. $\textcircled { 3 ( \mathrm { a } ) }$ shows that a decrease is not guaranteed for the variance, and that it can increase even under the small label-noise condition. Moreover, while the bias continues to decrease for large label noise $( \sigma _ { \epsilon } ^ { 2 } > \omega )$ ), the variance can become so large that bias can no longer offset it, causing the error itself to increase, as seen in Fig. 3(a).
269
+
270
+ The strict ordering of overlap coefficients in Def. $^ { 4 . 1 }$ are also necessary to guarantee a complete decoupling of the model and the shift strength. In the absence of these conditions, Fig. $\overline { { | 3 } } ( { \mathsf { b } } )$ shows how even a single out-of-order overlap coefficient induces a violation of the monotonicity with respect to shift strength suggested by Prop. $\boxed { 5 . 1 }$ (this example is detailed further in Sec. A8)
271
+
272
+ Finally, we note that the exact linear relationship between in-distribution and out-of-distribution generalization characterized by Prop. $5 . 5$ in Eq. $\textcircled { 1 9 }$ relies crucially on the overparameterization condition, $\psi < \phi$ , as evidenced in Fig. 3(c), which shows marked nonlinearity in the underparameterized regime. This observation is perhaps unsurprising, as severely underparameterized models tend towards chance predictions, which produce comparable errors on shifted and unshifted data. Indeed, similar nonlinear behavior is seen in the low-accuracy regime for realistic models [56, Figure 17].
273
+
274
+ # 6 Conclusion
275
+
276
+ We have presented an exact, asymptotic calculation of the test error, bias, and variance for random feature kernel regression in the presence of covariate shift. After defining a partial order over covariate shifts (motivated by the setting of linear regression), we have proved that harder shifts imply increased error. Our results capture many empirical phenomena such as the fact that overparameterization is beneficial even under covariate shift and that a linear relationship exists between the generalization error on shifted and unshifted data. Future directions include extending our results to the nonasymptotic regime, accommodating feature learning and more general neural network models, and investigating the impact of covariate shift for other loss functions.
277
+
278
+ # Acknowledgments and Disclosure of Funding
279
+
280
+ The authors would like to thank Rodolphe Jenatton, Horia Mania, Ludwig Schmidt, D. Sculley, Vaishaal Shankar, Lechao Xiao, and Steve Yadlowsky for valuable discussions.
281
+
282
+ This work was performed at and funded by Google. No third party funding was used.
283
+
284
+ # References
285
+
286
+ [1] B. Adlam, J. Levinson, and J. Pennington. A random matrix perspective on mixtures of nonlinearities for deep learning. arXiv preprint arXiv:1912.00827, 2019.
287
+ [2] B. Adlam and J. Pennington. The neural tangent kernel in high dimensions: Triple descent and a multi-scale theory of generalization. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 74–84. PMLR, 2020.
288
+ [3] B. Adlam and J. Pennington. Understanding double descent requires a fine-grained bias-variance decomposition. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 11022–11032. Curran Associates, Inc., 2020.
289
+ [4] M. S. Advani, A. M. Saxe, and H. Sompolinsky. High-dimensional dynamics of generalization error in neural networks. Neural Networks, 132:428–446, 2020.
290
+ [5] M. Banna, F. Merlevède, and M. Peligrad. On the limiting spectral distribution for a large class of symmetric random matrices with correlated entries. Stochastic Processes and their Applications, 125(7):2700–2726, 2015.
291
+ [6] M. Banna, J. Najim, and J. Yao. A CLT for linear spectral statistics of large random informationplus-noise matrices. Stochastic Processes and their Applications, 130(4):2250–2281, 2020.
292
+ [7] P. L. Bartlett, A. Montanari, and A. Rakhlin. Deep learning: a statistical viewpoint, 2021.
293
+ [8] C. J. Becker, C. M. Christoudias, and P. Fua. Non-linear domain adaptation with boosting. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc., 2013.
294
+ [9] M. Belkin, D. Hsu, S. Ma, and S. Mandal. Reconciling modern machine-learning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849–15854, 2019.
295
+ [10] S. Ben-David, J. Blitzer, K. Crammer, and F. Pereira. Analysis of representations for domain adaptation. In B. Schölkopf, J. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems, volume 19. MIT Press, 2007.
296
+ [11] C. Cortes and M. Mohri. Domain adaptation and sample bias correction theory and algorithm for regression. Theor. Comput. Sci., 519:103–126, 2014.
297
+ [12] A. D’Amour, K. Heller, D. Moldovan, B. Adlam, B. Alipanahi, A. Beutel, C. Chen, J. Deaton, J. Eisenstein, M. D. Hoffman, et al. Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395, 2020.
298
+ [13] Y. Deshpande and A. Montanari. Sparse pca via covariance thresholding. Journal of Machine Learning Research, 17(141):1–41, 2016.
299
+ [14] E. Dobriban and S. Wager. High-dimensional asymptotics of prediction: Ridge regression and classification. The Annals of Statistics, 46(1):247 – 279, 2018.
300
+ [15] J. Duchi, T. Hashimoto, and H. Namkoong. Distributionally robust losses for latent covariate mixtures, 2020.
301
+ [16] J. C. Duchi and H. Namkoong. Learning models with uniform performance via distributionally robust optimization. The Annals of Statistics, 49(3):1378 – 1406, 2021.
302
+
303
+ [17] L. Erdos. The matrix dyson equation and its applications for random matrices. arXiv preprint arXiv:1903.10060, 2019.
304
+
305
+ [18] L. Erdos, H.-T. Yau, and J. Yin. Bulk universality for generalized wigner matrices. ˝ Probability Theory and Related Fields, 154(1-2):341–407, 2012.
306
+
307
+ [19] R. R. Far, T. Oraby, W. Bryc, and R. Speicher. Spectra of large block matrices. arXiv preprint cs/0610045, 2006.
308
+
309
+ [20] X. Glorot, A. Bordes, and Y. Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML’11, page 513–520, Madison, WI, USA, 2011. Omnipress.
310
+
311
+ [21] I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. MIT press, 2016.
312
+
313
+ [22] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In Y. Bengio and Y. LeCun, editors, 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015.
314
+
315
+ [23] G. Grimmett. Percolation. In Percolation, pages 1–31. Springer, 1999.
316
+
317
+ [24] T. Hastie, A. Montanari, S. Rosset, and R. J. Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
318
+
319
+ [25] J. W. Helton, T. Mai, and R. Speicher. Applications of realizations (aka linearizations) to free probability. Journal of Functional Analysis, 274(1):1–79, 2018.
320
+
321
+ [26] D. Hendrycks, S. Basart, N. Mu, S. Kadavath, F. Wang, E. Dorundo, R. Desai, T. Zhu, S. Parajuli, M. Guo, D. Song, J. Steinhardt, and J. Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pages 8340–8349, October 2021.
322
+
323
+ [27] D. Hendrycks and T. G. Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019.
324
+
325
+ [28] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, page 448–456. JMLR.org, 2015.
326
+
327
+ [29] A. Jacot, F. Gabriel, and C. Hongler. Neural tangent kernel: Convergence and generalization in neural networks. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, NIPS’18, page 8580–8589, Red Hook, NY, USA, 2018. Curran Associates Inc.
328
+
329
+ [30] D. Kobak, J. Lomond, and B. Sanchez. The optimal ridge penalty for real-world highdimensional data can be zero or negative due to the implicit ridge regularization. Journal of Machine Learning Research, 21(169):1–16, 2020.
330
+
331
+ [31] P. W. Koh, S. Sagawa, H. Marklund, S. M. Xie, M. Zhang, A. Balsubramani, W. Hu, M. Yasunaga, R. L. Phillips, I. Gao, T. Lee, E. David, I. Stavness, W. Guo, B. Earnshaw, I. Haque, S. M. Beery, J. Leskovec, A. Kundaje, E. Pierson, S. Levine, C. Finn, and P. Liang. Wilds: A benchmark of in-the-wild distribution shifts. 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 5637–5664. PMLR, 18–24 Jul 2021.
332
+
333
+ [32] A. Kumar, T. Ma, and P. Liang. Understanding self-training for gradual domain adaptation. In H. D. III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 5468–5479. PMLR, 13–18 Jul 2020.
334
+
335
+ [33] J. Lee, Y. Bahri, R. Novak, S. S. Schoenholz, J. Pennington, and J. Sohl-Dickstein. Deep neural networks as gaussian processes. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
336
+
337
+ [34] J. Lee, S. Schoenholz, J. Pennington, B. Adlam, L. Xiao, R. Novak, and J. Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 15156–15172. Curran Associates, Inc., 2020.
338
+
339
+ [35] Z. Liao, R. Couillet, and M. W. Mahoney. A random matrix analysis of random fourier features: beyond the gaussian kernel, a precise phase transition, and the corresponding double descent. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 13939–13950. Curran Associates, Inc., 2020.
340
+
341
+ [36] M. Long, H. Zhu, J. Wang, and M. I. Jordan. Unsupervised domain adaptation with residual transfer networks. In Proceedings of the 30th International Conference on Neural Information Processing Systems, NIPS’16, page 136–144, Red Hook, NY, USA, 2016. Curran Associates Inc.
342
+
343
+ [37] M. Long, H. Zhu, J. Wang, and M. I. Jordan. Deep transfer learning with joint adaptation networks. In D. Precup and Y. W. Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 2208– 2217, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR.
344
+
345
+ [38] C. Louart, Z. Liao, R. Couillet, et al. A random matrix approach to neural networks. The Annals of Applied Probability, 28(2):1190–1248, 2018.
346
+
347
+ [39] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net, 2018.
348
+
349
+ [40] H. Mania and S. Sra. Why do classifier accuracies show linear trends under distribution shift?, 2021.
350
+
351
+ [41] S. Mei and A. Montanari. The generalization error of random features regression: Precise asymptotics and the double descent curve. Communications on Pure and Applied Mathematics, 06 2021.
352
+
353
+ [42] G. Mel and S. Ganguli. A theory of high dimensional regression with arbitrary correlations between input features and target functions: sample complexity, multiple descent curves and a hierarchy of phase transitions. 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 7578–7587. PMLR, 18–24 Jul 2021.
354
+
355
+ [43] J. Miller, K. Krauth, B. Recht, and L. Schmidt. The effect of natural distribution shift on question answering models. In H. D. III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 6905–6916. PMLR, 13–18 Jul 2020.
356
+
357
+ [44] J. P. Miller, R. Taori, A. Raghunathan, S. Sagawa, P. W. Koh, V. Shankar, P. Liang, Y. Carmon, and L. Schmidt. Accuracy on the line: on the strong correlation between out-of-distribution and in-distribution generalization. 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 7721–7735. PMLR, 18–24 Jul 2021.
358
+
359
+ [45] J. A. Mingo and R. Speicher. Free probability and random matrices, volume 35. Springer, 2017.
360
+
361
+ [46] Z. Nado, S. Padhy, D. Sculley, A. D’Amour, B. Lakshminarayanan, and J. Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv preprint arXiv:2006.10963, 2020.
362
+
363
+ [47] V. Nagarajan and J. Z. Kolter. Uniform convergence may be unable to explain generalization in deep learning. 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.
364
+ [48] R. M. Neal. Priors for infinite networks. In Bayesian Learning for Neural Networks, pages 29–53. Springer, 1996.
365
+ [49] B. Neyshabur, S. Bhojanapalli, D. Mcallester, and N. Srebro. Exploring generalization in deep learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
366
+ [50] Y. Ovadia, E. Fertig, J. Ren, Z. Nado, D. Sculley, S. Nowozin, J. Dillon, B. Lakshminarayanan, and J. Snoek. Can you trust your models uncertainty? evaluating predictive uncertainty under dataset shift. 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.
367
+ [51] S. Péché et al. A note on the pennington-worah distribution. Electronic Communications in Probability, 24, 2019.
368
+ [52] J. Pennington and P. Worah. Nonlinear random matrix theory for deep learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
369
+ [53] J. Pennington and P. Worah. The spectrum of the fisher information matrix of a single-hiddenlayer neural network. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
370
+ [54] A. Rahimi and B. Recht. Random features for large-scale kernel machines. In J. Platt, D. Koller, Y. Singer, and S. Roweis, editors, Advances in Neural Information Processing Systems, volume 20. Curran Associates, Inc., 2008.
371
+ [55] B. Recht, R. Roelofs, L. Schmidt, and V. Shankar. Do cifar-10 classifiers generalize to cifar-10? arXiv preprint arXiv:1806.00451, 2018.
372
+ [56] B. Recht, R. Roelofs, L. Schmidt, and V. Shankar. Do imagenet classifiers generalize to imagenet? In K. Chaudhuri and R. Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, volume 97 of Proceedings of Machine Learning Research, pages 5389–5400. PMLR, 2019.
373
+ [57] D. Richards, J. Mourtada, and L. Rosasco. Asymptotics of ridge(less) regression under general source condition. In A. Banerjee and K. Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 3889–3897. PMLR, 13–15 Apr 2021.
374
+ [58] D. V. Rosen. On moments of the inverted wishart distribution. Statistics, 30(3):259–278, 1997.
375
+ [59] S. Sagawa, P. W. Koh, T. B. Hashimoto, and P. Liang. Distributionally robust neural networks. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
376
+ [60] L. Schmidt, S. Santurkar, D. Tsipras, K. Talwar, and A. Madry. Adversarially robust generalization requires more data. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
377
+ [61] V. Shankar, A. Fang, W. Guo, S. Fridovich-Keil, J. Ragan-Kelley, L. Schmidt, and B. Recht. Neural kernels without tangents. In H. D. III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 8614–8623. PMLR, 13–18 Jul 2020.
378
+ [62] M. Sugiyama, M. Krauledat, and K.-R. Müller. Covariate shift adaptation by importance weighted cross validation. Journal of Machine Learning Research, 8(35):985–1005, 2007.
379
+ [63] R. Taori, A. Dave, V. Shankar, N. Carlini, B. Recht, and L. Schmidt. Measuring robustness to natural distribution shifts in image classification. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 18583–18599. Curran Associates, Inc., 2020.
380
+ [64] N. Tripuraneni, B. Adlam, and J. Pennington. Covariate shift in high-dimensional random feature regression. arXiv preprint arXiv:2111.08234, 2021.
381
+ [65] R. Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2018.
382
+ [66] M. J. Wainwright. High-Dimensional Statistics: A Non-Asymptotic Viewpoint. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2019.
383
+ [67] D. Wu and J. Xu. On the optimal weighted $\ell _ { 2 }$ regularization in overparameterized linear regression. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 10112–10123. Curran Associates, Inc., 2020.
384
+ [68] Z. Yang, Y. Bai, and S. Mei. Exact gap between generalization error and uniform convergence in random feature models. In M. Meila and T. Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pages 11704–11715. PMLR, 2021.
385
+ [69] H. Zhao, R. T. D. Combes, K. Zhang, and G. Gordon. On learning invariant representations for domain adaptation. In K. Chaudhuri and R. Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 7523–7532. PMLR, 09–15 Jun 2019.
386
+ [70] H. Zhao, S. Zhang, G. Wu, J. M. F. Moura, J. P. Costeira, and G. J. Gordon. Adversarial multiple source domain adaptation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018.
md/train/SJlDDnVKwS/SJlDDnVKwS.md ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IMPROVING EVOLUTIONARY STRATEGIES WITH GENERATIVE NEURAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Evolutionary Strategies (ES) are a popular family of black-box zeroth-order optimization algorithms which rely on search distributions to efficiently optimize a large variety of objective functions. This paper investigates the potential benefits of using highly flexible search distributions in ES algorithms, in contrast to standard ones (typically Gaussians). We model such distributions with Generative Neural Networks (GNNs) and introduce a new ES algorithm that leverages their expressiveness to accelerate the stochastic search. Because it acts as a plug-in, our approach allows to augment virtually any standard ES algorithm with flexible search distributions. We demonstrate the empirical advantages of this method on a diversity of objective functions.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ We are interested in the global minimization of a black-box objective function, only accessible through a zeroth-order oracle. In many instances of this problem the objective is expensive to evaluate, which excludes brute force methods as a reasonable mean of optimization. Also, as the objective is potentially non-convex and multi-modal, its global optimization cannot be done greedily but requires a careful balance between exploitation and exploration of the optimization landscape (the surface defined by the objective).
12
+
13
+ The family of algorithms used to tackle such a problem is usually dictated by the cost of one evaluation of the objective function (or equivalently, by the maximum number of function evaluations that are reasonable to make) and by a precision requirement. For instance, Bayesian Optimization (Jones et al., 1998; Shahriari et al., 2016) targets problems of very high evaluation cost, where the global minimum must be approximately discovered after a few hundreds of function evaluations. When aiming for a higher precision and hence having a larger budget (e.g. thousands of function evaluations), a popular algorithm class is the one of Evolutionary Strategies (ES) (Rechenberg, 1978; Schwefel, 1977), a family of heuristic search procedures.
14
+
15
+ ES algorithms rely on a search distribution, which role is to propose queries of potentially small value of the objective function. This search distribution is almost always chosen to be a multivariate Gaussian. It is namely the case of the Covariance Matrix Adaptation Evolution Strategies (CMA-ES) (Hansen & Ostermeier, 2001), a state-of-the-art ES algorithm made popular in the machine learning community by its good results on hyper-parameter tuning (Friedrichs & Igel, 2005; Loshchilov & Hutter, 2016). It is also the case for Natural Evolution Strategies (NES) (Wierstra et al., 2008) algorithms, which were recently used for direct policy search in Reinforcement Learning (RL) and shown to compete with state-of-the-art MDP-based RL techniques (Salimans et al., 2017). Occasionally, other distributions have been used; e.g. fat-tails distributions like the Cauchy were shown to outperform the Gaussian for highly multi-modal objectives (Schaul et al., 2011).
16
+
17
+ We argue in this paper that in ES algorithms, the choice of a standard parametric search distribution (Gaussian, Cauchy, ..) constitutes a potentially harmful implicit constraint for the stochastic search of a global minimum. To overcome the limitations of classical parametric search distributions, we propose using flexible distributions generated by bijective Generative Neural Networks (GNNs), with computable and differentiable log-probabilities. We discuss why common existing optimization methods in ES algorithms cannot be directly used to train such models and design a tailored algorithm that efficiently train GNNs for an ES objective. We show how this new algorithm can readily incorporate existing ES algorithms that operates on simple search distributions,
18
+
19
+ # Algorithm 1: Generic ES procedure
20
+
21
+ input: zeroth-order oracle on $f$ , distribution $\pi _ { 0 }$ , population size $\lambda$ repeat
22
+
23
+ (Sampling) Sample $x _ { 1 } , \dotsc , x _ { \lambda } \stackrel { \mathrm { i . i . d } } { \sim } \pi _ { t }$
24
+ (Evaluation) Evaluate $f ( x _ { 1 } ) , \ldots , f ( x _ { n } )$ .
25
+ (Update) Update $\pi _ { t }$ to produce $x$ of potentially smaller objective values. ntil convergence;
26
+
27
+ like the Gaussian. On a variety of objective functions, we show that this extension can significantly accelerate ES algorithms.
28
+
29
+ We formally introduce the problem and provide background on Evolutionary Strategies in Section 2. We discuss the role of GNNs in generating flexible search distributions in Section 3. We explain why usual algorithms fail to train GNNs for an ES objective and introduce a new algorithm in Section 4. Finally we report experimental results in Section 5.
30
+
31
+ # 2 PRELIMINARIES
32
+
33
+ In what follows, the real-valued objective function $f$ is defined over a compact $\mathcal { X }$ and $\pi$ will generically denote a probability density function over $\mathcal { X }$ . We consider the global optimization of $f$ :
34
+
35
+ $$
36
+ x ^ { * } \in \operatorname { a r g m i n } _ { x \in \mathcal { X } } f ( x )
37
+ $$
38
+
39
+ # 2.1 EVOLUTIONARY STRATEGIES
40
+
41
+ The generic procedure followed by ES algorithms is presented in Algorithm 1. To make the update step tractable, the search distribution is tied to a family of distributions and parametrized by a realvalued parameter vector $\theta$ (e.g. the mean and covariance matrix of a Gaussian), and is referred to as $\pi _ { \theta }$ . This update step constitutes the main difference between ES algorithms.
42
+
43
+ Natural Evolution Strategies One principled way to perform that update is to minimize the expected objective value over samples $x$ drawn from $\pi _ { \theta }$ . Indeed, when the search distribution is parametric and tied to a parameter $\theta$ , this objective can be differentiated with respect to $\theta$ thanks to the log-trick:
44
+
45
+ $$
46
+ J ( \theta ) \triangleq \mathbb { E } _ { \pi _ { \theta } } \left[ f ( x ) \right] \qquad { \mathrm { ~ a n d ~ } } \qquad { \frac { \partial J ( \theta ) } { \partial \theta } } = \mathbb { E } _ { \pi _ { \theta } } \left[ f ( x ) { \frac { \partial \log \pi _ { \theta } ( x ) } { \partial \theta } } \right]
47
+ $$
48
+
49
+ This quantity can be approximated from samples - it is known as the score-function or REINFORCE (Williams, 1992) estimator, and provides a direction of update for $\theta$ . Unfortunately, naively following a stochastic version of the gradient $( 2 ) - \mathtt { a }$ procedure called Plain Gradient Evolutionary Strategies (PGES) – is known to be highly ineffective. PGES main limitation resides in its instability when the search distribution is concentrating, making it unable to precisely locate any local minimum. To improve over the PGES algorithm the authors of Wierstra et al. (2008) proposed to descend $J ( \theta )$ along its natural gradient (Amari, 1998). More precisely, they introduce a trust-region optimization scheme to limit the instability of PGES, and minimize a linear approximation of $J ( \theta )$ under a Kullback-Leibler (KL) divergence constraint:
50
+
51
+ $$
52
+ \begin{array} { r l } { \underset { \delta \theta } { \operatorname { a r g m i n } } } & { { } J ( \theta + \delta \theta ) \simeq J ( \theta ) + \delta \theta ^ { T } \nabla _ { \theta } J ( \theta ) \quad \mathrm { s . t } \quad \mathrm { K L } ( \pi _ { \theta + \delta \theta } | | \pi _ { \theta } ) \leq \epsilon } \end{array}
53
+ $$
54
+
55
+ To avoid solving analytically the trust region problem (3), Wierstra et al. (2008) shows that its solution can be approximated by:
56
+
57
+ $$
58
+ \begin{array} { r } { \delta \theta ^ { * } \propto - F _ { \theta } ^ { - 1 } \nabla _ { \theta } J ( \theta ) \quad \mathrm { w h e r e } \quad F _ { \theta } = \mathbb { E } _ { \pi _ { \theta } } \left[ \nabla _ { \theta } \log \pi _ { \theta } ( x ) \nabla _ { \theta } \log \pi _ { \theta } ( x ) ^ { T } \right] } \end{array}
59
+ $$
60
+
61
+ is the Fischer Information Matrix (FIM) of $\pi _ { \theta }$ . The parameter $\theta$ is therefore not updated along the negative gradient of $J$ but rather along $F _ { \theta } ^ { - 1 } \nabla _ { \theta } J ( \theta )$ , a quantity known as the natural gradient. The FIM $F _ { \theta }$ is known analytically when $\pi _ { \theta }$ is a multivariate Gaussian and the resulting algorithm, Exponential Natural Evolutionary Strategies (xNES) (Glasmachers et al., 2010) has been shown to reach state-of-the-art performances on a large ES benchmark.
62
+
63
+ ![](images/4a34bd041023d6a274a1434d891b09ef4bfa2b2897ede2637a57dec5d6d07344.jpg)
64
+ Figure 2: Example of an undesirable behavior of a Gaussian search distribution. The dashed lines represent density level lines of the search distribution. Because the latter cannot have a curved profile, it is forced to drastically reduce its entropy until it reaches the straight part of the valley.
65
+
66
+ CMA-ES Naturally, there exist other strategies to update the search distribution $\pi _ { \theta }$ . For instance, CMA-ES relies on a variety of heuristic mechanisms like covariance matrix adaptation and evolution paths, but is only defined when $\pi _ { \theta }$ is a multivariate Gaussian. Explaining such mechanisms would be out of the scope of this paper, but the interested reader is referred to the work of Hansen (2016) for a detailed tutorial on CMA-ES.
67
+
68
+ # 2.2 LIMITATIONS OF CLASSICAL SEARCH DISTRIBUTIONS
69
+
70
+ ES implicitly balance the need for exploration and exploitation of the optimization landscape. The exploitation phase consists in updating the search distribution, and exploration happens when samples are drawn from the search distribution’s tails. The key role of the search distribution is therefore to produce a support adapted to the landscape’s structure, so that new points are likely to improve over previous samples.
71
+
72
+ We argue here that the choice of a given parametric distribution (the multivariate Gaussian distribution being overwhelmingly represented in state-of-the-art ES algorithms) constitutes a potentially harmful implicit constraint for the stochastic search of a global minimum. For instance, a Gaussian distribution is not adapted to navigate a curved valley because of its inability to continuously curve its density. This lack of flexibility will lead it to drastically reduce its entropy, until the curved valley looks locally straight. At this point, the ES algorithm resembles a hill-climber and barely takes advantage of the exploration abilities of the search distribution. An illustration of this phenomenon is presented in Figure 2 on the Rosenbrock function. Another limitation of classical search distribution is their inability to follow multiple hypothesis, that is to explore at the same time different local minima. Even if mixture models can show such flexibility, hyper-parameters like the number of mixtures have optimal values that are impossible to guess a priori.
73
+
74
+ We want to introduce flexible search distributions to overcome these limitations. Such distributions should, despite their expressiveness, be easily trainable. We should also be concerned when designing them with their role in the exploration/exploitation trade off: a search distribution with too much capacity could over-fit some seemingly good samples, leading to premature convergence. To sum-up, we want to design search-distributions that are:
75
+
76
+ • more flexible than classical distributions
77
+ • yet easily trainable
78
+ • while keeping control over the exploration / exploitation trade-off
79
+
80
+ In the following section, we carefully investigate the class of Generative Neural Networks (GNNs) to find a parametric class of distributions satisfying such properties.
81
+
82
+ # 3 FLEXIBLE SEARCH DISTRIBUTIONS WITH GNNS
83
+
84
+ Generative Neural Networks (MacKay, 1995) have been studied in the context of density estimation and shown to be able to model complex and highly multimodal distributions (Srivastava et al., 2017). We propose here to leverage their expressiveness for ES, and train them in a principled way thanks to the ES objective:
85
+
86
+ $$
87
+ J ( \pi ) = \mathbb { E } _ { \pi } \left[ f ( x ) \right]
88
+ $$
89
+
90
+ As discussed in Section 2, optimizing $J ( \pi )$ with gradient-based methods is possible through the score-function estimator, which requires to be able to compute and efficiently differentiate the logprobabilities of $\pi$ .
91
+
92
+ # 3.1 GNN BACKGROUND
93
+
94
+ The core idea behind a GNN is to map a latent variable $z \in { \mathcal { Z } }$ drawn from a known distribution $\nu _ { \omega }$ to an output variable $x = g _ { \eta } ( z )$ where $g _ { \eta }$ is the forward-pass of a neural network. The parameter $\eta$ represents the weights of this neural network while $\omega$ describe the degrees of freedom of the latent space distribution $\nu _ { \omega }$ . We denote $\theta = ( \omega , \eta )$ and $\pi _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ the density of the output variable $x$ .
95
+
96
+ For general neural network architectures, it is impossible to compute $\pi _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ for samples $x$ drawn from the GNN. This is namely why their are often trained with adversarial methods (Goodfellow et al., 2014) for sample generation purposes, bypassing the need of computing densities, but at the expense of a good density estimation (mode-dropping). An alternative to adversarial methods was proposed with variational auto-encoders (Kingma & Welling, 2013) however at the cost of learning two neural networks (an encoder and a decoder). A less computationally expensive method consists in restricting the possible architectures to build bijective GNNs, also known as Normalizing Flows (NF) (Rezende & Mohamed, 2015; Papamakarios et al., 2017), which allows the exact computation of the distribution’s density. Indeed, if $g _ { \eta }$ is a bijection from $\mathcal { Z }$ to $\mathcal { X }$ with inverse $h _ { \eta } \triangleq g _ { \eta } ^ { - 1 }$ , the change of variable formula provides a way to compute $\pi _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ :
97
+
98
+ $$
99
+ \pi _ { \boldsymbol { \theta } } ( x ) = \nu _ { \omega } ( h _ { \eta } ( x ) ) \cdot \left| \frac { \partial h _ { \eta } ( x ) } { \partial x } \right|
100
+ $$
101
+
102
+ To have a tractable density one therefore needs to ensure that the determinant of the Jacobian $| \partial h _ { \eta } ( x ) / \partial x |$ is easily computable. Several models satisfying these two properties $i . e$ bijectivity and computable Jacobian) have been proposed for density estimation (Rippel & Adams, 2013; Dinh et al., 2014; 2016), and proved their expressiveness despite their relatively simple structure.
103
+
104
+ NFs therefore answer two of our needs when building our new search distribution: flexibility and easiness to train. In this work, we will focus on one NF model: the Non-Linear Independent Component Estimation (Dinh et al., 2014) (NICE) model, for its numerical stability and volume preserving properties.
105
+
106
+ # 3.2 NICE MODEL
107
+
108
+ The authors of NICE proposed to build complex yet invertible transformations through the use of additive coupling layers. An additive coupling layer leaves half of its input unchanged, and adds a non-linear transformation of the first half to the second half. More formally, by noting $\boldsymbol { v } = [ v _ { 1 } , v _ { 2 } ]$ the output of a coupling layer and $u = [ u _ { 1 } , u _ { 2 } ]$ its input, one has:
109
+
110
+ $$
111
+ v _ { 1 } = u _ { 1 } \quad \mathrm { a n d } \quad v _ { 2 } = u _ { 2 } + t ( u _ { 1 } )
112
+ $$
113
+
114
+ where $t$ is an arbitrarily complex transformation - modelled by a Multi-Layer Perceptron (MLP) with learnable weights and biases. This transformation has unit Jacobian determinant and is easily invertible:
115
+
116
+ $$
117
+ u _ { 1 } = v _ { 1 } \quad \mathrm { a n d } \quad u _ { 2 } = v _ { 2 } - t ( v _ { 1 } )
118
+ $$
119
+
120
+ and only requires a feed-forward pass on the MLP $t$ . The choice of the decomposition $u = [ u _ { 1 } , u _ { 2 } ]$ can be arbitrary, and is performed by applying a binary filter to the input. By stacking additive coupling layers, one can create complex distributions, and the inversion of the resulting mapping is independent of the complexity of the neural networks $t$ . The density of the resulting distribution is readily computable thanks to the inverse transform theorem (5).
121
+
122
+ # 3.3 VOLUME PRESERVING PROPERTIES
123
+
124
+ The transformation induced by NICE is volume preserving (it has a unitary Jacobian determinant). This is quite desirable in a ES context, as the role of concentrating the distribution on a minimum can be left to the latent space distribution $\nu _ { \omega }$ . The role of the additive coupling layers is therefore only to introduce non-linearities in the inverse transform $h _ { \eta }$ so that the distribution is better adapted to the optimization landscape. The fact that this fit is volume-preserving (every subset of the latent space has an image in the data space with the same probability mass) encourages the search distribution to align its tails with regions of small value of the optimization landscape, which is likely to improve the quality of future exploration steps. The NICE model therefore fits perfectly our needs for a flexible search distribution that is easy to train, and that provides enough control on the exploration / exploitation trade-off. Other bijective GNN models like the Real-NVP (Dinh et al., 2016) introduce non-volume preserving transformations, which cannot provide such a control. In practice, we observed that using such transformations for ES led to early concentration and premature convergence.
125
+
126
+ # 4 AN EFFICIENT TRAINING ALGORITHM
127
+
128
+ We are now equipped with enough tools to use GNNs for ES: an adapted model (NICE) for our search distribution $\pi _ { \theta }$ , and an objective to train it with:
129
+
130
+ $$
131
+ J ( \theta ) = \mathbb { E } _ { \pi _ { \theta } } \left[ f ( x ) \right]
132
+ $$
133
+
134
+ Here, $\theta$ describes jointly the free parameters of the latent distribution $\nu _ { \omega }$ and $\eta$ , the weights and biases of the MLPs forming the additive coupling layers.
135
+
136
+ We start this section by explaining why existing training strategies based on the objective (8) are not sufficient to truly leverage the flexibility of GNNs for ES, before introducing a new algorithm tailored for this task.
137
+
138
+ # 4.1 LIMITATIONS OF EXISTING TRAINING STRATEGIES
139
+
140
+ We found that the PGES algorithm (naive stochastic gradient descent of (8) with the score-function estimator) applied to the NICE distribution suffers from the same limitations as when applied to the Gaussian; it is inable to precisely locate any local minimum. As for the Gaussian, training the NICE distribution for ES requires employing more sophisticated algorithms - such as NES.
141
+
142
+ However, using the natural gradient for the GNNs distributions is not trivial. First the Fischer Information Matrix $F _ { \theta }$ is not known analytically and must be estimated via Monte-Carlo sampling, thereby introducing approximation errors. Also, we found that the approximations justifying to follow the descent direction provided by the natural gradient are not adapted to the NICE distribution. Indeed, the assumption behind the NES update (4) is that the loss $\bar { \boldsymbol { J } } ( \theta )$ can be (locally) well approximated by the quadratic objective:
143
+
144
+ $$
145
+ J ( \theta + \delta \theta ) = J ( \theta ) + \delta \theta ^ { T } \nabla _ { \theta } J ( \theta ) + \frac { \gamma } { 2 } \delta \theta ^ { T } F _ { \theta } \delta \theta
146
+ $$
147
+
148
+ where $\gamma$ is a given non-negative Lagrange multiplier. For NICE, given the highly non-linear nature of $\pi _ { \theta }$ this approximation is bound to fail even close to the current parameter $\theta$ and will lead to spurious updates. A classical technique (Martens, 2010) to avoid such updates is to artificially increase the curvature of the quadratic term, and is known as damping. Practically, this implies using $F _ { \theta } + \beta I$ instead of $F _ { \theta }$ as the local curvature metric, with $\beta$ a non-negative damping parameter.
149
+
150
+ We found that to ensure continuous decrease of $J ( \theta )$ , and because of its highly non-linear nature when using the GNNs, the damping parameter $\beta$ has to be set to such high values that the modifications of the search distribution are too small to quickly make progress and by no means reaches state-of-the-art performances. We observed that even if the training of the additive coupling layers is performed correctly (i.e the distribution has the correct shape), high damping of the latent space parameters prevents the distribution from quickly concentrating when a minimum is found.
151
+
152
+ It is unclear how the damping parameter should be adapted to avoid spurious update, while still allowing the distribution to make large step in the latent space and ensure fast concentration when needed. In the following, we present an alternated minimization scheme to bypass the issues raised by natural gradient training for GNN distributions in a ES context.
153
+
154
+ # 4.2 ALTERNATING MINIMIZATION
155
+
156
+ So far, we used the parameter $\theta$ to describe both $\omega$ and $\eta$ (respectively, the free parameters of the latent space distribution $\nu _ { \omega }$ and the degrees of freedom of the non-linear mapping $g _ { \eta , \ l }$ ), and the
157
+
158
+ optimization over all these parameters was performed jointly. Separating the roles of $\omega$ and $\eta$ , the initial objective (2) can be rewritten as follows:
159
+
160
+ $$
161
+ J ( \theta ) = \mathbb { E } _ { z \sim \nu _ { \omega } } \left[ f ( g _ { \eta } ( z ) ) \right] = J ( \omega , \eta )
162
+ $$
163
+
164
+ Therefore, the initial objective can be rewritten as the expected value of samples drawn from the latent distribution, under the objective $f \circ g _ { \eta }$ - that is, the representation of the objective function $f$ in the latent space. If $\nu _ { \omega }$ is a standard distribution (i.e efficiently trainable with the natural gradient) and $f \circ g _ { \eta }$ is a well structured function (i.e one for which $\nu _ { \omega }$ is an efficient search distribution), then the single optimization of $\omega$ by classical methods (such as the natural gradient) should avoid the limitations discussed in 2.2. This new representation motivates the design of a new training algorithm that optimizes the parameters $\omega$ and $\eta$ separately.
165
+
166
+ Alternating Minimization In the following, we will replace the notation $\pi _ { \theta }$ with $\pi _ { \omega , \eta }$ to refer to the NICE distribution with parameter $\theta = ( \omega , \eta )$ . We want to optimize $\omega$ and $\eta$ in an alternate fashion, which means performing the following updates at every step of the ES procedure:
167
+
168
+ $$
169
+ \begin{array} { l } { \omega _ { t + 1 } = \underset { \omega } { \operatorname { a r g m i n } } J ( \omega , \eta _ { t } ) } \\ { \eta _ { t + 1 } = \underset { \eta } { \operatorname { a r g m i n } } J ( \omega _ { t + 1 } , \eta ) } \end{array}
170
+ $$
171
+
172
+ This means that at iteration $t$ , samples are drawn from $\pi _ { \omega _ { t } , \eta _ { t } }$ and serve to first optimize the latent space distribution parameters $\omega$ , and then the additive coupling layers parameters $\eta$ . For the following iteration, the population is sampled under πωt+1,ηt+1 .
173
+
174
+ The update (11a) of the latent space parameters is naturally derived from the new representation (10) of the initial objective. Indeed, $\omega$ can be updated via natural gradient ascent of $J ( \omega , \eta _ { t } )$ - that is with keeping $\eta = \eta _ { t }$ fixed. Practically, this therefore reduces to applying a NES algorithm to the latent distribution $\nu _ { \omega }$ on the modified objective function $f \circ g _ { \eta _ { t } }$ .
175
+
176
+ Once the latent space parameters updated, the coupling layers parameters should be optimized with respect to:
177
+
178
+ $$
179
+ J ( \omega _ { t + 1 } , \eta ) = \mathbb { E } _ { \pi _ { \omega _ { t + 1 } , \eta } } \left[ f ( x ) \right]
180
+ $$
181
+
182
+ At this stage, the only available samples are drawn under $\pi _ { \omega _ { t } , \eta _ { t } }$ . To estimate, based on these samples, expectations under $\pi _ { \omega _ { t + 1 } , \eta _ { t } }$ one must use importance propensity scores:
183
+
184
+ $$
185
+ J ( \omega _ { t + 1 } , \eta ) = \mathbb { E } _ { \pi _ { \omega _ { t } , \eta _ { t } } } \left[ f ( x ) \frac { \pi _ { \omega _ { t + 1 } , \eta } ( x ) } { \pi _ { \omega _ { t } , \eta _ { t } } ( x ) } \right]
186
+ $$
187
+
188
+ The straightforward minimization of this off-line objective is known to lead to degeneracies (Swaminathan & Joachims, 2015, Section 4), and must therefore be regularized. For our application, it is also desirable to make sure that the update $\eta$ does not undo the progress made in the latent space - in other words, we want to regularize the change in $f \circ g _ { \eta }$ . To that extent, we adopt a technique proposed in Schulman et al. (2017) and minimize a modification on the initial objective with clipped propensity weights:
189
+
190
+ $$
191
+ \eta _ { t + 1 } = \underset { \eta } { \mathrm { a r g m i n } } \quad \mathbb { E } _ { \pi _ { \omega _ { t + 1 } } , \eta _ { t } } \left[ f ( x ) \mathrm { c l i p } _ { \varepsilon } \left( \frac { \pi _ { \omega _ { t + 1 } , \eta } ( x ) } { \pi _ { \omega _ { t + 1 } , \eta _ { t } } ( x ) } \right) \right]
192
+ $$
193
+
194
+ ${ \mathrm { c l i p } } _ { \varepsilon } ( x )$ clips the value of $x$ between $1 - \epsilon$ and $1 + \epsilon$ . The parameter $\varepsilon$ is an hyper-parameter that controls the change in distribution, and the program (14) can be efficiently solved via a gradient descent type algorithm, such as Adam (Kingma & Ba, 2014).
195
+
196
+ To sum up, we propose optimizing the latent distribution and the coupling layers separately. The latent space is optimized by natural gradient descent, and the coupling layers via an off-policy objective with clipped propensity weights. We call this algorithm GNN-ES for Generative Neural Networks Evolutionary Strategies.
197
+
198
+ Latent space optimization It turns out the GNN-ES can be readily modified to incorporate virtually any existing ES algorithms that operates on the simple distribution $\nu _ { \omega }$ . For instance, if $\nu _ { \omega }$ is set to be a multivariate Gaussian with learnable mean and covariance matrix, the latent space optimization (11a) can be performed by either xNES or CMA-ES. This holds for any standard distribution $\nu _ { \omega }$ and any ES algorithm operating on that distribution. This remark allows us to place GNN-ES in a more general framework and to understand it as a way to improve existing ES algorithm, by providing a principled way to learn complex, non-linear transformations on top of rather standard search distributions (like the Gaussian). In what follows, we will use the GNN prefix in front of existing ES algorithm to describe its augmented version with our algorithm, working as a plug-in. Pseudo-code for this general algorithm can be found in Appendix B.
199
+
200
+ # 4.3 ADDITIONAL TOOLS
201
+
202
+ Using historic data ES algorithms typically use small populations of samples to estimate expectations. Such small sample sizes don’t allow for enough data exposure for the GNN to build a meaningful transformation $g _ { \eta }$ . To circumvent this problem, we augment the off-line program (14) with samples for past generations thanks to the fused importance sampling estimator (Peshkin & Shelton, 2002). This technique is classical in similar settings like MDP-based reinforcement learning and counterfactual reasoning (Nedelec et al., 2017; Agarwal et al., 2017) and proves to be essential for our problem. Formally, for a given horizon $T$ that controls how far we look in the past, this amounts to storing the samples $x$ drawn from $\pi _ { \theta _ { t - T + 1 } } , \ldots , \pi _ { \theta _ { t } }$ (as well as their respective scores) in a buffer $\mathcal { H } _ { T }$ . The objective (13) can then be rewritten as:
203
+
204
+ $$
205
+ \mathbb { E } _ { \pi _ { \omega _ { t } , \eta _ { t } } } \left[ f ( x ) \frac { \pi _ { \omega _ { t + 1 } , \eta } ( x ) } { \pi _ { \omega _ { t } , \eta _ { t } } ( x ) } \right] = T \cdot \mathbb { E } _ { x , f ( x ) \in \mathcal { H } _ { T } } \left[ f ( x ) \frac { \pi _ { \omega _ { t + 1 } , \eta } ( x ) } { \pi _ { \theta _ { t - T + 1 } } ( x ) + \dots + \pi _ { \theta _ { t } } ( x ) } \right]
206
+ $$
207
+
208
+ This technique allows to increase the data exposure of the GNN by using past samples (and therefore does not require additional function evaluations) and to reduce the variance of the off-line estimator of the original expectation (12) (Nedelec et al., 2017). To control the change in distribution, the fused propensity weights can then be clipped in a similar fashion than in the program (14).
209
+
210
+ Mode preserving properties To achieve improved exploration, the search distribution should align its tails with the level sets of the objective function. This is not guaranteed when performing the update step (14) since the GNN’s update could simply move the mean of the search distribution without shaping the tails. One way to encourage the GNN’s capacity to be allocated to the tails is to impose a mode-preserving property. If $\mu$ denotes the location of a mode of the latent distribution, then the mode of the distribution $\pi _ { \theta }$ generated by the NICE model is located in $g _ { \eta } ( \mu )$ (see Appendix A for the proof). It is therefore easy to build a map $f _ { \eta }$ based on the initial $g _ { \eta }$ that is mode-preserving:
211
+
212
+ $$
213
+ f _ { \eta } ( z ) \triangleq g _ { \eta } ( z ) - g _ { \eta } ( \mu ) + f _ { \eta _ { t } } ( \mu )
214
+ $$
215
+
216
+ where $\mu _ { t }$ denotes the mode of the latent distribution $\nu _ { \omega }$ at iteration $t$ . Defined as such, $f _ { \eta }$ preserves the mode of the previous search distribution (since $f _ { \eta _ { t + 1 } } ( \mu ) = f _ { \eta _ { t } } ( \mu ) )$ , is trivially still a bijection and remains volume preserving. Using the push-forward map $f _ { \eta }$ instead of $g _ { \eta }$ , we explicitly push the flexibility brought by the GNN to impact only the tails of the search distribution. As detailed in an ablation study presented in Appendix F, this additional tool turns out to be essential in order to use GNNs for ES.
217
+
218
+ # 5 EXPERIMENTAL RESULTS
219
+
220
+ In all that follows, we build the NICE model with three coupling layers. Each coupling layer’s nonlinear mapping $t$ is built with a one hidden layer MLP, with 128 neurons and leaky ReLU (Maas et al., 2013) activation functions. This architecture is kept constant in all our experiments.
221
+
222
+ # 5.1 VISUALIZATION
223
+
224
+ We present here two-dimensional visualizations of the behavior of a GNN distribution trained with GNN-xNES - the latent distribution is therefore Gaussian. Figure 3a displays the density level lines
225
+
226
+ ![](images/73234a4420b6789f163034662822ec21c1faba1f0a0927942dab0d95c31b19fb.jpg)
227
+ Figure 3: Rosenbrock
228
+ Figure 4: Rastrigin
229
+
230
+ Density level curves (dotted lines) in the data space and in the latent space of the resulting search distribution on the Rosenbrock function. Figure 3b displays the density level lines of the latent distribution, as well as the learned representation of the objective in the latent space. The search distribution is able to have curved density isolines, enabling better exploration. In the latent space, the global minimum can be reached without navigating a curved valley. Figures 4a and 4b provide similar visualizations on the Rastrigin function, a highly multimodal but symmetric objective. The GNN lowers the barriers between local minima, making it easier to escape a local minimum to the global minimum.
231
+
232
+ # 5.2 SYNTHETIC OBJECTIVES
233
+
234
+ Experimental set-up We present experiments on both unimodal and multimodal objectives for xNES and GNN-xNES. We use the official implementation of ${ \bf x } { \bf N } { \bf E } { \bf S } ^ { 1 }$ with default hyper-parameters (such as the population size $\lambda$ ), both as a baseline and as an inner optimization method for GNNxNES. All experiments are run on the COmparing Continous Optimizers (COCO) (Hansen et al., 2016) platform, a popular framework for comparing black-box optimization algorithms. It namely allows to benchmark different algorithms on translated and rotated versions of the same objectives, in order to evaluate multiple configurations with different global minimum positions. We compare xNES and GNN-xNES on functions from the 2018 Black-Box Optimization Benchmark (BBOB) (Hansen et al., 2010) suite. When comparing these two algorithms, we impose that their initial search distributions are close in order to ensure fair comparison. We insist on the fact that the xNES algorithm has the exact same configuration whether it is used by itself or as an inner-optimization algorithm for GNN-xNES. Further experimental details, including additional hyper-parameters value for GNN-xNES are provided in Appendix C.
235
+
236
+ Unimodal landscapes We run the different algorithms on two unimodal landscapes where we expect GNN search distributions to bring a significant improvement over the Gaussian - as discussed in 2.2. These objectives functions are the Rotated Rosenbrock function (a curved valley with high conditioning) and the Bent Cigar (an asymmetric and curved Cigar function). Extensive details on these objective functions can be found in the BBOB documentation (Hansen et al., 2010). Results on additional unimodal functions can be found in Appendix E.
237
+
238
+ Performance is measured through Empirical Cumulative Distribution Functions (ECDFs) of the runtime, also known as data profiles (More & Wild, 2009). Such curves report the fraction of problems ´ solved as a function of the number of objective evaluations. For a given precision $\Delta$ , a problem is said to be solved if the best function evaluation made so far is smaller than $f ( x ^ { * } ) + \Delta$ . We create 200 problems, equally spaced on a log-scale from $\Delta = 1 0 ^ { 2 }$ to $\Delta = 1 0 ^ { - 5 }$ and, as in the COCO framework, aggregate them over 15 function instances. Results are presented in Figure 5 for the two benchmark functions and in dimensions $d = 2 , 5 , 1 0$ .
239
+
240
+ Multimodal landscapes We now compare the performances of the different algorithms on a collection of three multimodal objectives: the Rastrigin function, the Griewank-Rosenbrock function and the Schwefel function. Extensive details about these objectives can be found in Hansen et al. (2010).
241
+
242
+ ![](images/b10c47e6f87a4ca1484e4dbb8fb856ef523e7d90d0615d3965dadde266b9716d.jpg)
243
+ Figure 5: ECDFs curves comparing GNN-xNES and xNES on the Rotated Rosenbrock and Bent Cigar functions, in dimensions $d { = } 2 , 5 , 1 0$ .
244
+
245
+ ![](images/c5a2dc2c1f95397fa76ee16194d3cf2e62ba52dae3659fc6be5207f67bc1c1f3.jpg)
246
+ Figure 6: Scaling comparison of GNN-xNES and xNES on the Rastrigin, Griewank-Rosenbrock and Schwefel functions, $d { = } 2 , 5 , 1 0$ .
247
+
248
+ When using ES algorithms to optimize multimodal functions, it is usual to augment them with restart strategies (Hansen, 2016). When convergence is detected, the search distribution is re-initialized in order to search another part of the landscape, and often the population size is increased. This allows to fairly compared algorithms that converge fast to potentially bad local minima, and algorithms that converges slower to better minima. Their exist a large variety of restart strategies (Loshchilov et al., 2012; Auger & Hansen, 2005); as the official implementation of xNES is not equipped with a default one, we trigger a restart whenever the algorithm makes no progress for more than $3 0 \times d$ iterations. The standard deviation of the search distribution is set back to 1, and its mean sampled uniformly within the compact $\mathcal { X }$ of interest (defined by the COCO framework). At each restart, the population size of the algorithm is multiplied by 2, as in Auger & Hansen (2005). This restart strategy is used for both xNES and GNN-xNES.
249
+
250
+ We measure performance as the number of functions evaluations to find an objective value smaller than $f ( x ^ { * } ) \stackrel { * } { + } 1 0 ^ { - 5 }$ within a budget of $d \times 1 0 ^ { 5 }$ function evaluations, averaged over 15 function instances. When an algorithm is not able to discover the global minimum within the given budget, we use the maximum number of evaluations as its performance. For visualization purposes, this measure of performance is divided by $d ^ { 2 }$ . Results are reported in Figure 6. On all objectives, and for all dimensions, GNN-xNES discovers (in average) the global minimum faster than xNES. Additional results on others multimodal functions are presented in Appendix E.
251
+
252
+ ![](images/3f18464dcb8a92d8644bf09066084cf2ba259edb116ef3954c7026137fe015d3.jpg)
253
+ Figure 7: Direct Policy Search experiments
254
+
255
+ # 5.3 REINFORCEMENT LEARNING EXPERIMENTS
256
+
257
+ The goal of this section is to present additional comparison between xNES and GNN-xNES on RL-based objective functions - less synthetic than the previously considered BBOB functions. ES algorithms have recently been used for direct policy search in Reinforcement Learning (RL) and shown to reach performances comparable with state-of-the-art MDP-based techniques (Liu et al., 2019; Salimans et al., 2017). Direct Policy Search ignores the MDP structure of the RL environment and rather considers it as a black-box. The search for the optimal policy is performed directly in parameter space to maximize the average reward per trajectory:
258
+
259
+ $$
260
+ f ( \boldsymbol { x } ) = \mathbb { E } _ { \tau \sim p _ { \boldsymbol { x } } } \left[ \sum _ { j \in \tau } \boldsymbol { r } _ { j } \right]
261
+ $$
262
+
263
+ where $p _ { x }$ is the distribution of trajectories induced by the policy (the state-conditional distribution over actions) parametrized by $x$ , and $r$ the rewards generated by the environment. The objective (17) can readily be approximated from samples by simply rolling out $M$ trajectories, and optimized using ES. In our experiments2, we set $M = 1 0$ and optimize deterministic linear policies (as in Rajeswaran et al. (2017)).
264
+
265
+ In Figures $\mathrm { 7 a }$ and 7b we report results of the GNN-xNES algorithm compared to xNES, when run on the Mujoco locomotion tasks Swimmer and InvertedDoublePendulum, both from the OpenAI Gym (Brockman et al., 2016). Performance is measured by the average reward per trajectory as a function of the number of evaluations of the objective $f$ . Results are averaged over 5 random seeds (ruling the initialization of the environment and the initial distribution over the policy parameters $x$ ). In all three environments, GNN-xNES discovers behaviors of high rewards faster than xNES.
266
+
267
+ # 6 CONCLUSION
268
+
269
+ In this work, we motivate the use of GNNs for improving Evolutionary Strategies by pinpointing the limitations of classical search distributions, commonly used by standard ES algorithms. We propose a new algorithm that leverages the high flexibility of distributions generated by bijective GNNs with an ES objective. We highlight that this algorithm can be seen as a plug-in extension to existing ES algorithms, and therefore can virtually incorporate any of them. Finally, we show its empirical advantages across a diversity of synthetic objective functions, as well as from objectives coming from Reinforcement Learning. Beyond the proposal of this algorithm, we believe that our work highlights the role of expressiveness in exploration for optimization tasks. This idea could be leverage in other settings where exploration is crucial, such a MDP-based policy search methods. An interesting line of future work could focus on optimizing GNN-based conditional distribution for RL tasks - an idea already developed in Ward et al. (2019); Mazoure et al. (2019). Other possible extensions to our work could focus on investigating first-order and mixed oracles, such as in Grathwohl et al. (2017); Faury et al. (2018).
270
+
271
+ REFERENCES
272
+ Aman Agarwal, Soumya Basu, Tobias Schnabel, and Thorsten Joachims. Effective evaluation using logged bandit feedback from multiple loggers. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 687–696. ACM, 2017.
273
+ Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural Computation, 10(2):251– 276, 1998.
274
+ Anne Auger and Nikolaus Hansen. A restart cma evolution strategy with increasing population size. In 2005 IEEE congress on evolutionary computation, volume 2, pp. 1769–1776. IEEE, 2005.
275
+ Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAi Gym. arXiv preprint arXiv:1606.01540, 2016.
276
+ Laurent Dinh, David Krueger, and Yoshua Bengio. NICE: Non-Linear Independent Components Estimation. arXiv preprint arXiv:1410.8516, 2014.
277
+ Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density Estimation using Real NVP. arXiv preprint arXiv:1605.08803, 2016.
278
+ 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.
279
+ Louis Faury, Flavian Vasile, Clement Calauz ´ enes, and Oliver Fercoq. Neural Generative Models for \` Global Optimization with Gradients. arXiv preprint arXiv:1805.08594, 2018.
280
+ Frauke Friedrichs and Christian Igel. Evolutionary tuning of multiple SVM parameters. Neurocomputing, 64:107–117, 2005.
281
+ Tobias Glasmachers, Tom Schaul, Sun Yi, Daan Wierstra, and Jurgen Schmidhuber. Exponential ¨ natural evolution strategies. In Proceedings of the 12th annual conference on Genetic and evolutionary computation, pp. 393–400. ACM, 2010.
282
+ 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.
283
+ Will Grathwohl, Dami Choi, Yuhuai Wu, Geoff Roeder, and David Duvenaud. Backpropagation through the void: Optimizing control variates for black-box gradient estimation. arXiv preprint arXiv:1711.00123, 2017.
284
+ Nikolaus Hansen. The CMA Evolution Strategy: a tutorial. arXiv preprint arXiv:1604.00772, 2016.
285
+ Nikolaus Hansen and Andreas Ostermeier. Completely derandomized self-adaptation in Evolution Strategies. Evolutionary Computation, 9(2):159–195, 2001.
286
+ Nikolaus Hansen, Anne Auger, Steffen Finck, and Raymond Ros. Real-parameter black-box optimization benchmarking 2010: Experimental setup. PhD thesis, INRIA, 2010.
287
+ Nikolaus Hansen, Anne Auger, Olaf Mersmann, Tea Tusar, and Dimo Brockhoff. Coco: A platform for comparing continuous optimizers in a black-box setting. arXiv preprint arXiv:1603.08785, 2016.
288
+ Nikolaus Hansen, Youhei Akimoto, and Petr Baudis. CMA-ES/pycma on Github. Zenodo, DOI:10.5281/zenodo.2559634, February 2019. URL https://doi.org/10.5281/ zenodo.2559634.
289
+ Donald R Jones, Matthias Schonlau, and William J Welch. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13(4):455–492, 1998.
290
+ Diederik P Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. arXiv preprint arXiv:1412.6980, 2014.
291
+ Diederik $\mathrm { \bf P }$ Kingma and Max Welling. Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
292
+
293
+ Guoqing Liu, Li Zhao, Feidiao Yang, Jiang Bian, Tao Qin, Nenghai Yu, and Tie-Yan Liu. Trust Region Evolution Strategies. Association for the Advancement of Artificial Intelligence, 2019.
294
+
295
+ Ilya Loshchilov and Frank Hutter. CMA-ES for hyperparameter optimization of deep neural networks. arXiv preprint arXiv:1604.07269, 2016.
296
+
297
+ Ilya Loshchilov, Marc Schoenauer, and Michele Sebag. Alternative restart strategies for cma-es. In International Conference on Parallel Problem Solving from Nature, pp. 296–305. Springer, 2012.
298
+
299
+ Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In ICML Workshop on Deep Learning for Audio, Speech and Language Processing. Citeseer, 2013.
300
+
301
+ David JC MacKay. Bayesian neural networks and density networks. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 354(1):73–80, 1995.
302
+
303
+ James Martens. Deep Learning via Hessian-free Optimization. In International Conference of Machine Learning, volume 27, pp. 735–742, 2010.
304
+
305
+ Bogdan Mazoure, Thang Doan, Audrey Durand, R Devon Hjelm, and Joelle Pineau. Leveraging exploration in off-policy algorithms via normalizing flows. arXiv preprint arXiv:1905.06893, 2019.
306
+
307
+ Jorge J More and Stefan M Wild. Benchmarking derivative-free optimization algorithms. ´ SIAM Journal on Optimization, 20(1):172–191, 2009.
308
+
309
+ Thomas Nedelec, Nicolas Le Roux, and Vianney Perchet. A Comparative Study of Counterfactual Estimators. arXiv preprint arXiv:1704.00773, 2017.
310
+
311
+ George Papamakarios, Theo Pavlakou, and Iain Murray. Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pp. 2338–2347, 2017.
312
+
313
+ Leonid Peshkin and Christian R Shelton. Learning from scarce experience. In Proceedings of the Nineteenth International Conference on Machine Learning, pp. 498–505. Morgan Kaufmann Publishers Inc., 2002.
314
+
315
+ Aravind Rajeswaran, Kendall Lowrey, Emanuel V Todorov, and Sham M Kakade. Towards generalization and simplicity in continuous control. In Advances in Neural Information Processing Systems, pp. 6550–6561, 2017.
316
+
317
+ Ingo Rechenberg. Evolutionsstrategien. In Simulationsmethoden in der Medizin und Biologie, pp. 83–114. Springer, 1978.
318
+
319
+ Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning, pp. 1530–1538, 2015.
320
+
321
+ Oren Rippel and Ryan Prescott Adams. High-dimensional Probability Estimation with Deep Density Models. arXiv preprint arXiv:1302.5125, 2013.
322
+
323
+ Tim Salimans, Jonathan Ho, Xi Chen, Szymon Sidor, and Ilya Sutskever. Evolution Strategies as a scalable alternative to Reinforcement Learning. arXiv preprint arXiv:1703.03864, 2017.
324
+
325
+ Tom Schaul, Justin Bayer, Daan Wierstra, Yi Sun, Martin Felder, Frank Sehnke, Thomas Ruckstieß, ¨ and Jurgen Schmidhuber. PyBrain. ¨ Journal of Machine Learning Research, 11:743–746, 2010.
326
+
327
+ Tom Schaul, Tobias Glasmachers, and Jurgen Schmidhuber. High dimensions and heavy tails for ¨ Natural Evolution Strategies. In Proceedings of the 13th annual conference on Genetic and Evolutionary Computation, pp. 845–852. ACM, 2011.
328
+
329
+ John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal Policy Optimization Algorithms. arXiv preprint arXiv:1707.06347, 2017.
330
+
331
+ Hans-Paul Schwefel. Numerische Optimierung von Computer-Modellen mittels der Evolutionsstrategie: mit einer vergleichenden Einfuhrung in die Hill-Climbing-und Zufallsstrategie ¨ . Birkhauser, 1977. ¨
332
+
333
+ Bobak Shahriari, Kevin Swersky, Ziyu Wang, Ryan P Adams, and Nando De Freitas. Taking the human out of the loop: A review of Bayesian Optimization. Proceedings of the IEEE, 104(1): 148–175, 2016.
334
+ Akash Srivastava, Lazar Valkoz, Chris Russell, Michael U Gutmann, and Charles Sutton. Veegan: Reducing mode collapse in GANs using Implicit Variational Learning. In Advances in Neural Information Processing Systems, pp. 3308–3318, 2017.
335
+ Adith Swaminathan and Thorsten Joachims. Counterfactual Risk Minimization: Learning from Logged Bandit Feedback. In International Conference on Machine Learning, pp. 814–823, 2015.
336
+ Patrick Nadeem Ward, Ariella Smofsky, and Avishek Joey Bose. Improving exploration in softactor-critic with normalizing flows policies. arXiv preprint arXiv:1906.02771, 2019.
337
+ Daan Wierstra, Tom Schaul, Jan Peters, and Juergen Schmidhuber. Natural Evolution Strategies. In Evolutionary omputation, 2008. CEC 2008.(IEEE World Congress on Computational Intelligence), pp. 3381–3387. IEEE, 2008.
338
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist Reinforcement Learning. Machine Learning, 8(3-4):229–256, 1992.
339
+
340
+ # A COMPUTING THE MODE OF THE SEARCH DISTRIBUTION
341
+
342
+ We prove here the fact that if $\mu$ denotes the location of the mode of the latent distribution $\nu _ { \omega }$ , then $g _ { \eta } ( \mu )$ is a mode for $\pi _ { \omega , \eta }$ . Indeed, under reasonable smoothness assumptions, one has that $y$ is a mode for $\pi _ { \omega , \eta }$ if and only if:
343
+
344
+ $$
345
+ \frac { \partial \pi _ { \omega , \eta } ( x ) } { \partial x } \bigg | _ { x = y } = 0
346
+ $$
347
+
348
+ Since $\pi _ { \omega , \eta } ( x ) = \nu _ { \omega } ( h _ { \eta } ( x ) )$ , this is therefore equivalent to:
349
+
350
+ $$
351
+ \frac { \partial h _ { \eta } ( x ) } { \partial x } \bigg | _ { x = y } \cdot \frac { \partial \nu _ { \omega } ( z ) } { \partial z } \bigg | _ { z = h _ { \eta } ( y ) } = 0
352
+ $$
353
+
354
+ In the NICE model, we have that $\begin{array} { r } { \left| \frac { \partial h _ { \eta } ( x ) } { \partial x } \right| = 1 } \end{array}$ for all $x$ hence the matrix $\left. \frac { \partial h _ { \eta } ( x ) } { \partial x } \right| _ { x = y }$ is invertible and its kernel is reduced to the null vector. Therefore:
355
+
356
+ $$
357
+ \frac { \partial \nu _ { \omega } ( z ) } { \partial z } \bigg | _ { z = h _ { \eta } ( y ) } = 0
358
+ $$
359
+
360
+ and therefore $\mu = h _ { \eta } ( y )$ by definition of $\mu$ (the only critical point of $\nu _ { \omega }$ ). Hence since $h _ { \eta } ^ { - 1 } = g _ { \eta }$ , we have that $y = g _ { \eta } ( \mu )$ which concludes the proof.
361
+
362
+ # B ALGORITHM PSEUDO-CODE
363
+
364
+ We provide below the pseudo-code for the generic algorithm GNN- $\mathcal { A }$ -ES, where $\mathcal { A }$ is a generic ES algorithm operating on a parametric distribution $\nu _ { \omega }$ . The additional hyper-parameters are the horizon $T$ as well as the clipping constant $\varepsilon$ . The function ${ \mathrm { c l i p } } ( x , l b , u b )$ clips the input $x$ between a lower-bound $l b$ and an upper-bound $u b$ .
365
+
366
+ Algorithm 2: GNN-A-ES (ex: GNN-xNES, GNN-CMA-ES)
367
+
368
+ <table><tr><td>inputs : objective function f,distribution Vω and its related ES algorithm A hyper-parameters: clipping constant ε, NICE model architecture, initial parameters Wo, initial weights no, horizon T, population size 入 (Initialization) Initialize NICE MLPs weights and biases with 7o. Let Hbe a circular buffer of length T × 入</td></tr></table>
369
+
370
+ ∗The (GNN iteration) step can be performed with virtually any gradient descent solver. In all our experiments, we used Adam (Kingma & Ba, 2014) with learning rate 1e-4 for 500 epochs.
371
+
372
+ Algorithm 2 does not detail the mode-preserving addition for the sake of readability and clarity. We provide additional details on this procedure here. Let $\mu _ { t }$ be the mode of the latent distribution $\nu _ { \omega _ { t } }$ . At the (Initialization) step, set $\alpha _ { 0 } = g _ { \eta _ { 0 } } ( \mu _ { 0 } )$ where $g _ { \eta } ( \cdot )$ is the push-forward map on the NICE model described in Section 3.2. For all round $t \geq 1$ , let $\dot { f } _ { \eta } ( z ) = \bar { g } _ { \eta } ( z ) - g _ { \eta } ( \mu _ { t } ) \bar { + } \alpha _ { t }$ . The variable $\alpha _ { t }$ represent the push forward mapping of the latent distribution’s mean under the current model. Every time the latent space is updated - the $_ { E S }$ update) step, let $\alpha _ { t + 1 } = f _ { \eta _ { t } } ( \mu _ { t + 1 } )$ . Then, for the (GNN update), optimize the forward-map $f _ { \eta } ( z ) = g _ { \eta } ( z ) - g _ { \eta } ( \mu _ { t + 1 } ) + \alpha _ { t + 1 }$ . After this update, we have $\bar { f } _ { \eta _ { t + 1 } } ( \mu _ { t + 1 } ) = \alpha _ { t + 1 } = f _ { \eta _ { t } } ( \mu _ { t + 1 } ) \bar { { \bf \Phi } }$ , which means that the mode of the search distribution (which is the image of the latent distribution mode) has not been impacted by the GNN update.
373
+
374
+ # C EXPERIMENTAL DETAILS
375
+
376
+ # C.1 HYPER-PARAMETERS
377
+
378
+ Baselines We use xNES with its default (adapted) hyper-parameters (described in Wierstra et al. (2008)) for both its baselines versions and its inner optimization parts in GNN-xNES. The population size $\lambda$ is one such hyper-parameters, and is therefore set to $\lambda = 4 + \lfloor 3 \log ( d ) \rfloor$ . Also, as it is classically done in ES algorithms, we use a rank-based fitness shaping, designed to make the algorithm invariant with respect to order-preserving cost transformations. We use the same fitnessshaping function as in Wierstra et al. (2008).
379
+
380
+ GNN-ES Across all experiments, we use the same hyper-parameters for GNN-xNES without fine tuning for each tasks. We use three coupling layers, each with a single hidden layer MLP with 128 hidden neurons and Leaky ReLU activations. The MLPs are initialized via Glorot initialization, and the clipping constant is set to $\varepsilon = 0 . 0 5$ . The history size $T$ was determined experimentally, and set to $T = \bar { \lfloor 3 * ( 1 + \log ( d ) ) \rfloor }$ . When restarts are used, this history size is divided by the numbers of restart so far (as the population size grows larger).
381
+
382
+ # C.2 SYNTHETIC OBJECTIVES
383
+
384
+ Every synthetic objective we used in this work was taken from the BBOB2019 benchmark dataset. Their expression as well as additional details on the framework can be found in Hansen et al. (2010; 2016). At the beginning of each experiment, we set the Gaussian search distribution (for xNES) and the Gaussian latent distribution (for GNN-xNES) to a standard normal, with a mean uniformly sampled within the compact $\mathcal { X }$ of interest (defined by the COCO framework).
385
+
386
+ # C.3 RL ENVIRONMENTS
387
+
388
+ Table 1 provides details on the RL environment used to compare GNN-xNES and xNES, like the dimensions of the state space $s$ and action space $\mathcal { A }$ , the number $d$ of the policy’s degrees of freedom and the maximum number of steps $m$ per trajectory. At the beginning of each experiment, we set the Gaussian search distribution (for xNES) and the Gaussian latent distribution (for GNN-xNES) to a standard normal with zero mean. In this particular case, where the function evaluations are noisy, we kept the default population size of the xNES algorithm.
389
+
390
+ Table 1: Reinforcement Learning environments
391
+
392
+ <table><tr><td>Name</td><td>|S|</td><td>|A|</td><td>d</td><td>m</td></tr><tr><td>Swimmer-v1</td><td>13</td><td>21</td><td>28</td><td>1000</td></tr><tr><td>InvertedDoublePendulum-v1</td><td>11</td><td></td><td>12</td><td>1000</td></tr><tr><td>HalfCheetah-v1</td><td>20</td><td>6</td><td>126</td><td>1000</td></tr></table>
393
+
394
+ # D TWO-DIMENSIONAL VISUALIZATIONS
395
+
396
+ We provide in Figure 8 additional two-dimensional visualizations of the behavior of GNN-xNES, on the Rosenbrock, Rastrigin, Beale and Bent-Cigar functions. We see that the NICE distributions can
397
+
398
+ ![](images/311d594c3ec6e8fb78527803e6d60d271d737b730c251be035e25006765a1219.jpg)
399
+ (d) (Doubly asymmetric) Bent Cigar, global optimum at $( 0 , 0 )$
400
+
401
+ ![](images/da2a20cb2e51968ad3673c4e04b747ac7345cc1e02f779521621aacac09f74da.jpg)
402
+ (a) Rosenbrock, global op- (b) Rastrigin, global opti- (c) Beale, global optimum timum at $( 1 , 1 )$ mum at $( 0 , 0 )$ at (3, 0.5)
403
+
404
+ Figure 8: Two-dimensional visualizations. The black dotted lines represent the isolines of the level curves of a NICE search distribution trained with GNN-xNES.
405
+
406
+ <table><tr><td>Algorithm</td><td>mean(# restarts), d=2</td><td>mean(# restarts), d=5</td><td>mean(# restarts),d=10</td></tr><tr><td>xNES</td><td>2.3</td><td>2.7</td><td>3.4</td></tr><tr><td>GNN-xNES</td><td>1.3</td><td>2.5</td><td>2.9</td></tr></table>
407
+
408
+ Table 2: Mean number of restarts needed to discover the global minimum on the Rastrigin function.
409
+
410
+ efficiently fit each optimization landscapes, without having to reduce its entropy like a multivariate normal would.
411
+
412
+ # E ADDITIONAL RESULTS
413
+
414
+ We present here some additional results on some unimodal and multimodal synthetic functions. Figure 9 present ECDFs curve obtained from the Attractive Sector function, a highly asymmetrical function around its global minimum. On such a function, GNN-xNES seems to accelerate xNES in small dimensions, however this speed-up disappears in higher dimensions. Figure 10 presents results on the Rosenbrock function (without random rotations). Again, GNN-xNES accelerates the xNES algorithm. Figure 11 present results on the multimodal functions Gallagher’s Gaussian 101 Peaks and Gallagher’s Gaussian 21 Peaks. Again, GNN-xNES discovers the global minimum faster (on average) than xNES.
415
+
416
+ In our multimodal experiments, we used simulated restarts as a fair mean of comparing different algorithm (this is common practice in order to fairly compare algorithms that converge fast to potentially bad local minima to algorithms that converge slowly to the global minimum). If the empirical results prove that GNN-xNES accelerate xNES in the discovery of the global minimum, it does not prove that GNN-xNES leverages the flexibility of the GNN to detect the global minimum when xNES misses it. In an attempt to prove that it is indeed the case, we report in Table 2 the number of restarts needed by both GNN-xNES and xNES to discover the global minimum on the Rastrigin function (averaged over the 15 randomly initialized run). For this instance, GNN-xNES consistently discovers the global minimum with less restarts than xNES.
417
+
418
+ As detailed in Section 4, one can apply Algorithm 2 as a plug-in to any ES method. So far, we empirically evaluated the benefits of our approach by comparing xNES against its GNN extension (GNN-xNES). We present in Figure 12 additional evaluations obtained by comparing CMA-ES and its GNN extension (denoted GNN-CMA-ES) on the Rosenbrock function in dimension 2,5 and 10. CMA-ES is considered to be the state-of-the-art ES algorithm, and improving its performances is a non-trivial task. On the considered example GNN-CMA-ES improves CMA-ES, highlighting the empirical benefit of our approach for a large class of ES algorithm. One can however observe that the performance boost brought by the GNN extension is milder for GNN-CMA-ES then for GNNxNES. We suspect that this is due to the use of cumulation via an evolution path in ${ \mathrm { C M A } } – \mathbf { E S } ^ { 3 }$ , which basically introduces a momentum-like update when optimizing the latent distribution. While using an evolution path makes a lot of sense when optimizing a stationary objective, it can be quite harmful for non-stationary ones. We therefore believe that the cumulation step in CMA-ES (for the latent distribution) and the GNN optimization (making the objective optimized by CMA-ES in the latent space non-stationary) can lead to conflicting updates and might hinder the benefits brought by the GNN’s additional flexibility. Designing a GNN update strategy complying with the use of evolution paths could therefore be a way of further improving GNN-CMA-ES, and is left for future work.
419
+
420
+ ![](images/4780aff2f18f49f8bd5ac4ccf8d08c815faa7980e56dd2a9c4d6ffed6c3bb3dc.jpg)
421
+ Figure 9: ECDFs curve for the Attractive Sector function, $d { = } 2 , 5 , 1 0$
422
+
423
+ ![](images/15d5a43dad711006f45eb3c63a9311ee94135c357e7b775f9513f021c1f1efe7.jpg)
424
+ Figure 10: ECDFs curve for the Rosenbrock function, $\mathrm { d } { = } 2 , 5 { , } 1 0$
425
+
426
+ # F ABLATION STUDY
427
+
428
+ We present here an ablation study for two additional tools that we introduced after the alternating optimization view: the mode preserving (16) extension as well as the history augmentation (15). Figure 13 presents ECDFs curves on the Rosenbrock, Rotated Rosenbrock and Bent Cigar functions in 2D, for a version of GNN-xNES that doesn’t use history but only the current population. Using history and therefore exposing the GNN to larger datasets improves the procedure. Figure 14 present similar results on a version of GNN-xNES without the mode preserving property (16). Again, one can notice that ensuring that the GNN training is mode-preserving is crucial to improve experimental results.
429
+
430
+ ![](images/9e572d17a157ffd117415bd0f15a63c7cb309d9c5abf2d26176f23925a1ac64f.jpg)
431
+ Figure 11: Scaling comparison of GNN-xNES and xNES on the Gallagher’s Gaussian 101 Peaks and Gallagher’s Gaussian 21 Peaks functions, $d { = } 2 , 5 , 1 0$ .
432
+
433
+ ![](images/68ddd1cc5a7162a527451ccc1288b466f524bac93c83284b277804ec4d168823.jpg)
434
+ Figure 12: ECDFs curves for the Rosenbrock function, $\mathrm { ( d } { = } 2 , 5 , 1 0 \mathrm { ) }$ comparing the CMA-ES and GNN-CMA-ES
435
+
436
+ ![](images/ce5f379c22f570a949ae5a5c15dc76ba8c84c7e12ffc5755ca17c0d20d6b8274.jpg)
437
+ Figure 13: ECDFs curves for xNES, GNN-xNES and GNN-xNES-no-history, for which the history size $T = 1$ . Using past populations to estimate expectations improves the optimization.
438
+
439
+ ![](images/6c05e70bd63b61ad177ed55b672b85c9bdf4e56871bfb862f80ad4ae8ca57013.jpg)
440
+ Figure 14: ECDFs curves for xNES, GNN-xNES and GNN-xNES-nmp, which is not mode preserving. Ensuring that the training of the GNN doesn’t impact the mode of the search distribution improves the optimization.
md/train/Syez3j0cKX/Syez3j0cKX.md ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DISSECTING AN ADVERSARIAL FRAMEWORK FOR INFORMATION RETRIEVAL
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Recent advances in Generative Adversarial Networks facilitated by improvements to the framework and successful application to various problems has resulted in extensions to multiple domains. IRGAN attempts to leverage the framework for Information-Retrieval (IR), a task that can be described as modeling the correct conditional probability distribution $p ( d | q )$ over the documents $( d )$ , given the query $( q )$ . The work that proposes IRGAN claims that optimizing their minimax loss function will result in a generator which can learn the distribution, but their setup and baseline term steer the model away from an exact adversarial formulation, and this work attempts to point out certain inaccuracies in their formulation. Analyzing their loss curves gives insight into possible mistakes in the loss functions and better performance can be obtained by using the co-training like setup we propose, where two models are trained in a co-operative rather than an adversarial fashion.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Information-Retrieval (IR) involves providing a list of ranked documents $\{ d _ { 1 } , d _ { 2 } , \dots , d _ { k } \}$ in answer to a query $q$ . This general formulation can be extended to various tasks like web-search, where the documents are web pages and information needs are queries, content-recommendation, where the documents are items/content to suggest and queries are users, and Question-Answering, where the documents are answers and queries are questions. The retrieved list can also be viewed as a probability distribution over candidates, one example being $\begin{array} { r } { R a n k _ { q } ( d _ { i } ) \equiv p ( d _ { i } | q ) \propto ( \frac { 1 } { R a n k _ { q } ( d _ { i } ) } ) ^ { l } } \end{array}$ where $l$ is a hyperparameter. Even if the probability distribution is not explicit, it is desirable to retrieve a higher ranked document more often than a lower ranked document.
12
+
13
+ GANs were proposed as alternatives to generative models and have been shown to be capable of modeling the true data well. High dimensional settings like images and word sequences have seen some success. Given that the generator in GANs tries to model the training data’s distribution, adversarial setups seem like a natural fit for IR. The learned distribution can then be used to retrieve relevant documents for incoming queries. IRGAN is a framework proposed by Wang et al. (2017), with the hope of giving Information-Retrieval, access to the large literature of GANs.
14
+
15
+ IRGAN consists of a discriminator and a generator. Like in a typical setup, the discriminator learns to distinguish between documents produces by the real probability distribution or the real ranking and the generator’s probability distribution. It increases the likelihood of the former and decreases it for the latter. The generator tries to bring its probability distribution closer to the real one so that it increases the likelihood of confusing the discriminator into believing that it is the true distribution. Ideally, equilibrium is achieved when the generator manages to rank the documents according to the true distribution.
16
+
17
+ However, the formulation and implementation of the loss function in the work seems to have a few issues. Specifically, the use of the baseline term recommended in the work results in pitting the loss functions of the discriminator and the generator directly against each other and this leads to issues that are conspicuous in the loss curves. The training starts off with a pre-trained discriminator and generator, and the performance of the generator decreases as the training proceeds, while you would actually expect the opposite. When pre-training is not used, the generator does not learn at all. This forces IRGAN to choose the generator or discriminator based on whichever has better performance, while it expected that the generator is chosen at equilibrium.
18
+
19
+ Given the traction this paper has received since its inception (53 citations as of $2 7 ^ { t h }$ September 2018), it is important to critically analyze the work and attribute the claimed performance improvements correctly. To this end, we propose two models which outperform IRGAN on two of the three tasks and give a comparable performance on the third. They also serve as an ablation study by experimentally showing that the generator might not be playing a vital role during train or test time.
20
+
21
+ The following contributions are made in this work • We propose a model motivated by Co-training which outperforms IRGANs • We point out inaccuracies in the minimax loss function used in IRGANs • We substantiate the same by drawing conclusions from the loss curves
22
+
23
+ # 2 RELATED WORK
24
+
25
+ # 2.1 GENERATIVE ADVERSARIAL NETWORKS
26
+
27
+ Generative Adversarial Networks (GANs) (Goodfellow et al. (2014)) were proposed as an alternative to generative models (Salakhutdinov & Larochelle (2010)) which used Markov Chains or other approximations to compute intractable probability distributions. In essence, the generator tries to model the real data distribution and the discriminator learns to differentiate between real data points and generated data points. GANs are notoriously unstable to train and works like DCGANs (Radford et al. (2015)) and Wasserstein GAN (Arjovsky et al. (2017)) have successfully attempted to alleviate a few issues. Nonetheless, GANs have been widely applied to various problems like image generation, text generation, cross-modal retrieval and more niche ones like Interactive Image Generation (Zhu et al. (2016)), Text to Image (Zhang et al. (2017)), Image to Image style transfer (Isola et al. (2017)) and robotics (Bousmalis et al. (2017)).
28
+
29
+ While GANs allow generation based on a random variable $z$ , Conditional GANs (Mirza & Osindero (2014)) partition the sample variable into two parts ( $z$ and $y$ ). $y$ is used to denote which part of the probability distribution the generator has to generate from, and $z$ plays the same role played in Vanilla GANs (Goodfellow et al. (2014)). Conditional GANs dovetail with IR because $y$ can be used to represent the query or its embedding, and in theory, the model should be able to generate the required document.
30
+
31
+ $$
32
+ y \sim q u e r y \qquad G ( z | y ) \sim p _ { \theta } ( d | z , q )
33
+ $$
34
+
35
+ We feel that an eventual adversarial formulation for IR will be similar to this in flavor.
36
+
37
+ # 2.2 RETRIEVAL OF IMAGE RESPONSES
38
+
39
+ Creswell & Bharath (2016) employed Sketch-GANs for the interesting task of retrieving similar merchant seals (images) based on an input image. DCGANs (Radford et al. (2015)) are used to generate an image, and post training, the last layer of the discriminator is popped off and the rest of it is used as an encoder. This model, however, is specifically for retrieving image responses.
40
+
41
+ # 3 BACKGROUND
42
+
43
+ In the subsequent sections, $D$ denotes the discriminator, $G$ the generator, $p _ { t r u e }$ the real probability distribution over documents, $\phi$ the parameters of the discriminator, $\theta$ the parameters of the generator, $d$ the document, $q$ the query and $r$ the rank of a document with respect to a query.
44
+
45
+ The equations used to train the discriminator and generator in Goodfellow et al. (2014) are the following respectively.
46
+
47
+ $$
48
+ \begin{array} { r l r } { { \nabla _ { \theta _ { d } } \frac { 1 } { m } \sum _ { i = 1 } ^ { m } [ \log D ( \pmb { x } ^ { ( i ) } ) + \log ( 1 - D ( G ( \pmb { z } ^ { ( i ) } ) ) ) ] } } \\ & { } & { \nabla _ { \theta _ { g } } \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \log ( 1 - D ( G ( \pmb { z } ^ { ( i ) } ) ) ) } \end{array}
49
+ $$
50
+
51
+ The discriminator minimizes the likelihood of a “generated” data point and maximizes it for a “real” data point, while the generator tries to generate data points which the discriminator thinks is “real”. The two models are trained alternatively and the procedure culminates in a generator which is able to produce data which looks like the real data.
52
+
53
+ # 4 IRGAN FORMULATION
54
+
55
+ This section elucidates the IRGAN formulation (Wang et al. (2017)). Comments by the authors are in italics (in this section alone), while normal typeface is a paraphrased version of IRGAN. IRGAN is motivated by the combination of two schools of thoughts, the generative retrieval model and the discriminative retrieval model.
56
+
57
+ # 4.1 DISCRIMINATOR AND GENERATOR
58
+
59
+ The generative retrieval model $p _ { \theta } ( d | q , r )$ tries to sample relevant documents from a candidate pool with the aim of cloning the true probability distribution $p _ { t r u e }$ . The discriminative retrieval model $f _ { \phi } ( q , d )$ , which is a binary classifier, tries to discriminate between real and generated pairs $( q , d )$ .
60
+
61
+ Two different loss functions IRGAN-Pointwise and IRGAN-Pairwise are proposed.
62
+
63
+ # 4.2 IRGAN-POINTWISE
64
+
65
+ This is called so because each data point is independently used to train, unlike in IRGAN-Pairwise where pairs of points are used. The dataset is expected to have some cue with respect to how often a document is correctly retrieved for a query, if at all.
66
+
67
+ $$
68
+ J ^ { G ^ { * } , D ^ { * } } = \underset { \theta } { \mathrm { m i n } } \underset { \phi } { \mathrm { m a x } } \sum _ { n = 1 } ^ { N } ( E _ { d \sim p _ { t r u e } ( d | q _ { n } , r ) } [ ( \log D ( d | q _ { n } ) ) ] + E _ { d \sim p _ { \theta } ( d | q _ { n } , r ) } [ ( \log 1 - D ( d | q _ { n } ) ) ] )
69
+ $$
70
+
71
+ Note that the generator $G$ can alternately be written as $p _ { \theta } ( d | q _ { n } , r )$ , which denotes the modeled probability distribution, and $D ( d | q ) = \sigma ( \ ' f _ { \phi } ( d , q ) )$ represents the discriminator’s score.
72
+
73
+ # 4.3 IRGAN-PAIRWISE
74
+
75
+ In some IR problems the training data may not be a set of relevant documents for each query, but rather a set of ordered document pairs $R _ { n } = [ < d _ { i } , d _ { j } > | d _ { i } \succ d _ { j } ]$ , where $d _ { i } \succ d _ { j }$ means that the first document is more relevant for query $q _ { n }$ than the second document. $o$ represents a real pair $< d _ { u } , d _ { v } >$ and $o ^ { \prime }$ represents a generated pair $< d _ { u } ^ { \prime } , d _ { v } ^ { \prime } >$ . The discriminator’s goal in this setting is to discriminate between $o$ and $o ^ { \prime }$ , with $D ( o | q ) = \overset { \vartriangle } { \boldsymbol { \sigma } } ( \bar { f } _ { \phi } ( d _ { u } , q ) - f _ { \phi } ( d _ { v } , q ) )$
76
+
77
+ $$
78
+ J ^ { G ^ { * } , D ^ { * } } = \underset { \theta } { \mathrm { m i n } } \underset { \phi } { \mathrm { m a x } } \sum _ { n = 1 } ^ { N } ( E _ { o \sim p _ { t r u c } ( o | q _ { n } ) } [ ( \log D ( o | q _ { n } ) ) ] + E _ { o ^ { \prime } \sim p _ { \theta } ( o ^ { \prime } | q _ { n } ) } [ ( \log 1 - D ( o ^ { \prime } | q _ { n } ) ) ] )
79
+ $$
80
+
81
+ Note the similarity between this and the previous formula. The problem with this formula is that $D ( o | q )$ is actually supposed to denote the probability that the pair o is from the real data distribution and not the probability that the pair is correctly ranked, as mentioned in the paper.
82
+
83
+ # 4.4 OPTIMIZING THE GENERATOR
84
+
85
+ The generator samples documents from the candidate pool based on its belief (relevance score). This sampling has the downside that the gradients cannot be backpropagated, and policy gradients (Sutton et al. (2000)) have to be used. As an intuition, the documents can be considered as the arms of a contextual multi-arm bandit (Auer et al. (2002), Lu et al. (2010)), and picking an arm can be viewed as analogous to choosing the document as relevant. The policy discovered gives us the relevance of each document and $- \log ( 1 - D ( d | q ) )$ is the reward for picking that action/document $( d )$ . Let $J ^ { \tilde { G } }$ represent the objective function of the generator that it has to maximize. The policy gradient (REINFORCE) can be written as the following.
86
+
87
+ $$
88
+ \nabla _ { \theta } J ^ { G } ( q _ { n } ) = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \nabla _ { \theta } \log p _ { \theta } ( d _ { k } | q _ { n } , r ) \log ( 1 + e x p ( f _ { \phi } ( d _ { k } , q _ { n } ) ) )
89
+ $$
90
+
91
+ # 4.5 BASELINE TERM
92
+
93
+ To reduce the variance in REINFORCE, a standard trick is to use the advantage function instead of just the reward. This does not change the optimal parameters.
94
+
95
+ $$
96
+ \log ( 1 + e x p ( f _ { \phi } ( d _ { k } , q _ { n } ) ) ) - \mathbb { E } _ { p _ { \theta } ( d _ { k } | q _ { n } ) } [ \log ( 1 + e x p ( f _ { \phi } ( d _ { k } , q _ { n } ) ) ) ]
97
+ $$
98
+
99
+ Another baseline term that is suggested for each query is $f _ { \phi } ( d _ { + } , q )$ , where $d _ { + }$ represents the positive document. This is legal because the term does not depend on the document (action). This is motivated by the belief of a larger generator score if $f _ { \phi } ( \bar { d _ { + } } , q )$ is large and lower if $f _ { \phi } ( d _ { + } , q )$ is low. This baseline term is used in two of their three tasks and causes the violation of adversarial formulation, as we show in the following section.
100
+
101
+ # 5 INSIGHTS INTO IRGAN MINIMAX LOSS FUNCTION
102
+
103
+ Having shown that the generator can be optimized using REINFORCE, we focus on the loss function and show how the baseline term exacerbates training. We consider Stochastic Gradient Descent updates for ease of illustration. Consider a triple $( q , d _ { r } , d _ { g } )$ , where $d _ { r }$ denotes the correct document according to the true distribution and $d _ { g }$ denotes the generated document. The discriminator’s updates are in the direction of $\nabla J ^ { D }$ , with the following definition.
104
+
105
+ $$
106
+ J ^ { D } = \log D ( d _ { r } | q ) + \log ( 1 - D ( d _ { g } | q ) )
107
+ $$
108
+
109
+ With the baseline term included, the generator’s updates are in the direction of $\nabla J ^ { G }$ , with the following definition.
110
+
111
+ $$
112
+ J ^ { G } = \log ( 1 - D ( d _ { r } | q ) ) + \log D ( d _ { g } | q )
113
+ $$
114
+
115
+ Since maximizing $\log ( 1 - z )$ with respect to $z$ is the same as maximizing $- \log z$ , we can write the following equivalent loss functions
116
+
117
+ $$
118
+ J ^ { D } = \log D ( d _ { r } | q ) - \log D ( d _ { g } | q ) \qquad J ^ { G } = - \log D ( d _ { r } | q ) + \log D ( d _ { g } | q )
119
+ $$
120
+
121
+ Note that this substitution is similar in principle to the substitution in Goodfellow et al. (2014), where the motivation is to allow easier flow of gradients. It is apparent that the discriminator and the generator are optimizing directly opposite loss functions and this detrimental to the performance of the models. We provide experimental proof later that the performance improvements shown in IRGAN are mainly because of the discriminator maximizing the likelihood of the real data and not because of the generator.
122
+
123
+ # 6 PROPOSED MODELS
124
+
125
+ We propose two models to compare and critically analyze performance gains facilitated by IRGAN and illustrate them in Figure 1.
126
+
127
+ The first model increases the likelihood of the training data and decreases the likelihood of documents which are not relevant to the query but have a high score according to its own parameters. It maximizes the following, where the sampling for the second term is from a candidate pool with only negative answers (denoted by $p ^ { - } .$ ). Not following this will lead to undesirable updates because sampling positive documents for the second term will result in decreasing the likelihood of real data. $\psi$ denotes the parameters of the only model.
128
+
129
+ $$
130
+ J ^ { M o d e l 1 } = \operatorname* { m a x } _ { \psi } \sum _ { n = 1 } ^ { N } ( E _ { d \sim p _ { t r u e } ( d | q _ { n } , r ) } [ ( \log D ( d | q _ { n } ) ) ] + E _ { d \sim p _ { \psi } ^ { - } ( d | q _ { n } , r ) } [ ( \log 1 - D ( d | q _ { n } ) ) ] )
131
+ $$
132
+
133
+ ![](images/90d72faff9848714db0f8a16698b2246a2947c87938645c125df29a2315c4b90.jpg)
134
+ Figure 1: Models
135
+
136
+ To alleviate the pernicious loss function of IRGAN, we propose a model which uses two discriminators in a co-operative setup influenced by Co-training (Blum & Mitchell (1998)). Instead of using two different views $( x _ { 1 } , x _ { 2 } )$ as mentioned in the work, we use the same views for both the discriminators but let them influence each other in a feedback loop. Training is similar to Model 1 with the only difference being that each discriminator decreases the likelihood of documents relevant to the other discriminator rather than itself, as shown in the equation below. This model achieves better performance than IRGAN.
137
+
138
+ $$
139
+ \begin{array} { r l } & { J ^ { M o d e l 1 } = \displaystyle \operatorname* { m a x } _ { \psi _ { 1 } } \sum _ { n = 1 } ^ { N } ( E _ { d \sim p _ { t r u e } ( d | q _ { n } , r ) } [ ( \log D ( d | q _ { n } ) ) ] + E _ { d \sim p _ { \psi _ { 2 } } ^ { - } ( d | q _ { n } , r ) } [ ( \log 1 - D ( d | q _ { n } ) ) ] ) } \\ & { \displaystyle } \\ & { J ^ { M o d e l 2 } = \displaystyle \operatorname* { m a x } _ { \psi _ { 2 } } \sum _ { n = 1 } ^ { N } ( E _ { d \sim p _ { t r u e } ( d | q _ { n } , r ) } [ ( \log D ( d | q _ { n } ) ) ] + E _ { d \sim p _ { \psi _ { 1 } } ^ { - } ( d | q _ { n } , r ) } [ ( \log 1 - D ( d | q _ { n } ) ) ] ) } \end{array}
140
+ $$
141
+
142
+ # 7 EXPERIMENTAL SETUP
143
+
144
+ This section describes the datasets, the task and hyperparameters.
145
+
146
+ # 7.1 DATASETS
147
+
148
+ We conduct experiments on three tasks, Web Search, Item Recommendation and Question Answering, using the same datasets mentioned in IRGAN.
149
+
150
+ Table 1: Datasets
151
+
152
+ <table><tr><td>Task</td><td>Dataset</td></tr><tr><td>WebSearch</td><td>LETOR by Liu et al. (2007)</td></tr><tr><td>Item-Recommendation</td><td>Movielens</td></tr><tr><td>Question Answering</td><td>InsuranceQA by Feng et al. (2015)</td></tr></table>
153
+
154
+ # 7.2 TASK
155
+
156
+ In Web Search, the task is to retrieve the document which is most relevant to the query. Each query on average has around 5 positive documents. In Content Recommendation, users give ratings for movies and given a user, the task is to retrieve a movie that they would probably rate high. In IRGAN, any movie retrieved for which the user rating is greater than or equal to 4 (out of a scale of 5) is considered correct. Based on the dataset statistics, around $5 5 \%$ of the user-movie ratings are $\geq 5$ . This makes the problem easy to solve. In Question Answering, every query has just one relevant document in most cases. This is thus the hardest task.
157
+
158
+ # 7.3 HYPERPARAMETERS
159
+
160
+ The hyperparameters for the proposed model are the same except for absence of G Epochs, for obvious reasons. Information about hyperparameter tuning is mentioned in the Appendix.
161
+
162
+ Table 2: Hyperparameters for IRGAN
163
+
164
+ <table><tr><td>Hyperparameter</td><td>Description</td></tr><tr><td>Learning Rate</td><td>Forboth generator and discriminator</td></tr><tr><td>Batch Size</td><td>Batch size for training</td></tr><tr><td>Embed Dim</td><td>Embedding dimension of query or document</td></tr><tr><td>Epochs</td><td>Number of epochs of training</td></tr><tr><td>DEpochs</td><td>Number of epochs the discriminator is trained per epoch</td></tr><tr><td>G_Epochs Temperature</td><td>Number of epochs the generator is trained per epoch Temperature parameter for softmax sampling of documents</td></tr></table>
165
+
166
+ # 8 EXPERIMENTS AND DISCUSSION
167
+
168
+ We report only the $\mathrm { P @ 5 }$ and ${ \mathrm { N D C G } } @ 5$ values because all other metrics follow the same trend.
169
+
170
+ # 8.1 WEB SEARCH
171
+
172
+ Table 3 reports the performance of various models. As can be seen, both the Single Discriminator and the Co-training models outperform IRGAN models. The fact that each query is associated approximately with 5 positive documents provides evidence that the proposed models can perform well in sparse reward settings.
173
+
174
+ Table 3: Results on LETOR dataset used in IRGAN
175
+
176
+ <table><tr><td>Model</td><td>P@5</td><td>NDCG@5</td></tr><tr><td>RankNet (Burges et al. (2005))</td><td>0.1219</td><td>0.1709</td></tr><tr><td>LambdaRank (Burges et al. (2007))</td><td>0.1352</td><td>0.1920</td></tr><tr><td>IRGAN-pointwise</td><td>0.1657</td><td>0.2225</td></tr><tr><td>IRGAN-pairwise</td><td>0.1676</td><td>0.2154</td></tr><tr><td>Single Discriminator</td><td>0.1676</td><td>0.2190</td></tr><tr><td>Co-training</td><td>0.1733</td><td>0.2252</td></tr></table>
177
+
178
+ # 8.2 ITEM-RECOMMENDATION
179
+
180
+ This task, in contrast to the other two, has multiple relevant documents that can be retrieved for each query, making it slightly easier. Each user (query) rates a movie (document), and $5 5 \%$ of the entries in the train set and $5 6 \%$ in the test set are relevant pairs. It can be seen in Table 4 that the single discriminator model achieves only a slightly lower score, and given the small size of the dataset (943 users), it makes just 7 more mistakes when compared to IRGAN. This is not a statistically significant number, especially because the IRGAN generator is pre-initialized to a model which scores 0.34 but our model learns from scratch.
181
+
182
+ # 8.3 QUESTION ANSWERING
183
+
184
+ After close correspondence with the authors of IRGAN, we obtained all the hyperparameters required for the models. Multiple random seeds were used in vain, the results in the paper for Question-Answering tasks could not be replicated. We instead mention the best results out of all random seeds. We believe that if there is some random seed which gives better performance for IRGAN, it should do so for our model as well. The co-training model outperforms IRGAN-Pairwise.
185
+
186
+ Table 4: Results on Movielens Dataset
187
+
188
+ <table><tr><td>Model</td><td>P@5</td><td>NDCG@5</td></tr><tr><td>BPR (Rendle et al. (2009))</td><td>0.3044</td><td>0.3245</td></tr><tr><td>LambdaFM (Yuan et al. (2016))</td><td>0.3474</td><td>0.3749</td></tr><tr><td>IRGAN-pointwise</td><td>0.3750</td><td>0.4099</td></tr><tr><td>Single Discriminator</td><td>0.3675</td><td>0.3925</td></tr><tr><td>Co-training</td><td>0.345</td><td>0.373</td></tr></table>
189
+
190
+ Table 5: $\mathrm { P @ 1 }$ on InsuranceQA
191
+
192
+ <table><tr><td>Model</td><td>P@1</td></tr><tr><td>IRGAN-Pairwise Single Discriminator Co-training</td><td>0.616 0.614 0.623</td></tr></table>
193
+
194
+ # 8.4 LOSS CURVES
195
+
196
+ ![](images/9d9f5cbe6e06a42653d99ecdd9ebfc40d91d7554d358d409e99c9bf6be2943b1.jpg)
197
+ Figure 2: Performance curves
198
+
199
+ The loss curves in Figure 2 picked from IRGAN’s work show deteriorating performance of the generator, which is in contrast to what is observed in actual adversarial training. In the minimax setting, since the generator is expected to capture the real data distribution, its performance is supposed to improve and this can indirectly be seen in GANs and DCGANs where the samples generated look more and more like real-world data points. Further, a deteriorating generator implies that the discriminator’s improvement in performance is only because of the first term of $J ^ { D }$ , which hints that our proposed models might be able to do better than IRGAN. The reason offered in the paper is that “A worse generator could be the result of the sparsity of document distribution, i.e., each question usually has only one correct answer”. But this reason does not seem plausible, given that DCGANs have been able to model very high dimensional data, where the probability distribution is only a tiny part of the real space.
200
+
201
+ Further, the increase in performance of the discriminator in all cases is coupled with a deteriorating generator. This substantiates our claim that the discriminator and the generator are optimizing directly opposite loss functions.
202
+
203
+ Item-recommendation task is a little different from the other two tasks at hand because of a large number of positive answers. When the loss curves are plotted, though the generator’s performance improves, the discriminator’s loss remains high and almost constant throughout the procedure, as shown in Figure 3. This is another indication that the performance of IRGAN is not actually because of the adversarial setup, but because of the maximization of the likelihood of the real data.
204
+
205
+ # 9 CONNECTIONS TO PREVIOUS WORK
206
+
207
+ We have already shown in Section 2 that Conditional GANs are connected directly to Information Retrieval. The problem can also be viewed as a contextual multi-armed bandit problem (Li et al.
208
+
209
+ ![](images/6d5d7efb0cd7b45fd56ee19f6142f5ea5e2a0dd6ff2125a68691f433a1d369d9.jpg)
210
+ Figure 3: Discriminator Loss for Content-Recommendation
211
+
212
+ (2010)), where each documents is an arm and the context $x _ { q , d }$ can be used to determine the actionvalue function $f _ { \theta } ( x _ { q , d } )$ . In previous works (Li et al. (2010)) $f$ has been considered to be linear, but recent studies Collier & Llorens (2018) have modeled them as deep neural networks.
213
+
214
+ In Pfau & Vinyals (2016), a parallel is drawn between Actor-Critic algorithms (Konda & Tsitsiklis (2000)) and GANs. This is directly related to our work because REINFORCE (Sutton et al. (2000)) with a baseline can be connected to Actor-Critic algorithms when bootstrapping is used (Sutton & Barto (2018)). The work shows a restricted scenario which involves a stateless MDP, each action setting all the pixels of the image and cross-entropy loss instead of mean-squared Bellmann residual in which GANs are equivalent to Actor-Critic algorithms. But this equivalence holds only when the baseline term is not used so the formulation in IRGAN is not exactly equivalent to a GAN framework. Another study (Finn et al. (2016)) draws a parallel between Inverse Reinforcement Learning $\mathrm { N g }$ et al. (2000)) and GANs because both the methods try to “learn” the cost function to optimize for.
215
+
216
+ # 10 CONCLUSION AND FUTURE WORK
217
+
218
+ The experiments performed show that IRGAN is by no means state-of-the-art on those datasets. Further, the performance does not justify the large training time of 4 hours per generator epoch and 1 hour of discriminator epoch as opposed to 2 hours per epoch of the co-training model (11 GB GPU and Question Answering task). The shaky mathematical formulation renders the generator useless after training, and any gains in performance can be attributed directly to the first term of $J ^ { D }$ , where the likelihood of the real data is increased. We showed that the discriminator and generator are optimizing directly opposite loss functions and this is the cause of deleterious training.
219
+
220
+ The poor performance of IRGAN on Web-Search and Question Answering and only a satisfactory performance on Content-Recommendation (which has dense rewards) lead us to speculate that it does not work well in sparse reward scenarios. This is similar to a well-known problem called the Sparse Reward Reinforcement Learning. We think that a correct formulation along with established techniques from the former, like reward shaping $\mathrm { N g }$ et al. (1999)) may lead to better performance. Newer methods like Hindsight Experience Replay (Andrychowicz et al. (2017)) which allow models to learn both from mistakes and rewards may further ameliorate learning.
221
+
222
+ We would also like to explore in the direction of learning correct adversarial frameworks for more complex tasks like Image Retrieval and Question Answering which will involve learning end-toend trainable models. With advances in modeling sequences, this could also involve generation of documents rather than sampling them.
223
+
224
+ # REFERENCES
225
+
226
+ 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.
227
+
228
+ Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
229
+
230
+ Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235–256, 2002.
231
+
232
+ Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In Proceedings of the eleventh annual conference on Computational learning theory, pp. 92–100. ACM, 1998.
233
+
234
+ Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, pp. 7, 2017.
235
+
236
+ 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, pp. 89–96. ACM, 2005.
237
+
238
+ Christopher J Burges, Robert Ragno, and Quoc V Le. Learning to rank with nonsmooth cost functions. In Advances in neural information processing systems, pp. 193–200, 2007.
239
+
240
+ Mark Collier and Hector Urdiales Llorens. Deep contextual multi-armed bandits. arXiv preprint arXiv:1807.09809, 2018.
241
+
242
+ Antonia Creswell and Anil Anthony Bharath. Adversarial training for sketch retrieval. In European Conference on Computer Vision, pp. 798–809. Springer, 2016.
243
+
244
+ Minwei Feng, Bing Xiang, Michael R Glass, Lidan Wang, and Bowen Zhou. Applying deep learning to answer selection: A study and an open task. arXiv preprint arXiv:1508.01585, 2015.
245
+
246
+ Chelsea Finn, Paul Christiano, Pieter Abbeel, and Sergey Levine. A connection between generative adversarial networks, inverse reinforcement learning, and energy-based models. arXiv preprint arXiv:1611.03852, 2016.
247
+
248
+ 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.
249
+
250
+ Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint, 2017.
251
+
252
+ Vijay R Konda and John N Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pp. 1008–1014, 2000.
253
+
254
+ Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pp. 661–670. ACM, 2010.
255
+
256
+ Tie-Yan Liu, Jun Xu, Tao Qin, Wenying Xiong, and Hang Li. Letor: Benchmark dataset for research on learning to rank for information retrieval. In Proceedings of SIGIR 2007 workshop on learning to rank for information retrieval, volume 310. ACM Amsterdam, The Netherlands, 2007.
257
+
258
+ Tyler Lu, David P ´ al, and Martin P ´ al. Contextual multi-armed bandits. In ´ Proceedings of the Thirteenth international conference on Artificial Intelligence and Statistics, pp. 485–492, 2010.
259
+
260
+ Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
261
+
262
+ Andrew Y Ng, Daishi Harada, and Stuart Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In ICML, volume 99, pp. 278–287, 1999.
263
+
264
+ Andrew Y Ng, Stuart J Russell, et al. Algorithms for inverse reinforcement learning. In Icml, pp. 663–670, 2000.
265
+
266
+ David Pfau and Oriol Vinyals. Connecting generative adversarial networks and actor-critic methods. arXiv preprint arXiv:1610.01945, 2016.
267
+
268
+ Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
269
+
270
+ Steffen Rendle, Christoph Freudenthaler, Zeno Gantner, and Lars Schmidt-Thieme. Bpr: Bayesian personalized ranking from implicit feedback. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence, pp. 452–461. AUAI Press, 2009.
271
+
272
+ Ruslan Salakhutdinov and Hugo Larochelle. Efficient learning of deep boltzmann machines. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pp. 693–700, 2010.
273
+
274
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
275
+
276
+ Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
277
+
278
+ Jun Wang, Lantao Yu, Weinan Zhang, Yu Gong, Yinghui Xu, Benyou Wang, Peng Zhang, and Dell Zhang. Irgan: A minimax game for unifying generative and discriminative information retrieval models. In Proceedings of the 40th International ACM SIGIR conference on Research and Development in Information Retrieval, pp. 515–524. ACM, 2017.
279
+
280
+ Fajie Yuan, Guibing Guo, Joemon M Jose, Long Chen, Haitao Yu, and Weinan Zhang. Lambdafm: learning optimal ranking with factorization machines using lambda surrogates. In Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, pp. 227–236. ACM, 2016.
281
+
282
+ 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. arXiv preprint, 2017.
283
+
284
+ Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A Efros. Generative visual manipu- ¨ lation on the natural image manifold. In European Conference on Computer Vision, pp. 597–613. Springer, 2016.
285
+
286
+ # APPENDIX A HYPERPARAMETERS
287
+
288
+ The hyperparameters are mentioned in tables 6, 7, 8, 9 and 10. The following were the ranges of hyperparameter tuning, along with the best value. Gradient Descent Optimizer was used so that the comparison with IRGAN is fair.
289
+
290
+ Table 6: Single Discriminator for Web-Search
291
+
292
+ <table><tr><td>Hyperparameter/Seed</td><td>Range/List</td><td>Best</td></tr><tr><td>Learning Rate</td><td>0.002-0.2</td><td>0.004</td></tr><tr><td>Batch Size</td><td>[8,16,32]</td><td>8</td></tr><tr><td>Feature Size</td><td>[46,92]</td><td>46</td></tr><tr><td>Random Seed</td><td>[20,40,60]</td><td>40</td></tr></table>
293
+
294
+ For the co-training model, for every epoch, we optimize the two discriminators several times. We call these the outer and inner epochs in Table 7.
295
+
296
+ Table 7: Co-training for Web-Search
297
+
298
+ <table><tr><td>Hyperparameter/Seed</td><td>Range/List</td><td>Best</td></tr><tr><td>Learning Rate Outer Epochs Inner Epochs Batch Size Feature Size Random Seed</td><td>0.002-0.2 [30,50] [30,50] [8,16,32] [46,92]</td><td>0.006 50 30 8 46</td></tr></table>
299
+
300
+ DNS K in Table 8 represents the number of candidates that are chosen before performing the softmax. This is done to make the procedure computationally tractable. We use the value suggested in IRGAN.
301
+
302
+ Table 8: Single Discriminator for Content Recommendation
303
+
304
+ <table><tr><td>Hyperparameter/Seed</td><td>Range/List</td><td>Best</td></tr><tr><td>Learning Rate</td><td>0.01-0.05</td><td>0.02</td></tr><tr><td rowspan="3">Batch Size Embedding Dimension Random Seed</td><td>10</td><td>10</td></tr><tr><td>[20,40,60]</td><td>20</td></tr><tr><td>70</td><td>70</td></tr><tr><td>DNS_K</td><td>5</td><td>5</td></tr></table>
305
+
306
+ # APPENDIX B DESCRIPTION OF MODELS
307
+
308
+ The discriminator and the generator have the same architecture in all the tasks. For the Web-retrieval task, the model has a single hidden layer 46 units.
309
+
310
+ For the content-recommendation task, the model converts users and movies to a 5 dimensional embedding. This can be though to be a single hidden layer which compresses a one-hot user embedding to a 5 dimensional embedding.
311
+
312
+ For the Question-Answering task, each word is initialized to a 100 dimensional random vector. A Convolutional Neural Network is then used and the window size of the convolutional kernel is (1,2,3,5). A max-pooling-over-time strategy is then used and the output is a 100 dimensional vector because each feature map is pooled to a scalar. Note that this architecture is the same as the one used in the IRGAN paper. We refer the user to that for further description.
313
+
314
+ Table 9: Single Discriminator for Question Answering
315
+
316
+ <table><tr><td>Hyperparameter</td><td>Best</td></tr><tr><td>Learning Rate</td><td>0.05</td></tr><tr><td>Epochs</td><td>20</td></tr><tr><td>Batch Size</td><td>100</td></tr><tr><td>Embedding Dimension</td><td>100</td></tr></table>
317
+
318
+ Table 10: Co-training for Question Answering
319
+
320
+ <table><tr><td>Hyperparameter</td><td>Best</td></tr><tr><td>Learning Rate</td><td>0.05</td></tr><tr><td>Outer Epochs</td><td>20</td></tr><tr><td>Inner Epochs</td><td>1</td></tr><tr><td>Batch Size</td><td>100</td></tr><tr><td>Embedding Dimension</td><td>100</td></tr></table>
md/train/n646avOVJ7q/n646avOVJ7q.md ADDED
@@ -0,0 +1,478 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Global Convergence of Multi-Agent Policy Gradient in Markov Potential Games
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ Potential games are arguably one of the most important and widely studied classes of normal form games. They define the archetypal setting of multi-agent coordination as all agent utilities are perfectly aligned with each other via a common potential function. Can this intuitive framework be transplanted in the setting of Markov Games? What are the similarities and differences between multi-agent coordination with and without state dependence? We present a novel definition of Markov Potential Games (MPG) that generalizes prior attempts at capturing complex stateful multi-agent coordination. Counter-intuitively, insights from normal-form potential games do not carry over as MPGs can consist of settings where state-games can be zero-sum games. In the opposite direction, Markov games where every state-game is a potential game are not necessarily MPGs. Nevertheless, MPGs showcase standard desirable properties such as the existence of deterministic Nash policies. In our main technical result, we prove fast convergence of independent policy gradient to Nash policies by adapting recent gradient dominance property arguments developed for single agent MDPs to multi-agent learning settings.
11
+
12
+ # 16 1 Introduction
13
+
14
+ 17 Reinforcement learning (RL) has been a fundamental driver of numerous recent advances in Artificial
15
+ 18 Intelligence (AI) applications that range from super-human performance in competitive game-playing
16
+ 19 [28, 29, 5] and strategic decision-making in multiple tasks [21, 23, 33] to robotics, autonomous
17
+ 20 driving and cyber-physical systems [6, 37]. A core ingredient for the success of single-agent RL
18
+ 21 systems, which are typically modelled as Markov Decision Processes (MDPs), is the guarantee of
19
+ 22 existence of stationary deterministic optimal policies [3, 30]. This allows for the design of efficient
20
+ 23 algorithms that provably converge towards the optimal policy [1]. However, a majority of the above
21
+ 24 systems involve multi-agent interactions and despite the notable empirical advancements, there is
22
+ 25 a lack of understanding about the theoretical convergence guarantees of the existing multi-agent
23
+ 26 reinforcement learning (MARL) algorithms.
24
+ 27 The main challenge in the transition from single to multi-agent RL settings is the computation of
25
+ 28 Nash policies. A Nash policy for $n > 1$ agents is defined to be a profile of policies $( \pi _ { 1 } ^ { * } , . . . , \pi _ { n } ^ { * } )$ so
26
+ 29 that by fixing the stationary policies of all agents but $i$ , $\pi _ { i } ^ { * }$ is an optimal policy for the resulting
27
+ 30 single-agent MDP and this is true for all $1 \leq i \leq n ^ { \mathrm { ~ 1 ~ } }$ (see Definition 1). Note that in multi-agent
28
+ 31 settings, Nash policies may not be unique in principle.
29
+ 32 A common approach for computing Nash policies in MDPs is the use of policy gradient methods.
30
+ 33 The significant progress in the analysis of such methods during the last couple of years, including
31
+ 34 [1] (and references therein), mainly concerns the single-agent case: the convergence properties of
32
+ 35 policy gradient in MARL remain poorly understood. Existing steps towards a theory for multi-agent
33
+ 36 settings involve the papers of [10] who show convergence of independent policy gradient to the
34
+ 37 optimal policy, for two-agent zero-sum stochastic games, of [36] who improve the result of [10] using
35
+ 38 optimistic policy gradient and of [38] who study extensions of Natural Policy Gradient using function
36
+ 39 approximation. It is worth noting that the positive results of [10, 36] and [38] depend on the fact that
37
+ 40 two-agent stochastic zero-sum games satisfy the “min-max equals max-min” property [27] (even
38
+ 41 though the value-function landscape may not be convex-concave, which implies that Von Neumann’s
39
+ 42 celebrated minimax theorem may not be applicable).
40
+ 43 Model and Informal Statement of Results. While the previous works make progress in competi
41
+ 44 tive interactions, i.e., interactions in which gains can only come at the expense of others, MARL in
42
+ 45 cooperative settings remains largely under-explored and constitutes one of the current frontiers in AI
43
+ 46 research [9, 8]. Based on this, our work is motivated by the following natural question:
44
+
45
+ Can we get (provably) fast convergence guarantees for multi-agent RL settings in which cooperation is desirable?
46
+
47
+ 49 To address this question, we define and study a class of $n$ -agent MDPs that naturally generalize
48
+ 50 normal form potential games [22], called Markov Potential Games (MPGs). In words, a multi-agent
49
+ 51 MDP is a MPG as long as there exists a (state-dependent) real-valued potential function $\Phi$ so that if an
50
+ 52 agent $i$ changes their policy (and the rest of the agents keep their policy unchanged), the difference in
51
+ 53 agent $i$ ’s value/utility, $V ^ { i }$ , is captured by the difference in the value of $\Phi$ (see Definition 2). Weighted
52
+ 54 and ordinal MPGs are defined similar to the normal form counterparts (see Remark 1).
53
+ 55 Under our definition, we answer the above motivating question in the affirmative. In particular, we
54
+ 56 show that if every agent $i$ independently runs (with simultaneous updates) policy gradient on his
55
+ 57 utility/value $V ^ { i }$ , after ${ \cal O } ( 1 / \epsilon ^ { 2 } )$ iterations, the system will reach an $\epsilon$ -approximate Nash policy (see
56
+ 58 informal Theorem 1.1 and formal Theorem 4.2). Moreover, we show the finite sample analogue, that
57
+ 59 is if every agent $i$ independently runs (with simultaneous updates) stochastic policy gradient, then
58
+ 60 with high probability, the system will reach an $\epsilon$ -approximate Nash policy after ${ \cal O } ( 1 \bar { 1 } / \bar { \epsilon } ^ { 6 } )$ iterations.
59
+ 61 Along the way, we prove several properties about the structure of MPGs and their Nash policies (see
60
+ 62 Theorem 1.2 and Section 3). Our results can be summarized in the following two Theorems.
61
+ 63 Theorem 1.1 (Convergence of Policy Gradient (Informal)). Consider a MPG with n agents and let
62
+ 64 $\epsilon > 0$ . (a) If each agent i runs independent policy gradient using direct parameterization on his policy
63
+ 65 and that the updates are simultaneous, then, the learning dynamics reach an $\epsilon$ -Nash policy after
64
+ 66 $\mathcal { O } ( 1 / \epsilon ^ { 2 } )$ iterations. $( b )$ If each agent $i$ runs stochastic policy gradient using greedy parameterization
65
+ 67 (see (3)) on his policy and the updates are simultaneous, then the learning dynamics reach an $\epsilon$ -Nash
66
+ 68 policy after $\bar { \mathcal { O } } ( \bar { 1 } / \epsilon ^ { 6 } )$ iterations.
67
+
68
+ 69 This result holds trivially for weighted MPGs and asymptotically also for ordinal MPGs, see Remark 2.
69
+
70
+ Theorem 1.2 (Structural Properties of MPGs). The following facts are true for MPGs with $n$ -agents:
71
+
72
+ (a) There always exists a Nash policy profile $( \pi _ { 1 } ^ { * } , \ldots , \pi _ { n } ^ { * } )$ so that $\pi _ { i } ^ { * }$ is deterministic for each agent i (see Theorem 3.1).
73
+
74
+ (b) We can construct MDPs for which each state is an underlying potential game but the MDPs are not MPGs. This can be true regardless of whether the whole MDP is competitive or cooperative in nature (see Examples 1 and 2, respectively). On the opposite side, we can construct MDPs that are MPGs but which include states that are purely competitive (i.e., zero-sum games), see Example 3. (c) We provide sufficient conditions so that a MDP is a MPG. These include cases where each state is an underlying potential game and the transition probabilities are not affected by agents actions or the reward functions satisfy certain regularity conditions between different states (see conditions C1 and C2 in Proposition 3.2).
75
+
76
+ 81 Technical Overview. The first challenge in the proof of Theorem 1.1 is that multi-agent settings
77
+ 82 (MPGs) do not satisfy the gradient dominance property, which is an important part in the proof of
78
+ 83 convergence of policy gradient in single-agent settings [1]. In particular, there is no uniqueness of
79
+ 84 optimal policies and as a result, there is not a properly defined notion of value in MPGs (in contrast to
80
+ 85 zero-sum stochastic games [10]). On the positive side, we show that agent-wise (i.e., after fixing the
81
+ 86 policy of all agents but $i$ ), the value function, $V ^ { i }$ , satisfies the gradient dominance property along the
82
+ 87 direction of $\pi _ { i }$ (policy of agent $i$ ). This can be leveraged to show that every (approximate) stationary
83
+ 88 point (Definition 4) of the potential function $\Phi$ is an (approximate) Nash policy (Lemma 4.1). As a
84
+ 89 result, convergence to an approximate Nash policy is established by showing that $\Phi$ is smooth and
85
+ 90 then applying Projected Gradient Ascent (PGA) on $\Phi$ . This step uses the rather well-known fact that
86
+ 91 (PGA) converges to $\epsilon$ -stationary points in ${ \cal O } ( 1 / \epsilon ^ { 2 } )$ iterations for smooth functions. As a result, by
87
+ 92 applying PGA on the potential $\Phi$ , one gets an approximate Nash policy. Our convergence result then
88
+ 93 follows by showing that PGA on the potential function, $\Phi$ , generates the same dynamics as if each
89
+ 94 agent $i$ runs independent PGA on their value function, $V ^ { i }$ .
90
+ 95 In the case that agents do not have access to exact gradients, we derive a similar result for finite
91
+ 96 samples. In this case, we apply Projected Stochastic Gradient Ascent (PSGA) on $\Phi$ which (as was
92
+ 97 the case for PGA) can be shown to be the same as when agents apply PSGA independently on their
93
+ 98 individual value functions. The key is to get an unbiased sample for the gradient of the value functions
94
+ 99 and prove that it has bounded variance (in terms of the parameters of the MPG). This comes from the
95
+ 100 discount factor, $\gamma$ ; in this case, $1 - \gamma$ can be interpreted as the probability to terminate the MDP at
96
+ 101 a particular state (and $\gamma$ to continue). This can be used to show that a trajectory of the MDP is an
97
+ 102 unbiased sample for the gradient of the value functions. To guarantee that the estimate has bounded
98
+ 103 variance, we apply the approach of [10] which requires that agents perform PSGA with $\alpha$ -greedy
99
+ 104 exploration (see (3)). The main idea is that this parameterization stays away from the boundary of the
100
+ 105 simplex throughout its trajectory.
101
+ 106 Concerning our structural results in Theorem 1.2, the main challenge is (again) the lack of a value in
102
+ 107 general multi-agent settings and the dependence of state-transitions (in addition to agents’ rewards)
103
+ 108 on agents’ actions. The proof of Theorem 3.1 shows that these issues can be still successfully handled
104
+ 109 within the class of MPGs by studying single-agent deviations (to deterministic optimal policies)
105
+ 110 which keep the value of the potential constant (at its global maximum). Our examples in this part
106
+ 111 show that the class of MPGs can be significantly larger than state based potential games but also that
107
+ 112 even simple coordination games may fail to satisfy the (exact) MPG property.
108
+
109
+ # 113 2 Preliminaries
110
+
111
+ 114 Markov Decision Process (MDP). The following notation is standard and largely follows [1] and
112
+ 115 [10]. We consider a setting with $n$ agents who repeatedly select actions in a shared Markov Decision
113
+ 116 Process (MDP). The goal of each agent is to maximize their respective value function. Formally, a
114
+ 117 MDP is defined as a tuple $\mathcal { G } = ( \mathcal { S } , \mathcal { \bar { N } } , \{ A _ { i } , R _ { i } \} _ { i \in \mathcal { N } } , P , \gamma , \rho )$ , where $s$ is a finite state space of size
115
+ 118 $S = | S |$ , $\mathcal { N } = \{ 1 , 2 , \dots , n \}$ is a the set of active agents in the MDP and $\mathbf { \mathcal { A } } _ { i }$ is a finite action space of
116
+ 119 size $A _ { i } = | { \mathcal { A } } _ { i } |$ for each agent $i \in \mathcal N$ with generic element $a _ { i } \in { \mathcal { A } } _ { i }$ . We will write $\begin{array} { r } { \mathcal { A } = \prod _ { i \in \mathcal { N } } \mathcal { A } _ { i } } \end{array}$
117
+ 120 and $\begin{array} { r } { \mathcal { A } _ { - i } = \prod _ { j \neq i } \mathcal { A } _ { j } } \end{array}$ to denote the joint action spaces of all agents and of all agents other than $i$
118
+ 121 with generic elements $\mathbf { a } = ( a _ { i } ) _ { i \in \mathcal { N } }$ and $\mathbf { a } _ { - \mathbf { i } } = ( a _ { j } ) _ { j \neq i }$ , respectively. $R _ { i } : S \times A \to [ - 1 , 1 ]$ is the
119
+ 122 individual reward function of agent $i \in \mathcal N$ , i.e., $R _ { i } \mathbf { \bar { ( } } s , a _ { i } , \mathbf { a } _ { - i } )$ is the instantaneous reward of agent $i$
120
+ 123 when agent $i$ takes action $a _ { i }$ and all other agents take actions $\mathbf { a } _ { - i }$ at state $s \in S$ . $P$ is the transition
121
+ 124 probability function, for which $P ( s ^ { \prime } \mid s , \bar { \mathbf { a } } )$ is the probability of transitioning from $s$ to $s ^ { \prime }$ when
122
+ 125 $\mathbf { a } \in { \mathcal { A } }$ is the action profile chosen by the agents. Finally, $\gamma$ is a discount factor for future rewards of
123
+ 126 the MDP, shared by all agents and $\rho \in \Delta ( \mathcal { S } )$ is a distribution for the initial state at time $t = 0$ . 2
124
+ 127 Whenever time is relevant, we will index the above terms with $t$ . In particular, at each time step
125
+ 128 $t \geq 0$ , all agents observe the state $s _ { t } ~ \in ~ S$ , select actions $\mathbf { a } _ { t } ~ = ~ ( a _ { i , t } , \mathbf { a } _ { - i , t } )$ , receive rewards
126
+ 129 $r _ { i , t } : = R _ { i } ( s _ { t } , \mathbf { a } _ { t } ) , i \in \mathcal { N }$ and transition to the next state $s _ { t + 1 } \sim P ( \cdot \mid s _ { t } , \mathbf { a } _ { t } )$ . We will write
127
+ 130 $\boldsymbol { \tau } = ( s _ { t } , \mathbf { a } _ { t } , \mathbf { r } _ { t } ) _ { t \geq 0 }$ to denote the trajectories of the system, where $\mathbf { r } _ { t } : = ( r _ { i , t } ) , i \in \mathcal { N }$ .
128
+
129
+ Policies and Value Functions. For each agent $i \in \mathcal N$ , a deterministic, stationary policy $\pi _ { i } : { \cal { S } } $ $A _ { i }$ specifies the action of agent $i$ at each state $s \in S$ , i.e., $\pi _ { i } ( s ) = a _ { i } \in { \mathcal { A } } _ { i }$ for each $s \in S$ . A stochastic, stationary policy $\pi _ { i } : { \mathcal { S } } \Pi _ { i }$ , where $\Pi _ { i } : = \Delta ( { \mathcal { A } } _ { i } ) ^ { S }$ , specifies a probability distribution over the actions of agent $i$ for each state $s \in S$ . In this case, we will write $a _ { i } \sim \pi _ { i } ( \cdot \mid s )$ to denote the randomized action of agent $i$ at state $s \in S$ . As above, we will write $\pi = ( \pi _ { i } ) _ { i \in \mathcal { N } } \in \Pi : =$ $\times _ { i \in \mathcal { N } } \Delta ( \mathcal { A } _ { i } ) ^ { S }$ and $\pi _ { - i } = ( \pi _ { j } ) _ { i \neq j \in N } \in \Pi _ { - i } : = \times _ { i \neq j \in N } \Delta ( \mathcal { A } _ { j } ) ^ { S }$ to denote the joint policies of all agents and of all agents other than $i$ , respectively. A joint policy $\pi$ induces a distribution $\mathrm { P r } ^ { \pi }$ over trajectories $\boldsymbol { \tau } = ( s _ { t } , \mathbf { a } _ { t } , \mathbf { r } _ { t } ) _ { t \geq 0 }$ , where $s _ { 0 }$ is drawn from the initial state distribution $\rho$ and $a _ { i , t }$ is drawn from $\pi _ { i } ( \cdot \mid s _ { t } )$ for all $i \in \mathcal N$ .
130
+
131
+ 140 The value function, $V _ { s } ^ { i } : \Pi \mathbb { R }$ , gives the expected reward of agent $i \in \mathcal N$ when $s _ { 0 } = s$ and the agents draw their actions, 141 $\mathbf { a } _ { t } = \left( a _ { i , t } , \mathbf { a } _ { - i , t } \right)$ , at time $t \geq 0$ from policies $\pi = ( \pi _ { i } , \pi _ { - i } )$
132
+
133
+ $$
134
+ V _ { s } ^ { i } ( \pi ) : = \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { i , t } \mid s _ { 0 } = s \right] .
135
+ $$
136
+
137
+ 142 We also denote $V _ { \rho } ^ { i } ( \pi ) = \mathbb { E } _ { s \sim \rho } \left[ V _ { s } ^ { i } ( \pi ) \right]$ if the initial state is random and follows distribution $\rho$ . The
138
+ 143 solution concept that we will be focusing on are the Nash Policies. Formally:
139
+ 144 Definition 1 ( $\epsilon$ -Nash Policy). A joint policy $\pi ^ { * } = ( \pi _ { i } ^ { * } ) _ { i \in \mathcal { N } }$ is an $\epsilon$ -Nash policy if there exists an $\epsilon \geq 0$
140
+ 145 so that for each agent $i \in \mathcal N$ , $V _ { s } ^ { i } ( \pi _ { i } ^ { * } , \pi _ { - i } ^ { * } ) \geq V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ^ { * } ) - \epsilon .$ , for all $\pi _ { i } \in \Delta ( \mathcal { A } _ { i } ) ^ { S }$ , and all $s \in S$ .
141
+ 146 If $\epsilon = 0$ , then $\pi ^ { * }$ is a called a Nash policy. In this case, $\pi _ { i } ^ { * }$ maximizes each agent $i$ ’s value function
142
+ 147 for each starting state $s \in S$ given the policies, $\pi _ { - i } ^ { * } = ( \pi _ { j } ^ { * } ) _ { j \neq i }$ , of all other agents $j \neq i \in \mathcal { N }$ . The
143
+ 148 definition of a Nash policy remains the same if $s \sim \rho$ (random starting state).
144
+
145
+ # 3 Markov Potential Games
146
+
147
+ 50 We are now ready to define the class of MDPs that we will focus on for the rest of the paper, i.e.,
148
+ 51 Markov Potential Games.
149
+ 52 Definition 2 (Markov Potential Game). A Markov Decision Process (MDP), $\mathcal { G }$ , is called a Markov
150
+ 153 Potential Game (MPG) if there exists a (state-dependent) function $\Phi _ { s } : \Pi \mathbb { R }$ for $s \in S$ so that
151
+
152
+ $$
153
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) = V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) ,
154
+ $$
155
+
156
+ for all agents 154 $i \in \mathcal N$ , all states $s \in S$ and all policies $\pi _ { i } , \pi _ { i } ^ { \prime } \in \Pi _ { i } , \pi _ { - i } \in \Pi _ { - i }$ . We should note that 155 by linearity of expectation, it follows that $\Phi _ { \rho } ( { \bar { \pi } } _ { i } , { \pi } _ { - i } ) - \Phi _ { \rho } ( \pi _ { i } ^ { \prime } , { \pi } _ { - i } ) = V _ { \rho } ^ { i } ( \pi _ { i } , { \pi } _ { - i } ) - V _ { \rho } ^ { i } ( \pi _ { i } ^ { \prime } , { \pi } _ { - i } )$ , 156 where $\Phi _ { \rho } ( \pi ) : = \mathbb { E } _ { s \sim \rho } \left[ \Phi _ { s } ( \pi ) \right]$ .
157
+
158
+ 157 As in normal-form games, an immediate consequence of this definition is that the value function of
159
+ 158 each agent in a MPG can be written as a sum of the potential (common term) and a term that does not
160
+ 159 depend on that agent’s policy (dummy term), cf. Proposition B.1 in Appendix B, i.e., for each agent
161
+ 160 $i \in \mathcal N$ there exists a function $U _ { s } ^ { i } : \Pi _ { - i } \xrightarrow { } \mathbb { R }$ so that $\begin{array} { r } { \dot { V } _ { s } ^ { i } ( \pi ) = \Phi _ { s } ( \pi ) \dot { + } \dot { U } _ { s } ^ { i } ( \pi _ { - i } ) } \end{array}$ , for all $\pi \in \Pi$ .
162
+ 161 Remark 1 (Ordinal and Weighted Potential Games). Similar to normal-form games, we may also
163
+ 162 define more general notions of MPGs, such as weighted or ordinal MPGs. Specifically, if there exist
164
+ 163 positive constants $w _ { i } > 0 , i \in \mathcal { N }$ so that
165
+
166
+ $$
167
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) = w _ { i } ( V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) ) ,
168
+ $$
169
+
170
+ 164 then $\mathcal { G }$ is called a Weighted Markov Potential Game (WMPG). If for all agents $i \in \mathcal N$ , all states $s \in S$ and all policies165 $\pi _ { i } , \pi _ { i } ^ { \prime } \in \Pi _ { i } , \pi _ { - i } \in \Pi _ { - i }$ , the function $\Phi _ { s } , s \in { \cal S }$ satisfies
171
+
172
+ $$
173
+ \Phi _ { s } ( \pi _ { i } , \pi _ { - i } ) - \Phi _ { s } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) > 0 \Longleftrightarrow V _ { s } ^ { i } ( \pi _ { i } , \pi _ { - i } ) - V _ { s } ^ { i } ( \pi _ { i } ^ { \prime } , \pi _ { - i } ) > 0 ,
174
+ $$
175
+
176
+ 166 then the MPD, $\mathcal { G }$ , is called an Ordinal Markov Potential Game (OMPG).
177
+
178
+ 167 Similarly to normal-form games, such classes are naturally motivated also in the setting of multi-agent
179
+ 168 MDPs. As Example 2 shows, even simple potential-like settings, i.e., settings in which coordination is
180
+ 169 desirable for all agents, may fail to be exact MPGs (but may still be ordinal or weighted MPGs). From
181
+ 170 our current perspective, ordinal and weighted MPGs remain relevant, since our main convergence
182
+ 171 results on the convergence of policy gradient carry over (in an exact or asymptotic sense) also in these
183
+ 172 classes of games (see Remark 2). As with the rest of the proofs (and technical details) of Section 3,
184
+ 173 the proof of Theorem 3.1 is provided in Appendix B.
185
+ 174 Existence of Deterministic Nash Policies in MPGs. Before studying which types of MDPs are
186
+ 175 captured by Definition 2, we first show that MPGs always possess deterministic Nash policies
187
+ 176 (similarly to their single-state counterparts, i.e., normal-form potential games [22]). This is established
188
+ 177 in Theorem 3.1, which settles part (a) of Theorem 1.2
189
+ 178 Theorem 3.1 (Deterministic Optimal Policy Profile). Let $\mathcal { G }$ be a Markov Potential Game (MPG).
190
+ 179 Then, there exists a Nash policy $\pi ^ { * } \in \Delta ( \mathcal { A } ) ^ { \bar { S } }$ which is deterministic, i.e., for each agent $i \in \mathcal N$ and
191
+ 180 each state $s \in S$ , there exists an action $a _ { i } \in { \mathcal { A } } _ { i }$ so that $\pi _ { i } ^ { * } ( a _ { i } \mid s ) = 1$ .
192
+ 181 Starting from an arbitrary Nash policy profile that is also a global maximizer of the potential function,
193
+ 182 the proof of Theorem 3.1 (which is deferred to Appendix B) relies on an iterative reduction process
194
+ 183 of its non-deterministic components. At each iteration, we isolate an agent $i \in \mathcal N$ , and find a
195
+ 184 deterministic (optimal) policy for that agent in the (single-agent) MDP in which the policies of all
196
+ 185 other agents but $i$ remain fixed. The important observation is that the resulting profile is again a
197
+ 186 global maximizer of the potential and hence, a Nash policy profile. This argument critically relies on
198
+ 187 the MPG structure and does not seem directly generalizable to MDPs that do not satisfy Definition 2.
199
+ 188 Sufficient Conditions for MPGs. Based on the above, it is tempting to think that MDPs which
200
+ 189 are potential at every state (meaning that the immediate rewards at every state are captured by a
201
+ 190 (normal-form) potential game at that state) are trivially MPGs. As we show in Examples 1 and 2,
202
+ 191 this intuition fails in the most straightforward way: we can construct simple MDPs that are potential
203
+ 192 at every state but which are purely competitive (do not possess a deterministic Nash policy) overall
204
+ 193 (Example 1) or which are cooperative in nature overall but which do not possess an exact potential
205
+ 194 function (Example 2).
206
+ 195 Example 1. Consider the MDP in Figure 1. To show that $\mathcal { G }$ is not a MPG, it suffices to show that
207
+ 196 it cannot have a deterministic optimal policy as should be the case according to Theorem 3.1. To
208
+ 197 obtain a contradiction, assume that agent $A$ is using a deterministic action $\bar { a _ { A } ^ { 0 } } \in \{ 0 , 1 \}$ at state 0.
209
+ 198 Then, agent $B$ , who prefers to move to state 1, will optimize their utility by choosing the action
210
+ 199 $a _ { B } ^ { 0 } \in \{ \bar { 0 } , 1 \}$ that yields $a _ { A } ^ { 0 } \oplus a _ { B } ^ { 0 } = 1$ . In other words, given any deterministic action of agent $A$ at
211
+ 200 state 0, agent can choose an action that always moves the sequence of play to state 1. Thus, such
212
+ 201 an action cannot be optimal for agent $A$ which implies that the MDP $\mathcal { G }$ does not have a deterministic
213
+ 202 optimal policy profile as claimed.
214
+ 203 Intuitively, competition arises in Example 1 because the two agents play a game of matching pennies
215
+ 204 in terms of the states that they prefer (which can be determined by the actions that they choose)
216
+ 205 despite the fact that the immediate rewards at each state are determined by normal form potential
217
+ 206 games. Example 2 shows that a state-based potential game may fail to be a MPG even if agents have
218
+ 207 similar preferences over states.
219
+
220
+ ![](images/25eebbe0f304e858ef30497a0424e6699307c9f7b0026115cdb5c3ff8ee0e999.jpg)
221
+ Figure 1: A MDP with normal-from potential games at each state (shown in matrix form below each state) but which is not a MPG due to conflicting preferences over states.
222
+
223
+ ![](images/379464134e3be8df89bc525d5bad6939a364104c0c03c5ada11db47cde21f67e.jpg)
224
+ Figure 2: A MDP with normal-form potential games at each state which is an ordinal MPG but not a MPG despite common preferences over states.
225
+
226
+ Example 2. In $s _ { 0 }$ the agents play a Battle of the Sexes game and hence a potential game, while in $s _ { 1 }$ they receive no reward (which is trivially a potential game). A simple calculation shows that there is not an exact potential function due to the dependence of the transitions on agents’ actions (thus, this MDP is not a MPG). However, in the case of Example 2, it is straightforward to show that the game is an ordinal potential game, cf. Appendix B.1.
227
+
228
+ 13 The previous discussion focuses on games that consist of normal-form potential games at every state,
229
+ 14 which leaves an important question unanswered: are there games which are not potential at every
230
+ 15 state but which are captured by the current definition of MPGs? Example 3 (see Figure 3) answers
231
+ 16 this question affirmatively. Together with Example 1, this settles the claim in Theorem 1.2, part (b).
232
+
233
+ Proposition 3.2 (Sufficient Conditions for MPGs). Consider a MDP $\mathcal { G }$ in which every state $s \in S$ is a potential game, i.e., the immediate rewards $R ( s , \mathbf { a } ) = ( R _ { i } ( s , \mathbf { a } ) ) _ { i \in \mathcal { N } }$ for each state $s \in S$ are captured by the utilities of a potential game with potential function $\phi _ { s }$ . Additionally, assume that one of the following conditions holds
234
+
235
+ C1. Agent-Independent Transitions: $P ( s ^ { \prime } \mid s , \mathbf { a } )$ does not depend on a, that is, $P ( s ^ { \prime } \mid s , \mathbf { a } ) = P ( s ^ { \prime } \mid$ s) is just a function of the present state for all states $s , s ^ { \prime } \in S$ .
236
+
237
+ ![](images/a20aa384317ec73757b9c06d5b6ef1aed0728c901971924c71eb5202cfeec416.jpg)
238
+ Figure 3: A 2-player MDP which is not potential at every state but which is overall an MPG. While state $s _ { 1 }$ corresponds to a zero-sum game, the states inside the dotted rectangle do form a potential game which can be used to show the MPG property whenever $p _ { 0 }$ does not depend on agents’ actions.
239
+
240
+ C2. Equality of Individual Dummy Terms: $P ( s ^ { \prime } \mid s , \mathbf { a } )$ is arbitrary but the dummy terms of each agent’s immediate rewards are equal across all states, i.e., there exists a function $u ^ { i } : \Delta ( \bar { \mathcal { A } } _ { - i } ) ^ { S } \mathbb { R }$ such that $R _ { i } ( s , a _ { i } , \bar { \mathbf { a } _ { - i } } ) = \phi _ { s } ( \pi _ { i } , \pi _ { - i } ) + u ^ { i } ( \pi _ { - i } )$ , for all states $s \in S$ .
241
+
242
+ 26 If either C1 or $C 2$ are true, then $\mathcal { G }$ is a MPG.
243
+
244
+ Relation to Other Works on MPGs Condition C2 (or variations of it) is also known as statetransitivity and is present as requirement in the existing definitions of potential-like MDPs, see e.g., [16, 19, 20] and along with some additional conditions on the transitions also in [32]. Example 3 shows that such conditions are restrictive, in the sense that they do not capture simple MDPs that intuitively have a cooperative structure. Similarly, Example 2 motivates the study of weighted or ordinal MPGs (cf. Remark 1). As we show, our convergence results about independent policy gradient naturally apply to these classes as well (see Remark 2).
245
+
246
+ 234 Another sufficient condition for a MPD that is potential at every state to be a MPG is that the
247
+ 235 instantaneous rewards of all agents are the same at each state, i.e., that $R _ { i } ( s , a _ { i } , \mathbf { a } _ { - i } ) = \phi _ { s } ( a _ { i } , \mathbf { a } _ { - i } )$
248
+ 236 for all agents $i \in \mathcal N$ , all actions $a _ { i } \in { \mathcal { A } } _ { i }$ and all states $s \in S$ . MDPs that satisfy this condition are
249
+ 237 called Team Markov Games and their analysis trivially boils down to single agent settings. However,
250
+ 238 they constitute the only (to the best of our knowledge) cooperative multi-agent setting (covered by
251
+ 239 MPGs) that have been successfully addressed in terms of convergence of independent policy gradient
252
+ 240 prior to this work, [35].
253
+
254
+ # 241 4 Convergence of Policy Gradient in Markov Potential Games
255
+
256
+ 242 The current section presents the main lemmas and steps for the proof of convergence of (projected)
257
+ 243 policy gradient (and its stochastic variant) to approximate Nash policies in Markov Potential Games
258
+ 244 (MPGs). We analyze these cases using direct and $\alpha$ -greedy parameterization, respectively. All proofs
259
+ 245 and auxiliary materials are deferred to the supplementary material (full version).
260
+ 246 Independent Policy Gradient and Direct Parameterization. We assume that all agents update
261
+ 247 their policies independently according to the projected gradient ascent $( P G A )$ or policy gradient
262
+ 248 algorithm. Independence here refers to the fact that (PGA) requires only local information (each
263
+ 249 agent’s own rewards, actions and view of the environment) to determine the updates. Such protocols
264
+ 250 are naturally motivated in distributed AI settings in which all information about the interacting agents,
265
+ 251 the type of interaction and the agent’s actions (policies) is encoded in the environment of each agent.3
266
+ 252 The PGA algorithm is given by
267
+
268
+ $$
269
+ \pi _ { i } ^ { ( t + 1 ) } : = P _ { \Delta ( A _ { i } ) ^ { S } } \left( \pi _ { i } ^ { ( t ) } + \eta \nabla _ { \pi _ { i } } V _ { \rho } ^ { i } ( \pi ^ { ( t ) } ) \right) ,
270
+ $$
271
+
272
+ for each agent $i \in \mathcal N$ , where $P _ { \Delta } ( \mathcal { A } _ { i } ) ^ { S }$ is the projection onto $\Delta ( \mathcal { A } _ { i } ) ^ { S }$ in the Euclidean norm. Here, the additional argument $t \geq 0$ denotes time. We also assume that all players $i \in \mathcal N$ use direct policy parameterizations, i.e., $\pi _ { i } ( a \mid s ) = x _ { i , s , a }$ , with $x _ { i , s , a } ~ \geq ~ 0$ for all $s \in \mathcal { S } , a \in \mathcal { A } _ { i }$ and $\textstyle \sum _ { a \in { \mathcal { A } } _ { i } } x _ { i , s , a } = 1$ for all $s \in S$ . This parameterization is complete in the sense that any stochastic policy can be represented in this class [1].
273
+
274
+ 258 In practice, agents use projected stochastic gradient ascent (PSGA), according to which, the actual
275
+ 259 gradient, $\nabla _ { \pi _ { i } } V _ { \rho } ^ { i } ( \pi ^ { ( t ) } )$ , is replaced by an estimate thereof that is calculated from a randomly selected
276
+ 260 (yet finite) sample of trajectories of the MDP. This estimate, $\hat { \nabla } _ { \pi _ { i } } ^ { ( t ) }$ may be derived from a single or a
277
+ 261 batch of observations which in expectation behave as the actual gradient. We choose the estimate of
278
+ 262 the gradient of $V _ { \rho } ^ { i }$ to be
279
+
280
+ $$
281
+ \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } = R _ { i } ^ { ( T , t ) } \sum _ { k = 0 } ^ { T } \nabla \log \pi _ { i } ( a _ { k } ^ { ( t ) } \mid s _ { k } ^ { ( t ) } ) ,
282
+ $$
283
+
284
+ where st0 ∼ ρ, and R(T ,t)i 263 $\begin{array} { r } { R _ { i } ^ { ( T , t ) } = \sum _ { k = 0 } ^ { T } r _ { i , t } ^ { k } } \end{array}$ is the sum of rewards of agent $i$ for a bat h of time horizon $T$ 264 along the trajectory generated by the stochastic gradient ascent algorithm at its $t$
285
+
286
+ 265 The direct parameterization is not sufficient to ensure that the variance of the gradient estimator is
287
+ 266 bounded (as policies approach the boundary). In this case, we will require that each agent $i \in \mathcal N$
288
+ 267 uses instead direct parameterization with $\alpha$ -greedy exploration as follows
289
+
290
+ $$
291
+ \pi _ { i } ( a \mid s ) = ( 1 - \alpha _ { i } ) x _ { i , s , a } + \alpha / A _ { i } ,
292
+ $$
293
+
294
+ 268 where $\alpha$ is the exploration parameter for all agents. Under greedy exploration, it can be shown that
295
+ 269 (2) is unbiased and has bounded variance for $\alpha$ -greedy exploration (see Lemma 4.3). The form of
296
+ 270 PSGA is given below:
297
+
298
+ $$
299
+ \pi _ { i } ^ { ( t + 1 ) } : = P _ { \Delta ( A _ { i } ) ^ { S } } \left( \pi _ { i } ^ { ( t ) } + \eta \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } \right) .
300
+ $$
301
+
302
+ 271 Proofs of main results. The first step is to observe that, in MPGs, the (partial) derivatives of
303
+ 272 the value functions and the potential function are equal, i.e., $\nabla _ { \pi _ { i } } V _ { s } ^ { i } ( \pi ) = \bar { \nabla } _ { \pi _ { i } } \Phi ( \pi )$ for all $i \in \mathcal N$
304
+ 273 (property P2 in Proposition B.1). Together with the separability of the projection operator, i.e., the fact
305
+ 274 that projecting independently for each agent $i$ on $\Delta ( \dot { A } _ { i } ) ^ { S }$ is the same as jointly projecting on $\Delta ( { \mathcal { A } } ) ^ { S }$
306
+ 275 (see Lemma 4.1), this establishes that running (PGA) or (PSGA) on each agent’s value function is
307
+ 276 equivalent to running (PGA) or (PSGA) on the potential function $\Phi$ .
308
+
309
+ 277 Based on the above, the next step is to study the stationary points of $\Phi$ . Lemma 4.1 suggests that 278 as long as policy gradient reaches a point $\pi ^ { ( \dot { t } ) }$ with small gradient along the directions in $\Delta ( { \mathcal { A } } ) ^ { S }$ , it must be the case that 279 $\pi ^ { ( t ) }$ is an approximate Nash policy.
310
+
311
+ Lemma 4.1 (Stationarity of $\Phi$ implies Nash). Let √ $\epsilon \geq 0$ , $\pi$ be an $\epsilon$ -stationary point of $\Phi$ (see Definition 4). Then, it holds that $\pi$ is a SD -Nash policy.
312
+
313
+ 282 Lemma 4.1 will be the one of two mains ingredients to establish convergence of (PGA) and (PSGA).
314
+ 283 To prove Lemma 4.1, we will use an agent-wise version of the “Gradient Domination property”, that
315
+ 284 has been shown to hold in single-agent MDPs [1] (see Lemma 4.3). The second main ingredient is
316
+ 285 the fact that $\Phi$ is a $\beta$ -smooth function (its gradient is Lipschitz) with parameter $\begin{array} { r } { \beta = \frac { 2 n \gamma \bar { A } _ { \mathrm { m a x } } } { ( 1 - \gamma ) ^ { 3 } } } \end{array}$ .
317
+ 286 Exact gradients case. Theorem 1.1 (restated formally below) about rates of convergence of (PGA)
318
+ 287 can now be proved following standard arguments (in particular an ascent property, Lemma D.1),
319
+ 288 on analysis of convergence of gradient descent to approximate stationary points in non-convex
320
+ 289 optimization [11]. The ascent lemma suggests that for any $\beta$ -smooth function, $f$ , it holds that
321
+ 290 $\begin{array} { r } { f ( x ^ { \prime } ) - f ( x ) \geq \frac { 1 } { 2 \beta } \left\| x ^ { \prime } - x \right\| _ { 2 } ^ { 2 } } \end{array}$ , where $x ^ { \prime }$ is the next iterate of (PGA). Thus, having shown that $\Phi$ is a
322
+ 291 $\beta$ -smooth function, the ascent lemma implies in our setting that
323
+
324
+ $$
325
+ \Phi _ { \mu } ( \pi ^ { ( t + 1 ) } ) - \Phi _ { \mu } ( \pi ^ { ( t ) } ) \geq \frac { ( 1 - \gamma ) ^ { 3 } } { 4 \gamma A _ { \operatorname* { m a x } } n } \left\| \pi ^ { ( t + 1 ) } - \pi ^ { ( t ) } \right\| _ { 2 } ^ { 2 } .
326
+ $$
327
+
328
+ 292 Putting everything together, we can show the following theorem.
329
+
330
+ 93 Theorem 4.2 (Formal Theorem 1.1, part (a)). Let $\mathcal { G }$ be a MPG and let $s _ { 0 } \in S$ denote an arbitrary 4 initial state. Let also Amax = maxi |Ai|, and set the number of iterations to be T = 16γnD2SAmax(1−γ)52 and the learning rate (step-size) to be 5 $\begin{array} { r } { \eta = \frac { ( 1 - \gamma ) ^ { 3 } } { 2 \gamma A _ { \mathrm { m a x } } n } } \end{array}$ . If the agents run independent projected policy gradient $( P G A )$ starting from arbitrarily initialized policies, then there exists a $t \in \{ 1 , \ldots , T \}$ such that 97 $\pi ^ { ( t ) }$ is an $\epsilon$ -approximate Nash policy.
331
+
332
+ 298 Finite samples case. In the case of finite samples, we analyze (PSGA) on the value $V ^ { i }$ of each
333
+ 299 agent $i$ which (as was the case for PGA) can be shown to be the same as applying projected gradient
334
+ 300 ascent on $\Phi$ . In this case, we choose $\alpha$ -greedy parametrization with $\alpha$ chosen appropriately. The
335
+ 301 key is to get an estimate of the gradient of $\Phi$ (see (2)) at every iterate. Lemma 4.3 argues that the
336
+ 302 estimator of equation (2) is unbiased and has bounded variance.
337
+
338
+ Lemma 4.3 (Unbiased estimator with bounded variance ). It holds that 303 $\hat { \nabla } _ { \pi _ { i } } ^ { ( t ) }$ is an unbiased estimator 304 of $\nabla _ { \pi _ { i } } \Phi$ with bounded variance for all $i \in \mathcal N$ , i.e.,
339
+
340
+ $$
341
+ \mathbb { E } _ { \pi ^ { ( t ) } } \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } = \nabla _ { \pi _ { i } } \Phi _ { \mu } \big ( \pi ^ { ( t ) } \big ) , w i t h \mathbb { E } _ { \pi ^ { ( t ) } } \left. \hat { \nabla } _ { \pi _ { i } } ^ { ( t ) } \right. _ { 2 } ^ { 2 } \leq \frac { 2 4 A _ { \operatorname* { m a x } } ^ { 2 } } { \epsilon ( 1 - \gamma ) ^ { 4 } } , f o r a
342
+ $$
343
+
344
+ 305 In this case, $1 - \gamma$ captures the probability for the MDP to terminate after each round since we
345
+ 306 consider finite length trajectories. Using the above, we can now state part (b) of Theorem 1.1.
346
+ 307 Together with Lemma 4.3 and the stationarity-Lemma (Lemma 4.1), i.e., that stationary points of $\Phi$
347
+ 308 are Nash policies, its proof uses the smoothness of $\Phi$ and existing tools for the analysis of stochastic
348
+ 309 gradient descent for non-convex functions.
349
+
350
+ Theorem 4.4 (Formal Theorem 1.1, part (b)). Let $\mathcal { G }$ be a MPG and let $s _ { 0 } \in S$ denote an arbitrary initial state. Let Amax = maxi |Ai|, and set the number of iterations to be T = 48(1−γ)AmaxD4S2δ46γ3 and the learning rate (step-size) to be $\begin{array} { r } { \eta = \frac { \epsilon ^ { 4 } ( 1 - \gamma ) ^ { 3 } \gamma } { 4 8 n D ^ { 2 } A _ { \mathrm { m a x } } ^ { 2 } S \delta ^ { 2 } } } \end{array}$ . If the agents run projected stochastic policy gradient (PSGA) starting from arbitrarily initialized policies and using $\alpha$ -greedy parametrization with $\bar { \alpha } = \epsilon ^ { 2 }$ , then with probability $1 - \delta$ there exists a $t \in \{ 1 , \ldots , T \}$ such that $\pi ^ { ( \dot { t } ) ^ { \dag } }$ is an -approximate Nash policy.
351
+
352
+ 316 Remark 2 (Weighted and ordinal MPGs). We conclude this section with a remark on Weighted and
353
+ 317 Ordinal MPGs (cf. Definition in 1). It is rather straightforward to see that our results carry over for
354
+ 318 WMPGs. The only difference in the running time of (PGA) is to account for the weights (which are
355
+ 319 just multiplicative constants).
356
+ 320 By contrast, the extension to OMPGs is not immediate and the reason is that we cannot prove any
357
+ 321 bound on the smoothness of $\Phi$ in that case. Therefore, we cannot have rates of convergence of policy
358
+ 322 gradient. Nevertheless, it is quite straightforward that (PGA) converges asymptotically to critical
359
+ 323 points (in bounded domains) for differentiable functions. Thus, as long as $\Phi$ is differentiable, it is
360
+ 324 guaranteed that (PGA) will asymptotically converge to a critical point of $\Phi$ . By Lemma 4.1, this
361
+ 325 point will be a Nash policy.
362
+
363
+ # 5 Experiments: Congestion Games
364
+
365
+ We next study the performance of policy gradient in a general class of MPGs that are congestion games at every state (cf. [4]). The setting of the current experiment is illustrated in Figure 4.
366
+
367
+ Experimental setup. There are 8 agents, 4 facilities and 2 states: a safe state and a distancing state. In both states, all agents prefer to be in the same facility with as many other agents as possible (follow the crowd) [12]. In particular, the reward of each agent for being at facility $k = A , B , C , D$ is equal to a predefined positive weight $w _ { k } ^ { \mathrm { s a f e } }$ times the number of agents at that facility. kThe weights satisfy $w _ { A } ^ { \mathrm { s a f e } } < w _ { B } ^ { \mathrm { s a f e } } < w _ { C } ^ { \mathrm { s a f e } } < w _ { D } ^ { \mathrm { s a f e } }$ , i.e., facility $D$ is the most preferable by all agents. If more than $4 = N / 2$ agents find themselves in the same facility, then the game transitions to
368
+
369
+ ![](images/bc27199bfe3990035863fad67552a519702ab7a356182fe9e7f03e1bb6f0311a.jpg)
370
+ Figure 4: The 2-state MPG.
371
+
372
+ 339 340 the distancing state. At tby a constant factor, i.e., $w _ { k } ^ { \mathrm { d i s t } } = w _ { k } ^ { \mathrm { s a f e } } - c$ rd struc, where $c > 0$ mains the same, but the weights are reducedis a (considerably large) constant. To return
373
+ 341 to the safe state, the agents need to achieve maximum distribution over the facilities, i.e., no more
374
+ 342 than $2 = N / 4$ agents may be in the same facility.
375
+ 343 To see that this MDP is a MPG, it suffices to check that every state is a potential game and that
376
+ 344 condition C2 (i.e., equality of individual dummy terms) of Proposition 3.2 is satisfied. The first claim
377
+ 345 is straightforward since at each state, the agents play a congestion game [22, 25]. The second claim
378
+ 346 follows from the fact that the rewards of all agents in all facilities at the distancing state are shifted by
379
+ 347 the same constant amount, $c$ .
380
+
381
+ ![](images/59dd653e089895cc35a146ab47cdb8a7100be3acea91461c0204f46c95334326.jpg)
382
+ Figure 5: Policy gradient in the 2-state MPG with 8 agents of Section 5. In all runs, the 8 agents learn one of the deterministic Nash policies that leads to the optimal distribution among states (left). Individual trajectories of the L1-accuracy and averages (with 1-standard deviation error bars) show fast convergence in all cases (middle and right columns).
383
+
384
+ Paremeters. We perform episodic updates with $T = 2 0$ steps. At each iteration, we estimate the policy gradients using the average of mini-batches of size 20. We use $\gamma = 0 . 9 9$ and a common learning rate $\eta = 0 . 0 0 0 1$ (this $\eta$ is (several orders of magnitude) larger than the theoretical guarantee, $\begin{array} { r } { \eta = \frac { ( 1 - \gamma ) ^ { 3 } } { 2 \gamma A _ { \mathrm { m a x } } n } \approx 1 e - 0 8 } \end{array}$ , of Theorem 4.2). Experiments with randomly generated learning rates (different for each agent), non-deterministic transitions between states and with different weights at each facility in the distancing state (that result in non- MPG structure) produce qualitatively equivalent results and are presented in Appendix E.
385
+
386
+ Results. The left panel of Figure 5 shows that the agents learn the expected Nash profile in both states in all runs. Importantly, this (Nash) policy profile is deterministic in line with Theorem 4.2. The panels in the middle and right columns depict the L1-accuracy in the policy space at each iteration which is defined as the average distance between the current policy and the final policy of all 8 agents, i.e., L1-accuracy $\begin{array} { r } { = \frac { 1 } { N } \sum _ { i \in \mathcal { N } } \left| \pi _ { i } - \pi _ { i } ^ { \mathrm { f n a l } } \right| = \frac { 1 } { N } \sum _ { i \in \mathcal { N } } \sum _ { s } \dot { \sum _ { a } } \left| \tilde { \pi } _ { i } ( a \mid s ) - \pi _ { i } ^ { \mathrm { f n a l } } ( a \stackrel { . } { | } s ) \right| } \end{array}$ .
387
+
388
+ # 0 6 Further Discussion and Conclusions
389
+
390
+ We presented positive results (both structural and algorithmic) about the performance of independent policy gradient in Markov Potential Games (MPGs). We showed that MPGs always possess deterministic Nash policies and that independent policy gradient is guaranteed to converge (polynomially fast in the approximation error) to (deterministic) Nash policy profiles even in the case of finite samples (assuming a direct parameterization with greedy exploration). Our definition of MPGs generalizes prior works on state-based potential MDPs (importantly, by encompassing MDPs that are not necessarily potential at each state) and demonstrates the effectiveness of simultaneous policy gradient in learning Nash policies even without the need to impose additional assumptions on state-based potential functions (cf. [16, 32]). Given these positive results, several interesting questions emerge.
391
+
392
+ 370 Open questions. When it comes to online learning in normal form potential games, it is possible to
393
+ 371 prove that many naturally motivated dynamics converge to deterministic Nash equilibria with certain
394
+ 372 desirable stability properties for most initial conditions [13, 24, 7, 17]. To produce such equilibrium
395
+ 373 selection results, standard Lyapunov arguments do not suffice and one needs to apply more advanced
396
+ 374 techniques such as the Center-Stable-Manifold theorem [15]. Studying such techniques in the context
397
+ 375 of MPGs is a fascinating direction for future work.
398
+ 376 On the other hand, given the complexities of multi-agent, state-based environments, it is highly
399
+ 377 unlikely to expect that practical algorithms can always guarantee convergence to equilibrium. This is
400
+ 378 already the case even for the more restricted settings of normal-form games [34, 2]. Nevertheless,
401
+ 379 deriving strong theoretical guarantees in the sense of cyclic/recurrent orbits, invariant functions [18]
402
+ 380 or social welfare [31] in the context of exact, weighted or ordinal MPGs is another stimulating
403
+ 381 direction for future work. As a measurement of the inefficiency due to lack of coordination between
404
+ 382 agents, it would also be interesting to perform a Price of Anarchy type of analysis [14] as has been
405
+ 383 excessively done in the context of normal-form potential (congestion) games (e.g., [26]).
406
+ 384 Finally, other natural directions for future work involve the study of policy gradient or variations
407
+ 385 thereof (such as Natural Policy Gradient) in MPGs under different policy parametrizations, cf. [1], or
408
+ 386 the study of settings that fruitfully combine tools from both cooperative and competitive settings (as
409
+ 387 in [10, 36, 38]) that have (up to now) produced results in orthogonal directions.
410
+
411
+ # References
412
+
413
+ [1] A. Agarwal, S. M. Kakade, J. D. Lee, and G. Mahajan. Optimality and Approximation with Policy Gradient Methods in Markov Decision Processes. In J. Abernethy and S. Agarwal, editors, Proceedings of 33rd Conference on Learning Theory, volume 125 of PMLR, pages 64–66, 2020.
414
+ [2] Gabriel P Andrade, Rafael Frongillo, and Georgios Piliouras. Learning in matrix games can be arbitrarily complex. arXiv preprint arXiv:2103.03405, 2021. [3] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control. Athena Scientific, 2nd edition, 2000.
415
+ [4] I. Bistritz and N. Bambos. Cooperative multi-player bandit optimization. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 2016–2027. Curran Associates, Inc., 2020.
416
+ [5] Noam Brown and Tuomas Sandholm. Superhuman ai for multiplayer poker. Science, 365(6456):885–890, 2019.
417
+ [6] Lucian Busoniu, Robert Babuska, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 38(2):156–172, 2008.
418
+ [7] Johanne Cohen, Amélie Héliou, and Panayotis Mertikopoulos. Learning with bandit feedback in potential games. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6372–6381, 2017.
419
+ [8] A. Dafoe, Y. Bachrach, G. Hadfield, E. Horvitz, K. Larson, and T. Graepel. Cooperative ai: machines must learn to find common ground. Nature, 7857:33–36, 2021.
420
+ [9] A. Dafoe, E. Hughes, Y. Bachrach, T. Collins, K. R. McKee, J. Z. Leibo, K. Larson, and T. Graepel. Open Problems in Cooperative AI. arXiv e-prints, December 2020.
421
+ [10] C. Daskalakis, D.J. Foster, and N. Golowich. Independent Policy Gradient Methods for Competitive Reinforcement Learning. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 5527–5540. Curran Associates, Inc., 2020.
422
+ [11] Saeed Ghadimi and Guanghui Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM J. Optim., 23(4):2341–2368, 2013.
423
+ [12] R. Hassin and M. Haviv. To queue or not to queue: Equilibrium behavior in queueing systems. Kluwer Academic Publishers, Boston, USA, 2003.
424
+ [13] Robert Kleinberg, Georgios Piliouras, and Éva Tardos. Multiplicative updates outperform generic no-regret learning in congestion games. In ACM Symposium on Theory of Computing (STOC), 2009.
425
+ [14] E. Koutsoupias and C. Papadimitriou. Worst-case equilibria. In (STACS), pages 404–413. Springer-Verlag, 1999.
426
+ [15] Jason D Lee, Ioannis Panageas, Georgios Piliouras, Max Simchowitz, Michael I Jordan, and Benjamin Recht. First-order methods almost always avoid strict saddle points. Mathematical programming, 176(1):311–337, 2019.
427
+ [16] J. R. Marden. State based potential games. Automatica, 48(12):3075–3088, 2012.
428
+ [17] Ruta Mehta, Ioannis Panageas, and Georgios Piliouras. Natural selection as an inhibitor of genetic diversity: Multiplicative weights updates algorithm and a conjecture of haploid genetics. In Innovations in Theoretical Computer Science, 2015.
429
+ [18] Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2703–2717. SIAM, 2018.
430
+ 435 [19] D. Mguni. Stochastic Potential Games. arXiv e-prints, page arXiv:2005.13527, May 2020.
431
+ 436 [20] D. Mguni, Y. Wu, Y. Du, Y. Yang, Z. Wang, M. Li, Y. Wen, J. Jennings, and J. Wang. Learning in Nonzero-Sum Stochastic Games with Potentials. arXiv e-prints, page arXiv:2103.09284, March 2021. [21] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, Feb 2015. [22] D. Monderer and L. S. Shapley. Potential Games. Games and Economic Behavior, 14(1):124– 143, 1996.
432
+ 446 [23] OpenAI. Openai five. openai.com, 2018.
433
+ 447 [24] Ioannis Panageas, Georgios Piliouras, and Xiao Wang. Multiplicative weights update as a distributed constrained optimization algorithm: Convergence to second-order stationary points almost always. In ICML, 2018.
434
+ [25] T. Roughgarden. Intrinsic robustness of the price of anarchy. J. ACM, 62(5), November 2015.
435
+ 451 [26] Tim Roughgarden and Éva Tardos. How bad is selfish routing? Journal of the ACM (JACM), 49(2):236–259, 2002. [27] L. S. Shapley. Stochastic games. PNAS, 1953. [28] David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, Jan 2016. [29] David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy Lillicrap, Karen Simonyan, and Demis Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140–1144, 2018. [30] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. A Bradford Book, Cambridge, MA, USA, 2018.
436
+ 465 [31] Vasilis Syrgkanis, Alekh Agarwal, Haipeng Luo, and Robert E. Schapire. Fast convergence of regularized learning in games. In Proceedings of the 28th International Conference on Neural Information Processing Systems, NIPS’15, pages 2989–2997, Cambridge, MA, USA, 2015. MIT Press. [32] S. Valcarcel Macua, J. Zazo, and S. Zazo. Learning Parametric Closed-Loop Policies for Markov Potential Games. In International Conference on Learning Representations, 2018. [33] Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H. Choi, Richard Powell, Timo Ewalds, Petko Georgiev, Junhyuk Oh, Dan Horgan, Manuel Kroiss, Ivo Danihelka, Aja Huang, Laurent Sifre, Trevor Cai, John P. Agapiou, Max Jaderberg, Alexander S. Vezhnevets, Rémi Leblond, Tobias Pohlen, Valentin Dalibard, David Budden, Yury Sulsky, James Molloy, Tom L. Paine, Caglar Gulcehre, Ziyu Wang, Tobias Pfaff, Yuhuai Wu, Roman Ring, Dani Yogatama, Dario Wünsch, Katrina McKinney, Oliver Smith, Tom Schaul, Timothy Lillicrap, Koray Kavukcuoglu, Demis Hassabis, Chris Apps, and David Silver. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, Nov 2019.
437
+ 480 [34] Emmanouil-Vasileios Vlatakis-Gkaragkounis, Lampros Flokas, Panayotis Mertikopoulos, and Georgios Piliouras. No-regret learning and mixed nash equilibria: They do not mix. In Annual Conference on Neural Information Processing Systems, 2020.
438
+ [35] X. Wang and T. Sandholm. Reinforcement Learning to Play an Optimal Nash Equilibrium in Team Markov Games. In Proceedings of the 15th International Conference on Neural Information Processing Systems, NIPS’02, page 1603–1610, Cambridge, MA, USA, 2002. MIT Press.
439
+ [36] Chen-Yu Wei, Chung-Wei Lee, Mengxiao Zhang, and Haipeng Luo. Last-iterate convergence of decentralized optimistic gradient descent/ascent in infinite-horizon competitive markov games. CoRR, abs/2102.04540, 2021.
440
+ [37] K. Zhang, Z. Yang, and T. Ba¸sar. Multi-Agent Reinforcement Learning: A Selective Overview of Theories and Algorithms. arXiv e-prints, page arXiv:1911.10635, 2019.
441
+ [38] Yulai Zhao, Yuandong Tian, Jason D. Lee, and Simon S. Du. Provably efficient policy gradient methods for two-player zero-sum markov games. CoRR, abs/2102.08903, 2021.
442
+
443
+ # Checklist
444
+
445
+ 1. For all authors...
446
+
447
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] • Our introduction contains an informal presentation of our main results and an overview of our techniques to make the better accessible to a wider audience.
448
+
449
+ (b) Did you describe the limitations of your work? [Yes] • Our work is mainly methodological. Its limitations in terms of the results are clearly described throughout the paper (in the sense that the results hold within the class of MPGs and not for general MDPs) and its limitations in terms of the techniques are described in the technical sections.
450
+
451
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
452
+
453
+ 2. If you are including theoretical results...
454
+
455
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes]
456
+ (b) Did you include complete proofs of all theoretical results? [Yes] • In the main paper, we have included both a high-level technical overview (Introduction) and a sketch of the proof of the main results (Sections 3 and 4). In the supplementary material, we provide detailed proofs.
457
+
458
+ 3. If you ran experiments...
459
+
460
+ (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]
461
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
462
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
463
+ (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] • Our experiments can be reproduced in any conventional computer in reasonable time. The code is freely accessible on GitHub (links to the repository are provided in the supplementary materials).
464
+
465
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
466
+
467
+ (a) If your work uses existing assets, did you cite the creators? [N/A]
468
+ (b) Did you mention the license of the assets? [N/A]
469
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
470
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
471
+
472
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
473
+
474
+ 5. If you used crowdsourcing or conducted research with human subjects...
475
+
476
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
477
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
478
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
md/train/r1IRctqxg/r1IRctqxg.md ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SAMPLE IMPORTANCE IN TRAINING DEEP NEURAL NETWORKS
2
+
3
+ Tianxiang Gao, Vladimir Jojic Department of Computer Science University of North Carolina at Chapel Hill Chapel Hill, NC, 27599 , USA {tgao,vjojic}@cs.unc.edu
4
+
5
+ # ABSTRACT
6
+
7
+ The contribution of each sample during model training varies across training iterations and the model’s parameters. We define the concept of sample importance as the change in parameters induced by a sample. In this paper, we explored the sample importance in training deep neural networks using stochastic gradient descent. We found that “easy” samples – samples that are correctly and confidently classified at the end of the training – shape parameters closer to the output, while the “hard” samples impact parameters closer to the input to the network. Further, “easy” samples are relevant in the early training stages, and “hard” in the late training stage. Further, we show that constructing batches which contain samples of comparable difficulties tends to be a poor strategy compared to maintaining a mix of both hard and easy samples in all of the batches. Interestingly, this contradicts some of the results on curriculum learning which suggest that ordering training examples in terms of difficulty can lead to better performance.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Sample importance is the sample’s contribution to the parameter change during training. In statistics, the concept “leverage” of a point is used (St Laurent & Cook (1992)) to measure the impact of a sample on the training of a model. In the context of SVM, the most important samples are the support vectors as they define the separating hyperplane. Understanding the importance of the samples can help us interpret trained models and structure training to speed up convergence and improve prediction accuracy. For example, Curriculum learning (CL) from Bengio et al. (2009) shows that training with easy samples first, then gradually transitioning to difficult samples can improve the learning. In CL, the “easiness” of a sample is predefined either manually or using an evaluation model. Self-paced learning (SPL) (Kumar et al. (2010)) shows that it is possible to learn from samples in order of easiness. In this framework, easiness is related to the prediction error and can be estimated from the model. However, easiness of a sample may not be sufficient to decide when it should be introduced to a learner. Maintaining diversity among the training samples can have a substantial effect on the training (Jiang et al. (2014)).
12
+
13
+ In this work, we explore the sample importance in deep neural networks. Deep learning methods have been successfully applied in many tasks and routinely achieve better generalization error than classical shallow methods (LeCun et al. (2015)). One of the key characteristics of a deep network is its capacity to construct progressively more complex features throughout its layers (Lee et al. (2011)). An intuitive question arises: which samples contribute the most to the training of the different layer’s parameters? From literature Saxe et al. (2011), we know that even randomly generated filters can compute features that lead to good performance – presumably on easy samples. However, to learn hard samples correctly, the model may need to construct complex features, which require both more training time and refined filters from bottom layers. Hence, we hypothesized that the hard samples shape the bottom layers – closer to the input – and easy samples shape the top layers – closer to the output.
14
+
15
+ Motivated by the above hypothesis, we analyzed the sample importance in a 3 layer ReLU network on two standard datasets. The results reveal several interesting facts about the sample importance in easy and hard samples:
16
+
17
+ 1. Easy and hard samples impact the parameters in different training stages. The biggest impact of easy samples on parameters are mostly during the early training stage, while the impact of hard samples become large in the late training stage.
18
+
19
+ 2. Easy and hard samples impact the parameters in different layers. Easy samples impact have larger impact on top layer parameters, while hard samples shape the bottom layer parameters.
20
+
21
+ 3. Mixing hard samples with easy samples in each batch helps training. We conducted batches with homogeneous or mixed “easiness”. We found that use of homogeneous batches hinders the training. Hence, it is preferable for network to see both easy and hard samples during all stages of training.
22
+
23
+ Next, we are going to give the definition of sample importance in Section 2. The empirical analysis for sample importance in the deep neural network in two real datasets is discussed in Section 3. Extension about sample importance is showed in Section 4.
24
+
25
+ # 2 SAMPLE IMPORTANCE
26
+
27
+ In this section, we are going to introduce the terminology and provide a quantitative measurement of sample importance for a training procedure.
28
+
29
+ # 2.1 SAMPLE WEIGHT
30
+
31
+ In supervised learning, a model is trained by optimizing an objective over a set of observed training samples $\left( \mathbf { x } _ { i } , y _ { i } \right)$ . Let $f ( \mathbf { x } _ { i } , \pmb { \theta } )$ be the output of a model for parameter $\pmb { \theta }$ . The training objective can be written as:
32
+
33
+ $$
34
+ \sum _ { i = 1 } ^ { n } L ( y _ { i } , f ( \mathbf { x } _ { i } , \pmb { \theta } ) ) + R ( \pmb { \theta } ) ,
35
+ $$
36
+
37
+ where $L ( y _ { i } , f ( \mathbf { x } _ { i } , \pmb { \theta } ) )$ is the loss on sample $i$ , and $R ( \pmb \theta )$ is the regularization on the parameters. In order to highlight contribution of each sample, we can introduce sample specific weights $v _ { i } \in [ 0 , 1 ]$ which scale sample’s contribution to the loss. Hence, the objective in (1) can be rewritten as:
38
+
39
+ $$
40
+ \sum _ { i = 1 } ^ { n } v _ { i } L ( y _ { i } , f ( \mathbf { x } _ { i } , \pmb { \theta } ) ) + R ( \pmb { \theta } ) ,
41
+ $$
42
+
43
+ We define the weight $v _ { i }$ as the sample weight. Similar definitions on $v _ { i }$ has been proposed in Self-paced learning (SPL) Kumar et al. (2010).
44
+
45
+ In Stochastic Gradient descend (SGD) methods, parameters $\pmb \theta$ are updated with a certain step size $\eta$ in each iteration with regard to a set of training samples. If we allow different sample weights in different iterations, a single update can be written as:
46
+
47
+ $$
48
+ \pmb { \theta } ^ { t + 1 } = \pmb { \theta } ^ { t } - \eta \sum _ { i = 1 } ^ { n } v _ { i } ^ { t } \mathbf { g } _ { i } ^ { t } - \eta \mathbf { r } ^ { t } ,
49
+ $$
50
+
51
+ where $\theta ^ { t }$ is the parameter vector at epoch $t$ , $\begin{array} { r } { \mathbf { g } _ { i } ^ { t } = \frac { \partial } { \partial \pmb { \theta } ^ { t } } L _ { i } ( y _ { i } , f ( \mathbf { x } _ { i } , \pmb { \theta } ^ { t } ) ) , \mathbf { r } ^ { t } = \frac { \partial } { \partial \pmb { \theta } ^ { t } } R ( \pmb { \theta } ^ { t } ) } \end{array}$ , and $\boldsymbol { v } _ { i } ^ { t }$ is the weight of ith sample at iteration $t$ .
52
+
53
+ # 2.2 SAMPLE IMPORTANCE
54
+
55
+ If we change the weight of a sample $i$ at iteration $t$ , how would such change impact the parameter training in that iteration? We can answer this question by calculating the first order derivative of parameter change $\Delta \pmb { \theta } ^ { t } = \pmb { \theta } ^ { t + 1 } - \pmb { \theta } ^ { t }$ with regard to sample weight $\boldsymbol { v } _ { i } ^ { t }$ :
56
+
57
+ $$
58
+ { \boldsymbol { \phi } } _ { i } ^ { t } = { \frac { \partial } { \partial v _ { i } ^ { t } } } \Delta { \pmb { \theta } } ^ { t } = - \eta \mathbf { g } _ { i } ^ { t } .
59
+ $$
60
+
61
+ We call $\boldsymbol { \phi } _ { i } ^ { t }$ the parameter affectibility by ith sample at iteration $t$ . $\boldsymbol { \phi } _ { i } ^ { t }$ is a vector consists of parameter affectibility from all parameters in the network. Specifically, $\boldsymbol { \phi } _ { i , j } ^ { t }$ is the parameter affectibility for $j$ th parameter in the network. $\boldsymbol { \phi } _ { i } ^ { t }$ reflects the relationship between parameter change and different samples.
62
+
63
+ Typical deep networks contains millions of parameters. Hence, we are going to focus on groups of parameters of interests. We define ith sample’s importance for parameters of $d \mathrm { t h }$ layer of as:
64
+
65
+ $$
66
+ \beta _ { i , d } ^ { t } = \sum _ { j \in \mathcal { Q } _ { d } } ( \phi _ { i , j } ^ { t } ) ^ { 2 } ,
67
+ $$
68
+
69
+ where $\mathcal { Q } _ { d }$ is a set consists of the indexes of all parameters in layer $d$ . Hence, sample’s importance for all the parameters in the model is:
70
+
71
+ $$
72
+ \alpha _ { i } ^ { t } = \sum _ { j } ( \phi _ { i , j } ^ { t } ) ^ { 2 } ,
73
+ $$
74
+
75
+ Obviously, we have $\begin{array} { r } { \alpha _ { i } ^ { t } = \sum _ { d = 1 } ^ { D } \beta _ { i , d } ^ { t } } \end{array}$
76
+
77
+ The sum of sample’s importance across all iterations is defined as overall importance of a sample:
78
+
79
+ $$
80
+ \tau _ { i } = \sum _ { t } \alpha _ { i } ^ { t }
81
+ $$
82
+
83
+ In general, for each sample $i$ , computing $\beta _ { i , d } ^ { t }$ allows us to decompose its influence in the model’s training across training stages and different layers.
84
+
85
+ We note that the sample importance is a high-level measurement of the samples influence on parameters at each iteration of the update. This quantity is not an accurate measurement of the relationship between a sample and final trained model. Refinements of this concept are discussed in Section 4.
86
+
87
+ # 3 EMPIRICAL ANALYSIS OF SAMPLE IMPORTANCE
88
+
89
+ We are going to explore the samples’ importance for different layers at different epoch through a series of empirical experiments on two standard datasets.
90
+
91
+ # 3.1 EXPERIMENT SETUP
92
+
93
+ Dataset All the analysis are performed on two standard datasets: MNIST 1 (LeCun et al. (1998)), a benchmark dataset that contains handwritten digit images. Each sample is a $2 8 \times 2 8$ image from 10 classes. We used 50000 samples for training and 10000 samples for testing. CIFAR-10 2 (Krizhevsky & Hinton (2009)), a dataset contains $3 2 \times 3 2$ tiny color images from 10 classes. Each sample has 3072 features. We used 50000 samples for training and 10000 samples for testing.
94
+
95
+ Architecture We used a multilayer feed forward neural network with 3 hidden layers of 512 hidden nodes with rectified linear units (ReLU) activation function, a linear output layer, and a softmax layer on top for classification. The weights in each hidden layer are initialized according to Glorot & Bengio (2010). For hyper-parameters, we used learning rate of 0.1, batch size of 100, 50 total epochs, and weight-decay of $1 e - 5$ . No momentum or learning decay was used. All the code are based on a common deep learning package Theano from Bergstra et al. (2010); Bastien et al. (2012).
96
+
97
+ # 3.2 SAMPLE IMPORTANCE IS STABLE WITH RESPECT TO DIFFERENT INITIALIZATIONS
98
+
99
+ Firstly, we want to explore whether the sample importance is stable under different initializations. We used three different random seeds to initialize the network parameters and calculated the sample importance every five epochs. We computed the Spearman’s rank correlation between sample importance to the model, $\alpha _ { i } ^ { t }$ , in each pair of initializations. This correlation remains high in all epochs, above 0.9, as shown in Figure 1. This indicates that the sample importance is relatively stable to initialization of the network. Hence, all the following analysis are based on the results from initialization seed 1. (Details of training and test error for the chosen model can be viewed in Appendix Figure 9).
100
+
101
+ ![](images/0a3fc09ab1365aa5c2ccb287411ae343403bce7f9654cd12222a19101f92d457.jpg)
102
+ Figure 1: Does initialization affect sample’s importance? Sample importance is preserved between initializations of the network. For each epoch, and a pair of initializations, we computed Spearman Correlation of samples’ importance. Across all epochs, the correlation is of greater than 0.9 in both MNIST and CIFAR-10. Early epochs show higher consistency between ranks of sample importance across different initializations.
103
+
104
+ # 3.3 DECOMPOSITION OF SAMPLE IMPORTANCE
105
+
106
+ To better understand and visualize the sample importance, we firstly calculate the overall sample importance at each epoch as $\begin{array} { r } { A ^ { t } = \sum _ { i = 1 } ^ { n } \dot { \alpha _ { i } ^ { t } } } \end{array}$ . Similarly, the overall sample importance to layer $d$ is $\begin{array} { r } { B _ { d } ^ { t } = \sum _ { i = 1 } ^ { n } \beta _ { i , d } ^ { t } } \end{array}$ . We show the overall sample importance and its decomposition in layers for two datasets in Figure 2. Firstly, we found that even with a fixed learning rate, the overall sample importance is different under different epochs. Output layer always has the largest average sample importance per parameter, and its contribution reaches the maximum in the early training stage and then drops. Each layer contributes differently to the total sample importance. In both MNIST and CIFAR-10, the 2nd layer contributes more than the 3rd layer. In CIFAR-10, the 1st layer’s provides largest contribution the total sample importance, as it contains much more parameters than other layers. Interestingly, all classes do not provide the same amount of sample importance.
107
+
108
+ We found that most samples have small sample importance (Appendix Figure 10). To visualize the contribution of different samples, we split the samples based on their total importance into three groups: $10 \%$ , top $10 \%$ – top $20 \%$ most important samples, and other $80 \%$ samples. We show the decomposition of importance contribution in each layer in Figure 3. In MNIST, the top $10 \%$ samples contribute almost all the sample importance. In CIFAR-10, most important samples contribute more in lower layers rather than output layer. This result indicates that top $20 \%$ most important samples contribute to the majority of the sample importance.
109
+
110
+ # 3.4 SAMPLE IMPORTANCE AND NEGATIVE LOG-LIKELIHOOD
111
+
112
+ Negative log likelihood (NLL) is the loss metric we used for training objective. It has been used to measure the “easiness” of a sample in Curriculum learning Bengio et al. (2009) and Self-paced learning Kumar et al. (2010). Intuitively, the samples with large NLL should also have large sample importance (SI). However, in our experiment, we found that this is not always the case. In Figure 4, we found that 1) NLL and SI become more correlated as training goes on. However, 2) NLL is not predictive of the SI. There are many points with high NLL but small SI, and otherwise.
113
+
114
+ ![](images/7b01f6ee56ad410d554315b0e829197fb194fba35538582c41bb8eb261a1288f.jpg)
115
+ Figure 2: Which classes and at which stage shape the network’s layer’s parameters? Parameters of different layers are learned at different times. Parameters in Output layers are learned mostly during the early training stage. In the lower layers, parameters are learned predominantly during the middle and late training stage. All classes do not contribute equally to training of the model.
116
+
117
+ ![](images/c65928096336387e31f6986d8a5c1157a406686b28f9f2fb2cc62ef0c29e1cd8.jpg)
118
+ Figure 3: Are all data samples equally important for all layers? The top $20 \%$ most important samples contributes to the majority of parameter learning, especially in lower layers. “L1” to “L3” stands for Layer 1 to Layer 3. “Out” stands for output layer.
119
+
120
+ # 3.5 CLUSTERING SAMPLES BASED ON SAMPLE IMPORTANCE
121
+
122
+ To better visualize the importance of different samples, we provide three representative clusters of samples for each dataset. In MNIST, we clustered all digit “5” samples into 20 clusters based on their epoch-specific, layer-specific sample importance. In CIFAR-10, we clustered all “horse” samples into 30 clusters using the same features as MNIST. Kmeans algorithm is used for clustering.
123
+
124
+ ![](images/366cabd6209561647cb6d00ed6cdc1387b95f239c1a5c25a3d36e0ae64232719.jpg)
125
+ Figure 4: Is Sample Importance correlated with Negative log-likelihood of a sample? Sample importance is positively correlated with negative log-likelihood. As training goes on, their correlation becomes higher. However, there remain many samples with high NLL and low SI, and vice versa. Left column: correlation between sample importance and negative log likelihood for all samples across epochs. Right column: scatter plot for NLL in the last epoch and all epoch sample importance for each sample.
126
+
127
+ MNIST In Figure 5, we showed 3 example clusters on digit $\cdot 5 ^ { , }$ . In the cluster of easy samples, where NLL converges very fast, most of the sample importance is concentrated in the first few epochs in output layer parameters. The cluster of medium samples has a slow NLL convergence compared to the easy cluster. The biggest impact is in middle training stage and more towards bottom layer parameters. Hard samples hardly converge even during the late stage of training. As training goes on, the sample importance for the bottom layer parameters become larger.
128
+
129
+ CIFAR-10 In Figure 6, we showed 3 examples clusters on class “horse”. We observed very similar sample importance changing pattern as for the MNIST examples for easy, medium and hard clusters. Comparing to MNIST, all three clusters in CIFAR-10 have a very large impact on the parameters in the bottom layer. We note that the CIFAR-10 has almost 4 times larger number of parameters $( 3 0 7 5 \times 5 1 2 \approx 1 5 7 4 k )$ in the first layer than MNIST $7 8 5 \times 5 1 2 \approx 4 0 1 k$ ).
130
+
131
+ # 3.6 BATCH ORDER AND SAMPLE IMPORTANCE
132
+
133
+ With the observations from empirical analysis on sample importance, we know that time – iteration – and place – layer – of sample’s impact varies according to its “easiness” . We wanted to know whether constructing batches based on the sample importance or negative log likelihood would make a difference in training. Hence, we designed an experiment to explore how the different construction of batches influence the training. We note that the information used to structure the batches (negative log-likelihood and sample importance) – was obtained from a full training run.
134
+
135
+ We split all 50, 000 samples into $b = 5 0 0$ batch subsets $\{ B _ { 1 } , B _ { 2 } , \ldots , B _ { b } \}$ . Each batch has batch size $| B _ { i } | = 1 0 0$ . In our experiment, each training sample must be in exactly one batch. There is no intersection between batches.
136
+
137
+ During training, in each epoch, we update the parameters with each batch in order $1 , 2 , \ldots , b$ iteratively.
138
+
139
+ We used seven different batch construction methods in this experiment:
140
+
141
+ ![](images/beca3d0da8b2003b41df3f1588b013088625e0966c9a1ccd126e7c77463862f6.jpg)
142
+ Figure 5: When and where does an MNIST sample make the biggest impact? For “easy” samples, their biggest impact is on output layers and during the early training stage. As sample’s difficulty increases (medium and hard), the biggest impact moves to lower layers and in the late training stage. Each row is a sample cluster. In each row, from left to right: example images in the cluster; average sample importance and layer-wise decomposition across epochs; A boxplot of average training negative log likelihood across epochs.
143
+
144
+ 1. Rand: Randomly constructed batch. All $5 0 \mathrm { k }$ samples are randomly split into $b$ batches before training. The batches and orders stay fixed during training.
145
+ 2. NLO: Negative Log-likelihood Order. We sort all the samples based on their final NLL from low to high. The batches are constructed based on the sorted samples. First 100 samples with least NLL are in $\boldsymbol { B } _ { 1 }$ , 101 to 200 samples are in $B _ { 2 }$ , and so on. Hence, during training, the batches with small NLL will be trained first.
146
+ 3. RNLO Reverse-Negative Log-likelihood Order. We construct the batches same as NLO. During training, we update the batches in reverse order $B _ { b } , B _ { b - 1 } , \ldots , B _ { 1 }$ . Hence, the batches with large NLL will be trained first.
147
+ 4. NLM Negative Log-likelihood Mixed. We sort all the samples based on their final NLL from low to high. Next, for each sample $i$ in the sorted sequence, we put that sample into batch $j = ( i { \bmod { b } } ) + 1$ . This ordering constructs batches out of samples with diverse levels of NLL.
148
+ 5. SIO: Sample Importance Order. Similar to NLO, except that we sort all the samples based on their sum sample importance over all epochs from low to high. Hence, batches with small sample importance will be trained first.
149
+ 6. RSIO Reverse-Sample Importance Order. We construct the batches same as SIO. During training, we update the batches in reverse order $B _ { b } , B _ { b - 1 } , \ldots , B _ { 1 }$ . Hence, during training, the batches with large sample importance will be trained first.
150
+
151
+ ![](images/06ecd2bfd33d18b39d48776d6ab4984ee42b58766a17f2e0d0d3d92cd9424928.jpg)
152
+ Figure 6: When and where does a CIFAR-10 sample make the biggest impact? For “easy” samples, their biggest impact is on the first layer during the early training stage. As samples’s difficulty increases (medium and hard), the biggest impact moves to lower layers and to late training stage. Each row is a sample cluster. In each row, from left to right: example images in the cluster; average sample importance and layer-wise decomposition across epochs; A boxplot of average training negative log likelihood across epochs.
153
+
154
+ 7. SIM Sample Important Mixed. Similar to NLM, but we sort the samples based on overall sample importance. Thus, batches contain samples with divers sample importance.
155
+
156
+ We performed five different runs (with different random initializations) on MNIST and CIFAR-10. The result is shown in Figure 7. From the result, we found that: 1) In both MNIST and CIFAR-10, Rand, SIS, and NLS have the lowest test error compared to all other methods. This indicates that diverse batches are helpful for training. 2) NLO and SIO got the worst performance in CIFAR10. Their training error even goes up after the early stage. RNLO and RSIO have same batch constructions as NLO and SIO, but their performances are drastically different. This indicates that the order of batches during training is important. Further, training on easy samples first and hard later seems to be counter-productive.
157
+
158
+ To better understand the impact of different batch construction, we performed the principle component analysis on the learned parameters in each epoch (Figure 8). In MNIST, the impact of batch construction is not very significant. In CIFAR-10, batch construction and even the order of batch training do have a large impact on the training.
159
+
160
+ Our experiment result shows a different conclusion to Curriculum Learning and Self-paced learning, where easy samples are trained on before introducing hard samples. We found that constructing and ordering the batches – hard to easy and easy to hard – seems to hinder the performance of learning. Having hard samples mixed in with the easy ones in each batch helps the training.
161
+
162
+ Also, the results show that we want to learn from the hard samples in early epochs and “see” hard samples more frequently, even if their major impact on parameters is during the late stage. As hard examples are few compared to easy samples and hard examples need a longer time to train, we do want to mix the hard samples into each batch to start learning from those samples early and learn longer.
163
+
164
+ ![](images/42716aa645f0c758ca13ad616d456e30f3c7f969dca4da6b441665f267b2d69c.jpg)
165
+ Figure 7: Does organizing batches by “easiness” affect training? When batches are constructed with homogeneous easiness, the training performance become worse. Batches with mixed easiness have lower test error. The solid color line represents the mean over 5 runs. The error bar indicates the standard error over 5 runs.
166
+
167
+ ![](images/2356039eb64f765e3572f2159baff9807ba4501ba29d7c5578292085327cf2f9.jpg)
168
+ Figure 8: Do parameters converge differently under different batch construction? In MNIST, the converging path for all batch constructions are very similar. In CIFAR-10, batch construction with mixed easiness (Rand, NLM, SIM) has a very different converging path with all other methods. Notably, we found that even with same batch constructions but just reversed order (NLO vs. RNLO, SIO vs. RSIO), the parameters converge to different points. Each circle dotted line shows the path of the first two principle components of all parameters in different epochs. Note that in CIFAR-10, the paths of Rand, NLS and SIS are very similar and they are overlapped in the plot.
169
+
170
+ # 4 EXTENSIONS OF SAMPLE IMPORTANCE
171
+
172
+ We calculated the sample importance in each iteration in Stochastic Gradient Descent. However, such quantity only reflects the impact on the change in parameters within each iteration. The influence of a sample at a particular iteration can be accumulated through updates and impact the final model. Here, we are going to derive the exact calculation of the sample’s influence to the model. We rewrite the Objective (2) in Section 2 here:
173
+
174
+ $$
175
+ \operatorname* { m i n } _ { \pmb { \theta } } \sum _ { i = 1 } ^ { n } v _ { i } L ( y _ { i } , f ( \mathbf { x } _ { i } , \pmb { \theta } ) ) + R ( \pmb { \theta } ) ,
176
+ $$
177
+
178
+ Here, we deem the sample weight $v _ { i }$ is fixed across all iterations. The update rule for stochastic gradient descent in each iteration is:
179
+
180
+ $$
181
+ \pmb { \theta } ^ { t + 1 } = \pmb { \theta } ^ { t } - \eta \sum _ { i } v _ { i } \mathbf { g } _ { i } ^ { t } - \eta \mathbf { r } _ { i } ^ { t }
182
+ $$
183
+
184
+ The derivative of $\pmb { \theta } ^ { t + 1 }$ with respect to sample weight $v _ { i }$ is:
185
+
186
+ $$
187
+ \begin{array} { r c l } { { \displaystyle \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { t + 1 } } } & { { = } } & { { \displaystyle \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { t } - \eta \mathbf { g } _ { i } ^ { t } - \eta H ( \pmb { \theta } ^ { t } ) \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { t } } } \\ { { \displaystyle \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { 1 } } } & { { = } } & { { \displaystyle - \eta \mathbf { g } _ { i } ^ { 0 } , } } \end{array}
188
+ $$
189
+
190
+ where $H ( \pmb \theta ^ { t } )$ is the Hessian matrix of the objective in (2) with regard to all parameters in iteration $t$ . If we iterate the updates until convergence, then we can assume that $\theta ^ { T }$ is a fix-point, $\pmb { \theta } ^ { \ast } = \pmb { \theta } ^ { T + 1 } =$ $\theta ^ { T }$ , and we obtain:
191
+
192
+ $$
193
+ \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { T + 1 } - \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { T } = - \eta \mathbf { g } _ { i } ^ { t } - \eta H ( \pmb { \theta } ^ { * } ) \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { * }
194
+ $$
195
+
196
+ Hence, the derivative of parameters in the final model with regard to a sample weight is:
197
+
198
+ $$
199
+ \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { * } = - H ( \pmb { \theta } ^ { * } ) ^ { - 1 } \mathbf { g } _ { i } ^ { T }
200
+ $$
201
+
202
+ Equation (4) indicates that we can calculate the sample specific impact on final trained model by using the parameters learned at the convergence point. In deep learning methods, due to early stopping, fix point might not be achieved, and Equation (4) might not be an accurate.
203
+
204
+ For any target quantity $\boldsymbol { \mathcal { T } } ( \boldsymbol { \theta } ^ { * } )$ that depends on the final trained parameter $\pmb { \theta } ^ { * }$ , we can calculate the impact of a particular sample on that target as:
205
+
206
+ $$
207
+ \frac { \partial } { \partial v _ { i } } T ( \pmb { \theta } ^ { * } ) = \frac { \partial } { \partial \pmb { \theta } ^ { * } } T ( \pmb { \theta } ^ { * } ) \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { * }
208
+ $$
209
+
210
+ For example, if we are interested in the sum of predictions on a set of samples ${ \mathcal { T } } ( \theta ^ { * } ) ~ =$ $\textstyle \sum _ { i \in { \mathcal { S } } _ { c } } f ( \mathbf { x } _ { i } , { \pmb \theta } ^ { t } )$ , we can use Equation (5) to calculate the derivative:
211
+
212
+ $$
213
+ \begin{array} { r c l } { \displaystyle \frac { \partial } { \partial v _ { i } } \mathcal { T } ( \pmb { \theta } ^ { * } ) } & { = } & { \displaystyle \sum _ { i \in \mathcal { S } _ { c } } \frac { \partial } { \partial \pmb { \theta } ^ { * } } f ( \mathbf { x } _ { i } , \pmb { \theta } ^ { t } ) \frac { \partial } { \partial v _ { i } } \pmb { \theta } ^ { * } } \end{array}
214
+ $$
215
+
216
+ We note evaluating the exact impact of a sample, as shown above, is computationally cumbersome for all but the simplest models.
217
+
218
+ # 5 DISCUSSION
219
+
220
+ Samples’ impact on the deep network’s parameters vary across stages of training and network’s layers. In our work, we found that easy samples predominantly shape parameters the top layers at the early training stages, while hard samples predominantly shape the parameters of the bottom layers at the late training stage. Our experiments show that it is important to mix hard samples into different batches rather than keep them together in the same batch and away from other examples.
221
+
222
+ There are many future extensions to the current work. Firstly, we want to expand our sample importance analysis to different deep learning structures, like Convolution Neural Network and Recurrent Neural Networks. Secondly, we want to use the sample importance as a guidance to extract a minimal subset of samples that are sufficient to achieve performance comparable to a network trained on the full dataset.
223
+
224
+ # REFERENCES
225
+
226
+ Fred´ eric Bastien, Pascal Lamblin, Razvan Pascanu, James Bergstra, Ian J. Goodfellow, Arnaud ´ Bergeron, Nicolas Bouchard, and Yoshua Bengio. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012.
227
+
228
+ Yoshua Bengio, Jer´ ome Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ˆ Proceedings of the 26th annual international conference on machine learning, pp. 41–48. ACM, 2009.
229
+
230
+ James Bergstra, Olivier Breuleux, Fred´ eric Bastien, Pascal Lamblin, Razvan Pascanu, Guillaume ´ Desjardins, Joseph Turian, David Warde-Farley, and Yoshua Bengio. Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy), June 2010. Oral Presentation.
231
+
232
+ Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In International Conference on Artificial Intelligence and Statistics, pp. 249–256, 2010.
233
+
234
+ Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander Hauptmann. Self-paced learning with diversity. In Advances in Neural Information Processing Systems, pp. 2078–2086, 2014.
235
+
236
+ Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 2009.
237
+
238
+ M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In Advances in Neural Information Processing Systems, pp. 1189–1197, 2010.
239
+
240
+ Yann LeCun, Corinna Cortes, and Christopher JC Burges. The MNIST database of handwritten digits, 1998.
241
+
242
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
243
+
244
+ Honglak Lee, Roger Grosse, Rajesh Ranganath, and A. Y. Ng. Unsupervised learning of hierarchical representations with convolutional deep belief networks. Communications of the ACM, 54(10): 95–103, 2011.
245
+
246
+ Andrew Saxe, Pang W Koh, Zhenghao Chen, Maneesh Bhand, Bipin Suresh, and Andrew Y Ng. On random weights and unsupervised feature learning. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 1089–1096, 2011.
247
+
248
+ Roy T St Laurent and R Dennis Cook. Leverage and superleverage in nonlinear regression. Journal of the American Statistical Association, 87(420):985–990, 1992.
249
+
250
+ # APPENDIX
251
+
252
+ ![](images/b50b1bc5189d4cb3fa5ad2950a2e80b6a0c2b3a70f01fab8b5c6bf2838fbfbfa.jpg)
253
+ Figure 9: The training and test error on MNIST (first row) and CIFAR-10 (second row). The left column showed the average class-specific negative log likelihood.
254
+
255
+ ![](images/f8db2eb88900f5393079c3638df2a7dc58b9a63367a73c5ed63a70e9013e6e1f.jpg)
256
+ Figure 10: Histogram of total sample importance.
md/train/r1lWUoA9FQ/r1lWUoA9FQ.md ADDED
@@ -0,0 +1,596 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ARE ADVERSARIAL EXAMPLES INEVITABLE?
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ A wide range of defenses have been proposed to harden neural networks against adversarial attacks. However, a pattern has emerged in which the majority of adversarial defenses are quickly broken by new attacks. Given the lack of success at generating robust defenses, we are led to ask a fundamental question: Are adversarial attacks inevitable?
8
+
9
+ This paper analyzes adversarial examples from a theoretical perspective, and identifies fundamental bounds on the susceptibility of a classifier to adversarial attacks. We show that, for certain classes of problems, adversarial examples are inescapable. Using experiments, we explore the implications of theoretical guarantees for real-world problems and discuss how factors such as dimensionality and image complexity limit a classifier’s robustness against adversarial examples.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ A number of adversarial attacks on neural networks have been recently proposed. To counter these attacks, a number of authors have proposed a range of defenses. However, these defenses are often quickly broken by new and revised attacks. Given the lack of success at generating robust defenses, we are led to ask a fundamental question: Are adversarial attacks inevitable?
14
+
15
+ In this paper, we identify a broad class of problems for which adversarial examples cannot be avoided. We also derive fundamental limits on the susceptibility of a classifier to adversarial attacks that depend on properties of the data distribution as well as the dimensionality of the dataset.
16
+
17
+ Adversarial examples occur when a small perturbation to an image changes its class label. There are different ways of measuring what it means for a perturbation to be “small”; as such, our analysis considers a range of different norms. While the $\ell _ { \infty }$ -norm is commonly used, adversarial examples can be crafted in any $\ell _ { p }$ -norm (see Figure 1). We will see that the choice of norm can have a dramatic effect on the strength of theoretical guarantees for the existence of adversarial examples. Our analysis also extends to the $\ell _ { 0 }$ -norm, which yields “sparse” adversarial examples that only perturb a small subset of image pixels (Figure 2).
18
+
19
+ ![](images/aab2cca670abfcf6574b1081a02b9c665e958d75ffd647bfbdbb2224763319d9.jpg)
20
+ Figure 1: Adversarial examples with different norm constraints formed via the projected gradient method (Madry et al., 2017) on Resnet50, along with the distance between the base image and the adversarial example, and the top class label.
21
+
22
+ As a simple example result, consider a classification problem with $n$ -dimensional images with pixels scaled between 0 and 1 (in this case images live inside the unit hypercube). If the image classes each occupy a fraction of the cube greater than $\textstyle { \frac { 1 } { 2 } } \exp ( - \pi \epsilon ^ { 2 } )$ , then images exist that are susceptible to adversarial perturbations of $\ell _ { 2 }$ -norm at most $\epsilon$ . Note that $\epsilon = 1 0$ was used in Figure 1, and larger values are typical for larger images.
23
+
24
+ Finally, in Section 8, we explore the causes of adversarial susceptibility in real datasets, and the effect of dimensionality. We present an example image class for which there is no fundamental link between dimensionality and robustness, and argue that the data distribution, and not dimensionality, is the primary cause of adversarial susceptibility.
25
+
26
+ # 1.1 BACKGROUND: A BRIEF HISTORY OF ADVERSARIAL EXAMPLES
27
+
28
+ Adversarial examples, first demonstrated in Szegedy et al. (2013) and Biggio et al. (2013), change the label of an image using small and often imperceptible perturbations to its pixels. A number of defenses have been proposed to harden networks against attacks, but historically, these defenses have been quickly broken. Adversarial training, one of the earliest defenses, successfully thwarted the fast gradient sign method (FGSM) (Goodfellow et al., 2014), one of the earliest and simplest attacks. However, adversarial training with FGSM examples was quickly shown to be vulnerable to more sophisticated multi-stage attacks (Kurakin et al., 2016; Tramer et al., 2017a). More sophisticated defenses that rely on network distillation (Papernot et al., 2016b) \` and specialized activation functions (Zantedeschi et al., 2017) were also toppled by strong attacks (Papernot et al., 2016a; Tramer et al., 2017b; Carlini & Wagner, 2016; 2017a). \`
29
+
30
+ The ongoing vulnerability of classifiers was highlighted in recent work by Athalye et al. (2018) and Athalye & Sutskever (2017) that broke an entire suite of defenses presented in ICLR 2018 including thermometer encoding (Buckman et al., 2018), detection using local intrinsic dimensionality (Ma et al., 2018), input transformations such as compression and image quilting (Guo et al., 2017), stochastic activation pruning (Dhillon et al., 2018), adding randomization at inference time (Xie et al., 2017), enhancing the confidence of image labels (Song et al., 2017), and using a generative model as a defense (Samangouei et al., 2018).
31
+
32
+ Rather than hardening classifiers to attacks, some authors have proposed sanitizing datasets to remove adversarial perturbations before classification. Approaches based on auto-encoders (Meng & Chen, 2017) and GANs (Shen et al., 2017) were broken using optimization-based attacks (Carlini & Wagner, 2017b;a).
33
+
34
+ A number of “certifiable” defense mechanisms have been developed for certain classifiers. Raghunathan et al. (2018) harden a two-layer classifier using semidefinite programming, and Sinha et al. (2018) propose a convex duality-based approach to adversarial training that works on sufficiently small adversarial perturbations with a quadratic adversarial loss. Kolter & Wong (2017) consider training a robust classifier using the convex outer adversarial polytope. All of these methods only consider robustness of the classifier on the training set, and robustness properties often fail to generalize reliably to test examples.
35
+
36
+ One place where researchers have enjoyed success is at training classifiers on low-dimensional datasets like MNIST (Madry et al., 2017; Sinha et al., 2018). The robustness achieved on more complicated datasets such as CIFAR-10 and ImageNet are nowhere near that of MNIST, which leads some researchers to speculate that adversarial defense is fundamentally harder in higher dimensions – an issue we address in Section 8.
37
+
38
+ ![](images/6ddd75fd53a9fc4b49de87358f7e597db9a66ba38a3b2e7c9f112263ea1a93b5.jpg)
39
+ Figure 2: Sparse adversarial examples perturb a small subset of pixels and can hide adversarial “fuzz” inside highfrequency image regions. The original image (left) is classified as an “ox.” Under $\ell _ { \infty }$ -norm perturbations, it is classified as “traffic light”, but the perturbations visibly distort smooth regions of the image (the sky). These effects are hidden in the grass using $\ell _ { 0 }$ -norm (sparse) perturbations limited to a small subset of pixels.
40
+
41
+ This paper uses well-known results from high-dimensional geometry, specifically isoperimetric inequalities, to provide bounds on the robustness of classifiers. Several other authors have investigated adversarial susceptibility through the lens of geometry. Fawzi et al. (2018) study adversarial susceptibility of datasets under the assumption that they are produced by a generative model that maps random Gaussian vectors onto images. Gilmer et al. (2018) do a detailed case study, including empirical and theoretical results, of classifiers for a synthetic dataset that lies on two concentric spheres. Simon-Gabriel et al. (2018) show that the Lipschitz constant of untrained networks with random weights gets large in high dimensions. Shortly after the original appearance of our work, Mahloujifar et al. (2018) presented a study of adversarial susceptibility that included both evasion and poisoning attacks. Our work is distinct in that it studies adversarial robustness for arbitrary data distributions, and also that it rigorously looks at the effect of dimensionality on robustness limits.
42
+
43
+ # 1.2 NOTATION
44
+
45
+ We use $[ 0 , 1 ] ^ { n }$ to denote the unit hypercube in $n$ dimensions, and $\operatorname { v o l } ( \mathcal { A } )$ to denote the volume (i.e., ndimensional Lebesgue measure) of a subset ${ \mathcal { A } } \subset [ 0 , 1 ] ^ { n }$ . We use $\mathbb { S } ^ { n - 1 } = \left\{ x \in \mathbb { R } ^ { n } | \| x \| _ { 2 } = 1 \right\}$ to denote the unit sphere embedded in $\mathbb { R } ^ { n }$ , and $s _ { n - 1 }$ to denote its surface area. The size of a subset $\mathcal { A } \in \mathbb { S } ^ { n - 1 }$ can be quantified by its $( n - 1$ dimensional) measure $\mu [ \mathcal { A } ]$ , which is simply the surface area the set covers. Because the surface area of the unit sphere varies greatly with $n$ , it is much easier in practice to work with the normalized measure, which we denote $\mu _ { 1 } [ \mathcal { A } ] = \mu [ \mathcal { A } ] / s _ { n - 1 }$ . This normalized measure has the property that $\mu _ { 1 } [ \mathbb { S } ^ { n - 1 } ] = 1$ , and so we can interpret $\mu _ { 1 } [ \mathcal { A } ]$ as the probability of a uniform random point from the sphere lying in $\mathcal { A }$ . When working with points on a sphere, we often use geodesic distance, which is always somewhat larger than (but comparable to) the Euclidean distance. In the cube, we measure distance between points using $\ell _ { p }$ -norms, which are denoted
46
+
47
+ $$
48
+ \| z \| _ { p } = \left( \sum _ { i } | z _ { i } | ^ { p } \right) ^ { 1 / p } { \mathrm { ~ i f ~ } } p > 0 , { \mathrm { a n d ~ } } \| z \| _ { 0 } = \operatorname { c a r d } \{ z _ { i } | z _ { i } \neq 0 \} .
49
+ $$
50
+
51
+ Note that $\| \cdot \| _ { p }$ is not truly a norm for $p < 1$ , but rather a semi-norm. Such metrics are still commonly used, particularly the $^ { 6 6 } \ell _ { 0 }$ -norm” which counts the number of non-zero entries in a vector.
52
+
53
+ # 2 PROBLEM SETUP
54
+
55
+ We consider the problem of classifying data points that lie in a space $\Omega$ (either a sphere or a hypercube) into $m$ different object classes. The $m$ object classes are defined by probability density functions $\{ \bar { \rho } _ { c } \} _ { c = 1 } ^ { m }$ , where $\rho _ { c } : \Omega \to \mathbb { R }$ . A “random” point from class $c$ is a random variable with density $\rho _ { c }$ . We assume $\rho _ { c }$ to be bounded (i.e., we don’t allow delta functions or other generalized functions), and denote its upper bound by $U _ { c } = \operatorname* { s u p } _ { x } \rho _ { c } ( x )$ .
56
+
57
+ We also consider a “classifier” function $\mathcal { C } : \Omega \{ 1 , 2 , \dots , m \}$ that partitions $\Omega$ into disjoint measurable subsets, one for each class label. The classifier we consider is discrete valued – it provides a label for each data point but not a confidence level.
58
+
59
+ With this setup, we can give a formal definition of an adversarial example.
60
+
61
+ Definition 1. Consider a point $x \in \Omega$ drawn from class $c$ , a scalar $\epsilon > 0$ , and a metric $d$ . We say that $x$ admits an $\epsilon$ -adversarial example in the metric $d$ if there exists a point ${ \hat { x } } \in \Omega$ with $\mathcal { C } ( \hat { x } ) \neq c$ , and $d ( x , { \hat { x } } ) \leq \epsilon$
62
+
63
+ In plain words, a point has an $\epsilon$ -adversarial example if we can sneak it into a different class by moving it at most $\epsilon$ units in the distance $d$ .
64
+
65
+ We consider adversarial examples with respect to different $\ell _ { p }$ -norm metrics. These metrics are written $d _ { p } ( x , { \hat { x } } ) = \| x - { \hat { x } } \| _ { p }$ . A common choice is $p = \infty$ , which limits the absolute change that can be made to any one pixel. However, $\ell _ { 2 }$ -norm and $\ell _ { 1 }$ -norm adversarial examples are also used, as it is frequently easier to create adversarial examples in these less restrictive metrics.
66
+
67
+ ![](images/bec453d8b88a06db74ab1cc8b4677e5f64e6711c700b0e65e5afb10aeb6e93f7.jpg)
68
+ Figure 3: The $\epsilon$ -expansion of a half sphere nearly covers the whole sphere for small $\epsilon$ and large $n$ . Visualizations show the fraction of the sphere captured within $\epsilon$ units of a half sphere in different dimensions. Results from a near-exact experimental method are compared to the theoretical lower bound in Lemma 2.
69
+
70
+ We also consider sparse adversarial examples in which only a small subset of pixels are manipulated. This corresponds to the metric $d _ { 0 }$ , in which case the constraint $\| x - { \hat { x } } \| _ { 0 } \leq \epsilon$ means that an adversarial example was crafted by changing at most $\epsilon$ pixels, and leaving the others alone.
71
+
72
+ # 3 THE SIMPLE CASE: ADVERSARIAL EXAMPLES ON THE UNIT SPHERE
73
+
74
+ We begin by looking at the case of classifiers for data on the sphere. While this data model may be less relevant than the other models studied below, it provides a straightforward case where results can be proven using simple, geometric lemmas. The more realistic case of images with pixels in $[ 0 , 1 ]$ will be studied in Section 4.
75
+
76
+ The idea is to show that, provided a class of data points takes up enough space, nearly every point in the class lies close to the class boundary. To show this, we begin with a simple definition.
77
+
78
+ Definition 2. The $\epsilon$ -expansion of a subset $A \subset \Omega$ with respect to distance metric $d$ , denoted $A ( \epsilon , d )$ , contains all points that are at most $\epsilon$ units away from $\mathcal { A }$ . To be precise
79
+
80
+ $$
81
+ \begin{array} { r } { A ( \epsilon , d ) = \{ x \in \Omega | d ( x , y ) \leq \epsilon f o r s o m e y \in \mathcal { A } \} . } \end{array}
82
+ $$
83
+
84
+ We sometimes simply write $\boldsymbol { \mathcal { A } } ( \boldsymbol { \epsilon } )$ when the distance metric is clear from context.
85
+
86
+ Our result provides bounds on the probability of adversarial examples that are independent of the shape of the class boundary. This independence is a simple consequence of an isoperimetric inequality. The classical isoperimetric inequality states that, of all closed surfaces that enclose a unit volume, the sphere has the smallest surface area. This simple fact is intuitive but famously difficult to prove. For a historical review of the isoperimetric inequality and its variants, see Osserman et al. (1978). We will use a special variant of the isoperimetric inequality first proved by Levy & Pellegrino (1951) and simplified by Talagrand (1995). ´
87
+
88
+ Lemma 1 (Isoperimetric inequality). Consider a subset of the sphere $\mathcal { A } \subset \mathbb { S } ^ { n - 1 } \subset \mathbb { R } ^ { n }$ with normalized measure $\mu _ { 1 } ( \mathcal { A } ) \ge 1 / 2$ . When using the geodesic metric, the -expansion $\boldsymbol { \mathcal { A } } ( \boldsymbol { \epsilon } )$ is at least as large as the $\epsilon$ -expansion of a half sphere.
89
+
90
+ The classical isoperimetric inequality is a simple geometric statement, and frequently appears without absolute bounds on the size of the $\epsilon$ -expansion of a half-sphere, or with bounds that involve unspecified constants (Vershynin, 2017). A tight bound derived by Milman $\&$ Schechtman (1986) is given below. The asymptotic blow-up of the $\epsilon$ -expansion of a half sphere predicted by this bound is shown in Figure 3.
91
+
92
+ Lemma 2 ( $\epsilon$ -expansion of half sphere). The geodesic $\epsilon$ -expansion of a half sphere has normalized measure at least
93
+
94
+ $$
95
+ 1 - \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
96
+ $$
97
+
98
+ Lemmas 1 and 2 together can be taken to mean that, if a set is not too small, then in high dimensions almost all points on the sphere are reachable within a short $\epsilon$ jump from that set. These lemmas have immediate implications for adversarial examples, which are formed by mapping one class into another using small perturbations. Despite its complex appearance, the result below is a consequence of the (relatively simple) isoperimetric inequality.
99
+
100
+ Theorem 1 (Existence of Adversarial Examples). Consider a classification problem with m object classes, each distributed over the unit sphere ${ \mathbb { S } } ^ { n - 1 } \subset { \overline { { \mathbb { R } } } } ^ { n }$ with density functions $\{ \rho _ { c } \} _ { c = 1 } ^ { m }$ . Choose a classifier function $\mathcal { C } : \mathbb { S } ^ { n - 1 } \to \{ 1 , 2 , \dots , m \}$ that partitions the sphere into disjoint measurable subsets. Define the following scalar constants:
101
+
102
+ • Let $V _ { c }$ denote the magnitude of the supremum of $\rho _ { c }$ relative to the uniform density. This can be written $V _ { c } : = s _ { n - 1 } \cdot \operatorname* { s u p } _ { x } \rho _ { c } ( x )$ . • Let $f _ { c } = \mu _ { 1 } \{ x | \mathcal { C } ( x ) = c \}$ be the fraction of the sphere labeled as c by classifier $\mathcal { C }$ .
103
+
104
+ Choose some class c with $f _ { c } \leq \frac { 1 } { 2 }$ . Sample a random data point $x$ from $\rho _ { c }$ . Then with probability at least
105
+
106
+ $$
107
+ 1 - V _ { c } \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right)
108
+ $$
109
+
110
+ one of the following conditions holds:
111
+
112
+ 1. x is misclassified by $\mathcal { C }$ , or
113
+ 2. x admits an $\epsilon$ -adversarial example in the geodesic distance.
114
+
115
+ Proof. Choose a class $c$ with $f _ { c } \leq \frac { 1 } { 2 }$ . Let ${ \mathcal { R } } = \{ x | { \mathcal { C } } ( x ) = c \}$ denote the region of the sphere labeled as class $c$ by $\mathcal { C }$ , and let $\overline { { \mathcal { R } } }$ be its complement. $\overline { { \mathcal { R } } } ( \epsilon )$ is the $\epsilon$ -expansion of $\overline { { \mathcal { R } } }$ in the geodesic metric. Because $\overline { { \mathcal { R } } }$ covers at least half the sphere, the isoperimetric inequality (Lemma 1) tells us that the epsilon expansion is at least as great as the epsilon expansion of a half sphere. We thus have
116
+
117
+ $$
118
+ \mu _ { 1 } [ \overline { { { R } } } ( \epsilon ) ] \geq 1 - \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
119
+ $$
120
+
121
+ Now, consider the set $ { \boldsymbol { S } } _ { c }$ of “safe” points from class $c$ that are correctly classified and do not admit adversarial perturbations. A point is correctly classified only if it lies inside $\mathcal { R }$ , and therefore outside of $\overline { { \mathcal { R } } }$ . To be safe from adversarial perturbations, a point cannot lie within $\epsilon$ distance from the class boundary, and so it cannot lie within $\overline { { R } } ( \epsilon )$ . It is clear that the set $ { \boldsymbol { S } } _ { c }$ of safe points is exactly the complement of $\dot { \overline { { R } } } ( \epsilon )$ . This set has normalized measure
122
+
123
+ $$
124
+ \mu _ { 1 } [ S _ { c } ] \leq \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
125
+ $$
126
+
127
+ The probability of a random point lying in $ { \boldsymbol { S } } _ { c }$ is bounded above by the normalized supremum of $\rho _ { c }$ times the normalized measure $\mu _ { 1 } [ S _ { c } ]$ . This product is given by
128
+
129
+ $$
130
+ V _ { c } \left( \frac { \pi } { 8 } \right) ^ { \frac { 1 } { 2 } } \exp \left( - \frac { n - 1 } { 2 } \epsilon ^ { 2 } \right) .
131
+ $$
132
+
133
+ We then subtract this probability from 1 to obtain the probability of a point lying outside the safe region, and arrive at equation 1. □
134
+
135
+ In the above result, we measure the size of adversarial perturbations using the geodesic distance. Most studies of adversarial examples measure the size of perturbation in either the $\ell _ { 2 }$ (Euclidean) norm or the $\ell _ { \infty }$ (max) norm, and so it is natural to wonder whether Theorem 1 depends strongly on the distance metric. Fortunately (or, rather unfortunately) it does not.
136
+
137
+ It is easily observed that, for any two points $x$ and $y$ on a sphere,
138
+
139
+ $$
140
+ d _ { \infty } ( x , y ) \leq d _ { 2 } ( x , y ) \leq d _ { g } ( x , y ) ,
141
+ $$
142
+
143
+ where $d _ { \infty } ( x , y )$ , $d _ { 2 } ( x , y )$ , and $d _ { g } ( x , y )$ denote the $l _ { \infty }$ , Euclidean, and geodesic distance, respectively. From this, we see that Theorem 1 is actually fairly conservative; any $\epsilon$ -adversarial example in the geodesic metric would also be adversarial in the other two metrics, and the bound in Theorem 1 holds regardless of which of the three metrics we choose (although different values of $\epsilon$ will be appropriate depending on the norm).
144
+
145
+ # 4 WHAT ABOUT THE UNIT CUBE?
146
+
147
+ The above result about the sphere is simple and easy to prove using classical results. However, real world images do not lie on the sphere. In a more typical situation, images will be scaled so that their pixels lie in [0, 1], and data lies inside a high-dimensional hypercube (but, unlike the sphere, data is not confined to its surface). The proof of Theorem 1 makes extensive use of properties that are exclusive to the sphere, and is not applicable to this more realistic setting. Are there still problem classes on the cube where adversarial examples are inevitable?
148
+
149
+ This question is complicated by the fact that geometric isoperimetric inequalities do not exist for the cube, as the shapes that achieve minimal $\epsilon$ -expansion (if they exist) depend on the volume they enclose and the choice of $\epsilon$ (Ros, 2001). Fortunately, researchers have been able to derive “algebraic” isoperimetric inequalities that provide lower bounds on the size of the $\epsilon$ -expansion of sets without identifying the shape that achieves this minimum (Talagrand, 1996; Milman & Schechtman, 1986). The result below about the unit cube is analogous to Proposition 2.8 in Ledoux (2001), except with tighter constants. For completeness, a proof (which utilizes methods from Ledoux) is provided in Appendix A.
150
+
151
+ Lemma 3 (Isoperimetric inequality on a cube). Consider a measurable subset of the cube $\mathcal { A } \subset [ 0 , 1 ] ^ { n }$ , and a p-norm distance metric dp(x, y) = kx − ykp for p > 0. Let Φ(z) = (2π)− 12 R z−∞ e , and let α be the scalar that satisfies $\Phi ( \alpha ) = \mathrm { v o l } [ \mathcal { A } ]$ . Then
152
+
153
+ $$
154
+ \mathrm { v o l } [ A ( \epsilon , d _ { p } ) ] \geq \Phi \left( \alpha + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right)
155
+ $$
156
+
157
+ where $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ . In particular, $i f \mathrm { v o l } ( \mathcal { A } ) \geq 1 / 2$ , then we simply have
158
+
159
+ $$
160
+ \mathrm { v o l } [ { \cal A } ( \epsilon , d _ { p } ) ] \ge 1 - \frac { \exp ( - \pi { n ^ { 1 - 2 / p ^ { * } } } \epsilon ^ { 2 } ) } { 2 \pi { n ^ { 1 / 2 - 1 / p ^ { * } } } } .
161
+ $$
162
+
163
+ Using this result, we can show that most data samples in a cube admit adversarial examples, provided the data distribution is not excessively concentrated.
164
+
165
+ Theorem 2 (Adversarial examples on the cube). Consider a classification problem with m classes, each distributed over the unit hypercube $[ 0 , 1 ] ^ { n }$ with density functions $\{ \rho _ { c } \} _ { c = 1 } ^ { m }$ . Choose a classifier function $\mathcal { C } : [ 0 , 1 ] ^ { n } \to \{ 1 , 2 , . . . , m \}$ that partitions the hypercube into disjoint measurable subsets. Define the following scalar constants:
166
+
167
+ • Let $U _ { c }$ denote the supremum of $\rho _ { c }$ .
168
+ • Let $f _ { c }$ be the fraction of hypercube partitioned into class c by $\mathcal { C }$ .
169
+
170
+ Choose some class $c$ with $f _ { c } \ \leq \ { \frac { 1 } { 2 } }$ , and select an $\ell _ { p }$ -norm with $p > 0$ . Define $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ . Sample a random data point $x$ from the class distribution $\rho _ { c }$ . Then with probability at least
171
+
172
+ $$
173
+ 1 - U _ { c } \frac { \exp ( - \pi { n ^ { 1 - 2 / p ^ { * } } \epsilon ^ { 2 } } ) } { 2 \pi { n ^ { 1 / 2 - 1 / p ^ { * } } } } .
174
+ $$
175
+
176
+ one of the following conditions holds:
177
+
178
+ 1. x is misclassified by $\mathcal { C }$ , or
179
+ 2. x has an adversarial example $\hat { x }$ , with $\| x - { \hat { x } } \| _ { p } \leq \epsilon$ .
180
+
181
+ When adversarial examples are defined in the $\ell _ { 2 }$ -norm (or for any $p \geq 2$ ), the bound in equation 4 becomes
182
+
183
+ $$
184
+ 1 - U _ { c } \exp ( - \pi \epsilon ^ { 2 } ) / ( 2 \pi ) .
185
+ $$
186
+
187
+ Provided the class distribution is not overly concentrated, equation 5 guarantees adversarial examples with relatively “small” $\epsilon$ relative to a typical vector. In $n$ dimensions, the $\ell _ { 2 }$ diameter of the cube is $\sqrt { n }$ , and so it is reasonable to choose $\epsilon = O ( { \sqrt { n } } )$ in equation 5. In Figure 1, we chose $\epsilon = 1 0$ . A similarly strong bound of $1 - U _ { c } \sqrt { n } \exp ( - \pi \epsilon ^ { 2 } / n ) / ( 2 \pi )$ holds for the case of the $\ell _ { 1 }$ -norm, in which case the diameter is $n$ .
188
+
189
+ Oddly, equation 4 seems particularly weak when the $\ell _ { \infty }$ norm is used. In this case, the bound on the right side of equation 4 becomes equation 5 just like in the $\ell _ { 2 }$ case. However, $\ell _ { \infty }$ adversarial examples are only interesting if we take $\epsilon < 1$ , in which case equation 5 becomes vacuous for large $n$ . This bound can be tightened up in certain situations. If we prove Theorem 2 using the tighter (but messier) bound of equation 2 instead of equation 3, we can replace equation 4 with
190
+
191
+ $$
192
+ 1 - U _ { c } \hat { \Phi } \left( \alpha + \sqrt { 2 \pi } \epsilon \right)
193
+ $$
194
+
195
+ for $p \geq 2$ , where $\begin{array} { r } { \hat { \Phi } ( z ) = \frac { 1 } { \sqrt { 2 \pi } } \int _ { z } ^ { \infty } e ^ { - t ^ { 2 } / 2 } d t \ge \frac { 1 } { \sqrt { 2 \pi } z } e ^ { - z ^ { 2 } / 2 } } \end{array}$ (for $z > 0$ ), and $\alpha = \Phi ^ { - 1 } ( 1 - f _ { c } )$ . For this bound to be meaningful with $\epsilon < 1$ , we need $f _ { c }$ to be relatively small, and $\epsilon$ to be roughly $f _ { c }$ or smaller. This is realistic for some problems; ImageNet has 1000 classes, and so $f _ { c } < 1 0 ^ { - 3 }$ for at least one class.
196
+
197
+ Interestingly, under $\ell _ { \infty }$ -norm attacks, guarantees of adversarial examples are much stronger on the sphere (Section 3) than on the cube. One might wonder whether the weakness of Theorem 4 in the $\ell _ { \infty }$ case is fundamental, or if this is a failure of our approach. One can construct examples of sets with $\ell _ { \infty }$ expansions that nearly match the behavior of equation 5, and so our theorems in this case are actually quite tight. It seems to be inherently more difficult to prove the existence of adversarial examples in the cube using the $\ell _ { \infty }$ -norm.
198
+
199
+ # 5 WHAT ABOUT SPARSE ADVERSARIAL EXAMPLES?
200
+
201
+ A number of papers have looked at sparse adversarial examples, in which a small number of image pixels, in some cases only one (Su et al., 2017), are changed to manipulate the class label. To study this case, we would like to investigate adversarial examples under the $\ell _ { 0 }$ metric. The $\ell _ { 0 }$ distance is defined as
202
+
203
+ $$
204
+ d ( x , y ) = \| x - y \| _ { 0 } = \mathrm { c a r d } \{ i | x _ { i } \neq y _ { i } \} .
205
+ $$
206
+
207
+ If a point $x$ has an $\epsilon$ -adversarial example in this norm, then it can be perturbed into a different class by modifying at most $\epsilon$ pixels (in this case $\epsilon$ is taken to be a positive integer).
208
+
209
+ Theorem 2 is fairly tight for $p = 1$ or 2. However, the bound becomes quite loose for small $p$ , and in particular it fails completely for the important case of $p = 0$ . For this reason, we present a different bound that is considerably tighter for small $p$ (although slightly looser for large $p$ ).
210
+
211
+ The case $p = 0$ was studied by Milman & Schechtman (1986) (Section 6.2) and McDiarmid (1989), and later by Talagrand (1995; 1996). The proof of the following theorem (appendix B) follows the method used in Section 5 of Talagrand (1996), with modifications made to extend the proof to arbitrary $p$ .
212
+
213
+ Lemma 4 (Isoperimetric inequality on the cube: small $p$ ). Consider a measurable subset of the cube ${ \mathcal { A } } \subset$ $[ 0 , 1 ] ^ { n }$ , and a $p$ -norm distance metric $d ( x , y ) = \| x - y \| _ { p }$ for any $p \geq 0$ . We have
214
+
215
+ $$
216
+ \begin{array} { l } { \displaystyle \mathrm { v o l } [ \mathcal { A } ( \epsilon , d _ { p } ) ] \ge 1 - \frac { \exp { \left( - \epsilon ^ { 2 p } / n \right) } } { \mathrm { v o l } [ \mathcal { A } ] } , f o r p > 0 a n d } \\ { \displaystyle \mathrm { v o l } [ \mathcal { A } ( \epsilon , d _ { 0 } ) ] \ge 1 - \frac { \exp { \left( - \epsilon ^ { 2 } / n \right) } } { \mathrm { v o l } [ \mathcal { A } ] } , f o r p = 0 . } \end{array}
217
+ $$
218
+
219
+ Using this result, we can prove a statement analogous to Theorem 2, but for sparse adversarial examples. We present only the case of $p = 0$ , but the generalization to the case of other small $p$ using Lemma 4 is straightforward.
220
+
221
+ Theorem 3 (Sparse adversarial examples). Consider the problem setup of Theorem 2. Choose some class c with $f _ { c } \leq \frac { 1 } { 2 }$ , and sample a random data point $x$ from the class distribution $\rho _ { c }$ . Then with probability at least
222
+
223
+ $$
224
+ 1 - 2 U _ { c } \exp ( - \epsilon ^ { 2 } / n )
225
+ $$
226
+
227
+ one of the following conditions holds:
228
+
229
+ 1. x is misclassified by $\mathcal { C }$ , or
230
+
231
+ 2. x can be adversarially perturbed by modifying at most  pixels, while still remaining in the unit hypercube.
232
+
233
+ Tighter bounds can be obtained if we only guarantee that adversarial examples exist for some data points in a class, without bounding the probability of this event.
234
+
235
+ Theorem 4 (Condition for existence of adversarial examples). Consider the setup of Theorem 2. Choose a class c that occupies a fraction of the cube $f _ { c } < \frac { 1 } { 2 }$ . Pick an $\ell _ { p }$ norm and set $p ^ { * } = \operatorname* { m i n } ( p , 2 )$ .
236
+
237
+ Let $\operatorname { s u p p } ( \rho _ { c } )$ denote the support of $\rho _ { c }$ . Then there is a point $x$ with $\rho _ { c } ( x ) > 0$ that admits an $\epsilon$ -adversarial example if
238
+
239
+ $$
240
+ \begin{array} { r } { \operatorname { v o l } [ \operatorname { s u p p } ( \rho _ { c } ) ] \geq \left\{ \begin{array} { l l } { \frac { 1 } { 2 } \exp \bigl ( - \pi \epsilon ^ { 2 } n ^ { 1 - 2 / p ^ { * } } \bigr ) , } & { f o r p > 0 o r } \\ { \exp \left( - 2 \left( \epsilon - \sqrt { \frac { n \log 2 } { 2 } } \right) ^ { 2 } / n \right) , } & { f o r p = 0 . } \end{array} \right. } \end{array}
241
+ $$
242
+
243
+ The bound for the case $p = 0$ is valid only if $\epsilon \geq \sqrt { n \log { 2 / 2 } }$ .
244
+
245
+ It is interesting to consider when Theorem 4 produces non-vacuous bounds. When the $\ell _ { 2 }$ -norm is used, the bound becomes √ $\mathrm { v o l } [ \mathrm { s u p p } ( \rho _ { c } ) ] \geq \exp ( - \pi \epsilon ^ { 2 } ) \dot { / } 2$ . The diameter of the cube is $\sqrt { n }$ , and so the bound becomes active for $\epsilon = \sqrt { n }$ . Plugging this in, we see that the bound is active whenever the size of the support satisfies $\begin{array} { r } { \mathrm { v o l } [ \mathrm { s u p p } ( \rho _ { c } ) ] > \frac { 1 } { 2 e ^ { \pi n } } } \end{array}$ . Remarkably, this holds for large $n$ whenever the support of class $c$ is larger than (or contains) a hypercube of side length at least $e ^ { - \pi } \approx 0 . 0 4 3$ . Note, however, that the bound being “active” does not guarantee adversarial examples with a “small” $\epsilon$ .
246
+
247
+ # 7 DISCUSSION: CAN WE ESCAPE FUNDAMENTAL BOUNDS?
248
+
249
+ There are a number of ways to escape the guarantees of adversarial examples made by Theorems 1-4. One potential escape is for the class density functions to take on extremely large values (i.e., exponentially large $U _ { c , }$ ); the dependence of $U _ { c }$ on $n$ is addressed separately in Section 8.
250
+
251
+ Unbounded density functions and low-dimensional data manifolds In practice, image datasets might lie on low-dimensional manifolds within the cube, and the support of these distributions could have measure zero, making the density function infinite (i.e., $U _ { c } = \infty$ ). The arguments above are still relevant (at least in theory) in this case; we can expand the data manifold by adding a uniform random noise to each image pixel of magnitude at most $\epsilon _ { 1 }$ . The expanded dataset has positive volume. Then, adversarial examples of this expanded dataset can be crafted with perturbations of size $\epsilon _ { 2 }$ . This method of expanding the manifold before crafting adversarial examples is often used in practice. Tramer et al. (2017a) proposed adding a small \` perturbation to step off the image manifold before crafting adversarial examples. This strategy is also used during adversarial training (Madry et al., 2017).
252
+
253
+ Adding a “don’t know” class The analysis above assumes the classifier assigns a label to every point in the cube. If a classifier has the ability to say “I don’t know,” rather than assign a label to every input, then the region of the cube that is assigned class labels might be very small, and adversarial examples could be escaped even if the other assumptions of Theorem 4 are satisfied. In this case, it would still be easy for the adversary to degrade classifier performance by perturbing images into the “don’t know” class.
254
+
255
+ Feature squeezing If decreasing the dimensionality of data does not lead to substantially increased values for $U _ { c }$ (we see in Section 8 that this is a reasonable assumption) or loss in accuracy (a stronger assumption), measuring data in lower dimensions could increase robustness. This can be done via an auto-encoder (Meng & Chen, 2017; Shen et al., 2017), JPEG encoding (Das et al., 2018), or quantization (Xu et al., 2017).
256
+
257
+ Computational hardness It may be computationally hard to craft adversarial examples because of local flatness of the classification function, obscurity of the classifier function, or other computational difficulties. Computational hardness could prevent adversarial attacks in practice, even if adversarial examples still exist.
258
+
259
+ # 8 EXPERIMENTS & EFFECT OF DIMENSIONALITY
260
+
261
+ In this section, we discuss the relationship between dimensionality and adversarial robustness, and explore how the predictions made by the theorems above are reflected in experiments.
262
+
263
+ It is commonly thought that high-dimensional classifiers are more susceptible to adversarial examples than low-dimensional classifiers. This perception is partially motivated by the observation that classifiers on highresolution image distributions like ImageNet are more easily fooled than low resolution classifiers on MNIST (Tramer et al., 2017a). Indeed, Theorem 2 predicts that high-dimensional classifiers should be much easier \` to fool than low-dimensional classifiers, assuming the datasets they classify have comparable probability density limits $U _ { c }$ . However, this is not a reasonable assumption; we will see below that high dimensional distributions may be more concentrated than their low-dimensional counterparts.
264
+
265
+ We study the effects of dimensionality with a thought experiment involving a “big MNIST” image distribution. Given an integer expansion factor $b$ , we can make a big MNIST distribution, denoted $b$ -MNIST, by replacing each pixel in an MNIST image with a $b \times b$ array of identical pixels. This expands an original $2 8 \times 2 8$ image into a $2 8 b \times 2 8 b$ image. Figure 4a shows that, without adversarial training, a classifier on big MNIST is far more susceptible to attacks than a classifier trained on the original MNIST1.
266
+
267
+ However, each curve in Figure 4a only shows the attack susceptibility of one particular classifier. In contrast, Theorems 1-4 describe the fundamental limits of susceptibility for all classifiers. These limits are an inherent property of the data distribution. The theorem below shows that these fundamental limits do not depend in a non-trivial way on the dimensionality of the images in big MNIST, and so the relationship between dimensionality and susceptibility in Figure 4a results from the weakness of the training process.
268
+
269
+ Theorem 5. Suppose  and p are such that, for all MNIST classifiers, a random image from class c has an $\epsilon$ -adversarial example (in the $\ell _ { 2 }$ -norm) with probability at least $p$ . Then for all classifiers on $b$ -MNIST, with integer $b \geq 1$ , a random image from c has a b-adversarial example with probability at least $p$ .
270
+
271
+ Likewise, if all $b$ -MNIST classifiers have b-adversarial examples with probability $p$ for some $b \geq 1$ , then all classifiers on the original MNIST distribution have $\epsilon$ -adversarial examples with probability $p$ .
272
+
273
+ Theorem 5 predicts that the perturbation needed to fool all $5 6 \times 5 6$ classifiers is twice that needed to fool all $2 8 \times 2 8$ classifiers. This is reasonable since the $\ell _ { 2 }$ -norm of a $5 6 \times 5 6$ image is twice that of its $2 8 \times 2 8$ counterpart. Put simply, fooling big MNIST is just as hard/easy as fooling the original MNIST regardless of resolution. This also shows that for big MNIST, as the expansion factor $b$ gets larger and $\epsilon$ is expanded to match, the concentration bound $U _ { c }$ grows at exactly the same rate as the exponential term in equation 2 shrinks, and there is no net effect on fundamental susceptibility. Also note that an analogous result could be based on any image classification problem (we chose MNIST only for illustration), and any $p \geq 0$ .
274
+
275
+ We get a better picture of the fundamental limits of MNIST by considering classifiers that are hardened by adversarial training2 (Figure 4b). These curves display several properties of fundamental limits predicted by our theorems. As predicted by Theorem 5, the $1 1 2 \times 1 1 2$ classifer curve is twice as wide as the $5 6 \times 5 6$ curve, which in turn is twice as wide as the $2 8 \times 2 8$ curve. In addition, we see the kind of “phase transition” behavior predicted by Theorem 2, in which the classifier suddenly changes from being highly robust to being highly susceptible as $\epsilon$ passes a critical threshold. For these reasons, it is reasonable to suspect that the adversarially trained classifiers in Figure 4b are operating near the fundamental limit predicted by Theorem 2.
276
+
277
+ Theorem 5 shows that increased dimensionality does not increase adversarial susceptibility in a fundamental way. But then why are high-dimensional classifiers so easy to fool? To answer this question, we look at the concentration bound $U _ { c }$ for object classes. The smallest possible value of $U _ { c }$ is 1, which only occurs when images are “spread out” with uniform, uncorrelated pixels. In contrast, adjacent pixels in MNIST (and especially big MNIST) are very highly correlated, and images are concentrated near simple, low-dimensional manifolds, resulting in highly concentrated image classes with large $U _ { c }$ . Theory predicts that such highly concentrated datasets can be relatively safe from adversarial examples.
278
+
279
+ ![](images/7156f6da0989991e35b2cf03ea4ff4f32e1b6a8d1b3ee00fe588d06e040a3e1c.jpg)
280
+ Figure 4: (a) Robustness of MNIST and “big” MNIST classifiers as a function of $\epsilon$ . Naturally trained classifiers are less robust with increased dimensionality. (b) With adversarial training, susceptibility curves behave as predicted by Theorems 2 and 5. (c) The susceptibility of CIFAR-10 is compared to big MNIST. Both datasets have similar dimension, but the higher complexity of CIFAR-10 results in far worse susceptibility. Perturbations are measured in the $\ell _ { 2 }$ -norm.
281
+
282
+ We can reduce $U _ { c }$ and dramatically increase susceptibility by choosing a more “spread out” dataset, like CIFAR-10, in which adjacent pixels are less strongly correlated and images appear to concentrate near complex, higher-dimensional manifolds. We observe the effect of decreasing $U _ { c }$ by plotting the susceptibility of a $5 6 \times 5 6$ MNIST classifier against a classifier for CIFAR-10 (Figure 4, right). The former problem lives in 3136 dimensions, while the latter lives in 3072, and both have 10 classes. Despite the structural similarities between these problems, the decreased concentration of CIFAR-10 results in vastly more susceptibility to attacks, regardless of whether adversarial training is used. The theory above suggests that this increased susceptibility is caused at least in part by a shift in the fundamental limits for CIFAR-10, rather than the weakness of the particular classifiers we chose.
283
+
284
+ Informally, the concentration limit $U _ { c }$ can be interpreted as a measure of image complexity. Image classes with smaller $U _ { c }$ are likely concentrated near high-dimensional complex manifolds, have more intra-class variation, and thus more apparent complexity. An informal interpretation of Theorem 2 is that “high complexity” image classes are fundamentally more susceptible to adversarial examples, and Figure 4 suggests that complexity (rather than dimensionality) is largely responsible for differences we observe in the effectiveness of adversarial training for different datasets.
285
+
286
+ # 9 SO...ARE ADVERSARIAL EXAMPLES INEVITABLE?
287
+
288
+ The question of whether adversarial examples are inevitable is an ill-posed one. Clearly, any classification problem has a fundamental limit on robustness to adversarial attacks that cannot be escaped by any classifier. However, we have seen that these limits depend not only on fundamental properties of the dataset, but also on the strength of the adversary and the metric used to measure perturbations. This paper provides a characterization of these limits and how they depend on properties of the data distribution. Unfortunately, it is impossible to know the exact properties of real-world image distributions or the resulting fundamental limits of adversarial training for specific datasets. However, the analysis and experiments in this paper suggest that, especially for complex image classes in high-dimensional spaces, these limits may be far worse than our intuition tells us.
289
+
290
+ # REFERENCES
291
+
292
+ Milton Abramowitz and Irene A Stegun. Handbook of mathematical functions: with formulas, graphs, and mathematical tables, volume 55. Courier Corporation, 1965.
293
+
294
+ Anish Athalye and Ilya Sutskever. Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397, 2017.
295
+
296
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
297
+
298
+ Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Giorgio Giac- ´ into, 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.
299
+
300
+ Sergey G Bobkov et al. An isoperimetric inequality on the discrete cube, and an elementary proof of the isoperimetric inequality in gauss space. The Annals of Probability, 25(1):206–214, 1997.
301
+
302
+ Jacob Buckman, Aurko Roy, Colin Raffel, and Ian Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. OpenReview, 2018.
303
+
304
+ Nicholas Carlini and David Wagner. Defensive distillation is not robust to adversarial examples. arXiv preprint arXiv:1607.04311, 2016.
305
+
306
+ Nicholas Carlini and David Wagner. Magnet and “efficient defenses against adversarial attacks” are not robust to adversarial examples. arXiv preprint arXiv:1711.08478, 2017a.
307
+
308
+ Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017b.
309
+
310
+ Nilaksh Das, Madhuri Shanbhogue, Shang-Tse Chen, Fred Hohman, Siwei Li, Li Chen, Michael E Kounavis, and Duen Horng Chau. Shield: Fast, practical defense and vaccination for deep learning using JPEG compression. arXiv preprint arXiv:1802.06816, 2018.
311
+
312
+ Guneet S Dhillon, Kamyar Azizzadenesheli, Zachary C Lipton, Jeremy Bernstein, Jean Kossaifi, Aran Khanna, and Anima Anandkumar. Stochastic activation pruning for robust adversarial defense. arXiv preprint arXiv:1803.01442, 2018.
313
+
314
+ Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. arXiv preprint arXiv:1802.08686, 2018.
315
+
316
+ Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018.
317
+
318
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
319
+
320
+ Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. arXiv preprint arXiv:1711.00117, 2017.
321
+
322
+ J Zico Kolter and Eric Wong. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017.
323
+
324
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
325
+
326
+ Michel Ledoux. The concentration of measure phenomenon. Number 89. American Mathematical Soc., 2001.
327
+
328
+ Paul Levy and Franco Pellegrino. ´ Problemes concrets d’analyse fonctionnelle ´ . Gauthier-Villars, Paris, 1951.
329
+
330
+ Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Michael E Houle, Grant Schoenebeck, Dawn Song, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. arXiv preprint arXiv:1801.02613, 2018.
331
+
332
+ 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.
333
+
334
+ Saeed Mahloujifar, Dimitrios I Diochnos, and Mohammad Mahmoody. The curse of concentration in robust learning: Evasion and poisoning attacks from concentration of measure. arXiv preprint arXiv:1809.03063, 2018.
335
+
336
+ C McDiarmid. On the method of bounded differences. London Mathematical Society Lecture Notes, 141: 148–188, 1989.
337
+
338
+ Dongyu Meng and Hao Chen. MagNet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
339
+
340
+ Vitali D Milman and Gideon Schechtman. Asymptotic Theory of Finite Dimensional Normed Spaces. Springer-Verlag, Berlin, Heidelberg, 1986. ISBN 0-387-16769-2.
341
+
342
+ Robert Osserman et al. The isoperimetric inequality. Bulletin of the American Mathematical Society, 84(6): 1182–1238, 1978.
343
+
344
+ 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.
345
+
346
+ Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 582–597. IEEE, 2016b.
347
+
348
+ Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344, 2018.
349
+
350
+ Antonio Ros. The isoperimetric problem. Global theory of minimal surfaces, 2:175–209, 2001.
351
+
352
+ Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. arXiv preprint arXiv:1805.06605, 2018.
353
+
354
+ Shiwei Shen, Guoqing Jin, Ke Gao, and Yongdong Zhang. APE-GAN: Adversarial perturbation elimination with GAN. ICLR Submission, available on OpenReview, 4, 2017.
355
+
356
+ Carl-Johann Simon-Gabriel, Yann Ollivier, Bernhard Scholkopf, L ¨ eon Bottou, and David Lopez-Paz. Adver- ´ sarial vulnerability of neural networks increases with input dimension. arXiv preprint arXiv:1802.01421, 2018.
357
+
358
+ Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying some distributional robustness with principled adversarial training. OpenReview, 2018.
359
+
360
+ Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. PixelDefend: Leveraging generative models to understand and defend against adversarial examples. arXiv preprint arXiv:1710.10766, 2017.
361
+
362
+ Jiawei Su, Danilo Vasconcellos Vargas, and Sakurai Kouichi. One pixel attack for fooling deep neural networks. arXiv preprint arXiv:1710.08864, 2017.
363
+
364
+ Vladimir Sudakov and Boris Tsirelson. Extremal properties of half-spaces for spherically invariant measures. J. Soviet Math., 41, 1974.
365
+
366
+ 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.
367
+
368
+ Michel Talagrand. Concentration of measure and isoperimetric inequalities in product spaces. Publications Mathematiques de l’Institut des Hautes Etudes Scientifiques ´ , 81(1):73–205, 1995.
369
+
370
+ Michel Talagrand. A new look at independence. The Annals of probability, pp. 1–34, 1996.
371
+
372
+ Florian Tramer, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. \` Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017a.
373
+
374
+ Florian Tramer, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. The space of trans- \` ferable adversarial examples. arXiv preprint arXiv:1704.03453, 2017b.
375
+
376
+ Roman Vershynin. High-Dimensional Probability. Cambridge University Press, 2017.
377
+
378
+ Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. arXiv preprint arXiv:1711.01991, 2017.
379
+
380
+ Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. arXiv preprint arXiv:1704.01155, 2017.
381
+
382
+ Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient defenses against adversarial attacks. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 39–49. ACM, 2017.
383
+
384
+ # A PROOF OF LEMMA 3
385
+
386
+ We now prove Lemma 3. To do this, we begin with a classical isoperimetric inequality for random Gaussian variables. Unlike the case of a cube, tight geometric isoperimetric inequalities exist in this case. We then prove results about the cube by creating a mapping between uniform random variables on the cube and random Gaussian vectors.
387
+
388
+ In the lemma below, we consider the standard Gaussian density in $\mathbb { R } ^ { n }$ given by 1(2π)n/2 e−nx2/2 and corresponding Gaussian measure $\mu$ . We also define
389
+
390
+ $$
391
+ \Phi ( z ) = \frac { 1 } { \sqrt { 2 \pi } } \int _ { - \infty } ^ { z } e ^ { - t ^ { 2 } / 2 } d t ,
392
+ $$
393
+
394
+ which is the cumulative density of a Gaussian curve.
395
+
396
+ The following Lemma was first proved in Sudakov & Tsirelson (1974), and an elementary proof was given in Bobkov et al. (1997).
397
+
398
+ Lemma 5 (Gaussian Isoperimetric Inequality). Of all sets with the same Gaussian measure, the set with $\ell _ { 2 }$ $\epsilon$ -expansion of smallest measure is a half space. Furthermore, for any measurable set $\mathcal A \subset \mathbb { R } ^ { n }$ , and scalar constant a such that $\Phi ( a ) = \mu [ \mathcal { A } ]$ ,
399
+
400
+ $$
401
+ \mu [ { \cal A } ( \epsilon , d _ { 2 } ) ] \geq \Phi ( a + \epsilon ) .
402
+ $$
403
+
404
+ Using this result we can now give a proof of Lemma 3.
405
+
406
+ This function $\Phi$ maps a random Guassian vector $z \in N ( 0 , I )$ onto a random uniform vector in the unit cube. To see why, consider a measurable subset $B \subset R ^ { n }$ . If $\mu$ is the Gaussian measure on $\mathbb { R } ^ { n }$ and $\sigma$ is the uniform measure on the cube, then
407
+
408
+ $$
409
+ \sigma [ \Phi ( \mathcal { B } ) ] = \int \chi _ { \Phi ( \mathcal { B } ) } ( s ) d \sigma = \int \chi _ { \Phi ( \mathcal { B } ) } ( \Phi ( z ) ) \frac { 1 } { \operatorname* { d e t } ( J \Phi ) } d z = \int \chi _ { \mathcal { B } } ( z ) d \mu = \mu [ \mathcal { B } ] .
410
+ $$
411
+
412
+ Since $\textstyle { \frac { \partial } { \partial z _ { i } } } \Phi ( z ) \leq { \frac { 1 } { \sqrt { 2 \pi } } }$ , we also have
413
+
414
+ $$
415
+ \| \Phi ( z ) - \Phi ( w ) \| _ { p } \leq \| \frac { 1 } { \sqrt { 2 \pi } } ( x - w ) \| _ { p } = \frac { 1 } { \sqrt { 2 \pi } } \| z - w \| _ { p }
416
+ $$
417
+
418
+ for any $z , w \in \mathbb { R } ^ { n }$ . From this, we see that for $p ^ { * } = \operatorname* { m i n } ( p , 2 )$
419
+
420
+ $$
421
+ \| \Phi ( z ) - \Phi ( w ) \| _ { p } \leq n ^ { 1 / p ^ { * } - 1 / 2 } \| \Phi ( z ) - \Phi ( w ) \| _ { 2 } \leq \frac { n ^ { 1 / p ^ { * } } } { \sqrt { 2 \pi n } } \| z - w \| _ { 2 }
422
+ $$
423
+
424
+ where we have used the identity $\| u \| _ { p } \leq n ^ { 1 / \operatorname* { m i n } ( p , 2 ) - 1 / 2 } \| u \| _ { 2 }$
425
+
426
+ Now, consider any set $\mathcal { A }$ in the cube, and let $\ b { B } = \ b { \Phi } ^ { - 1 } ( \ b { A } )$ . From equation 10, we see that
427
+
428
+ $$
429
+ \Phi \mathcal { B } \left( \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon , d _ { 2 } \right) \subset \mathcal { A } ( \epsilon , d _ { p } ) .
430
+ $$
431
+
432
+ It follows from equation 10 that
433
+
434
+ $$
435
+ \sigma [ A ( \epsilon , d _ { p } ) ] \geq \mu \left[ B \left( \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon , d _ { 2 } \right) \right] .
436
+ $$
437
+
438
+ Applying Lemma 5, we see that
439
+
440
+ $$
441
+ \sigma [ A ( \epsilon , d _ { p } ) ] \geq \Phi \left( \alpha + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right)
442
+ $$
443
+
444
+ where $\alpha = \Phi ^ { - 1 } ( \sigma [ \mathcal { A } ] )$ .
445
+
446
+ To obtain the simplified formula in the theorem, we use the identity
447
+
448
+ $$
449
+ \frac { 1 } { \sqrt { 2 \pi } } \int _ { x } ^ { \infty } e ^ { - t ^ { 2 } } d t < \frac { e ^ { - x ^ { 2 } } } { \sqrt { 2 \pi } x }
450
+ $$
451
+
452
+ which is valid for $x > 0$ , and can be found in Abramowitz & Stegun (1965).
453
+
454
+ # B PROOF OF LEMMA 4
455
+
456
+ Our proof emulates the method of Talagrand, with minor modifications that extend the result to other $\ell _ { p }$ norms. We need the following standard inequality. Proof can be found in Talagrand (1995; 1996).
457
+
458
+ Lemma 6 (Talagrand). Consider a probability space $\Omega$ with measure $\mu$ . For $g : \Omega \to [ 0 , 1 ]$ , we have
459
+
460
+ $$
461
+ \int _ { \Omega } \operatorname* { m i n } \left( e ^ { t } , \frac { 1 } { g ^ { \alpha } } \right) d \mu \times \left( \int _ { \Omega } g d \mu \right) ^ { \alpha } \leq \exp \left( \frac { t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right) .
462
+ $$
463
+
464
+ Our proof of Lemma 3 follows the three-step process of Talagrand illustrated in Talagrand (1995). We begin by proving the bound
465
+
466
+ $$
467
+ \int e ^ { t f ( x , A ) } d x \leq { \frac { 1 } { \sigma ^ { \alpha } [ { \mathcal { A } } ] } } \exp \left( { \frac { n t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } } \right)
468
+ $$
469
+
470
+ where $\begin{array} { r } { f ( x , \mathcal { A } ) = \operatorname* { m i n } _ { y \in \mathcal { A } } \sum _ { i } | x _ { i } - y _ { i } | ^ { p } = d _ { p } ^ { p } ( x , \mathcal { A } ) } \end{array}$ is a measure of distance from $\mathcal { A }$ to $x$ , and $\alpha , t$ are arbitrary positive constants. Once this bound is established, a Markov bound can be used to obtain the final result. Finally, constants are tuned in order to optimize the tightness of the bound.
471
+
472
+ We start by proving the bound in equation 12 using induction on the dimension. The base case for the induction is $n = 1$ , and we have
473
+
474
+ $$
475
+ ^ { t } ( x , 4 ) d x \leq \sigma [ A ] + \int _ { A ^ { c } } e ^ { t f ( x , A ) } d x \leq \sigma [ A ] + \int _ { A ^ { c } } 1 d x \leq \sigma [ A ] + ( 1 - \sigma [ A ] ) e ^ { t } \leq \frac { 1 } { \sigma ^ { \alpha } [ A ] } \exp \left( \frac { t ^ { 2 } ( \alpha + 1 ) ( 1 - \sigma ) } { 8 \alpha } \right) e ^ { \alpha } .
476
+ $$
477
+
478
+ We now prove the result for $n$ dimensions using the inductive hypothesis. We can upper bound the integral by integrating over “slices” along one dimension. Let $\mathcal { A } \subset [ 0 , 1 ] ^ { n }$ . Define
479
+
480
+ $$
481
+ \mathcal { B } = \{ z \in \mathbb { R } ^ { n - 1 } | ( \omega , z ) \in \mathcal { A } \mathrm { f o r } \mathrm { s o m e } \omega \} .
482
+ $$
483
+
484
+ Clearly, the distance from $( \omega , z )$ to $\mathcal { A }$ is at most the distance from $z$ to $A _ { \omega }$ , and so
485
+
486
+ $$
487
+ \int e ^ { t f ( x , A ) } d x \leq \int _ { \omega \in [ 0 , 1 ] } \int _ { z \in [ 0 , 1 ] ^ { n - 1 } } e ^ { t f ( z , A _ { \omega } ) } d z d x \leq \int _ { \omega \in [ 0 , 1 ] } { \frac { 1 } { \sigma ^ { \alpha } [ A _ { \omega } ] } } \exp \left( { \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } } \right) .
488
+ $$
489
+
490
+ We also have that the distance from $x$ to $\mathcal { A }$ is at most one unit greater than the distance from $x$ to $\boldsymbol { B }$ . This gives us
491
+
492
+ $$
493
+ t f ( x , A ) d \boldsymbol { x } \leq \int _ { ( \omega , z ) \in [ 0 , 1 ] ^ { n } } e ^ { t ( f ( x , B ) + 1 ) } \leq e ^ { t } \int _ { ( \omega , z ) \in [ 0 , 1 ] ^ { n } } e ^ { t f ( x , B ) } \leq \frac { e ^ { t } } { \sigma ^ { \alpha } [ B ] } \exp \left( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right)
494
+ $$
495
+
496
+ Applying equation 6 gives us
497
+
498
+ $$
499
+ \begin{array} { r l } & { \int e ^ { t f ( x , A ) } d x \le \displaystyle \int _ { \omega \in [ 0 , 1 ] } \operatorname* { m i n } ( \frac { e ^ { t } } { \sigma ^ { \alpha } [ B ] } \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) , \frac { 1 } { \sigma ^ { \alpha } [ A _ { \omega } ] } \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) } \\ & { \qquad = \exp ( \frac { ( n - 1 ) t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } ) \frac { 1 } { \sigma ^ { \alpha } [ B ] } \int _ { \omega \in [ 0 , 1 ] } \operatorname* { m i n } ( e ^ { t } , \frac { \sigma ^ { \alpha } [ B ] } { \sigma ^ { \alpha } [ A _ { \omega } ] } ) . } \end{array}
500
+ $$
501
+
502
+ Now, we apply lemma 6 to equation 13 with $g ( \omega ) = \alpha [ \mathcal { A } _ { \omega } ] / \alpha [ B ]$ to arrive at equation 12.
503
+
504
+ The second step of the proof is to produce a Markov inequality from equation 12. For the bound in equation 12 to hold, we need
505
+
506
+ $$
507
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] = \sigma \{ x | f ( x ) > \epsilon ^ { p } \} \leq \frac { \int e ^ { t f ( x , A ) } d x } { e ^ { t \epsilon ^ { p } } } \leq \frac { \exp \left( \frac { n t ^ { 2 } ( \alpha + 1 ) } { 8 \alpha } \right) } { \sigma ^ { \alpha } [ A ] e ^ { t \epsilon ^ { p } } } .
508
+ $$
509
+
510
+ The third step is to optimize the bound by choosing constants. We minimize the right hand side by choosing $\begin{array} { r } { t = \frac { 4 \alpha \epsilon ^ { p } } { n ( \alpha + 1 ) } } \end{array}$ to get
511
+
512
+ $$
513
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \frac { \exp \left( - \frac { 2 \alpha \epsilon ^ { 2 p } } { n ( \alpha + 1 ) } \right) } { \sigma ^ { \alpha } [ A ] } .
514
+ $$
515
+
516
+ Now, we can simply choose $\alpha = 1$ to get the simple bound
517
+
518
+ $$
519
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \frac { \exp \left( - \epsilon ^ { 2 p } / n \right) } { \sigma [ A ] } ,
520
+ $$
521
+
522
+ or we can choose the optimal value of $\begin{array} { r } { \alpha = \sqrt { \frac { 2 \epsilon ^ { 2 p } } { n \log ( 1 / \sigma ) } } - 1 } \end{array}$ , which optimizes the bound in the case $\epsilon ^ { 2 p } \geq$ $\textstyle { \frac { n } { 2 } } \log ( 1 / \sigma ( { \mathcal { A } } ) )$ . We arrive at
523
+
524
+ $$
525
+ 1 - \sigma [ A ( \epsilon , d _ { p } ) ] \leq \exp \left( - \frac { 2 } { n } \left( \epsilon ^ { p } - \sqrt { n \log ( \sigma ^ { - 1 } [ A ] ) / 2 } \right) ^ { 2 } \right) .
526
+ $$
527
+
528
+ This latter bound is stronger than we need to prove Lemma 3, but it will come in handy later to prove Theorem 4.
529
+
530
+ # C PROOF OF THEOREMS 2 AND 3
531
+
532
+ We combine the proofs of these results since their proofs are nearly identical. The proofs closely follow the argument of Theorem 1.
533
+
534
+ Choose a class $c$ with $f _ { c } \ \leq \ { \frac { 1 } { 2 } }$ and let ${ \mathcal R } = \{ x | { \mathcal C } ( x ) = c \}$ denote the subset of the cube lying in class $c$ according to the classifier $\mathcal { C }$ . Let $\overline { { \mathcal { R } } }$ be the complement, who’s $\ell _ { p }$ expansion is denoted $\overline { { \mathcal { R } } } ( \epsilon ; d _ { p } )$ . Because $\overline { { \mathcal { R } } }$ covers at least half the cube, we can invoke Lemma 3. We have that
535
+
536
+ $$
537
+ \mathrm { v o l } [ \overline { { \mathcal { R } } } ( \epsilon ; h ) ] \geq 1 - \delta ,
538
+ $$
539
+
540
+ where
541
+
542
+ The set $\overline { { \mathcal { R } } } ( \epsilon ; h )$ contains all points that are correctly classified and safe from adversarial perturbations. This region has volume at most $\delta$ , and the probability of a sample from the class distribution $\rho _ { c }$ lying in this region is at most $U _ { c } \delta$ . We then subtract this from 1 to obtain the mass of the class distribution lying in the “unsafe” region $\overline { { \mathcal { R } } } _ { c }$ .
543
+
544
+ # D PROOF OF THEOREM 4
545
+
546
+ Let $\mathcal { A }$ denote the support of $p _ { c }$ , and suppose that this support has measure $\mathrm { v o l } [ \mathcal { A } ] = \eta$ . We want to show that, for large enough $\epsilon$ , the expansion $\boldsymbol { \mathcal { A } } ( \epsilon , d _ { p } )$ is larger than half the cube. Since class $c$ occupies less than half the cube, this would imply that $A ( \epsilon , d _ { p } )$ overlaps with other classes, and so there must be data points in $\mathcal { A }$ with $\epsilon$ -adversarial examples.
547
+
548
+ We start with the case $p > 0$ , where we bound $\boldsymbol { \mathcal { A } } ( \epsilon , d _ { p } )$ using equation 2 of Lemma 3. To do this, we need to approximate $\Phi ^ { - 1 } ( \eta )$ . This can be done using the inequality
549
+
550
+ $$
551
+ \Phi ( \alpha ) = \frac { 1 } { 2 \pi } \int _ { - \infty } ^ { \alpha } e ^ { - t ^ { 2 } / 2 } d t \le \frac { 1 } { 2 } e ^ { - \alpha ^ { 2 } / 2 } ,
552
+ $$
553
+
554
+ which holds for $\alpha < 0$ . Rearranging, we obtain
555
+
556
+ $$
557
+ \alpha \geq - \sqrt { \log \frac { 1 } { 4 \Phi ( \alpha ) ^ { 2 } } } .
558
+ $$
559
+
560
+ Now, if $\alpha = \Phi ^ { - 1 } ( \eta )$ , then $\Phi ( \alpha ) = \eta$ , and equation 19 gives us $\alpha \geq - \sqrt { \log { \frac { 1 } { 4 \eta ^ { 2 } } } }$ . Plugging this into equation 2 of Lemma 3, we get
561
+
562
+ $$
563
+ \mathrm { v o l } [ { \cal A } ( \epsilon , d _ { p } ) ] \ge \Phi ( \alpha + \epsilon ) \ge \Phi \left( - \sqrt { \log \frac { 1 } { 4 \eta ^ { 2 } } } + \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon \right) .
564
+ $$
565
+
566
+ The quantity on the left will be greater than $\frac { 1 } { 2 }$ , thus guaranteeing adversarial examples, if
567
+
568
+ $$
569
+ \frac { \sqrt { 2 \pi n } } { n ^ { 1 / p ^ { * } } } \epsilon > \sqrt { \log \frac { 1 } { 4 \eta ^ { 2 } } } .
570
+ $$
571
+
572
+ This can be re-arranged to obtain the desired result.
573
+
574
+ In the case $p = 0$ , we need to use equation 17 from the proof of Lemma 3 in Appendix B, which we restate here
575
+
576
+ $$
577
+ \mathrm { v o l } [ \boldsymbol { A } ( \epsilon , d _ { 0 } ) ] \ge 1 - \exp \left( - \frac { 2 } { n } \left( \epsilon - \sqrt { n \log ( 1 / \eta ) / 2 } \right) ^ { 2 } \right) .
578
+ $$
579
+
580
+ This bound is valid, and produces a non-vacuous guarantee of adversarial examples, if
581
+
582
+ $$
583
+ \exp \left( - \frac { 2 } { n } \left( \epsilon - \sqrt { n \log ( 1 / \eta ) / 2 } \right) ^ { 2 } \right) < \frac { 1 } { 2 } .
584
+ $$
585
+
586
+ which holds if
587
+
588
+ $$
589
+ \eta > \exp \left( - \frac { 2 \left( \epsilon - \sqrt { n \log { 2 / 2 } } \right) ^ { 2 } } { n } \right) .
590
+ $$
591
+
592
+ # E PROOF OF THEOREM 5
593
+
594
+ Assume that any MNIST classifier can be fooled by perturbations of size at most $\epsilon$ with probability at least $p$ . To begin, we put a bound on the susceptibility of any $b$ -MNIST classifier (for $b \geq 1$ ) under this assumption. We can classify MNIST images by upsampling them to resolution $2 8 b \times 2 8 b$ and feeding them into a highresolution “back-end” classifier. After upsampling, an MNIST image with perturbation of norm $\epsilon$ becomes a $2 8 b \times 2 8 b$ image with perturbation of norm $b \epsilon$ . The classifier we have constructed takes low-resolution images as inputs, and so by assumption it is fooled with probability at least $p$ . However, the low-resolution classifier is fooled only when the high-resolution “back-end” classifier is fooled, and so the high-resolution classifier is fooled with probability at least $p$ at well. Note that we can build this two-scale classifier using any high-resolution classifier as a back-end, and so this bound holds uniformly over all high-resolution classifiers.
595
+
596
+ Likewise, suppose we classify $b$ -MNIST images (for integer $b \geq 1$ ) by downsampling them to the original $2 8 \times 2 8$ resolution (by averaging pixel blocks) and feeding them into a “back-end” low-resolution classifier. After downsampling, a $2 8 b \times 2 8 b$ image with perturbation of norm $b \epsilon$ becomes a $2 8 \times 2 8$ image with perturbation of norm at most $\epsilon$ . Whenever the high-resolution classifier is fooled, it is only because the back-end classifier is fooled by a perturbation of size at most $\epsilon$ , and this happens with probability at least $p$ .
md/train/rJe04p4YDB/rJe04p4YDB.md ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEMI-SUPERVISED LEARNING BY COACHING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Recent semi-supervised learning (SSL) methods often have a teacher to train a student in order to propagate labels from labeled data to unlabeled data. We argue that a weakness of these methods is that the teacher does not learn from the student’s mistakes during the course of student’s learning. To address this weakness, we introduce Coaching, a framework where a teacher generates pseudo labels for unlabeled data, from which a student will learn and the student’s performance on labeled data will be used as reward to train the teacher using policy gradient.
8
+
9
+ Our experiments show that Coaching significantly improves over state-of-the-art SSL baselines. For instance, on CIFAR-10, with only 4,000 labeled examples, a WideResNet-28-2 trained by Coaching achieves $9 6 . 1 1 \%$ accuracy, which is better than $9 4 . 9 \%$ achieved by the same architecture trained with 45,000 labeled. On ImageNet with $10 \%$ labeled examples, Coaching trains a ResNet-50 to $7 2 . 9 4 \%$ top-1 accuracy, comfortably outperforming the existing state-of-the-art by more than $4 \%$ . Coaching also scales successfully to the high data regime with full ImageNet. Specifically, with additional 9 million unlabeled images from OpenImages, Coaching trains a ResNet-50 to $8 2 . 3 4 \%$ top-1 accuracy, setting a new state-of-the-art for the architecture on ImageNet without using extra labeled data.1
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Professional players in competitive sports such as chess, tennis, or swimming often have coaches to help improving their performance. Although coaches typically do not play as well as the players, they observe the players and provide instructions to improve the players’ performance. Modern semi-supervised learning (SSL) algorithms do not follow this strategy. They instead have a teacher model that generates pseudo labels for unlabeled data, from which a student model learns by imitation (e.g., Lee (2013); Tarvainen & Valpola (2017); Laine & Aila (2017)). A weakness of these methods is that the teacher does not adjust itself based on the student’s performance and cannot adapt to make the student better over time, unlike professional sport coaches develop their players.
14
+
15
+ Here, we propose a new semi-supervised learning method, called Coaching as shown in Figure 1, where the teacher learns throughout the course of student’s training. In our method, a teacher generates pseudo labels for unlabeled data, from which the student will learn. The student’s performance on labeled data will be used as reward to train the teacher with policy gradient.
16
+
17
+ ![](images/3a0ffb52634b9d076504729ad6bafe34cf33d3a55de49387d0cf2e344d54bd51.jpg)
18
+ Figure 1: Each step of gradient descent in Coaching consists of two steps. Updating the Student (top): The teacher network $T$ samples the labels $\hat { y }$ of unlabeled data $x _ { \mathrm { u n l } }$ for the student $S$ to learn from. Updating the Teacher (bottom): The teacher updates itself using policy gradient to improve the student’s performance on labeled data $x _ { \mathrm { l a b } }$ .
19
+
20
+ Experiments show that our method achieves significant improvements over state-of-the-art semisupervised learning baselines and can be up to $1 0 \times$ more data efficient than supervised learning. For instance, with CIFAR-10, only using 4,000 labeled examples, a WideResNet-28-2 can be coached to $9 6 . 1 1 \%$ accuracy, outperforming the same model trained with 45,000 labeled examples which achieves $9 4 . 9 \%$ . Meanwhile, on ImageNet, using ResNet-50 with only $1 0 \%$ labeled examples, our method achieves $7 2 . 9 4 \%$ top-1 accuracy, outperforming all existing semi-supervised learning methods with the same amount of labeled data, and approaching the top-1 accuracy of $7 6 . 3 \%$ of the same ResNet-50 trained with all labels. Coaching also scales to the high data regime. In particular, with all 1.28 million labeled examples from ImageNet, plus 9 million unlabeled and potentially out-of-distribution data from OpenImages (Kuznetsova et al., 2018), a ResNet-50 can be coached to the accuracy of $8 2 . 3 4 \%$ , which is a new state-of-the-art for the architecture without using extra labeled data.
21
+
22
+ # 2 METHOD
23
+
24
+ Notations. Let $T$ , $S$ respectively be the teacher network and the student network in Coaching, and $\theta _ { T }$ , $\theta _ { S }$ be their corresponding parameters. Since we work with both labeled data and unlabeled data, we use $( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } )$ to refer to a pair of an input and its corresponding label, and use $x _ { \mathrm { u n l } }$ to refer to an unlabeled example. In addition, we use $\ell ( x , y ; \theta )$ to denote the cross entropy loss computed on input $x$ by with parameter $\theta$ on label $y$ .
25
+
26
+ As shown in Figure 1, each training step in Coaching consists of two phases:
27
+
28
+ Phase 1: The student learns from data pseudo labeled by the teacher. In this phase, the teacher $T$ first performs a forward pass on $x _ { \mathrm { u n l } }$ to compute the class distribution $P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } )$ . From this distribution, the teacher samples a pseudo label $\hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } )$ . The pair $x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } }$ is then shown to the student $S$ to make an update on its parameters $\theta _ { S }$ . The update is based on the gradient computed by back-propagating from the cross entropy loss. For instance, if $\theta _ { S }$ is updated using SGD, then:
29
+
30
+ $$
31
+ \theta _ { S } ^ { ( t + 1 ) } : = \theta _ { S } ^ { t } - \eta \cdot \underbrace { \frac { \partial \ell ( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { S } ) } { \partial \theta _ { S } } } _ { \xrightarrow [ ] { \Delta } } \bigg | _ { \theta _ { S } = \theta _ { S } ^ { ( t ) } } = \theta _ { S } ^ { ( t ) } - \eta \cdot g _ { S } ^ { ( t ) } ,
32
+ $$
33
+
34
+ where $\eta$ is the learning rate.
35
+
36
+ Phase 2: The teacher learns from the student’s loss. After the student updates its parameters
37
+ as in Equation 1, its parameters entropy loss. The goal of the testudent is updated as in Equation $\theta _ { S } ^ { ( t + 1 ) }$ ) led example xlab, ylab is evaluated on a laben Coaching is to give tn the cross entropy loss using the crosssuch that if theill be minimized. $\hat { y } _ { \mathrm { u n l } }$ $^ { l }$ $\ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } ^ { ( t + 1 ) } )$
38
+
39
+ Clearly, $\ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } ^ { ( t + 1 ) } )$ depends on $\theta _ { S } ^ { ( t + 1 ) }$ , which in turn depends on the pseudo label $\hat { y } _ { \mathrm { u n l } }$ that the teacher samples. From the perspective of reinforcement learning, $\hat { y } _ { \mathrm { u n l } }$ can be treated as an onpolicy action of the teacher, which leads to the reward of $- \ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } ^ { ( t + 1 ) } )$ . In this perspective, we propose to train $\theta _ { T }$ to minimize the value of $\ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \bar { \theta } _ { S } ^ { ( t + 1 ) } )$ , where $\bar { \theta } _ { S } ^ { ( t + 1 ) }$ is the expected destination that the teacher will guide the student to. This expectation is taken over all possible pseudo labels $\hat { y } _ { \mathrm { u n l } }$ . Formally,
40
+
41
+ $$
42
+ \theta _ { T } ^ { * } = \operatorname * { a r g m i n } _ { \theta _ { T } } R ( \theta _ { T } ) \mathrm { ~ w h e r e ~ } R ( \theta _ { T } ) = \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \mathbb { E } _ { \hat { y } _ { \mathrm { t u n l } } \sim P ( \cdot | x _ { \mathrm { l a b } } ; \theta _ { T } ) } \left[ \theta _ { S } ^ { ( t + 1 ) } \right] \right)
43
+ $$
44
+
45
+ To find $\theta _ { T } ^ { * }$ , we differentiate $R ( \theta _ { T } )$ in Equation 2 with respect to $\theta _ { T }$ . Here, we present the resulting gradient $g _ { T } ^ { ( t ) }$ , which has the form
46
+
47
+ $$
48
+ g _ { T } ^ { ( t ) } \approx \eta \cdot \left[ \left( g _ { S } ^ { ( t ) } \right) ^ { \top } \cdot \left( \frac { \partial \ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } ) } { \partial \theta _ { S } } \bigg | _ { \theta _ { S } = \theta _ { S } ^ { ( t + 1 ) } } \right) ^ { \top } \right] \cdot \left( \frac { \partial \ell ( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { T } ) } { \partial \theta _ { T } } \bigg | _ { \theta _ { T } = \theta _ { T } ^ { ( t ) } } \right)
49
+ $$
50
+
51
+ The full derivation can be found in Appendix A, but intuitively, the differentiation depends on two tools. The first tool is the is the chain rule, which we leverage to differentiate $R ( \theta _ { T } )$ with respect to $\theta _ { T }$ . The second tool is the REINFORCE equation (Williams, 1992), which we leverage to establish the relationship between $\mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } } \left[ \theta _ { S } ^ { ( t + 1 ) } \right]$ and $\theta _ { T }$ .
52
+
53
+ Coaching combines the two steps above in an SGD step. We summarize the method in Algorithm 1.
54
+
55
+ # Algorithm 1 The Coaching method.
56
+
57
+ Input :Labeled data $x _ { \mathrm { l a b } }$ , $y _ { \mathrm { l a b } }$ and unlabeled data $x _ { \mathrm { u n l } }$ .
58
+ 1 Initialize $\theta _ { T } ^ { ( 0 ) }$ and $\theta _ { S } ^ { ( 0 ) }$
59
+ 2 for $t = 0$ to $N - 1$ do
60
+ 3 Sample an unlabeled example $x _ { \mathrm { u n l } }$ and a labeled example $x _ { \mathrm { l a b } }$ , $y _ { \mathrm { l a b } }$
61
+ 4 Sample $\hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } )$
62
+ 5 $\theta _ { S } ^ { ( t + 1 ) } : = \theta _ { S } ^ { ( t ) } - \eta \cdot g _ { S } ^ { ( t ) }$ . Compute $g _ { S } ^ { ( t ) }$ with pseudo labels as in Equation 1 and update $\theta _ { S }$
63
+ 6 Sθ(t+1)T : $\theta _ { T } ^ { ( t + 1 ) } : = \theta _ { T } ^ { ( t ) } - \eta \cdot h ^ { ( t ) } \cdot g _ { T } ^ { ( t ) }$ . Compute the gradient $g _ { T } ^ { ( t ) }$ as in Equation 3 and update $\theta _ { T }$
64
+ 7 end
65
+ 8 return $\theta _ { S } ^ { ( N ) }$ . Only the student model is used for predictions and evaluations
66
+
67
+ Generalize to an arbitrary batch size. Above, we have only discussed Coaching for a single unlabeled data $x _ { \mathrm { u n l } }$ and a single labeled data $x _ { \mathrm { l a b } }$ , $y _ { \mathrm { l a b } }$ . Now, we describe how to scale Coaching to an arbitrary batch size. Scaling $x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } }$ to a minibatch of labeled example, $X _ { \mathrm { l a b } }$ , $Y _ { \mathrm { l a b } }$ is straightforward, as we can simply replace all computations of the cross entropy $\ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } ^ { ( t + 1 ) } )$ with the average cross entropy on the minibatch \`(Xlab, Ylab; θ(t+1)S ). T(1) (2) o scale a single unlabeled example xunl to a minibatch of unlabeled examples $X _ { \mathrm { u n l } } = \{ x _ { \mathrm { u n l } } ^ { ( 1 ) } , x _ { \mathrm { u n l } } ^ { ( 2 ) } , . . . , x _ { \mathrm { u n l } } ^ { ( B ) } \}$ , we treat each batch of pseudo labels $\hat { Y } _ { \mathrm { u n l } }$ as a compound action sampled from the joint distribution
68
+
69
+ $$
70
+ P \left( \hat { Y } _ { \mathrm { u n l } } \middle | X _ { \mathrm { u n l } } ; \theta _ { T } \right) = P \left( \hat { y } _ { \mathrm { u n l } } ^ { ( 1 ) } , \hat { y } _ { \mathrm { u n l } } ^ { ( 2 ) } , \ldots , \hat { y } _ { \mathrm { u n l } } ^ { ( B ) } \middle | X _ { \mathrm { u n l } } ; \theta _ { T } \right) = \prod _ { i = 1 } ^ { B } P \left( \hat { y } _ { \mathrm { u n l } } ^ { ( i ) } \middle | x _ { \mathrm { u n l } } ^ { ( i ) } ; \theta _ { T } \right)
71
+ $$
72
+
73
+ Since every pseudo label $\hat { y } _ { \mathrm { u n l } } ^ { ( i ) }$ is sampled independently, applying REINFORCE as in Equation 3 simply factors the per-instance cross entropy into the batch cross entropy $\begin{array} { r l } { ~ } & { { } \sum _ { i = 1 } ^ { B } \ell ( x _ { \mathrm { u n l } } ^ { ( i ) } , \hat { y } _ { \mathrm { u n l } } ^ { ( i ) } ; \theta _ { T } ) } \end{array}$ .
74
+
75
+ # 3 EXPERIMENTS
76
+
77
+ Compared to other methods that use both labeled data and unlabeled data, Coaching has three main advantages:
78
+
79
+ 1. The teacher does not only demonstrate its knowledge to the student but also adjusts its teaching strategy in an adaptive manner with the student, throughout the course of the student’s learning.
80
+ 2. The teacher in Coaching can benefit from advanced SSL techniques such as consistency regularization.
81
+ 3. The student in Coaching never learns directly from labeled data. This does not only prevent overfitting when limited labeled data is available, but also allows us to finetune the trained student in Coaching directly on labeled data to further boost the student’s performance.
82
+
83
+ We perform experiments to verify the strength of Coaching. In Section 3.1, we consider the low data regime with typical benchmarks for SSL methods. After that, in Section 3.2, we consider the high data regime which contains potentially out-of-distribution data.
84
+
85
+ Model Architectures. In our experiments, our teacher model and our student model always have the same architecture but with different weights. For CIFAR-10 and SVHN, we use the WideResNet28-2 (Zagoruyko & Komodakis, 2016), which has 1.45 million parameters. For ImageNet, we use a ResNet-50 (He et al., 2016), which has 25.5 million parameters. For experiments that train only one model, we apply exponential moving average with a decay rate of 0.99 on the weights of the model. For experiments that have a teacher model and a student model, we apply this exponential moving average on the weights of the student model only.
86
+
87
+ Additional Implementation Details. To improve the stability and accuracy of the method, we apply a few minor enhancements to the teacher:
88
+
89
+ 1. Use cosine distance instead of dot product. As the dot product $h ^ { ( t ) }$ in Equation 3 has a large value range, in order to stabilize training, we compute $h ^ { ( t ) }$ using the gradients’ cosine distance.
90
+ 2. Use a baseline for $h ^ { ( t ) }$ . To further reduce the variance of $h ^ { ( t ) }$ , we maintain a moving average $b$ of $h ^ { ( t ) }$ and subtract $b$ from $h ^ { ( t ) }$ every time we compute $g _ { T } ^ { ( t ) }$ as in Equation 3.
91
+ 3. Additional supervised loss for the teacher. We find that adding the supervised loss $\ell ( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { T } )$ to the teacher’s objective results in a faster learning and better student.
92
+ 4. Consistently regularize the teacher. In the low data regime, consistency regularization improves the teacher and the student. More details are in Section 3.1.
93
+ 5. Pre-training the teacher. When the number of classes is large, it is beneficial to initialize the teacher with a trained model so that the pseudo labels are better than random at the beginning of the student’s learning. If we pre-train the teacher, Point 3 has minimal effect.
94
+ 6. Finetuning the student. Since the student in Coaching only learns from unlabeled data and pseudo labels generated by the teacher, finetuning a converged student on labeled data often improves the student’s performance.
95
+
96
+ The details mentioned above are mutually orthogonal. Since (1) and (2) are crucial to stabilize the Coaching process, they are always used in our experiments. In addition, we apply (3) and (4) to the low data regime, and apply (5) for the high data regime for computational efficiency and strong performance. We will explain these decisions in the corresponding sections.
97
+
98
+ # 3.1 RESULTS ON LOW DATA REGIME
99
+
100
+ Datasets. We consider three datasets with reduced numbers of labeled instances: CIFAR10 (Krizhevsky, 2009) with 4,000 labeled examples, SVHN (Netzer et al., 2011) with 1,000 labeled examples, and ImageNet (Russakovsky et al., 2015) with 128,000 labeled examples, which is approximately $1 0 \%$ of the whole ImageNet. All images in these datasets are used as unlabeled examples, which means that even the labeled images can be used as unlabeled examples. We use the image size of $3 2 \times 3 2$ for CIFAR-10 and SVHN, and the image size of $2 2 4 \times 2 2 4$ for ImageNet. These datasets, label reductions, and image sizes are standard for low data image classification.
101
+
102
+ Baselines. We compare Coaching against 3 baseline training algorithms Purely Supervised, PseudoLabel (Lee, 2013), and Unsupervised Data Augmentation (UDA; Xie et al. (2019)). We discuss these baselines more in Section 4. We choose these baselines for three reasons. First, the purely supervised baseline serves to verify our implementation and to demonstrate the overfitting of our models when labeled data is scarce. Second, comparing Coaching with Pseudo-Label confirms the benefits of continuing to train the teacher throughout the course of the student’s learning. Finally, we compare against UDA because is the state-of-the-art on the datasets that we consider.
103
+
104
+ To ensure a fair comparison, we re-implement these baselines in our environment. We follow Oliver et al. (2018)’s train/eval/test splitting, and we use the same amount of resources to tune hyperparameters for our baselines as well as for Coaching. More details are in Appendix C.
105
+
106
+ Additional baselines. In addition to the three main baselines discussed above, we also include four other baselines: Temporal Ensemble (Laine & Aila, 2017), Mean Teacher (Tarvainen & Valpola, 2017), VAT (Miyato et al., 2018), LGA (Jackson & Schulman, 2019), ICT (Verma et al., 2019), and MixMatch (Berthelot et al., 2019). We use results reported by Oliver et al. (2018). Since these methods do not share the same controlled environment, the comparison to them is not direct, and should be contextualized as suggested by Oliver et al. (2018).
107
+
108
+ Data augmentations. In our implementation of UDA and Coaching, we use RandomAugment, which is a randomized augmentation strategy over all the operations in the search space of AutoAugment (Cubuk et al., 2019). We use RandomAugment because it is simple to implement, requires no expensive search, and achieves similar performance compared to UDA with AutoAugment. More details of RandomAugment can be found in Appendix C.2.
109
+ Table 1: Image Classification Accuracy on reduced CIFAR-10, SVHN, and ImageNet. Higher is better. For CIFAR-10 and SVHN, we report mean $\pm$ std over 10 runs, while for ImageNet, we report Top-1/Top-5 accuracy of a single run. Results in the second block are taken from past papers, while the rest shares the same environment and hyper-parameter settings. All methods share the same model architecture: WideResNet-28-2 for CIFAR-10 and SVHN, and ResNet-50 for ImageNet.
110
+
111
+ <table><tr><td>Methods</td><td>CIFAR-10 (4,000)</td><td>SVHN (1,000)</td><td>ImageNet (10%)</td></tr><tr><td>Purely Supervised on full dataset</td><td>94.92 ± 0.17</td><td>97.41 ± 0.16</td><td>76.89/93.27</td></tr><tr><td>Temporal Ensemble</td><td>83.63 ±0.63</td><td>92.81± 0.27</td><td></td></tr><tr><td>Mean Teacher</td><td>84.13± 0.28</td><td>94.35 ± 0.47</td><td></td></tr><tr><td>VAT+EntMin</td><td>86.87± 0.39</td><td>94.65 ± 0.19</td><td>-/83.39</td></tr><tr><td>LGA +VAT</td><td>87.94 ± 0.19</td><td>93.42 ± 0.36</td><td>1</td></tr><tr><td>ICT</td><td>92.71±0.02</td><td>96.11 ± 0.04</td><td></td></tr><tr><td>MixMatch</td><td>93.76±0.06</td><td>96.73 ± 0.31</td><td></td></tr><tr><td>Purely Supervised</td><td>82.14±0.25</td><td>88.17 ±0.47</td><td>57.75/80.23</td></tr><tr><td>Pseudo Labels</td><td>83.79 ± 0.11</td><td>89.81± 0.41</td><td>58.21/82.19</td></tr><tr><td>UDA (our implementation)</td><td>94.53 ±0.18</td><td>97.11 ± 0.17</td><td>68.07/88.19</td></tr><tr><td>Coaching</td><td>95.60 ±0.19</td><td>97.79 ± 0.11</td><td>72.39/90.52</td></tr><tr><td>Coaching + Finetune</td><td>96.11 ± 0.07</td><td>98.01 ± 0.07</td><td>72.94/90.80</td></tr></table>
112
+
113
+ Main results. In Table 1, we present our main results before and after finetuning the student on labeled data. The results confirm that Coaching significantly outperforms UDA and other strong baselines in semi-supervised learning.
114
+
115
+ On CIFAR-10 and SVHN, compared to the state-of-the-art UDA, Coaching’s error rate reduction are roughly $3 0 \%$ and $1 0 \%$ . As UDA’s accuracy is already relatively high, such error reductions are significant. On CIFAR-10, Coaching is also the first approach to exceed supervised learning on the all labels by using merely 4,000 labeled examples. Meanwhile, on ImageNet- $10 \%$ , Coaching outperforms UDA by almost $5 \%$ in top-1 accuracy, going from $6 8 . 0 7 \%$ to ${ \bar { 7 } } 2 . 9 4 \%$ . Even prior to finetuning on labeled data, Coaching still outperforms UDA and other baselines.
116
+
117
+ Comparing to existing state-of-the-art methods. To the best of our knowledge, Coaching has achieved new state-of-the-art performances among the same model architectures on three datasets considered in this section.
118
+
119
+ For CIFAR-10 and SVHN, all existing better results use a larger model and more advanced regularization techniques. For instance, Xie et al. (2019) reports $9 7 . 3 \%$ with UDA (Xie et al., 2019), but their backbone model is PyramidNet, which has $1 8 \times$ more parameters than WideResNet-28-2 and they train with Shake-Drop regularization (Yamada et al., 2018). Similarly, for ImageNet- $10 \%$ , the only better published result is $7 3 . 2 1 \%$ top-1 accuracy, achieved by MOAM- $S ^ { 4 } L$ (Zhai et al., 2019). This accuracy is only slightly better than Coaching’s $7 2 . 9 4 \%$ , but uses a $4 \times$ wider ResNet-50. We believe that the enhancements in architectures, regularization techniques, and model sizes, can be applied to Coaching to further improve our results.
120
+
121
+ # 3.2 RESULTS ON HIGH DATA REGIME
122
+
123
+ We have seen Coaching achieves strong performance for low data image classification tasks. Another aspect of these tasks is that the unlabeled data also come from the same domain as the labeled data, which is a restricted assumption. In this section, we show that Coaching also excels in the regime where we have a large labeled dataset and an order of magnitude more unlabeled data. In this regime, we also test the performance of our method when the unlabeled set may have out-of-domain images, i.e., the images belong to categories that do not exist in ImageNet.
124
+
125
+ Datasets. We experiment with all labeled examples in ImageNet. Additionally, we take unlabeled images from the entire $4 ^ { \mathrm { t h } }$ version of OpenImages dataset (Kuznetsova et al., 2018), which has 9 million natural images. A few samples from OpenImages can be found in Figure 2. Unless otherwise specified, for both datasets, we use the image size of $2 2 4 \times 2 2 4$ .
126
+
127
+ Baselines. Since this regime of high data has not been extensively studied, we are only aware of two relevant, strong baselines. Our first baseline is Billion-scale Semi-supervised Learning (Billion-scale SSL; Yalniz et al. (2019)). Billion-scale SSL uses unlabeled data from the YFCC100M dataset (Thomee et al., 2015), studies several self-training settings, with various model architectures for teachers and students. Here, we restrict our comparison to the settings that use ResNet-50 for both the teacher and the student. Our second baseline is UDA (Xie et al., 2019), for which the authors select unlabeled images algorithmically from the JFT dataset.2
128
+
129
+ Other than these baselines, we compare Coaching to techniques that enhance supervised learning, such as DropBlock (Ghiasi et al., 2018), CutMix (Yun et al., 2019), and FixRes (Touvron et al., 2019).
130
+
131
+ Implementation details. We implement Coaching the same as in Section 3.1, except for one part: Instead of directly training and consistently regularizing the teacher, we initialize the teacher using a pre-trained ResNet-50 (pre-trained on full ImageNet). Then, throughout the course of the student’s learning, we only train the teacher to minimize the student’s cross entropy loss. We do not use additional supervised loss for the teacher because because once the teacher is pre-trained, adding another loss to the teacher has minimal effect. We do not consistently regularize the teacher because Xie et al. (2019) has found that consistency regularization requires in-domain data, while we do not filter our unlabeled images from OpenImages.
132
+
133
+ <table><tr><td rowspan="2">Methods</td><td rowspan="2">Unlabeled images</td><td colspan="2">Image size</td><td rowspan="2">Top-1</td><td rowspan="2">Top-5</td></tr><tr><td>Train</td><td>Test</td></tr><tr><td>Supervised</td><td>None</td><td>224</td><td>224</td><td>76.89</td><td>93.27</td></tr><tr><td>DropBlock</td><td>None</td><td>224</td><td>224</td><td>78.35</td><td>94.15</td></tr><tr><td>FixRes +CutMix</td><td>None</td><td>224</td><td>320</td><td>79.8</td><td>94.9</td></tr><tr><td>Coaching</td><td>OpenImages</td><td>224</td><td>320</td><td>79.80</td><td>94.87</td></tr><tr><td rowspan="2">FixRes Coaching</td><td>None</td><td>224</td><td>384</td><td>79.1</td><td>94.6</td></tr><tr><td>OpenImages</td><td>224</td><td>384</td><td>80.10</td><td>95.07</td></tr><tr><td>Billion-scale SSL</td><td>YFCC100M</td><td>224</td><td>224</td><td>77.6</td><td></td></tr><tr><td>Coaching</td><td>OpenImages</td><td>224</td><td>224</td><td>78.62</td><td>94.26</td></tr><tr><td>UDA</td><td>JFT</td><td>331</td><td>331</td><td>79.04</td><td>94.45</td></tr><tr><td>Coaching</td><td>OpenImages</td><td>224</td><td>331</td><td>79.86</td><td>94.92</td></tr><tr><td>Coaching+iterative</td><td>OpenImages</td><td>224</td><td>331</td><td>82.34</td><td>96.09</td></tr></table>
134
+
135
+ Table 2: Image classification accuracy with full ImageNet plus unlabeled images. Results are organized by image size because image size has a strong impact on models’ performance.
136
+
137
+ Results. We present our results in Table 2. As can be seen, Coaching outperforms all relevant SSL baselines. Specifically, for the image size of 224, Coaching outperforms Billion-scale SSL by about $1 \%$ top-1 accuracy, even though Billion-scale SSL uses 10 times more unlabeled data. Meanwhile, for the image size of 331, Coaching achieves the top-1 accuracy of $7 9 . 8 6 \%$ , comfortably outperforming the top-1 accuracy of $7 9 . 0 4 \%$ by UDA. This improvement is particularly significant, since Coaching simply uses all data from OpenImages, while UDA has to select and balance the class distribution of their unlabeled data using a pre-trained teacher. This difference suggests that the teacher in Coaching can give helpful pseudo labels to the student, even on potentially out-of-distribution data.
138
+
139
+ It is worth mentioning that Coaching also outperforms the strong supervised baselines of DropBlock and FixRes, and is on par with FixRes+CutMix. However, DropBlock and CutMix are both regularization techniques orthogonal to Coaching. Similar to consistency regularization in Section 3.1, these techniques can be incorporated into the teacher in Coaching to improve performance.
140
+
141
+ Comparing to state-of-the-art SSL results. Yalniz et al. (2019) reports the top-1 accuracy of $8 1 . 2 \%$ for a ResNet-50 student. However, they need to pre-train a much bigger network ResNext-101-32x48 teacher (829 million parameters, $3 2 \mathrm { x }$ larger than ResNet-50) on 1 billion Instagram images with weak labels (Mahajan et al., 2018). Then, they use the pseudo-labels from this teacher to train a ResNet-50 student for 2 billion steps. The fact that they use weakly labeled data from Instagram, much bigger architecture in ResNext-101-32x48 makes their results not directly comparable to ours.
142
+
143
+ Meanwhile, without the need of a much bigger dataset and architecture as used in Yalniz et al. (2019), Coaching achieves almost as good top-1 accuracy. To achieve this, we iterate the process of Coaching by turning the student into the teacher after convergence. After 17 iterations, our final student achieves $8 2 . 3 4 \%$ top-1 accuracy on ImageNet, outperforming Yalniz et al. (2019)’s $8 1 . 2 \%$ , even though we do not have the weakly labeled data from Instagram.
144
+
145
+ Insights about Coaching on OpenImages. Figure 2 shows five images taken from OpenImages, along with their OpenImages tags and the top 5 classes predicted by a teacher trained on ImageNet. From the figure, we can see that there are non-trivial overlapping contents between the OpenImages tags and the ImageNet top classes, such as sunglasses in the first image. We also see that for the images whose contents match stronger with an ImageNet class, such as the first and the third image, the entropy of the teacher’s prediction is smaller. As a result, when the teacher samples a pseudo label from these distribution, contents similar to an ImageNet class will receive more consistent labels, while content alien to ImageNet will have higher entropy on their labels. We suspect this is why a teacher trained on ImageNet can teach a student via pseudo labels on OpenImages.
146
+
147
+ ![](images/3f36c32f4813ff69e0c535abbb87f4e59c10b06addd499c4b452791024d90158.jpg)
148
+ Figure 2: An illustration of why OpenImages help ImageNet classification. Top: OpenImages tags. Middle: A sample image from OpenImages. Bottom: Top 5 labels for the image predicted by a teacher ResNet-50 trained on ImageNet. Some OpenImages tags overlap significantly with some ImageNet classes, such as wheel and car wheel in the second image. The class predictions also have a higher entropy when the ImageNet classes overlap less with the OpenImages contents (images 2, 4, 5), than when the ImageNet classes overlap more (images 1, 3).
149
+
150
+ # 3.3 ANALYSIS
151
+
152
+ Ablation Study of Implementation Details. To understand the contribution of each implementation detail of Coaching, we study their contributions on top of a purely supervised model. We conduct this study on ImageNet- $10 \%$ and visualize the results in Figure 3. From the figure we see that RandomAugment and UDA both improve the final accuracy significantly, respectively by $3 . 1 3 \%$ and $7 . 1 9 \%$ top-1 accuracy. On top of UDA, Coaching delivers a smaller improvement of $4 . 3 2 \%$ top-1 accuracy. However, since UDA’s accuracy is already high, we believe that the improvement of $4 . 3 2 \%$ top-1 accuracy is significant. Finally, finetuning only slightly improves over Coaching. However, this extra boost is a unique advantage of Coaching: it is possible for the student in Coaching to finetune on labeled data because the student never directly learns from these labeled data.
153
+
154
+ Coaching overfits less than Supervised Learning. In our Coaching framework, the student never directly learns from labeled data. This behavior is helps the student to avoid overfitting, especially when labeled data is scarce. In Figure 4, we visualize the training accuracy of Coaching and Supervised Learning on CIFAR-10 with 4,000 labels and on ImageNet with $10 \%$ labels. As shown, the training accuracy of both the teacher and the student of Coaching stay relatively low. Meanwhile, the training accuracy of the supervised model eventually reaches $1 0 0 \%$ and causes overfitting.
155
+
156
+ ![](images/ed6b51d0471ea4fd1866849074a61ccddd659333af9621335de5b95481ca6918.jpg)
157
+ Figure 3: Breakdown of the gains of different components in Coaching. The gain of Coaching over UDA, albeit smaller than the gain of UDA over RandomAugment, is significant as UDA is already very strong.
158
+
159
+ ![](images/daed95c2a2f864200b064f0f14afc1c16ae289b2406a7dcf06a279f17506cb5e.jpg)
160
+ Figure 4: Training accuracy of Coaching and of supervised learning on CIFAR-10-4,000 and ImageNet- $10 \%$ . Both the teacher and the student in Coaching have lower training accuracy, effectively avoiding overfitting.
161
+
162
+ # 4 RELATED WORK
163
+
164
+ Pseudo-Label. Pseudo-Label (Lee, 2013) is one of the simplest semi-supervised learning algorithms: First, a teacher model is trained on labeled data. Then, the converged teacher model generates pseudo labels for unlabeled data. These unlabeled data and their pseudo labels are combined with the labeled data to train another model, which is called the student model. An inherent weakness of Pseudo-Label is that once the teacher generates an incorrect pseudo label for an unlabeled datum, the student can only naively learn from this wrong label. This phenomenon is called the confirmation bias. Arazo et al. (2019) addressed the confirmation bias by generating soft labels from the teacher and by adding noise to these labels. However, this is a manual fix from an outside model designer. The main difference between Pseudo-Label and Coaching is that in Coaching, the teacher is trained along with the student throughout the course of training. This allows wrong knowledge learned by the teacher to be fixed in an end-to-end manner, leading to stronger performances.
165
+
166
+ Semi-supervised Learning (SSL). Pseudo-Label belongs to a more general group of algorithms known as Semi-supervised Learning. Unlike Pseudo-Label, typical SSL methods combine both labeled and unlabeled data to train a single model. Hence, the objective function of SSL is typically the sum of a supervised loss and an unsupervised loss. The supervised loss is often the cross-entropy computed on the labeled data. Meanwhile, the unsupervised loss can be a self-supervised loss (Rasmus et al., 2015; Noroozi & Favaro, 2018; Gidaris et al., 2018), or consistency regularization (Laine & Aila, 2017; Tarvainen & Valpola, 2017; Miyato et al., 2018; Berthelot et al., 2019; Xie et al., 2019). Self-supervised losses typically encourage the model to develop a common sense about the images. Meanwhile, consistency regularization enforces that the model is invariant against certain transformations of the data. The main difference between Coaching and SSL methods is that the student in Coaching never learns directly from labeled data. This helps the student in Coaching to avoid overfitting to labeled data, especially when labeled data is limited.
167
+
168
+ Meta Learning. In Meta Learning, there is typically an outer loop that optimizes the performance of a model trained in an inner loop (Finn et al., 2017; Metz et al., 2019). Meta Learning has been applied to perform self-training and SSL in the low data regime (Agarwal et al., 2019; Ren et al., 2018; Boney & Ilin, 2018; Hsu et al., 2019). A crucial difference between Coaching and Meta Learning is that in Coaching, the pseudo labels are chosen to improve the student, and hence there is no need for an outer loop. We suspect this is an advantage of our method, since gradients to be very powerful for models to navigate in the parameter space.
169
+
170
+ # 5 CONCLUSION
171
+
172
+ In this paper, we proposed the Coaching method for semi-supervised learning. Key to Coaching is the idea that the teacher learns from the student’s loss and improves itself to generate pseudo labels in a way that helps student’s learning the most. The learning process in Coaching consists of two main updates: updating the student based on the pseudo labeled data produced by the teacher and updating the teacher based on the student’s performance. Experiments on standard CIFAR-10 and SVHN show that Coaching is much better than supervised learning and consistenly better than other semi-supervised learning methods. Coaching scales well to large problems, and successfully uses out-of-domain data to improve ImageNet classification.
173
+
174
+ # REFERENCES
175
+
176
+ Martín 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, Benoit G, Derek . Murrayand Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: A system for large-scale machine learning. Arxiv 1605.08695, 2016. 14
177
+
178
+ Rishabh Agarwal, Chen Liang, Dale Schuurmans, and Mohammad Norouzi. Learning to generalize from sparse and underspecified rewards. In International Conference on Machine Learning, 2019. 8
179
+
180
+ Eric Arazo, Diego Ortego, Paul Albert, Noel E. O’Connor, and Kevin McGuinness. Pseudo-labeling and confirmation bias in deep semi-supervised learning. Arxiv, 1908.02983, 2019. 8
181
+
182
+ David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Advances in Neural Information Processing Systems, 2019. 4, 8
183
+
184
+ Rinu Boney and Alexander Ilin. Semi-supervised few-shot learning with maml. In Workshop Track of International Conference on Learning Representations, 2018. 8
185
+
186
+ Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. AutoAugment: Learning augmentation policies from data. In IEEE Conference on Computer Vision and Pattern Recognition, 2019. 5, 13, 14
187
+
188
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning, 2017. 8
189
+
190
+ Golnaz Ghiasi, Tsung-Yi Lin, and Quoc V. Le. Dropblock: A regularization method for convolutional networks. In Advances in Neural Information Processing Systems, 2018. 6
191
+
192
+ Spyros Gidaris, Praveer Singh, and Nikos Komodakis. Unsupervised representation learning by predicting image rotations. In IEEE Conference on Computer Vision and Pattern Recognition, 2018. 8
193
+
194
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. 3
195
+
196
+ Kyle Hsu, Chelsea Finn, and Sergey Levine. Unsupervised learning via meta learning. In International Conference on Learning Representations, 2019. 8
197
+
198
+ Jacob Jackson and John Schulman. Semi-supervised learning by label gradient alignment. Arxiv 1902.02336, 2019. 4
199
+
200
+ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. 4
201
+
202
+ Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Tom Duerig, and Vittorio Ferrari. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. Arxiv, 1811.00982, 2018. 2, 6
203
+
204
+ Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. In International Conference on Learning Representations, 2017. 1, 4, 8
205
+
206
+ Dong-Hyun Lee. Pseudo-Label: The simple and efficient semi-supervised learning method for deep neural networks. In International Conference on Machine Learning Workshop, 2013. 1, 4, 8
207
+
208
+ Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens van der Maaten. Exploring the limits of weakly supervised pretraining. Arxiv, 1805.00932, 2018. 7
209
+
210
+ Luke Metz, Niru Maheswaranathan, Brian Cheung, and Jascha Sohl-Dickstein. Meta-learning update rules for unsupervised representation learning. In International Conference on Learning Representations, 2019. 8
211
+
212
+ Takeru Miyato, Shin-ichi Maeda, Shin Ishii, and Masanori Koyama. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. In IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. 4, 8
213
+
214
+ Yuval Netzer, Tao Wang, Alessandro Coates, Adamand Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In Advances in Neural Information Processing Systems Workshop on Deep Learning and Unsupervised Feature Learning, 2011. 4
215
+
216
+ Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In IEEE Conference on Computer Vision and Pattern Recognition, 2018. 8
217
+
218
+ Avital Oliver, Augustus Odena, Colin Raffel, Ekin D. Cubuk, and Ian J. Goodfellow. Realistic evaluation of deep semi-supervised learning algorithms. In Advances in Neural Information Processing Systems, 2018. 4, 14
219
+
220
+ Antti Rasmus, Harri Valpola, Mikko Honkala, Mathias Berglund, and Tapani Raiko. Semi-supervised learning with ladder networks. In Advances in Neural Information Processing Systems, 2015. 8
221
+
222
+ Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. In International Conference on Machine Learning, 2018. 8
223
+
224
+ 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, 2015. 4
225
+
226
+ Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems, 2017. 1, 4, 8
227
+
228
+ Bart Thomee, David A. Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. YFCC100M: The new data in multimedia research. Arxiv 1503.01817, 2015. 6
229
+
230
+ Hugo Touvron, Andrea Vedaldi, Matthijs Douze, and Herve Jegou. Fixing the train-test resolution discrepancy. In Advances in Neural Information Processing Systems, 2019. 6
231
+
232
+ Vikas Verma, Alex Lamb, Juho Kannala, Yoshua Bengio, and David Lopez-Paz. Interpolation consistency training for semi-supervised learning. In International Joint Conference on Artificial Intelligence, 2019. 4
233
+
234
+ Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 1992. 3, 12
235
+
236
+ Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V. Le. Unsupervised data augmentation for consistency training. Arxiv, 1904.12848, 2019. 4, 5, 6, 8, 14
237
+
238
+ I. Zeki Yalniz, Herv’e J’egou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning for image classification. Arxiv 1905.00546, 2019. 6, 7
239
+
240
+ Yoshihiro Yamada, Masakazu Iwamura, Takuya Akiba, and Koichi Kise. Shakedrop regularization for deep residual learning. Arxiv, 1802.0237, 2018. 5
241
+
242
+ Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. CutMix: Regularization strategy to train strong classifiers with localizable features. In International Conference on Computer Vision, 2019. 6
243
+
244
+ Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference, 2016. 3
245
+
246
+ Xiaohua Zhai, Avital Oliver, Alexander Kolesnikov, and Lucas Beyer. $S ^ { 4 } L$ : Self-supervised semisupervised learning. Arxiv, 1905.03670, 2019. 5
247
+
248
+ # A DERIVATION OF THE TEACHER’S UPDATE RULE
249
+
250
+ In this section, we present the detailed derivation of the Teacher’s update rule in Equation 3 from Section 2.
251
+
252
+ Mathematical Notations and Conventions. Since we will work with the chain rule, we use the standard Jacobian notations.3 Specifically, for a differentiable function $f : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ , and for a vector $x \in \mathbb { R } ^ { m }$ , we use the notation ∂f∂x ∈ Rn×m to denote the Jacobian matrix of f, whose dimension is $n \times m$ . Additionally, when we mention the Jacobian of a function $f$ at multiple points such as x1 and x2, we will use the notations of ∂f∂x $\left. { \frac { \partial f } { \partial x } } \right| _ { x = x _ { 1 } }$ and $\left. \frac { \partial f } { \partial x } \right| _ { x = x _ { 2 } }$
253
+
254
+ Furthermore, by mathematical conventions, a vector $v \in \mathbb { R } ^ { n }$ is treated as a column matrix – that is, a matrix of size $n \times 1$ . For this reason, the gradient vector of a multi-variable real-valued function is actually the transpose of of its Jacobian matrix.
255
+
256
+ Finally, all multiplications in this section are standard matrix multiplications. If an operand is a vector, then as discussed in the previous paragraph, the operand is treated as a column matrix.
257
+
258
+ Dimension Annotations. Understanding that these notations and conventions might cause confusions, in the derivation below, we annotate the dimensions of the computed quantities to ensure that there is no confusion caused to our readers. To this end, we respectively use $| S |$ and $| T |$ to denote the dimensions of the parameters $\theta _ { S } , \theta _ { T }$ . That is, $\theta _ { S } \in \mathbb { R } ^ { | S | \times 1 }$ and $\boldsymbol { \theta _ { T } } \in \mathbb { R } ^ { | T | \times 1 }$ .
259
+
260
+ We now present the derivation. We need to compute:
261
+
262
+ $$
263
+ \underbrace { \frac { \partial R } { \partial \theta _ { T } } } _ { 1 \times | T | } = \frac { \partial } { \partial \theta _ { T } } \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } ) } \left[ \theta _ { S } ^ { ( t + 1 ) } \right] \right)
264
+ $$
265
+
266
+ To simplify our notation, let us define
267
+
268
+ $$
269
+ \underbrace { \bar { \theta } _ { S } ^ { ( t + 1 ) } } _ { | S | \times 1 } \triangleq \mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } ) } \left[ \theta _ { S } ^ { ( t + 1 ) } \right]
270
+ $$
271
+
272
+ Then, by the chain rule, we have
273
+
274
+ $$
275
+ \begin{array} { l } { { \displaystyle \frac { \partial R } { \partial \theta _ { T } } = \frac { \partial } { \partial \theta _ { T } } \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \mathbb { E } _ { \hat { y } _ { \mathrm { a n l } } \sim P ( \cdot \vert x _ { \mathrm { a n l } } ; \theta _ { T } ) } \left[ \theta _ { S } ^ { ( t + 1 ) } \right] \right) } } \\ { \displaystyle { \mathrm { ~ \Lambda ~ } } } \\ { { \displaystyle = \frac { \partial } { \partial \theta _ { T } } \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \bar { \theta } _ { S } ^ { ( t + 1 ) } \right) } } \\ { \displaystyle ~ = \underbrace { \frac { \partial \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } \right) } { \partial \theta _ { S } } \Big \vert _ { \theta _ { S } = \bar { \theta } _ { S } ^ { ( t + 1 ) } } \cdot \frac { \partial \bar { \theta } _ { S } ^ { ( t + 1 ) } } { \partial \theta _ { T } } } } \end{array}
276
+ $$
277
+
278
+ The first factor in Equation 7 can be simply computed via back-propagation. We now focus on the second term. We have
279
+
280
+ $$
281
+ \begin{array} { r l r } { { \underbrace { \frac { \partial \bar { \theta } _ { S } ^ { ( t + 1 ) } } { \partial \theta _ { T } } } } = \frac { \partial } { \partial \theta _ { T } } \mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } ) } [ \theta _ { S } ^ { ( t + 1 ) } ] } \\ & { } & \\ & { } & { = \frac { \partial } { \partial \theta _ { T } } \mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } ) } [ \theta _ { S } ^ { ( t ) } - \eta \cdot ( \frac { \partial \ell ( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { S } ) } { \partial \theta _ { S } } | _ { \theta _ { S } = \theta _ { S } ^ { ( t ) } } ) ^ { \top } ] } \end{array}
282
+ $$
283
+
284
+ 3Standard: https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant
285
+
286
+ Note that in Equation 8 above, the Jacobian of $\ell ( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { S } )$ , which has dimension $1 \times | S |$ , needs to be transposed to match the dimension of $\theta _ { S } ^ { ( t ) }$ , which, as we discussed above, conventionally has
287
+
288
+ Now, since $\theta _ { S } ^ { ( t ) }$ in Equation 8 does not depend on $\theta _ { T }$ , we can leave it out of subsequent derivations. Also, to simplify notations, let us define the gradient
289
+
290
+ $$
291
+ \underbrace { g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { u n l } } ) } _ { | S | \times | 1 | } \triangleq \left( \left. \frac { \partial \ell \left( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { S } \right) } { \partial \theta _ { S } } \right| _ { \theta _ { S } = \theta _ { S } ^ { ( t ) } } \right) ^ { \top }
292
+ $$
293
+
294
+ Then, Equation 8 becomes
295
+
296
+ $$
297
+ \underbrace { \frac { \partial \bar { \theta } _ { S } ^ { ( t + 1 ) } } { \partial \theta _ { T } } } _ { | S | \times | T | } = - \eta \cdot \frac { \partial } { \partial \theta _ { T } } \mathbb { E } _ { \hat { y } _ { \mathrm { u n l } } \sim P ( \cdot | x _ { \mathrm { u n l } } ; \theta _ { T } ) } \left[ \underbrace { g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { u n l } } ) } _ { | S | \times 1 } \right]
298
+ $$
299
+
300
+ Since $g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { u n l } } )$ has no dependency on on $\theta _ { T }$ , except for via $\hat { y } _ { \mathrm { u n l } }$ , we can apply the REINFORCE equation (Williams, 1992) to achieve
301
+
302
+ $$
303
+ \begin{array} { r l } & { \underbrace { \frac { \partial \bar { \theta } _ { S } ^ { ( t + 1 ) } } { \partial \theta _ { T } } } _ { | S | \times | T | } = - \eta \cdot \frac { \partial } { \partial \theta _ { T } } \mathbb { E } _ { \hat { y } _ { \mathrm { a n } } \times P ( \cdot | x _ { \mathrm { m i } } \times \theta _ { T } ) } \left[ g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { m i } } ) \right] } \\ & { = - \eta \cdot \mathbb { E } _ { \hat { y } _ { \mathrm { a n } } \times P ( \cdot | x _ { \mathrm { m i } } \times \theta _ { T } ) } \left[ \underbrace { g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { m i } } ) } _ { | S | \times 1 } \cdot \underbrace { \frac { \partial \log P \left( \hat { y } _ { \mathrm { m i } } | x _ { \mathrm { m i } } ; \theta _ { T } \right) } { \partial \theta _ { T } } } _ { 1 \times | T | } \right] } \\ & { = \eta \cdot \mathbb { E } _ { \hat { y } _ { \mathrm { a n } } \sim P ( \cdot | x _ { \mathrm { m i } } ; \theta _ { T } ) } \left[ \underbrace { g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { m i } } ) } _ { | S | \times 1 } \cdot \underbrace { \frac { \partial \ell \left( x _ { \mathrm { m i } } , \hat { y } _ { \mathrm { m i } } ; \theta _ { T } \right) } { \partial \theta _ { T } } } _ { 1 \times | T | } \right] } \end{array}
304
+ $$
305
+
306
+ Here, the last equality in Equation 11 is is due to the definition of the cross entropy loss, which is the negative of the log-prob term in the previous line.
307
+
308
+ Now, we can substitute Equation 11 into Equation 7 to obtain
309
+
310
+ $$
311
+ \begin{array} { l } { \displaystyle \frac { \partial R } { \partial \theta _ { T } } = \underbrace { \frac { \partial \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } \right) } { \partial \theta _ { S } } \bigg | _ { \theta _ { S } = \bar { \theta } _ { S } ^ { ( t + 1 ) } } } _ { = \eta \cdot \underbrace { 1 \times | S | } _ { = \eta \cdot \underbrace { 1 \times | S | } _ { = \theta _ { S } } } \bigg | _ { \theta _ { S } = \bar { \theta } _ { S } ^ { ( t + 1 ) } } } \cdot \underbrace { \frac { \partial \bar { \theta } _ { S } ^ { ( t + 1 ) } } { \partial \theta _ { T } } } _ { | S | \times \left| T \right| } } \\ { = \eta \cdot \underbrace { \frac { \partial \ell \left( x _ { \mathrm { l a b } } , y _ { \mathrm { l a b } } ; \theta _ { S } \right) } { \partial \theta _ { S } } \bigg | _ { \theta _ { S } = \bar { \theta } _ { S } ^ { ( t + 1 ) } } } _ { \mathrm { 1 \times | S | } } \cdot \mathbb { E } _ { \hat { y } _ { \mathrm { l a n } } \sim P \cdot ( \cdot | x _ { \mathrm { m i } } ; \theta _ { T } ) } \left[ \underbrace { g _ { S } ^ { ( t ) } ( \hat { y } _ { \mathrm { u n } } ) } _ { | S | \times 1 } \cdot \underbrace { \frac { \partial \ell \left( x _ { \mathrm { u n l } } , \hat { y } _ { \mathrm { u n l } } ; \theta _ { T } \right) } { \partial \theta _ { T } } } _ { \mathrm { 1 \times | T | } } \right] } \end{array}
312
+ $$
313
+
314
+ Finally, if we use Monte Carlo approximation for every term in Equation 12 using the sampled $\hat { y } _ { \mathrm { u n l } }$ then we have Equation 3 from Section 2. Note that in Section 2, we use the gradient notation, which results in the transposes.
315
+
316
+ # B TRAINING SPEED
317
+
318
+ Coaching performs up to 5 forward passes and 3 backward passes. Compared to vanilla backpropagation training, this is more 3 than times more expensive in FLOPs. However, many computations in Coaching are parallelizable. For example, the forward pass of the student and the forward pass for the teacher on unlabeled data (the top half of Figure 1), can be run in parallel since they do not depend on each other. Therefore, on computing hardware with sufficient memory, we find Coaching to be between 2 and 2.5 times slower than standard back-propagation training.
319
+
320
+ # C EXPERIMENTAL DETAILS
321
+
322
+ # C.1 DATASET SPLITS
323
+
324
+ We describe how we select the reduced datasets for the experiments on low data image classification in Section 3.1.
325
+
326
+ For CIFAR-10, we download the five training data batch files from www.cs.toronto.edu/ \~kriz/cifar.html. Then, we load all the images into a list of 50,000 images, keeping the order as downloaded. The fisrt 5,000 images ares reserved for validation. The next 4,000 images are used as labeled data. For SVHN, we download the data from the mat files on ufldl.stanford.edu/ housenumbers/, and follow the same procedure as with CIFAR-10. We note that this selection process leads to a slight imbalance in the class distribution for both CIFAR-10 and SVHN, but the settings are the same for all of our experiments.
327
+
328
+ For ImageNet, we follow the procedure in github.com/tensorflow/models/blob/ master/research/inception/inception/data/download_and_preprocess imagenet.sh. This results in 1,024 training TFRecord shards of approximately the same size. The order of the images in these shards are deterministic. For ImageNet- $10 \%$ , we use the first 102 shards; for ImageNet- $20 \%$ , we use the first 204 shards; and so on. The last 20 shards, corresponding to roughly 25,000 images, are reserved for hyper-parameters tuning.
329
+
330
+ # C.2 RANDOMAUGMENT: A DATA AUGMENTATION POLICY
331
+
332
+ We develop a data augmentation policy that achieves similarly high performance with AutoAugment (Cubuk et al., 2019) in a few cases that we consider, but which does not require learning a controller to generate policies. We names our policy RandomAugment. Our goal when developing RandomAugment is not to outperform AutoAugment, which is why we do not conduct extensive experiments with RandomAugment. Instead, we simply want to avoid indirectly using labeled data for our experiments, especially for the low data regime experiments in Section 3.1.
333
+
334
+ Each policy of RandomAugment consists of two operations that applied sequentially on an image. Each operation applies a uniformly sampled transformation with probability 0.5, and with a level uniformly chosen between 1 and 10. For a more comprehensive discussion of the probability and the level of a transformation, we refer readers to the AutoAugment paper (Cubuk et al., 2019).
335
+
336
+ Table 3: Transformations that RandomAugment uniformly samples for our datasets. We refer our readers to Cubuk et al. (2019) for the detailed descriptions of these transformations.
337
+
338
+ <table><tr><td>CIFAR-10 and ImageNet</td><td>SVHN</td></tr><tr><td>AutoContrast</td><td>AutoContrast</td></tr><tr><td>Brightness</td><td>Brightness</td></tr><tr><td>Color</td><td>Color</td></tr><tr><td>Contrast</td><td>Contrast</td></tr><tr><td>Equalize</td><td>Equalize</td></tr><tr><td>Invert</td><td>Invert</td></tr><tr><td>Sharpness</td><td>Sharpness</td></tr><tr><td>Posterize</td><td>Posterize</td></tr><tr><td>Sample Pairing</td><td>Solarize</td></tr><tr><td>Solarize</td><td>ShearX</td></tr><tr><td>Rotate</td><td>ShearY</td></tr><tr><td>ShearX</td><td>TranslateY</td></tr><tr><td>ShearY</td><td></td></tr><tr><td>TranslateX</td><td></td></tr><tr><td></td><td></td></tr><tr><td>TranslateY</td><td></td></tr></table>
339
+
340
+ We manually design the set of transformations for each of our datasets: CIFAR-10, ImageNet, and SVHN. The set of transformations for CIFAR-10 and for ImageNet are the same, and are slightly different from the set of transformation for SVHN. This is because the numbers in the SVHN have a different requirement for invariant. For instance, numbers should not be invariant against rotations like 6 and 9, and should not be invariant against horizontal translation like 3 and 8. Table 3 presents the transformation for our dataset. In addition to these operations, we only allow RandomAugment to select the three transformations AutoContrast, Brightness, and Invert in the first augmenting transformation. This is to avoid a few degenerating cases. For instance, when Brightness is applied twice on an image, both times with small levels, the image will become almost black.
341
+
342
+ In our experiments, RandomAugment’s performance is not far behind compared to AutoAugment. For example, on full ImageNet with ResNet-50, RandomAugment achives $\mathrm { \bar { 7 } 7 . 9 8 \% }$ top-1 accuracy, which is close to the top-1 accuracy of $7 7 . 6 \%$ reported by Cubuk et al. (2019).
343
+
344
+ # C.3 HYPER-PARAMETERS
345
+
346
+ To tune hyper-parameters, we follow Oliver et al. (2018) and allow each method to have 128 trials of hyper-parameters. When we tune, we let each model train for up to 50,000 steps. The optimal hyper-parameters are then used to run experiments that last for much more steps, as we report below. In our experiments with Coaching, training for more steps typically leads to stronger results. We stop at 1 million steps for CIFAR-10 and SVHN, and at 0.5 million steps for ImageNet simply because otherwise, these experiments will take too long. Meanwhile, in our experiments with purely supervised learning, Pseudo-Labels, and UDA, training for more steps overfits the models, and we have to employ early stopping.
347
+
348
+ We report the hyper-parameters for our baselines and for Coaching in Section 3.1. For the highresource experiments in Section 3.2, we use the same hyper-parameters, because tuning them is too expensive. Our hyper-parameters can be found in Table 4, 5, 6.
349
+
350
+ We note that our settings for UDA is different from originally reported by Xie et al. (2019). In their work, Xie et al. (2019) use a much larger batch size for their UDA objective. In our implementation of UDA, we keep these batch sizes the same. This leads to a much easier implementation of data parallelism in our framework, TensorFlow (Abadi et al., 2016) running on TPU big pods. To compensate for the difference, we train all UDA baselines for much longer than Xie et al. (2019). During the training process, we also mask out the supervised examples with high confidence. Effectively, our UDA model receives roughly the same amount of training with labeled examples and unlabeled examples as the models in Xie et al. (2019). We have also verified that on ImageNet- $10 \%$ with the augmentation policy from AutoAugment (Cubuk et al., 2019), our UDA implementation achives $6 8 . 7 7 \%$ top-1 accuracy, which is similar to $6 8 . 6 6 \%$ that Xie et al. (2019) reported.
351
+
352
+ Table 4: Hyper-parameters for supervised learning and Pseudo-Labels.
353
+
354
+ <table><tr><td>Hyper-parameter</td><td>CIFAR-10</td><td>SVHN</td><td>ImageNet</td></tr><tr><td>Weight decay</td><td>0.0005</td><td>0.001</td><td>0.0002</td></tr><tr><td>Label smoothing</td><td>0</td><td>0</td><td>0.1</td></tr><tr><td>Batch normalization decay</td><td>0.99</td><td>0.99</td><td>0.99</td></tr><tr><td>Learning rate</td><td>0.4</td><td>0.05</td><td>1.28</td></tr><tr><td>Number of training steps</td><td>50,000</td><td>50,000</td><td>40,000</td></tr><tr><td>Number of warm up steps</td><td>2500</td><td>0</td><td>2000</td></tr><tr><td>Batch size</td><td>1024</td><td>128</td><td>2048</td></tr><tr><td>Dropout rate</td><td>0.4</td><td>0.5</td><td>0.2</td></tr><tr><td>Pseudo label threshold</td><td>0.95</td><td>0.975</td><td>0.7</td></tr></table>
355
+
356
+ Table 5: Hyper-parameters for UDA. Unlike originally done by Xie et al. (2019), we do not use a larger batch size for the UDA objective. Instead, we use the same batch size for both the labeled objective and the unlabeled objective. This is to avoid instances where some particularly small batch sizes for the labeled objective cannot be split on our computational hardware.
357
+
358
+ <table><tr><td>Hyper-parameter</td><td>CIFAR-10</td><td>SVHN</td><td>ImageNet</td></tr><tr><td>Weight decay</td><td>0.0005</td><td>0.0005</td><td>0.0002</td></tr><tr><td>Label smoothing</td><td>0</td><td>0</td><td>0.1</td></tr><tr><td>Batch normalization decay</td><td>0.99</td><td>0.99</td><td>0.99</td></tr><tr><td>Learning rate</td><td>0.3</td><td>0.4</td><td>1.28</td></tr><tr><td>Number of training steps</td><td>1,000,000</td><td>1,000,000</td><td>500.000</td></tr><tr><td>Number of warm up steps</td><td>5,000</td><td>5.000</td><td>5,000</td></tr><tr><td>Batch size</td><td>128</td><td>128</td><td>2048</td></tr><tr><td>Dropout rate</td><td>0.5</td><td>0.6</td><td>0.25</td></tr><tr><td>UDA factor</td><td>2.5</td><td>1</td><td>20</td></tr><tr><td>UDA temperature</td><td>0.7</td><td>0.8</td><td>0.7</td></tr></table>
359
+
360
+ Table 6: Hyper-parameters for Coaching.
361
+
362
+ <table><tr><td></td><td>Hyper-parameter</td><td>CIFAR-10</td><td>SVHN</td><td>ImageNet</td></tr><tr><td rowspan="5">Common</td><td>Weight decay</td><td>0.0005</td><td>0.0005</td><td>0.0002</td></tr><tr><td>Label smoothing</td><td>0.1</td><td>0.1</td><td>0.1</td></tr><tr><td>Batch normalization decay</td><td>0.99</td><td>0.99</td><td>0.99</td></tr><tr><td>Number of training steps</td><td>1,000,000</td><td>1,000,000</td><td>500,000</td></tr><tr><td>Number of warm up steps</td><td>2.000</td><td>2,000</td><td>1,000</td></tr><tr><td rowspan="3">Student</td><td>Learning rate</td><td>0.3</td><td>0.15</td><td>0.8</td></tr><tr><td>Batch size</td><td>128</td><td>128</td><td>2048</td></tr><tr><td>Dropout rate</td><td>0.35</td><td>0.45</td><td>0.1</td></tr><tr><td rowspan="5">Teacher</td><td>Learning rate</td><td>0.125</td><td>0.05</td><td>0.5</td></tr><tr><td>Batch size</td><td>128</td><td>128</td><td>2048</td></tr><tr><td>Dropout rate</td><td>0.5</td><td>0.65</td><td>0.1</td></tr><tr><td>UDA factor</td><td>1.0</td><td>2.5</td><td>16.0</td></tr><tr><td>UDA temperature</td><td>0.8</td><td>1.25</td><td>0.75</td></tr></table>
md/train/rknt2Be0-/rknt2Be0-.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # COMPOSITIONAL OBVERTER COMMUNICATION LEARNING FROM RAW VISUAL INPUT
2
+
3
+ Edward Choi ∗
4
+ Georgia Institute of Technology
5
+ Atlanta, GA, USA
6
+ mp2893@gatech.edu
7
+ Angeliki Lazaridou & Nando de Freitas
8
+ DeepMind
9
+ London, UK
10
+ {angeliki, nandodefreitas}@google.com
11
+
12
+ # ABSTRACT
13
+
14
+ One of the distinguishing aspects of human language is its compositionality, which allows us to describe complex environments with limited vocabulary. Previously, it has been shown that neural network agents can learn to communicate in a highly structured, possibly compositional language based on disentangled input (e.g. handengineered features). Humans, however, do not learn to communicate based on well-summarized features. In this work, we train neural agents to simultaneously develop visual perception from raw image pixels, and learn to communicate with a sequence of discrete symbols. The agents play an image description game where the image contains factors such as colors and shapes. We train the agents using the obverter technique where an agent introspects to generate messages that maximize its own understanding. Through qualitative analysis, visualization and a zero-shot test, we show that the agents can develop, out of raw image pixels, a language with compositional properties, given a proper pressure from the environment.
15
+
16
+ # 1 INTRODUCTION
17
+
18
+ One of the key requirements for artificial general intelligence (AGI) to thrive in the real world is its ability to communicate with humans in natural language. Natural language processing (NLP) has been an active field of research for a long time, and the introduction of deep learning (LeCun et al., 2015) enabled great progress in NLP tasks such as translation, image captioning, text generation and visual question answering (Cho et al., 2014; Bahdanau et al., 2014; Vinyals et al., 2015; Karpathy & Fei-Fei, 2015; Hu et al., 2017; Serban et al., 2016; Lewis et al., 2017; Antol et al., 2015). However, training machines in a supervised manner with a large dataset has its limits when it comes to communication. Supervised methods are effective for capturing statistical associations between discrete symbols (i.e. words, letters). The essence of communication is more than just predicting the most likely word to come next; it is a means to coordinate with others and potentially achieve a common goal (Austin, 1975; Clark, 1996; Wittgenstein, 1953).
19
+
20
+ An alternative path to teaching machines the art of communication is to give them a specific task and encourage them to learn how to communicate on their own. This approach will encourage the agents to use languages grounded to task-related entities as well as communicate with other agents, which is one of the ways humans learn to communicate (Bruner, 1981). Recently, there have been several notable works that demonstrated the emergence of communication between neural network agents. Even though each work produced very interesting results of its own, in all cases, communication was either achieved with a single discrete symbol (as opposed to a sequence of discrete symbols) (Foerster et al., 2016; Lazaridou et al., 2017) or via a continuous value (Sukhbaatar et al., 2016; Jorge et al., 2016). Not only is human communication un-differentiable, but also using a single discrete symbol is quite far from natural language communication. One of the key features of human language is its compositional nature; the meaning of a complex expression is determined by its structure and the meanings of its constituents (Frege, 1892). More recently, Mordatch & Abbeel (2017) and Kottur et al. (2017) trained the agents to communicate in grounded, compositional language. In both studies, however, inputs given to the agents were hand-engineered features (disentangled input) rather than raw perceptual signals that we receive as humans.
21
+
22
+ In this work, we train neural agents to simultaneously develop visual perception from raw image pixels, and learn to communicate with a sequence of discrete symbols. Unlike previous works, our setup poses greater challenges to the agents since visual understanding and discrete communication have to be induced from scratch in parallel. We place the agents in a two-person image description game, where images contain objects of various color and shape. Inspired by the pioneering work of Batali (1998), we employ a communication philosophy named obverter to train the agents. Having its root in the theory of mind (Premack & Woodruff, 1978) and human language development (Milligan et al., 2007), the obverter technique motivates an agent to search over messages and generate the ones that maximize their own understanding. The contribution of our work can be summarized as follows:
23
+
24
+ • We train artificial agents to learn to disentangle raw image pixels and communicate in compositional language at the same time.
25
+ • We describe how the obverter technique, a differentiable learning algorithm for discrete communication, could be employed in a communication game with raw visual input.
26
+ • We visualize how the agents are perceiving the images and show that they learn to disentangle color and shape without any explicit supervision other than the communication one.
27
+ • Experiment results suggest that the agents could develop, out of raw image input, a language with compositional properties, given a proper pressure from the environment (i.e. the image description game).
28
+
29
+ Finally, while our exposition follows a multi-agent perspective, it is also possible to interpret our results in the single-agent setting. We are effectively learning a neural network that is able to learn disentangled compositional representations of visual scenes, without any supervision. Subject to the constraints imposed by their environment, our agents learn disentangled concepts, and how to compose these to form new concepts. This is an important milestone in the path to AGI.
30
+
31
+ # 2 METHOD
32
+
33
+ # 2.1 THE TWO-PERSON IMAGE DESCRIPTION GAME
34
+
35
+ ![](images/fe848c0db6f5de8bab346ead880e705a22d31e75c43a4509f5ea6f47130e08f7.jpg)
36
+ Figure 1: The two-person image description game. Speaker observes an image and generates a message (i.e. a sequence of discrete symbols). The listener, after observing a separate image and the message, must correctly decide whether it is seeing the same object as the speaker (left side; output 1) or not (right side; output 0).
37
+
38
+ ![](images/b0f08c116783796164e0f37b02eb2fea29ddc93f0d918fda9b7fa3e6ebcdda8e.jpg)
39
+ Figure 2: Example images of the dataset. There are eight colors (blue, red, white, gray, yellow, green, cyan, magenta), and five shapes (box, sphere, cylinder, capsule, ellipsoid), giving us total 40 combinations.
40
+
41
+ We choose a straightforward image description game with two factors (color and shape) so that we can perform extensive analysis on the outcome confidently, based on full control of the experiment. In a single round of the two-person image description game, one agent becomes the speaker and the other the listener. The speaker is given a random image, and generates a message to describe it. The listener is also given a random image, possibly the same image as the speaker’s. After hearing the message from the speaker, the listener must decide if it is seeing the same object as the speaker (Figure 1). Note that an image is the raw pixels given to the agents, and an object is the thing described by the image. Therefore two different images can depict the same object. In each round the agents change roles of being the speaker and the listener.
42
+
43
+ We generated synthetic images using Mujoco physics simulator1. The example images are shown in Figure 2. Each image depicts a single object with a specific color and shape in $1 2 8 \times 1 2 8$ resolution. There are eight colors (blue, red, white, gray, yellow, green, cyan, magenta) and five shapes (box, sphere, cylinder, capsule, ellipsoid), giving us 40 combinations. We generated 100 variations for each of the 40 object type. Note that the position of the object varies in each image, changing the object size and the orientation. Therefore even if the speaker and the listener are given the same object type, the actual images are very likely to be different, preventing the agents from using pixel-specific information, rather than object-related information to win the game.
44
+
45
+ # 2.2 MODEL ARCHITECTURE
46
+
47
+ ![](images/7902c027c72b5a000bf12271e28b3cfff9c03cda8af5899e656377dae25107a7.jpg)
48
+ Figure 3: Agent model architecture. The visual module processes the image, and the language module generates or consumes messages. The decision module accepts embeddings from both modules and produces the output. The solid arrows indicate modifying the output from the previous layer. The dotted arrows indicate copying the output from the previous layer.
49
+
50
+ Aside from using disentangled input, another strong assumption made in previous works(Batali, 1998; Mordatch & Abbeel, 2017) was that the agents had access to the true intention of the speaker. In Batali (1998), the listener was trained to modify its RNN hidden vector as closely to the speaker’s intention (meaning vector; please see Table 5 in Appendix A) as possible. In Mordatch & Abbeel (2017), each agent had an auxiliary task to predict the goals of all other agents. In both cases, the true meaning/goal vector was used to update the model parameters, exposing the disentangled information to the agents. In order to relax this assumption and encourage the agents to develop communication with minimal guidance, our model uses no other signal than whether the listener made a correct decision.
51
+
52
+ Figure 3 depicts the agent model architecture. We use a convolutional neural network followed by a fully-connected layer to process the image. A single RNN, specifically the gated recurrent units (GRU) (Cho et al., 2014), is used for both generating and consuming messages (the message generation using the obverter strategy is described in the next section). When consuming a message, the image embedding from the visual module and the message embedding from the language module are concatenated and processed by another fully-connected layers (i.e. decision module) with the sigmoid output $\hat { y }$ , 0 being “My (listener) image is different from the speaker’s” and 1 being “My image is the same as the speaker’s”. Further details of the model architecture (e.g. number of layers) are described in Appendix C.
53
+
54
+ # 2.3 OBVERTER TECHNIQUE
55
+
56
+ Although our work is inspired by Batali (1998) (see Appendix A for the description of Batali (1998)), obverter technique is a general message generation philosophy used/discussed in a number of communication and language evolution studies (Hurford, 1989; Oliphant & Batali, 1997; Smith, 2001; Kirby & Hurford, 2002), which has its root in the theory of mind. Theory of mind (Premack & Woodruff, 1978) observes that a human has direct access only to one’s own mind and not to the others’. Therefore we typically assume that the mind of others is analogous to ours, and such assumption is reflected in the functional use of language (Bruner, 1981). For example, if we want to convey a piece of information to the listener2, it is best to speak in a way that maximizes the listener’s understanding. However, since we cannot directly observe the listener’s state of mind, we cannot exactly solve this optimization problem. Therefore we posit that the listener’s mind operates in a similar manner as ours, and speak in a way that maximizes our understanding, thus approximately solving the optimization problem. This is exactly what the obverter technique tries to achieve.
57
+
58
+ When an agent becomes the teacher (i.e. speaker), the model parameters are fixed. The image is converted to an embedding via the visual module. After initializing its RNN hidden layer to zeros, the teacher at each timestep evaluates $\hat { y }$ for all possible symbols and selects the one that maximizes $\hat { y }$ The RNN hidden vector induced by the chosen symbol is used in the next timestep. This is repeated until $\hat { y }$ becomes bigger than the predefined threshold, or the maximum message length is reached (see Appendix D for algorithm). Therefore the teacher, through introspection, greedily selects characters at each timestep to generate a message such that the consistency between the image and the message is as clear to itself as possible. When an agent becomes the learner (i.e. listener), its parameters are updated via back-propagating the cross entropy loss between its output $\hat { y }$ and the true label $y$ . Therefore the agents must learn to communicate only from the true label indicating whether the teacher and the learner are seeing the same object.
59
+
60
+ We remind the reader that only the learner’s RNN parameters are updated, and the teacher uses its fixed RNN. Therefore an agent uses only one RNN for both speaking and listening, guaranteeing self-consistency (see Appendix B for a detailed comparison between the obverter technique and the RL-based approach). Furthermore, because the teacher’s parameters are fixed, message generation can easily be extended to be more exploratory. Although in this work we deterministically selected a character in each timestep, one can, for example, sample characters proportionally to $\hat { y }$ and still use gradient descent for training the agents. Using a more exploratory message generation strategy could help us discover a more optimal communication language when dealing with complex tasks.
61
+
62
+ Another feature of the obverter technique is that it observes the principle of least effort (Zipf, 1949). Because the teacher stops generating symbols as soon as $\hat { y }$ reaches the threshold, it does not waste any more effort trying to perfect the message. The same principle was implemented in one way or another in previous works, such as choosing the shortest among the generated strings (Kirby & Hurford, 2002) or imposing a small cost for generating a message (Mordatch & Abbeel, 2017).
63
+
64
+ # 2.4 ENVIRONMENTAL PRESSURE FOR COMPOSITIONAL COMMUNICATION
65
+
66
+ During the early stages of research, we noticed that randomly sampling object pairs (one for the teacher, one for the learner) lead to agents focusing only on colors and ignoring shapes. When the teacher’s object is fixed, there are 40 (8 colors $\times 5$ shapes) possibilities on the learner’s side. If the teacher only talks about the color of the object, the learner can correctly decide for 36 out of 40 possible object types. The learner makes incorrect decisions only when the teacher and the learner are given objects of the same color but different shapes, resulting in $9 0 \%$ accuracy on average. This is actually what we observed; the accuracy plateaued between 0.9 and 0.92 during the training, and the messages were more or less the same for objects with the same color. Therefore when constructing a mini-batch of images, we set $2 5 \%$ to be the object pairs of the same color and shape, $30 \%$ the same shape but different colors, $20 \%$ the same color but different shapes. The remaining $2 5 \%$ object pairs were picked randomly3.
67
+
68
+ Vocabulary size (i.e. number of unique symbols) and the maximum message length were also influential to the final outcome. We noticed that a larger vocabulary and a longer message length helped the agents achieve a high communication accuracy more easily. But the resulting messages were more challenging to analyze for compositional patterns. In all our experiments we used 5 and 20 respectively for the vocabulary size and the maximum message length, similar to what Batali (1998) used. This suggests that the environment plays as important, if not more, role as the model architecture in the emergence of complex communication as discussed by previous studies (Kirby et al., 2014; Bratman et al., 2010; Kottur et al., 2017) and should be a main consideration for future efforts. Further details regarding hyperparameters are described in Appendix E.
69
+
70
+ # 3 EXPERIMENTS
71
+
72
+ In this section, we first study the convergence behavior during the training phase. Then we analyze the language developed by the agents in terms of compositionality. As stated in the introduction, in compositional language, the meaning of a complex expression is determined by its structure and the meanings of its constituents. With this definition in mind, we focus on two aspects of the inter-agent communication to evaluate its compositional properties: the structure (i.e. grammar) of the communication, and zero-shot performance (i.e. generalizing to novel stimuli). These two aspects, which are both necessary conditions for any language to be considered compositional, have been used by previous works to study the compositional nature of artificial communication (Batali, 1998; Mordatch & Abbeel, 2017; Kottur et al., 2017).
73
+
74
+ To evaluate the structure of the messages, we study the evolution of the communication as training proceeds, and try to derive a grammar for expressing colors and shapes. To evaluate the zero-shot capabilities, we test if the agents can compose consistent messages for objects they have not seen during the training. Moreover, we visualize the image embeddings from the visual modules of both agents to understand how they are recognizing colors and shapes, the results of which, for a better view of the figures, are provided in Appendix H.
75
+
76
+ # 3.1 CONVERGENCE BEHAVIOR
77
+
78
+ ![](images/e4918ef563341b6e90dc729d2d56d92b62fe35943fcf79abaaa0650a641662d6.jpg)
79
+ Figure 4: Progress during the training (best seen in color). (Top) We plot the training accuracy, training loss, average message length and average message distinctness in each round. (Bottom) We plot the perplexities and the Jaccard similarity of the messages spoken by both agents in each round. Note that the average message length and the perplexities are divided by 20 to match the y-axis range with other metrics.
80
+
81
+ Figure 4 shows the convergence behavior during the training. Training accuracy was calculated by rounding the learner’s sigmoid output by 0.5. Message distinctness was calculated by dividing the number of unique messages in the mini-batch by the size of the mini-batch. Ideally there should be, on average, 40 distinct messages in the mini-batch of 50 images, therefore giving us 0.8 distinctness. Every 10 round, both agents were given the same 1, 000 randomly sampled images to generate 1, 000 message pairs. Then perplexity was calculated for each object type and averaged, thus indicating the average number of distinct messages used by the agents to describe a single object type (note that perplexities in the plot was divided by 20). Jaccard similarity between both agents’ messages was also calculated for each object type and averaged.
82
+
83
+ At the beginning, the listener (i.e. learner) always decides it is not seeing the same object as the speaker, giving us 0.75 accuracy4. But after 7, 000 rounds, accuracy starts to go beyond 0.9. Loss is negatively correlated with accuracy until round 15, 000, where it starts to fluctuate. Accuracy, however, remains high due to how accuracy is measured; by rounding the learner’s output by 0.5. Although we could occasionally observe some patterns in the messages when both accuracy and loss were high, a lower loss generally resulted in a clearer communication structure (i.e. grammar) and better zero-shot performance. The loss fluctuation also indicates some instability in the training process, which is a potential direction for future work. Message distinctness starts at near 0, indicating the agents are generating the same message for all object types. After round 7, 000, where both message distinctness and message length reach their maximum, both start to decrease. But message distinctness never goes as high as the ideal 0.8, meaning that the agents are occasionally using the same message for different object types, as will be shown in the following section.
84
+
85
+ Both perplexities and Jaccard similarity show seemingly meaningless fluctuation at early rounds. After round 7, 000, perplexities and Jaccard similarity show negatively correlated behavior, meaning that not only is each agent using consistent messages to describe each object type, but also both agents are using very similar messages to describe each object type. We found perplexity and Jaccard similarity to be an important indicator of the degree of the communication structure. During rounds $7 , 0 0 0 \sim 8 , 0 0 0$ , performance was excellent in terms of loss and accuracy, but perplexity was high and Jaccard similarity low, indicating the agents were assigning incoherent strings to each object type just to win the game. Similar behavior was observed in the early stages of language evolution simulation in Kirby & Hurford (2002) where words represented some meanings but had no structure (i.e. protolanguage). It seems that artificial communication acquires compositional properties after the emergence of protolanguage regardless of whether the input is entangled or disentangled.
86
+
87
+ # 3.2 GRAMMAR ANALYSIS
88
+
89
+ We choose agents from different training rounds to highlight how the language becomes more structured over time. Table 1 shows agents’ messages in the beginning (round 40), when the training accuracy starts pushing beyond $9 0 \%$ (round 6, 940), when agents settle on a common language (round 16, 760).
90
+
91
+ In round 40, both agents are respectively producing the same message for all object types as mentioned in section 3.1. We might say the messages are structured, but considering that the listener always answers 0 in early rounds, we cannot say the agents are communicating. In round 6, 940, which is roughly when the agents begin to communicate more efficiently, training accuracy is significantly higher than round 40. However, perplexities show that both agents are assigning many names to a single object type (40-80 names depending on the object type), indicating that the agents are focusing on pixel-level differences between images of the same object type. Table 1 shows, as an example, the messages used by both agents to describe the red sphere. Due to high perplexity, it is difficult to capture the underlying grammar of the messages even with regular expression. Furthermore, as Jaccard similarity indicates, both agents are generating completely different messages for the same object type. In round 16, 760, as the perplexities and Jaccard similarity tell us, the agents came to share a very narrow set of names for each object type (1-4 names depending on the object type). Moreover, the names of the same-colored objects and same-shaped objects clearly seem to follow a pattern. Overall, each of the three phases (round 40, round 6,940, round 16,760) seem to represent the development of visual perception, learning to communicate, and emergence of structure.
92
+
93
+ We found the messages in round 16, 760 could be decomposed in a similar manner as Table 6 in Appendix A. The top of Table 2 shows a possible decomposition of the messages from round 16, 760 and the bottom shows the rules for each color and shape derived from the decomposition. According to our analysis, the agents use the first part of the message (i.e. prefix) to specify a shape, and the second part (i.e. suffix) to specify a color. However, they use two different strings to specify a shape. For example, the agents use either aaaa or bbbbb to describe a box. The strings used for specifying colors show slightly weaker regularity. For example, red is always described by either the suffix c or suffix e, but magenta is described by the suffix bb, bd, and sometimes b or bc. a used for ¯ gray objects
94
+
95
+ Round 40 (Training accuracy: $6 6 . 1 \%$ , Agent0 perplexity:1.0, Agent1 perplexity:1.0, Jaccard similarity:0.0)
96
+
97
+ <table><tr><td rowspan=1 colspan=1>■</td><td rowspan=1 colspan=1>All objectsdescribed by Agent 0</td><td rowspan=1 colspan=1>All objectsdescribed byAgent1</td></tr><tr><td rowspan=1 colspan=1>Message</td><td rowspan=1 colspan=1>dddddddddddddddddddd</td><td rowspan=1 colspan=1>bbbbbbbbbbbbbbbbbbbb</td></tr></table>
98
+
99
+ # Round 6,940
100
+
101
+ (Training accuracy: $9 3 . 1 \%$ , Agent0 perplexity:9.90, Agent1 perplexity:17.73, Jaccard similarity:0.0)
102
+
103
+ <table><tr><td>■</td><td>Redsphere described byagent 0</td><td>Redspheredescribedbyagent1</td></tr><tr><td rowspan="9">Messages</td><td>aeceaeaeaaaeeeeeeeee</td><td>aaedacacaaaaaaaaaaaa</td></tr><tr><td>aacceeaaaaeeeeeeeeee</td><td>aaccdaacaaaaaaaaaaaa</td></tr><tr><td>aaccceaaaaaaaaeeeeee</td><td>aaabcdadaaaaaaaaaaaa</td></tr><tr><td>aeeeeaaaaeeeeeeeeeee</td><td>aaeeacaeaaaaaaaaaaaa</td></tr><tr><td>aeaceeaeaeeeeeeeeeee</td><td>aaccdadaaaaaaacaaaaa</td></tr><tr><td>aceacacaaaaaaeeeeeee</td><td>aaedaceaaaaaaaaaaaaa</td></tr><tr><td>abeeeeaeeeeeeeeeeeee</td><td>aaeaccaeaaaaaaaaaaaa</td></tr><tr><td>aacceeaeeeeeeeeeeeee</td><td>aaceacaacaaaaaaaaaaa</td></tr><tr><td>aacceeaeaaeeeeeeeeee</td><td>aacdacdaaaaaaaaaaaaa</td></tr><tr><td>aeeacacaaaeeccceeeee</td><td></td><td>aaccdadaaaaacaaaaaaa</td></tr></table>
104
+
105
+ Round 16,760 (Training accuracy: $9 8 . 0 \%$ , Agent0 perplexity:1.69, Agent1 perplexity:1.62, Jaccard similarity:0.82)
106
+ Table 1: (Top) Messages used by both agents when speaking about any object in round 40. (Middle) Ten most frequent messages used by each agent to describe a red sphere in round 6, 940. (Bottom) Messages most often used by both agents for each object type in round 16, 760. Brackets indicate the variation often seen at the last character. Underscores indicate blanks.
107
+
108
+ <table><tr><td>:</td><td>Box</td><td>Sphere</td><td>Cylinder</td><td>Capsule</td><td>Ellipsoid</td></tr><tr><td>Blue</td><td>bbbbbbb{b.d}</td><td>bb{b,d}</td><td>bbbbbb{b,d}</td><td>bbbbb{c,d}</td><td>bbbb{-,c,d}</td></tr><tr><td>Red White</td><td>aaaa{c,e}</td><td>aa{c,e}</td><td>aaa{c,e}</td><td>a{c,e}</td><td>c,e</td></tr><tr><td></td><td>bbbbbb</td><td>b,d</td><td>bbbb{b,d}</td><td>bbb{b.d}</td><td>bb{-,c,d}</td></tr><tr><td>Gray</td><td>aaa</td><td>a</td><td>aa</td><td>C</td><td>b,bd</td></tr><tr><td>Yellow</td><td>aaaaaa</td><td>aaaa</td><td>aaaaa</td><td>aaa</td><td>a{a,e}</td></tr><tr><td>Green</td><td>aaaa{a,ad}</td><td>aa{a,ad}</td><td>aaa{a.ad}</td><td>a{a,ad}</td><td>a</td></tr><tr><td>Cyan</td><td>ax20</td><td>bbb{b,d}</td><td>bbbbbbb{b,d}</td><td>bbbbbbd</td><td>bbbbb{b.d}</td></tr><tr><td>Magenta</td><td>bbbbbbb</td><td>b{b.d</td><td>bbbbb{b,d}</td><td>bbbbd</td><td>bbb{-.c,d}</td></tr></table>
109
+
110
+ represents deletion of the prefix a. Note that removing prefixes beyond their length causes the pattern to break. For example, gray box, gray sphere and gray cylinder use the same a¯aa to express the color, ¯ but gray capsule and gray ellipsoid use irregular suffixes.
111
+
112
+ Despite some irregularities and one exceptional case (cyan box), the messages provide strong evidence that the agents learned to properly recognize color and shape from raw pixel input (see Appendix H for studying what the visual module learned), mapped each color and shape to prefixes and suffixes, and are able to compose meaningful messages to describe a given image to one another. Communication accuracy for each object type is described in Appendix F. Communication examples and their analysis are given in Appendix G.
113
+
114
+ # 3.3 ZERO-SHOT EVALUATION
115
+
116
+ If the agents have truly learned to compose a message that can be divided into a color part and a shape part, then they should be able to accurately describe an object they have not seen before, which is another necessary condition for a compositional language. Therefore, we hold out five objects (the shaded cells in Table 3) from the dataset during the training and observe how agents describe five novel objects during the test phase. The agents were chosen from round 19, 980, which showed a high accuracy $( 9 7 . 8 \% )$ , low perplexities (1.48, 1.65) and a high Jaccard similarity (0.75). Table 3 shows a potential decomposition of the messages used by the agents (original messages are described by Table 8 in Appendix I). We can observe that there is clearly a structure in the communication, although some messages show somewhat weaker patterns compared to when the agents were trained with all object types (Table 2). Suffixes for specifying yellow and magenta are especially irregular, even when we consider the effects of b and ¯ e. However, the messages describing the held-out object ¯ types show clear structure with the exception of yellow ellipsoid.
117
+
118
+ <table><tr><td>■</td><td>Box</td><td>Sphere</td><td>Cylinder</td><td>Capsule</td><td>Ellipsoid</td></tr><tr><td>Blue Red</td><td>bbbbb bb{b,d} aaaa {c,e}</td><td>bb{b,d} aa {c,e}</td><td>bbbb bb{b.d} aaa {c,e}</td><td>bbb bb{c,d} a{c,e}</td><td>bb bb{-.c,d} {c,e}</td></tr><tr><td>White</td><td>bbbbbb</td><td>{b.d}</td><td>bbbb{b.d}</td><td>bbb {b.d}</td><td>bb{-c,d}</td></tr><tr><td>Gray</td><td>aaaa aaa</td><td>aa aaa</td><td>aaa aaa</td><td>a aac</td><td>aa{b,bd}</td></tr><tr><td>Yellow</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>aaaa aa</td><td>aaaa</td><td>aaaaa</td><td>aaa</td><td>a{ae}</td></tr><tr><td>Green</td><td>aaaa {a,ad}</td><td>aa {a,ad}</td><td>aaa {a,ad}</td><td>a{a,ad}</td><td>a</td></tr><tr><td>Cyan</td><td>a×20</td><td>bbb{b,d}</td><td>bbbb bbb{b,d}</td><td>bbb bbbd</td><td>bb bbb{b.d}</td></tr><tr><td>Magenta</td><td>bbbbbbb</td><td>b{b,d}</td><td>bbbbb{b.d}</td><td>bbb bd</td><td>bbb{-c,d}</td></tr></table>
119
+
120
+ Define Blue, White, Cyan, Magenta as color group 0, rest as color group 1.
121
+
122
+ <table><tr><td rowspan=1 colspan=1>■</td><td rowspan=1 colspan=1>Rule</td></tr><tr><td rowspan=1 colspan=1>Blue</td><td rowspan=3 colspan=1>End with bbb or bbdEnd with c or eEnd with b or dEnd with aaaEnd with aaEnd with a or adEnd with bbbb or bbbdEnd with bb or bd</td></tr><tr><td rowspan=1 colspan=1>RedWhite</td></tr><tr><td rowspan=1 colspan=1>Gray</td><td rowspan=1 colspan=1>GrayYellowGreenCyanMagenta</td></tr><tr><td rowspan=1 colspan=1>BoxSphereCylinderCapsuleEllipsoid</td><td rowspan=1 colspan=1>Start with bbbbb for color group O, start with aaaa for color group 1Start with aa for color group 1Start with bbbb for color group O, start with aaa for color group 1Start with bbb for color group O,start with a for color group 1Start with bb for color group 0</td></tr></table>
123
+
124
+ Table 2: (Top) Potential composition analysis of the messages from round 16,760 (bottom of Table 1). Italic symbols are used to specify shapes and roman symbols are used to specify colors. a indicates ¯ deleting a single prefix a. (Bottom) Rules for each color and shape derived from the top table.
125
+ Table 3: Potential analysis of the messages observed in the zero-shot test. Gray cells indicate object types unseen during the training phase. Italic symbols are used to specify shapes and roman symbols to specify colors. b indicates deleting a single prefix¯ $b$ . e indicates deleting a single prefix ¯ $e$ . Underscores indicate blanks.
126
+
127
+ <table><tr><td rowspan=1 colspan=1>■</td><td rowspan=1 colspan=3>Box</td><td rowspan=1 colspan=2>Sphere</td><td rowspan=1 colspan=3>Cylinder</td><td rowspan=1 colspan=1>Capsule</td><td rowspan=1 colspan=1>Ellipsoid</td></tr><tr><td rowspan=7 colspan=1>BlueRedWhiteGrayYellowGreen</td><td rowspan=1 colspan=3>eeeeee e{e,ee}</td><td rowspan=1 colspan=2>eeeeee</td><td rowspan=2 colspan=3>eeeee e{e,ed}eeeee eeee{e,a}</td><td rowspan=3 colspan=1>eee e{e,ed}eee eeee{b,ba}bb {b.d}</td><td rowspan=5 colspan=1>eee{e,a}ee eeee{a,c}bbb {d.c}ee eee{b.d}</td></tr><tr><td rowspan=6 colspan=3>eeeeee eeee{e.a}bbbbbeeeeeeeeeebbbb bb{c,d}eeeeee {e,a}</td><td rowspan=1 colspan=2>eeee eeee{e,ea}</td><td rowspan=1 colspan=2>eeee</td></tr><tr><td rowspan=1 colspan=2>bb</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=2></td><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>eeee eee{-,a}</td><td rowspan=1 colspan=1></td><td rowspan=2 colspan=3>eeeee eee{e,a}</td><td rowspan=2 colspan=1>eee eee{e,a}</td></tr><tr><td rowspan=4 colspan=2>bbbe{e,ec}eeee {e,a}eeee ee{e,a}bb{c.d</td></tr><tr><td rowspan=3 colspan=3>bbb bb{c,d}eeeee {e,a}eeeee ee{e,ea}bbbb{b.d}</td><td rowspan=2 colspan=1>bb bb{a.c}eee{e,a}</td><td rowspan=1 colspan=1>bbb bb{a,e}</td></tr><tr><td rowspan=2 colspan=1>eee{e,a}eee ee{e,a}bb bb</td><td rowspan=2 colspan=1>ee {e,a}ee eeabbb bb{c.a}</td></tr><tr><td rowspan=1 colspan=1>CyanMagenta</td><td rowspan=1 colspan=3>eeeeee eeeabbbb b{b.d}</td><td rowspan=1 colspan=1></td></tr></table>
128
+
129
+ In order to assess the communication accuracy when held-out objects are involved, we conducted another test with the agents from round 19, 980. Each held-out object was given to the speaker, the listener, or both. In the first two cases, the held-out object was paired with all 40 object types and each pair was tested 10 times. In the last case, the held-out object was tested against itself 10 times. In all cases, the agents switched roles after 5 times. Table 4 shows communication accuracies for each case. We can see the agents can successfully communicate most of the time even when given novel objects. The last column shows that the listener is not simply producing 0 to maximize its chance to win the game. It is also notable that the objects described without $\bar { \mathsf b }$ or e show better performance in general. ¯ We noticed the communication accuracy for held-out objects seems relatively weak considering the messages used to describe them strongly showed structure. (Table 3). This, however, results from the grammar (i.e. structure) being not as straightforward as Table 2, especially with short messages (i.e. frequent use of $\bar { \mathsf b }$ and e). The same tendency can be observed for non-held-out objects as described ¯ by the per-object communication accuracy Table 9 in Appendix J.
130
+
131
+ Table 4: Communication accuracy when agents were given objects not seen during the training.
132
+
133
+ <table><tr><td></td><td>Given to speaker</td><td>Given to listener</td><td>Given to both</td></tr><tr><td>BlueBox</td><td>0.97</td><td>0.97</td><td>1.00</td></tr><tr><td>Red Sphere</td><td>0.92</td><td>0.91</td><td>0.80</td></tr><tr><td>White Cylinder</td><td>0.95</td><td>0.95</td><td>0.90</td></tr><tr><td>Gray Capsule</td><td>0.91</td><td>0.91</td><td>1.00</td></tr><tr><td>Yellow Ellipsoid</td><td>0.91</td><td>0.90</td><td>1.00</td></tr></table>
134
+
135
+ From the grammar analysis in the previous section, we have shown that the emerged language strongly follows a well-defined grammar. In the zero-shot test, the agents demonstrated that they can successfully describe novel object, although not perfectly, by also following a similar grammar. Both are, as stated in the beginning of section 3, necessary conditions for any communication to be considered compositional. Therefore we can safely conclude that the emerged language in this work possesses some qualifications to be considered compositional.
136
+
137
+ # 4 DISCUSSION
138
+
139
+ In this work, we used the obverter technique to train neural network agents to communicate in a two-person image description game. Through qualitative analysis, visualization and the zero-shot test, we have shown that even though the agents receive raw perception in the form of image pixels, under the right environment pressures, the emerged language had properties consistent with the ones found in compositional languages.
140
+
141
+ As an evaluation strategy, we followed previous works and focused on assessing the necessary conditions of compositional languages. However, the exact definition of compositional language is still somewhat debatable, and, to the best of our knowledge, there is no reliable way to mathematically quantify the degree of compositionality of an arbitrary language. Therefore, in order to encourage active research and discussion among researchers in this domain, we propose for future work, a quantitatively measurable definition of compositionality. We believe compositionality of a language is not binary (e.g. language A is compositional/not compositional), but a spectrum. For example, human language has some aspects that are compositional (e.g., syntactic constructions, most morphological combinations) and some that are not (e.g., irregular verb tenses in English, character-level word composition). It is also important to clearly define grounded language and compositional language. If one agent says abc (eat red apple) and another says cba (apple red eat), and they both understand each other, are they speaking compositional language? We believe such questions should be asked and addressed to shape the definition of compositionality.
142
+
143
+ In addition to the definition/evaluation of compositional languages, there are numerous directions of future work. Observing the emergence of a compositional language among more than two agents is an apparent next step. Designing an environment to motivate the agents to disentangle more than two factors is also an interesting direction. Training agents to consider the context (i.e. pragmatics), such as giving each agent several images instead of one, is another exciting future work.
144
+
145
+ # ACKNOWLEDGMENTS
146
+
147
+ We would like to thank Scott Reed for discussions on pragmatics, Tom Le Paine for advising the visual module architecture, Jakob Foerster for discussions on grammar induction, Sookyung Kim and Joonseok Lee for discussions on human language and compositionality, Phil Blunsom and Jimeng Sun for helpful comments on the manuscript.
148
+
149
+ # REFERENCES
150
+
151
+ Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2425–2433, 2015.
152
+
153
+ John Langshaw Austin. How to do things with words. Oxford university press, 1975.
154
+
155
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2014.
156
+
157
+ John Batali. Computational simulations of the emergence of grammar. Approaches to the evolution of language: Social and cognitive bases, 405:426, 1998.
158
+
159
+ Jeshua Bratman, Michael Shvartsman, Richard L Lewis, and Satinder Singh. A new approach to exploring language emergence as boundedly optimal control in the face of environmental and cognitive constraints. In International Conference on Cognitive Modeling, pp. 7–12, 2010.
160
+
161
+ Jerome S Bruner. Intention in the structure of action and interaction. Advances in infancy research, 1981.
162
+
163
+ 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. In EMNLP, 2014.
164
+
165
+ Herbert H Clark. Using language. Cambridge university press, 1996.
166
+
167
+ Jakob Foerster, Yannis M Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In NIPS, pp. 2137–2145, 2016.
168
+
169
+ Gottlob Frege. Zeitschrift fur philosophie und philosophische kritik. ¨ NF, 100:25–50, 1892.
170
+
171
+ Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In ICML, pp. 1587–1596, 2017.
172
+
173
+ James R Hurford. Biological evolution of the saussurean sign as a component of the language acquisition device. Lingua, 77(2):187–222, 1989.
174
+
175
+ Emilio Jorge, Mikael Kageb ˚ ack, and Emil Gustavsson. Learning to play guess who? and inventing a ¨ grounded language as a consequence. arXiv preprint arXiv:1611.03218, 2016.
176
+
177
+ Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In CVPR, pp. 3128–3137, 2015.
178
+
179
+ Simon Kirby and James R Hurford. The emergence of linguistic structure: An overview of the iterated learning model. In Simulating the evolution of language, pp. 121–147. Springer, 2002.
180
+
181
+ Simon Kirby, Tom Griffiths, and Kenny Smith. Iterated learning and the evolution of language. Current opinion in neurobiology, 28:108–114, 2014.
182
+
183
+ Satwik Kottur, Jose MF Moura, Stefan Lee, and Dhruv Batra. Natural language does not ´ emerge’naturally’in multi-agent dialog. In EMNLP, 2017.
184
+
185
+ Angeliki Lazaridou, Alexander Peysakhovich, and Marco Baroni. Multi-agent cooperation and the emergence of (natural) language. In ICLR, 2017.
186
+
187
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
188
+
189
+ Mike Lewis, Denis Yarats, Yann N Dauphin, Devi Parikh, and Dhruv Batra. Deal or no deal? end-to-end learning for negotiation dialogues. arXiv preprint arXiv:1706.05125, 2017.
190
+
191
+ Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008.
192
+
193
+ Karen Milligan, Janet Wilde Astington, and Lisa Ain Dack. Language and theory of mind: metaanalysis of the relation between language ability and false-belief understanding. Child development, 78(2):622–646, 2007.
194
+
195
+ Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. arXiv preprint arXiv:1703.04908, 2017.
196
+
197
+ Michael Oliphant and John Batali. Learning and the emergence of coordinated communication. Center for research on language newsletter, 11(1):1–46, 1997.
198
+
199
+ David Premack and Guy Woodruff. Does the chimpanzee have a theory of mind? Behavioral and brain sciences, 1(4):515–526, 1978.
200
+
201
+ Iulian Vlad Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C Courville, and Joelle Pineau. Building end-to-end dialogue systems using generative hierarchical neural network models. In AAAI, 2016.
202
+
203
+ Andrew Smith. Establishing communication systems without explicit meaning transmission. Advances in artificial life, pp. 381–390, 2001.
204
+
205
+ Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In NIPS, pp. 2244–2252, 2016.
206
+
207
+ Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In CVPR, pp. 3156–3164, 2015.
208
+
209
+ Ludwig Wittgenstein. Philosophical investigations. Blackwell, Oxford, UK, 1953.
210
+
211
+ George Kingsley Zipf. Human behavior and the principle of least effort. Addison-Wesley, 1949.
212
+
213
+ ![](images/81623d6fa1690cf173bcc5d807c2fd91fc367f71b2d863a4604fa77be6c9f3a2.jpg)
214
+ Table 5: Meaning vectors are composed of (a) subject vectors and (b) predicate vectors. (c) shows 10 out of 100 possible meaning vectors.
215
+
216
+ # A EMERGENCE OF GRAMMAR, BATALI (1998)
217
+
218
+ In Batali (1998), the author successfully trained neural agents to develop a structured (i.e. grammatical) language using disentangled meaning vectors as the input. Using 10 subject vectors and 10 predicate vectors, all represented as explicit binary vectors, total 100 meaning vectors could be composed(Table 5). Each digit in the subject vector 5a serves a clear role, respectively representing speaker $( s p )$ , hearer $( h r )$ , other $( o t )$ , and plural $( p l )$ . The predicate vector values, on the other hand, are randomly chosen so that each predicate vector will have three 1’s and three 0’s. The combination of ten subject vectors and ten predicate vectors allows 100 meaning vectors.
219
+
220
+ The author used twenty neural agents for the experiment. Each agent was implemented with the vanilla recurrent neural networks (RNN), where the hidden vector h’s size was 10, same as the size of the meaning vector m in order to treat h as the agent’s understanding of m. In each training round a single learner (i.e. listener) and ten teachers (i.e. speaker) were randomly chosen. Each teacher, given all $1 0 0 \mathbf { m }$ ’s in random order, generates a message $\mathbf { s } ^ { 5 }$ for each $\mathbf { m }$ and sends it to the learner. The messages are generated using the obverter techinque, which is described in Algorithm 1. The learner is trained to minimize the mean squared error (MSE) between $\mathbf { h }$ (after consuming the s) and m. After the learner has learned from all ten teachers, the next round begins, repeating the process until the error goes below some threshold.
221
+
222
+ 1 $\mathbf { h } ^ { ( 0 ) } = \mathbf { 0 }$ //Initialize RNN hidden layer with zeros;
223
+ 2 $\mathbf { s } = \left[ \mathbf { \epsilon } \right]$ //Initialize the message vector;
224
+ 3 $t = 0$ //Timestep index;
225
+ 4 $\mathbf { V } = \mathbf { I } \in \mathbb { R } ^ { 4 \times 4 }$ //Each row $\mathbf { v } _ { 0 } , \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { v } _ { 3 }$ corresponds to $a , b , c , d$ ;
226
+ 5 while $| \mathbf { s } | < m a x$ message length do
227
+ 6 $\mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) } = \sigma ( \mathbf { v } _ { i } \mathbf { W } _ { i } + \mathbf { h } ^ { ( t - 1 ) } \mathbf { W } _ { h } + \mathbf { b } )$ ;
228
+ 7 $i = \mathrm { a r g m i n } _ { i } \vert \vert \mathbf { m } - \mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) } \vert \vert ^ { 2 }$ ;
229
+ 8 $\mathbf { h } ^ { ( t ) } = \mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) }$ ;
230
+ 9 Append $i$ to s;
231
+ 10 if $| | \mathbf { m } - \mathbf { h } ^ { ( t ) } | | ^ { 2 } < t h r e s h o l d \mathbf { t } 1$ hen
232
+ 11 Terminate;
233
+
234
+ When the training was complete, the author was able to find strong patterns in the messages used by the agents (Table 6). Note that the messages using predicates tired, scared, sick and happy especially follow a very clear pattern. Batali also conducted a zero-shot test where the agents were trained without the diagonal elements in Table 6 and tested with all 100 meaning vectors. The agents were able to successfully communicate even when held-out meaning vectors were used, but the
235
+
236
+ <table><tr><td>=</td><td>one</td><td>they</td><td>you</td><td>yall</td><td>yup</td><td>me</td><td>we</td><td>mip</td><td>yumi</td><td>all</td></tr><tr><td>tired</td><td>cda</td><td>cdab</td><td>cdc</td><td>cdcb</td><td>cdba</td><td>cd</td><td>cdd</td><td>cddb</td><td>cdcd</td><td>cdb</td></tr><tr><td>scared</td><td>caa</td><td>caab</td><td>cac</td><td>cacb</td><td>caba</td><td>ca</td><td>cad</td><td>cadb</td><td>cacd</td><td>cab</td></tr><tr><td>sick</td><td>daa</td><td>daab</td><td>dac</td><td>dacb</td><td>daba</td><td>da</td><td>dad</td><td>dadb</td><td>dacd</td><td>dab</td></tr><tr><td>happy sad</td><td>baa</td><td>baab abab</td><td>bca</td><td>bcab</td><td>baac</td><td>ba</td><td>badc</td><td>bab</td><td>bac</td><td>babc</td></tr><tr><td>excited</td><td>aba cba</td><td>cbab</td><td>ac</td><td>acb cacb</td><td>abac cbca</td><td>a</td><td>abdc ccdc</td><td>abb</td><td>abc</td><td>abbc</td></tr><tr><td>angry</td><td>bb</td><td>bbb</td><td>cca bc</td><td></td><td></td><td>c</td><td></td><td>cb</td><td>ccb</td><td>cbc</td></tr><tr><td></td><td></td><td></td><td></td><td>bcb</td><td>bbc</td><td>b</td><td>bddc</td><td>bdb</td><td>bdc</td><td>bdbc</td></tr><tr><td>silly</td><td>aa</td><td>aaab</td><td>aca</td><td>acab</td><td>adba</td><td>add</td><td>addc</td><td>adad</td><td>adc</td><td>adbc</td></tr><tr><td>thirsty</td><td>dbaa</td><td>dbab</td><td>dca</td><td>dcba</td><td>dbca</td><td>dda</td><td>ddac</td><td>dbad</td><td>dcad</td><td>dbacd</td></tr><tr><td>hungry</td><td>dbb</td><td>dbbd</td><td>dc</td><td>dcb</td><td>dbc</td><td>dd</td><td>ddc</td><td>dbd</td><td>dcd</td><td>dbcd</td></tr></table>
237
+
238
+ <table><tr><td>-</td><td>one</td><td>they</td><td>you</td><td>yall</td><td>yup</td><td>me</td><td>we</td><td>mip</td><td>yumi</td><td>all</td></tr><tr><td>tired</td><td>cda</td><td>cdab</td><td>cdc</td><td>cdcb</td><td>cdba</td><td>cd</td><td>cdd</td><td>cddb</td><td>cdcd</td><td>cdb</td></tr><tr><td>scared</td><td>caa</td><td>caab</td><td>cac</td><td>cacb</td><td>caba</td><td>ca</td><td>cad</td><td>cadb</td><td>cacd</td><td>cab</td></tr><tr><td>sick</td><td>daa</td><td>daab</td><td>dac</td><td>dacb</td><td>daba</td><td>da</td><td>dad</td><td>dadb</td><td>dacd</td><td>dab</td></tr><tr><td>happy</td><td>baa</td><td>baab</td><td>bca</td><td>bcab</td><td>baac</td><td>ba</td><td>badc</td><td>bab</td><td>bac</td><td>babc</td></tr><tr><td>sad excited</td><td>aba</td><td>abab</td><td>ac</td><td>acb</td><td>abac</td><td>a</td><td>abdc</td><td>abb</td><td>abc</td><td>abbc</td></tr><tr><td></td><td>cba</td><td>cbab</td><td>cca</td><td>cacb</td><td>cbca</td><td>C</td><td>ccdc</td><td>cb</td><td>ccb</td><td>cbc</td></tr><tr><td>angry</td><td>cb</td><td>cbb</td><td>CC</td><td>ccb</td><td>cbc</td><td>C</td><td>cddc</td><td>cdb</td><td>cdc</td><td>cdbc</td></tr><tr><td>silly</td><td>(aa)</td><td>(aaab)</td><td>(aca)</td><td>(acab)</td><td>adba</td><td>add</td><td>addc</td><td>adad</td><td>adc</td><td>adbc</td></tr><tr><td>thirsty</td><td>dbaa</td><td>dbab</td><td>dca</td><td>dcba</td><td>dbca</td><td>dda</td><td>ddac</td><td>dbad</td><td>dcad</td><td>dbacd</td></tr><tr><td>hungry</td><td>dbb</td><td>dbbd</td><td>dc</td><td>dcb</td><td>dbc</td><td>dd</td><td>ddc</td><td>dbd</td><td>dcd</td><td>dbcd</td></tr></table>
239
+
240
+ Table 6: (Top) Messages used by a majority of the population for each of the given meanings. (Bottom) A potential analysis of the system in terms of a root plus modifications. Italic symbols are used to specify predicates and roman symbols are used to specify subjects. Messages in parentheses cannot be made to fit into this analysis.
241
+
242
+ messages used for the held-out meaning vectors did not show as strong compositional patterns as the non-zero-shot case.
243
+
244
+ # B COMPARISON BETWEEN THE OBVERTER TECHINQUE AND THEREINFORCEMENT LEARNING-BASED APPROACH
245
+
246
+ The obverter technique allows us to generate messages that encourage the agents to use a shared language, even a highly structured one, via using a single RNN for both speaking and listening.
247
+
248
+ This is quite different from other RL-based related works (Lazaridou et al., 2017; Mordatch & Abbeel, 2017; Foerster et al., 2016; Jorge et al., 2016; Kottur et al., 2017) where each agent has separate components (e.g. two RNNs) for generating messages and consuming messages. This is necessary typically because the message generation module and the message consumption module have different input/output requirements. The message generation module accepts some input related to the task (e.g. goal description vector, question embedding, or image embedding) and generates discrete symbols. The message consumption module, on the other hand, accepts discrete symbols (i.e. the message) and generates some output related to the task (e.g. some prediction or some action to take). Therefore, when a neural agent speaks in the RL-based approach, its message generation process is completely separated from its own listening process, but tied to the listening process of another agent (i.e. listener)6. This means an agent may not have internal consistency; what an agent speaks may not make sense to itself. However, agents in the RL-based setting do converge on a common language because, during the training, the error signal flows from the listener to the speaker directly.
249
+
250
+ Obverter approach, on the other hand, requires that each agent has a single component for both message generation and message consumption. This single component accepts discrete symbols and generates some output related to the task. This guarantees internal consistency because an agent’s message generation process is tied to its own message consumption process; it will only generate messages that make sense to itself. In the obverter setting, the error signal does not flow between agents directly, but agents converge on a common language by taking turns to be the listener; the listener tries to understand what the speaker says, so that when the listener becomes the speaker, it can generate messages that make sense to itself and, at the same time, will be understood by the former speaker (now listener).
251
+
252
+ The advantage of obverter approach over RL-based approach is that it is motivated by the theory of mind and more resembles the acquisition/development process of human language. Having a single mechanism for both speaking and listening, and training oneself to be a good listener leads to the emergence of self-consistent, shared language. However, obverter technique requires that all agents perform the same task, which means all agents must have identical model architectures. This is because, during the message generation process, the speaker internally simulates what the listener will go though when it hears the message. Therefore we cannot play an asymmetrical game such as where the speaker sees only one image and generates a message but the listener is given multiple images and must choose one after hearing the message. RL-based approaches do not have this problem since there are separate modules for speaking and listening.
253
+
254
+ We believe obverter technique could be the better choice for certain tasks regarding human mind emulation. But it certainly is not the tool for every occasion. The RL-based approach is a robust tool for any general task that may or may not involve human-like communication. We conclude this section with a possible future research direction that combines the strengths of both approaches to enable communication in more interesting and complicated tasks.
255
+
256
+ # C MODEL ARCHITECTURE DETAILS
257
+
258
+ We used TensorFlow and the Sonnet library for all implementation.
259
+
260
+ # C.1 VISUAL MODULE
261
+
262
+ We used an eight-layer convolutional neural network. We used 32 filters with the kernel size 3 for every layer. The strides were $[ 2 , 1 , 1 , 2 , 1 , 2 , 1 , 2 ]$ for each layer. We used rectified linear unit (ReLU) as the activation function for every layer. Batch normalization was used for every layer. We did not use the bias parameters since we used Batch normalization. For padding, we used the TensorFlow VALID padding option for every layer. The fully connected layer that follows the convolutional neural network was of 256 dimensions, with ReLU as the activation function.
263
+
264
+ # C.2 LANGUAGE MODULE
265
+
266
+ We used a single layer Gated Recurrent Units (GRU) to implement the language module. The size of the hidden layer was 64.
267
+
268
+ # C.3 DECISION MODULE
269
+
270
+ We used a two-layer feedforward neural network. The first layer reduces the dimensionality to 128 with ReLU as the activation function, then the second layer generates a scalar value with sigmoid as the activation function.
271
+
272
+ # D MESSAGE GENERATION ALGORITHM USED IN OUR WORK
273
+
274
+ # E TRAINING DETAILS
275
+
276
+ Both agents’ model parameters are randomly initialized. The training process consists of rounds where teacher/learner roles are changed, and each round consists of multiple games where learner’s model parameters are updated. In each game, the teacher, given a mini-batch of images, generates corresponding messages. The learner, given a separate mini-batch of images and the messages from the teacher, decides whether it is seeing the same object type as the teacher. Learner’s model parameters are updated to minimize the cross entropy loss. After playing a predefined number of games, we move on to the next round where two agents change their roles.
277
+
278
+ 1 $\mathbf { h } ^ { ( 0 ) } = \mathbf { 0 }$ //Initialize GRU hidden layer with zeros;
279
+ 2 $\mathbf { s } = \left[ \mathbf { \epsilon } \right]$ //Initialize the message vector;
280
+ 3 $t = 0$ //Timestep index;
281
+ 4 $\mathbf { V } = \mathbf { I } \in \mathbb { R } ^ { 5 \times 5 }$ //Each row $\mathbf { v } _ { 0 } , \mathbf { v } _ { 1 } , \mathbf { v } _ { 2 } , \mathbf { v } _ { 3 } , \mathbf { v } _ { 4 }$ corresponds to $a , b , c , d , e$ ;
282
+ 5 $\mathbf { x } =$ image;
283
+ 6 $\mathbf { z } = V i s u a l M o d u l e ( \mathbf { x } )$ ;
284
+ 7 while $| \mathbf { s } | < m a x$ message length do
285
+ 8 $\mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) } = G R U ( \mathbf { v } _ { i } , \mathbf { h } ^ { ( t - 1 ) } )$ ;
286
+ 9 $\mathbf { h } ^ { ( t ) } = \mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) }$ $i = \mathrm { a r g m a x } _ { i }$ DecisionModule $( [ \mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) } , \mathbf { z } ] )$ ;
287
+ 11 Append $i$ to s;
288
+ 12 if DecisionModule $( [ \mathbf { h } _ { \mathbf { v } _ { i } } ^ { ( t ) } , \mathbf { z } ] ) >$ threshold then
289
+ 13 Terminate;
290
+
291
+ We found twenty games per round, with fifty images per mini-batch to work well. We repeat the rounds for 20, 000 times. Further rounds did not improve the results, or even degraded the performance. For vocabulary size (i.e. number of unique symbols) and the maximum message length, we used 5 and 20 respectively, similar to what Batali (1998) used. Note that when generating a message using the obverter technique, the generation process stops as soon as the speaker’s (i.e. teacher) output $\hat { y }$ becomes bigger than some threshold. In our work, we experimented with various values from 0.5 to 0.95, and found higher values to work better than lower values. We used 0.95 for all our final experiments.
292
+
293
+ # F COMMUNICATION ACCURACY FOR EACH OBJECT TYPE
294
+
295
+ Algorithm 2: Message generation process used in our work.
296
+ Table 7: Accuracy when each object type is given to the speaker.
297
+
298
+ <table><tr><td>■</td><td>Box</td><td>Sphere</td><td>Cylinder</td><td>Capsule</td><td>Ellipsoid</td></tr><tr><td>Blue</td><td>97.75</td><td>97.00</td><td>95.00</td><td>93.75</td><td>93.50</td></tr><tr><td>Red</td><td>95.50</td><td>93.00</td><td>95.75</td><td>95.25</td><td>97.00</td></tr><tr><td>White</td><td>95.25</td><td>96.25</td><td>93.50</td><td>94.50</td><td>97.00</td></tr><tr><td>Gray</td><td>93.00</td><td>95.00</td><td>94.25</td><td>96.75</td><td>97.25</td></tr><tr><td>Yellow</td><td>98.00</td><td>95.00</td><td>95.50</td><td>94.25</td><td>94.25</td></tr><tr><td>Green</td><td>96.00</td><td>93.50</td><td>95.00</td><td>94.50</td><td>95.25</td></tr><tr><td>Cyan</td><td>97.50</td><td>94.50</td><td>97.00</td><td>94.00</td><td>94.75</td></tr><tr><td>Magenta</td><td>95.25</td><td>96.75</td><td>94.75</td><td>94.50</td><td>95.25</td></tr></table>
299
+
300
+ We conducted a separate test with the agents from round 16, 760 to assess the communication accuracy for each object type. The agents were given 1, 600 total object pairs $( 4 0 \times 4 0 )$ . Each object pair was tested 10 times, where after 5 times the agents switched speaker/listener roles. The average accuracy was $9 5 . 4 \%$ , and only 88 out of 1, 600 object pairs were communicated with accuracy lower than 0.8.
301
+
302
+ Table 7 describes the accuracy when each object type was given to the speaker. We can observe that the accuracy is higher for objects that are described with less overlapping messages. For example, yellow box is communicated with the accuracy of $9 8 \%$ , and it is described with aaaaaa, which is not used for any other object types. Gray box, on the other hand, is communicated with accuracy $9 3 \%$ . It is described with aaa, which is also used for yellow capsule and green sphere, both of which are communicated with low accuracies as well.
303
+
304
+ ![](images/a3223aef4b5cd4670d5f3f12325fbeb3c69cf08d9078f75c33cd75f24d8f0912.jpg)
305
+ Figure 5: Ten communication examples when the speaker is given a blue box. Five examples on the left show when the listener is given blue objects. Five examples on the right show when the listener is given objects of different colors.
306
+
307
+ # G COMMUNICATION EXAMPLE AND ANALYSIS
308
+
309
+ Figure 5 provides ten examples of communication when the speaker is given a blue box and the listener is given various object types. The listener’s belief (i.e. score) that it is seeing the same image as the speaker changes each time it consumes a symbol. It is notable that most of the time the score jumps between 0 and 1, rather than gradually changing in between. This is natural given that messages that differ by only a single character can mean different objects (e.g. blue box and blue cylinder). This phenomenon can also be seen in human language. For example, blue can and blue cat differ by a single alphabet, but the semantics are completely different.
310
+
311
+ Object types that are described by similar messages as blue box, such as blue cylinder and magenta box cause marginal confusion to the listener such that prediction scores for both objects are not complete zeros. There are also cases where two completely different objects are described by the same message as mentioned in Section 3.1. From Table 2 we can see that blue box and cyan cylinder are described by the same message $b b b b b b \{ b , d \}$ , although the messages were composed using different rules. Therefore the listener generates high scores for both objects, occasionally losing the game when the agents are given this specific object pair (1 out of 40 chance). This can be seen as a side effect coming from the principle of least effort which motivates the agents to win the game most of the time while minimizing the effort to generate messages.
312
+
313
+ # H VISUALIZATION OF IMAGE EMBEDDINGS
314
+
315
+ Section 3.2 provides strong evidence that the agents are properly recognizing the color and shape of an object. In this section, we study the visual module of both agents to study how they are processing the pixel input. We give each agent 1600 images, 40 per object type, and take their image embeddings (output of the fully-connected layer in the visual module). We use t-SNE (Maaten & Hinton, 2008) to reduce the dimensionality to 2D, and generate scatter plots as shown by Figure 6. The top row and the bottom row are the same scatter plots, but the dots are colored with different labels; the top row shows the color of each object, and the bottom row shows the shape of each object.
316
+
317
+ ![](images/2bfef7d4a774b0f9d6527840974612b010564b9945e307d3641516c2479550bc.jpg)
318
+ Figure 6: Scatter plots of the image embedding from the agents’ visual module. T-SNE was used to reduce the dimension to 2D.
319
+
320
+ It is notable that the image embeddings form clear clusters, and all clusters are quite disentangled from one another. This means that the agents have learned to differentiate objects by their color and shape, and each color and shape have a specific place in the agents’ mind. It is also impressive that not only both agents learned similar relationships between colors and shapes(Figure 6 (a) and (b) show similar clusters, as do (d) and (e)), but also they learned similar absolute values for colors and shapes. Even when we plot image embeddings from both agents together (Figure 6 (c) and (f)) the cluster qualities are kept almost identical (with slightly higher number of clusters) to when we plot them separately. Therefore when one agent thinks of color red, and utters a message to describe it, the other agent hears the message and think of something red as well. This is, of course, what we wanted to achieve by using the obverter technique.
321
+
322
+ The fact that a couple of color or shapes are occasionally in the same cluster suggests the agents have not perfectly disentangled colors and shapes. For perfect disentanglement, we believe some modifications to the image description game is required, which can be an important topic for future work. However, studying the cluster sheds some light on why the agents generate specific messages for each object type. For example, in Figure 6 (a) and (b), blue, white, cyan and magenta are often intertwined or their respective clusters are located nearby, as is the case for red, gray, yellow and green. This suggests the reason agents use prefix $^ b$ ’s to specify shapes for former color group and prefix a’s to specify shapes for the latter color group. Additionally, in Figure 6 (d) and (e), Box and cylinder are often located nearby, and sphere and ellipsoid show similar behavior7. We conjecture that this is the reason the messages describing box and cylinder are similarly long, and the messages describing sphere and ellipsoid tend to be similarly short.
323
+
324
+ I ORIGINAL MESSAGES FROM THE ZERO-SHOT TEST
325
+ Table 8: Messages most often used by the two agents when speaking about a given object. Shaded cells indicate the objects not seen during the training. Brackets indicate the variation often seen at the last character.
326
+
327
+ <table><tr><td>■</td><td>Box</td><td>Sphere</td><td>Cylinder</td><td>Capsule</td><td>Ellipsoid</td></tr><tr><td>Blue Red</td><td>eeeeeee{e,ee}</td><td>eeeeee</td><td>eeeeee{e,ed}</td><td>eeee{e,ed}</td><td>eee{e,a}</td></tr><tr><td>White</td><td>ee{e,a} bbbbb</td><td>e,ea</td><td>e{e,a}</td><td>b,ba</td><td>a,c</td></tr><tr><td></td><td></td><td>bb e,ea</td><td>bbb{b,d}</td><td>bb{b,d}</td><td>bbb{d.c}</td></tr><tr><td>Gray</td><td>eeee</td><td>e{e,ec}</td><td>ee{e,a} b{c,d}</td><td>e,a</td><td>b,d</td></tr><tr><td>Yellow</td><td>bb{c.d}</td><td>eeee{e,a}</td><td>eeeee{e,a}</td><td>a,c</td><td>a,e</td></tr><tr><td>Green</td><td>eeeeee{e,a}</td><td></td><td></td><td>eee{e,a}</td><td>ee{e,a}</td></tr><tr><td>Cyan</td><td>eeeeeeeeea,a×20</td><td>eeeeee{e,a}</td><td>eeeeeee{e,ea}</td><td>eeeee{e,a}</td><td>eeeea</td></tr><tr><td>Magenta</td><td>bbb{b,d}</td><td>c,d</td><td>bb{b,d}</td><td>bb</td><td>b{c.a}</td></tr></table>
328
+
329
+ J COMMUNICATION ACCURACY FOR EACH OBJECT TYPE IN ZERO-SHOT TEST
330
+ Table 9: Accuracy when each object type is given to the speaker. Shaded cells indicate the objects not seen during the training.
331
+
332
+ <table><tr><td></td><td rowspan=1 colspan=1>■</td><td rowspan=1 colspan=1>Box</td><td rowspan=1 colspan=1>Sphere</td><td rowspan=1 colspan=1>Cylinder</td><td rowspan=1 colspan=1>Capsule</td><td rowspan=1 colspan=1>Ellipsoid</td></tr><tr><td></td><td rowspan=1 colspan=1>Blue</td><td rowspan=1 colspan=1>96.75</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>94.75</td><td rowspan=1 colspan=1>95.75</td><td rowspan=1 colspan=1>96.50</td></tr><tr><td></td><td rowspan=2 colspan=1>RedWhite</td><td rowspan=1 colspan=1>94.25</td><td rowspan=1 colspan=1>90.00</td><td rowspan=1 colspan=1>94.25</td><td rowspan=1 colspan=1>96.75</td><td rowspan=3 colspan=1>91.2595.7596.00</td></tr><tr><td></td><td rowspan=1 colspan=1>99.00</td><td rowspan=1 colspan=1>96.00</td><td rowspan=1 colspan=1>95.75</td><td rowspan=1 colspan=1>97.25</td></tr><tr><td></td><td rowspan=2 colspan=1>GrayYellow</td><td rowspan=2 colspan=1>93.5098.75</td><td rowspan=1 colspan=1>91.00</td><td rowspan=1 colspan=1>94.75</td><td rowspan=1 colspan=1>91.50</td></tr><tr><td></td><td rowspan=1 colspan=1>94.75</td><td rowspan=1 colspan=1>95.75</td><td rowspan=1 colspan=1>92.00</td><td rowspan=1 colspan=1>91.50</td></tr><tr><td></td><td rowspan=1 colspan=1>Green</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>94.50</td></tr><tr><td rowspan=2 colspan=2>CyanMagenta</td><td rowspan=1 colspan=1>Cyan</td><td rowspan=1 colspan=1>92.00</td><td rowspan=1 colspan=1>95.00</td><td rowspan=1 colspan=1>97.50</td><td rowspan=1 colspan=1>95.00</td></tr><tr><td rowspan=1 colspan=1>95.25</td><td rowspan=1 colspan=1>96.00</td><td rowspan=1 colspan=1>97.00</td><td rowspan=1 colspan=1>96.00</td><td rowspan=1 colspan=1>95.75</td></tr></table>
333
+
334
+ In the same manner as Appendix F, we conducted a separate test with the agents from round 19, 980 to assess the communication accuracy for each object type. The agents were given 1, 600 total object pairs $( 4 0 \times 4 0 )$ . Each object pair was tested 10 times, where after 5 times the agents switched speaker/listener roles. The average accuracy was $9 4 . 7 3 \%$ , and 103 out of 1, 600 object pairs were communicated with accuracy lower than 0.8.
335
+
336
+ Table 9 describes the accuracy when each object type was given the speaker. Shaded cells indicate objects not seen during the training. Here we can observe the same tendency as the one seen in Appendix F; the accuracy is higher for objects that are described with less overlapping messages.
337
+
338
+ # K AN EXAMPLE OF USING NEGATION TO PASS A ZERO-SHOT TEST
339
+
340
+ Lets assume agent0 is aware of red circle, blue square and green triangle. If agent0 came upon a blue circle for the first time and had to describe it to agent1, the efficient way would be to say blue circle. But it could also say blue not square not triangle. If agent1 had a similar knowledge as agent0 did, then both agents would have a successful communication. However, it is debatable whether saying blue not square not triangle is as compositional as blue circle.
md/train/rkxacs0qY7/rkxacs0qY7.md ADDED
@@ -0,0 +1,689 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FUNCTIONAL VARIATIONAL BAYESIAN NEURAL NETWORKS
2
+
3
+ Shengyang $\mathbf { S u n ^ { * \dagger } }$ , Guodong Zhang∗†, Jiaxin $\mathbf { S h i ^ { * \dagger } }$ , Roger Grosse†
4
+ †University of Toronto, †Vector Institute, ‡Tsinghua University
5
+ {ssy, gdzhang, rgrosse}@cs.toronto.edu, shijx15@mails.tsinghua.edu.cn
6
+
7
+ # ABSTRACT
8
+
9
+ Variational Bayesian neural networks (BNNs) perform variational inference over weights, but it is difficult to specify meaningful priors and approximate posteriors in a high-dimensional weight space. We introduce functional variational Bayesian neural networks (fBNNs), which maximize an Evidence Lower BOund (ELBO) defined directly on stochastic processes, i.e. distributions over functions. We prove that the KL divergence between stochastic processes equals the supremum of marginal KL divergences over all finite sets of inputs. Based on this, we introduce a practical training objective which approximates the functional ELBO using finite measurement sets and the spectral Stein gradient estimator. With fBNNs, we can specify priors entailing rich structures, including Gaussian processes and implicit stochastic processes. Empirically, we find fBNNs extrapolate well using various structured priors, provide reliable uncertainty estimates, and scale to large datasets.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Bayesian neural networks (BNNs) (Hinton & Van Camp, 1993; Neal, 1995) have the potential to combine the scalability, flexibility, and predictive performance of neural networks with principled Bayesian uncertainty modelling. However, the practical effectiveness of BNNs is limited by our ability to specify meaningful prior distributions and by the intractability of posterior inference. Choosing a meaningful prior distribution over network weights is difficult because the weights have a complicated relationship to the function computed by the network. Stochastic variational inference is appealing because the update rules resemble ordinary backprop (Graves, 2011; Blundell et al., 2015), but fitting accurate posterior distributions is difficult due to strong and complicated posterior dependencies (Louizos & Welling, 2016; Zhang et al., 2018; Shi et al., 2018a).
14
+
15
+ In a classic result, Neal (1995) showed that under certain assumptions, as the width of a shallow BNN was increased, the limiting distribution is a Gaussian process (GP). Lee et al. (2018) recently extended this result to deep BNNs. Deep Gaussian Processes (DGP) (Cutajar et al., 2017; Salimbeni & Deisenroth, 2017) have close connections to BNNs due to similar deep structures. However, the relationship of finite BNNs to GPs is unclear, and practical variational BNN approximations fail to match the predictions of the corresponding GP. Furthermore, because the previous analyses related specific BNN architectures to specific GP kernels, it’s not clear how to design BNN architectures for a given kernel. Given the rich variety of structural assumptions that GP kernels can represent (Rasmussen & Williams, 2006; Lloyd et al., 2014; Sun et al., 2018), there remains a significant gap in expressive power between BNNs and GPs (not to mention stochastic processes more broadly).
16
+
17
+ In this paper, we perform variational inference directly on the distribution of functions. Specifically, we introduce functional variational BNNs (fBNNs), where a BNN is trained to produce a distribution of functions with small KL divergence to the true posterior over functions. We prove that the KL divergence between stochastic processes can be expressed as the supremum of marginal KL divergences at finite sets of points. Based on this, we present functional ELBO (fELBO) training objective. Then we introduce a GAN-like minimax formulation and a sampling-based approximation for functional variational inference. To approximate the marginal KL divergence gradients, we adopt the recently proposed spectral Stein gradient estimator (SSGE) (Shi et al., 2018b).
18
+
19
+ ![](images/e2a9c9f47e26b4abb7c4b2c6b1c8a9d761ceef7f8d84833f66e8e46a95434419.jpg)
20
+ Figure 1: Predictions on the toy funcction $y = x ^ { 3 }$ . Here $a \times b$ represents $a$ hidden layers of $b$ units. Red dots are 20 training points. The blue curve is the mean of final prediction, and the shaded areas represent standard derivations. We compare fBNNs and Bayes-by-Backprop (BBB). For BBB, which performs weight-space inference, varying the network size leads to drastically different predictions. For fBNNs, which perform functionspace inference, we observe consistent predictions for the larger networks. Note that the $1 \times 1 0 0$ factorized Gaussian fBNNs network is not expressive enough to generate diverse predictions.
21
+
22
+ Our fBNNs make it possible to specify stochastic process priors which encode richly structured dependencies between function values. This includes stochastic processes with explicit densities, such as GPs which can model various structures like smoothness and periodicity (Lloyd et al., 2014; Sun et al., 2018). We can also use stochastic processes with implicit densities, such as distributions over piecewise linear or piecewise constant functions. Furthermore, in contrast with GPs, fBNNs efficiently yield explicit posterior samples of the function. This enables fBNNs to be used in settings that require explicit minimization of sampled functions, such as Thompson sampling (Thompson, 1933; Russo & Van Roy, 2016) or predictive entropy search (Hernández-Lobato et al., 2014; Wang & Jegelka, 2017).
23
+
24
+ One desideratum of Bayesian models is that they behave gracefully as their capacity is increased (Rasmussen & Ghahramani, 2001). Unfortunately, ordinary BNNs don’t meet this basic requirement: unless the asymptotic regime is chosen very carefully (e.g. Neal (1995)), BNN priors may have undesirable behaviors as more units or layers are added. Furthermore, larger BNNs entail more difficult posterior inference and larger description length for the posterior, causing degeneracy for large networks, as shown in Figure 1. In contrast, the prior of fBNNs is defined directly over the space of functions, thus the BNN can be made arbitrarily large without changing the functional variational inference problem. Hence, the predictions behave well as the capacity increases.
25
+
26
+ Empirically, we demonstrate that fBNNs generate sensible extrapolations for both explicit periodic priors and implicit piecewise priors. We show fBNNs outperform competing approaches on both small scale and large scale regression datasets. fBNNs’ reliable uncertainty estimates enable state-of-art performance on the contextual bandits benchmark of Riquelme et al. (2018).
27
+
28
+ # 2 BACKGROUND
29
+
30
+ # 2.1 VARIATIONAL INFERENCE FOR BAYESIAN NEURAL NETWORKS
31
+
32
+ Given a dataset $\mathbf { \mathcal { D } } = \{ ( \mathbf { x } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ , a Bayesian neural network (BNN) is defined in terms of a prior $p ( \mathbf { w } )$ on the weights, as well as the likelihood $p ( \mathcal { D } | \mathbf { w } )$ . Variational Bayesian methods (Hinton $\&$ Van Camp, 1993; Graves, 2011; Blundell et al., 2015) attempt to fit an approximate posterior $q ( \mathbf { w } )$ to maximize the evidence lower bound (ELBO):
33
+
34
+ $$
35
+ \mathcal { L } _ { q } = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | \mathbf { w } ) ] - \mathrm { K L } [ q ( \mathbf { w } ) | | p ( \mathbf { w } ) ] .
36
+ $$
37
+
38
+ The most commonly used variational BNN training method is Bayes By Backprop (BBB) (Blundell et al., 2015), which uses a fully factorized Gaussian approximation to the posterior, i.e. $q ( \mathbf { w } ) =$ $\mathcal { N } ( \mathbf { w } ; \pmb { \mu } , \mathrm { d i a g } ( \pmb { \sigma } ^ { 2 } ) )$ . Using the reparameterization trick (Kingma & Welling, 2013), the gradients of ELBO towards $\mu , \sigma$ can be computed by backpropagation, and then be used for updates.
39
+
40
+ Most commonly, the prior $p ( \mathbf { w } )$ is chosen for computational convenience; for instance, independent Gaussian or Gaussian mixture distributions. Other priors, including log-uniform priors (Kingma et al., 2015; Louizos et al., 2017) and horseshoe priors (Ghosh et al., 2018; Louizos et al., 2017), were proposed for specific purposes such as model compression and model selection. But the relationships of weight-space priors to the functions computed by networks are difficult to characterize.
41
+
42
+ # 2.2 STOCHASTIC PROCESSES
43
+
44
+ A stochastic process (Lamperti, 2012) $F$ is typically defined as a collection of random variables, on a probability space $( \Omega , { \mathcal { F } } , P )$ . The random variables, indexed by some set $\mathcal { X }$ , all take values in the same mathematical space $\mathcal { V }$ . In other words, given a probability space $( \Omega , \Sigma , P )$ , a stochastic process can be simply written as $\{ F ( \mathbf { x } ) : \mathbf { x } \in \mathcal { X } \}$ . For any point $\omega \in \Omega$ , $F ( \cdot , \omega )$ is a sample function mapping index space $\mathcal { X }$ to space $\mathcal { V }$ , which we denote as $f$ for notational simplicity.
45
+
46
+ For any finite index set $\mathbf { x } _ { 1 : n } = \{ { \mathbf { x } } _ { 1 } , . . . , { \mathbf { x } } _ { n } \}$ , we can define the finite-dimensional marginal joint distribution over function values $\{ F ( \mathbf { x } _ { 1 } ) , \dot { \mathbf { \Omega } } \cdot \cdot \cdot \mathbf { \Omega } , F ( \mathbf { x } _ { n } ) \}$ . For example, Gaussian Processes have marginal distributions as multivariate Gaussians.
47
+
48
+ The Kolmogorov Extension Theorem (Øksendal, 2003) shows that a stochastic process can be characterized by marginals over all finite index sets. Specifically, for a collection of joint distributions $\rho _ { \mathbf { x } _ { 1 : n } }$ , we can define a stochastic process $F$ such that for all $\mathbf { x } _ { 1 : n } , \ \rho _ { \mathbf { x } _ { 1 : n } }$ is the marginal joint distribution of $F$ at $\mathbf { x } _ { 1 : n }$ , as long as $\rho$ satisfies the following two conditions:
49
+
50
+ Exchangeability. For any permutation $\pi$ of $\{ 1 , \cdots , n \}$ $\cdot \cdot , n \} , \rho _ { \pi ( \mathbf { x } _ { 1 : n } ) } ( \pi ( y _ { 1 : n } ) ) = \rho _ { \mathbf { x } _ { 1 : n } } ( y _ { 1 : n } ) .$
51
+
52
+ # 2.3 SPECTRAL STEIN GRADIENT ESTIMATOR (SSGE)
53
+
54
+ When applying Bayesian methods to modern probabilistic models, especially those with neural networks as components (e.g., BNNs and deep generative models), it is often the case that we have to deal with intractable densities. Examples include the marginal distribution of a non-conjugate model (e.g., the output distribution of a BNN), and neural samplers such as GANs (Goodfellow et al., 2014). A shared property of these distributions is that they are defined through a tractable sampling process, despite the intractable density. Such distributions are called implicit distributions (Huszár, 2017).
55
+
56
+ The Spectral Stein Gradient Estimator (SSGE) (Shi et al., 2018b) is a recently proposed method for estimating the log density derivative function of an implicit distribution, only requiring samples from the distribution. Specifically, given a continuous differentiable density $q ( \mathbf { x } )$ , and a positive definite kernel $k ( \mathbf { x } , \mathbf { x } ^ { \prime } )$ in the Stein class (Liu et al., 2016) of $q$ , they show
57
+
58
+ $$
59
+ \nabla _ { x _ { i } } \log { q ( \mathbf { x } ) } = - \sum _ { j = 1 } ^ { \infty } \Big [ \mathbb { E } _ { q } \nabla _ { x _ { i } } \psi _ { j } ( \mathbf { x } ) \Big ] \psi _ { j } ( \mathbf { x } ) ,
60
+ $$
61
+
62
+ where $\{ \psi _ { j } \} _ { j \ge 1 }$ is a series of eigenfunctions of $k$ given by Mercer’s theorem: $k ( \mathbf { x } , \mathbf { x } ^ { \prime } ) ~ =$ $\begin{array} { r } { \sum _ { j } \mu _ { j } \psi _ { j } ( \mathbf { x } ) \bar { \psi } _ { j } ( \mathbf { x } ^ { \prime } ) } \end{array}$ . The Nyström method (Baker, 1997; Williams & Seeger, 2001) is used to approximate the eigenfunctions $\psi _ { j } ( \mathbf { x } )$ and their derivatives. The final estimator is given by truncating the sum in Equation (2) and replacing the expectation by Monte Carlo estimates.
63
+
64
+ # 3 FUNCTIONAL VARIATIONAL BAYESIAN NEURAL NETWORKS
65
+
66
+ # 3.1 FUNCTIONAL EVIDENCE LOWER BOUND (fELBO)
67
+
68
+ We introduce function space variational inference analogously to weight space variational inference (see Section 2.1), except that the distributions are over functions rather than weights. We assume a stochastic process prior $p$ over functions $f : \mathcal { X } \mathcal { Y }$ . This could be a GP, but we also allow stochastic processes without closed-form marginal densities, such as distributions over piecewise linear functions. For the variational posterior $q _ { \phi } \in \mathcal { Q }$ , we consider a neural network architecture with stochastic weights and/or stochastic inputs. Specifically, we sample a function from $q$ by sampling a random noise vector $\xi$ and defining $f ( { \bf x } ) { \bar { \bf \phi } } = g _ { \phi } ( { \bf x } , \xi )$ for some function $g _ { \phi }$ . For example, standard weight space BNNs with factorial Gaussian posteriors can be viewed this way using the reparameterization trick (Kingma & Welling, 2013; Blundell et al., 2015). (In this case, $\phi$ corresponds to the means and variances of all the weights.) Note that because a single vector $\xi$ is shared among all input locations, it corresponds to randomness in the function, rather than observation noise; hence, the sampling of $\xi$ corresponds to epistemic, rather than aleatoric, uncertainty (Depeweg et al., 2017).
69
+
70
+ Functional variational inference maximizes the functional ELBO (fELBO), akin to the weight space ELBO in Equation (1), except that the distributions are over functions rather than weights.
71
+
72
+ $$
73
+ \mathcal { L } ( q ) : = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | f ) ] - \mathrm { K L } [ q | | p ] .
74
+ $$
75
+
76
+ Here $\mathrm { K L } [ q \| p ]$ is the KL divergence between two stochastic processes. As pointed out in Matthews et al. (2016), it does not have a convenient form as g q(f)p(f) q(f )df due to there is no infinitedimensional Lebesgue measure (Eldredge, 2016). Since the KL divergence between stochastic processes is difficult to work with, we reduce it to a more familiar object: KL divergence between the marginal distributions of function values at finite sets of points, which we term measurement sets. Specifically, let $\mathbf { X } \in { \mathcal { X } } ^ { n }$ denote a finite measurement set and $P _ { \mathbf { X } }$ the marginal distribution of function values at $\mathbf { X }$ . We equate the function space KL divergence to the supremum of marginal KL divergences over all finite measurement sets:
77
+
78
+ Theorem 1. For two stochastic processes $P$ and $Q$ ,
79
+
80
+ $$
81
+ \mathrm { K L } [ P \| Q ] = \operatorname* { s u p } _ { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } \mathrm { K L } [ P _ { \mathbf { X } } \| Q _ { \mathbf { X } } ] .
82
+ $$
83
+
84
+ Roughly speaking, this result follows because the $\sigma$ -algebra constructed with the Kolmogorov Extension Theorem (Section 2.2) is generated by cylinder sets which depend only on finite sets of points. A full proof is given in Appendix A.
85
+
86
+ fELBO. Using this characterization of the functional $\mathrm { K L }$ divergence, we rewrite the fELBO:
87
+
88
+ $$
89
+ \begin{array} { r l } & { \mathcal { L } ( q ) = \mathbb { E } _ { q } [ \log p ( \mathcal { D } | f ) ] - \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { s u p } } \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) | | p ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad \quad = \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { i n f } } \ \underset { ( \mathbf { x } _ { i } , y _ { i } ) \in \mathcal { D } } { \sum } \mathbb { E } _ { q } [ \log p ( y _ { i } | f ( \mathbf { x } _ { i } ) ) ] - \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) | | p ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad : = \underset { n \in \mathbb { N } , \mathbf { X } \in \mathcal { X } ^ { n } } { \operatorname* { i n f } } \mathcal { L } _ { \mathbf { X } } ( q ) . } \end{array}
90
+ $$
91
+
92
+ We also denote $\mathcal { L } _ { n } ( q ) : = \operatorname* { i n f } _ { \mathbf { X } \in \mathcal { X } ^ { n } } \mathcal { L } _ { \mathbf { X } } ( q )$ for the restriction to sets of $n$ points. This casts maximizing the fELBO as a two-player zero-sum game analogous to a generative adversarial network (GAN) (Goodfellow et al., 2014): one player chooses the stochastic network, and the adversary chooses the measurement set. Note that the infimum may not be attainable, because the size of the measurement sets is unbounded. In fact, the function space KL divergence may be infinite, for instance if the prior assigns measure zero to the set of functions representable by a neural network (Arjovsky & Bottou, 2017). Observe that GANs face the same issue: because a generator network is typically limited to a submanifold of the input domain, an ideal discriminator could discriminate real and fake images perfectly. However, by limiting the capacity of the discriminator, one obtains a useful training objective. By analogy, we obtain a well-defined and practically useful training objective by restricting the measurement sets to a fixed finite size. This is discussed further in the next section.
93
+
94
+ # 3.2 CHOOSING THE MEASUREMENT SET
95
+
96
+ As discussed above, we approximate the fELBO using finite measurement sets to have a well-defined and practical optimization objective. We now discuss how to choose the measurement sets.
97
+
98
+ Adversarial Measurement Sets. The minimax formulation of the fELBO naturally suggests a two-player zero-sum game, analogous to GANs, whereby one player chooses the stochastic network representing the posterior, and the adversary chooses the measurement set.
99
+
100
+ $$
101
+ \operatorname* { m a x } _ { q \in \mathcal { Q } } \mathcal { L } _ { m } ( q ) : = \operatorname* { m a x } _ { q \in \mathcal { Q } } \ \operatorname* { m i n } _ { \mathbf { x } \in \mathcal { X } ^ { m } } \mathcal { L } _ { \mathbf { X } } ( q ) .
102
+ $$
103
+
104
+ We adopt concurrent optimization akin to GANs (Goodfellow et al., 2014). In the inner loop, we minimize $\mathcal { L } _ { \mathbf { X } } ( q )$ with respect to $\mathbf { X }$ ; in the outer loop, we maximize $\mathcal { L } _ { \mathbf { X } } ( q )$ with respect to $q$ .
105
+
106
+ Unfortunately, this approach did not perform well in terms of generalization. The measurement set which maximizes the KL term is likely to be close to the training data, since these are the points where one has the most information about the function. But the KL term is the only part of the fELBO encouraging the network to match the prior structure. Hence, if the measurement set is close to the training data, then nothing will encourage the network to exploit the structured prior for extrapolation.
107
+
108
+ Sampling-Based Measurement Sets. Instead, we adopt a sampling-based approach. In order to use a structured prior for extrapolation, the network needs to match the prior structure both near the training data and in the regions where it must make predictions. Therefore, we sample measurement sets which include both (a) random training inputs, and (b) random points from the domain where one is interested in making predictions. We replace the minimization in Equation (6) with a sampling distribution $c$ , and then maximize the expected $\mathcal { L } _ { \mathbf { X } } ( q )$ :
109
+
110
+ $$
111
+ \operatorname* { m a x } _ { \boldsymbol { q } \in \mathcal { Q } } \mathbb { E } _ { \mathcal { D } _ { s } } \mathbb { E } _ { \mathbf { X } ^ { M } \sim c } \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D _ { s } } } ( \boldsymbol { q } ) .
112
+ $$
113
+
114
+ where $\mathbf { X } ^ { M }$ are $M$ points independently drawn from $c$
115
+
116
+ Consistency. With the restriction to finite measurement sets, one only has an upper bound on the true fELBO. Unfortunately, this means the approximation is not a lower bound on the log marginal likelihood (log-ML) $\log p ( \mathcal { D } )$ . Interestingly, if the measurement set is chosen to include all of the training inputs, then $\mathcal { L } ( q )$ is in fact a log-ML lower bound:
117
+
118
+ Theorem 2 (Lower Bound). If the measurement set $\mathbf { X }$ contains all the training inputs $\mathbf { X } ^ { D }$ , then
119
+
120
+ $$
121
+ \begin{array} { r } { \mathcal { L } _ { \mathbf { X } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( \mathbf { f } ^ { \mathbf { X } } ) \lVert p ( \mathbf { f } ^ { \mathbf { X } } | \mathcal { D } ) ] \leq \log p ( \mathcal { D } ) . } \end{array}
122
+ $$
123
+
124
+ The proof is given in Appendix B.1.
125
+
126
+ To better understand the relationship between adversarial and sampling-based inference, we consider the idealized scenario where the measurement points in both approaches include all training locations, i.e., $\mathbf { X } = \{ \mathbf { X } ^ { D } , \mathbf { X } ^ { M } \}$ . Let $\mathbf { f } ^ { M } , \mathbf { f } ^ { D }$ be the function values at $\dot { \mathbf { X } } ^ { M } , \mathbf { X } ^ { D }$ , respectively. By Theorem 2,
127
+
128
+ $$
129
+ \mathcal { L } _ { { \bf X } ^ { M } , { \bf X } ^ { D } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( { \bf f } ^ { M } , { \bf f } ^ { D } ) \| p ( { \bf f } ^ { M } , { \bf f } ^ { D } | \mathcal { D } ) ] .
130
+ $$
131
+
132
+ So maximizing $\mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } ( q )$ is equivalent to minimizing the KL divergence from the true posterior on points $\mathbf { X } ^ { M } , \mathbf { X } ^ { D }$ . Based on this, we have the following consistency theorem that helps justify the use of adversarial and sampling-based objectives with finite measurement points.
133
+
134
+ Corollary 3 (Consistency under finite measurement points). Assume that the true posterior $p ( f | \mathcal { D } )$ is a Gaussian process and the variational family $\mathcal { Q }$ is all Gaussian processes. We have the following results if $M > 1$ and $\operatorname { s u p p } ( c ) = \mathcal { X }$ :
135
+
136
+ $$
137
+ \underbrace { \underset { q \in \mathcal { Q } } { \operatorname { a r g m a x } } \left\{ \underset { \mathbf { X } ^ { M } } { \operatorname* { m i n } } \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } ( q ) \right\} } _ { A d v e r s a r i a l } = \underbrace { \underset { q \in \mathcal { Q } } { \operatorname { a r g m a x } } \left\{ \mathbb { E } _ { \mathbf { X } ^ { M } \sim \mathcal { L } _ { \mathbf { X } ^ { M } , \mathbf { X } ^ { D } } } ( q ) \right\} } _ { S a m p l i n g . B a s e d } = p ( f | \mathcal { D } ) .
138
+ $$
139
+
140
+ The proof is given in Appendix B.2. While it is usually impractical for the measurement set to contain all the training inputs, it is still reassuring that a proper lower bound can be obtained with a finite measurement set.
141
+
142
+ # 3.3 KL DIVERGENCE GRADIENTS
143
+
144
+ While the likelihood term of the fELBO is tractable, the KL divergence term remains intractable because we don’t have an explicit formula for the variational posterior density $q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } )$ . (Even if $q _ { \phi }$ is chosen to have a tractable density in weight space (Louizos $\&$ Welling, 2017), the marginal distribution over $\mathbf { f } ^ { \mathbf { X } }$ is likely intractable.) To derive an approximation, we first observe that
145
+
146
+ $$
147
+ \nabla _ { \phi } \mathrm { K L } \big [ q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) \| p ( \mathbf { f } ^ { \mathbf { X } } ) \big ] = \mathbb { E } _ { q } \left[ \nabla _ { \phi } \log q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) \right] + \mathbb { E } _ { \xi } \left[ \nabla _ { \phi } \mathbf { f } ^ { \mathbf { X } } \big ( \nabla _ { \mathbf { f } } \log q ( \mathbf { f } ^ { \mathbf { X } } ) - \mathrm { ~ ~ \xi ~ } \big ~ \right) \big ] .
148
+ $$
149
+
150
+ The first term (expected score function) in Equation (11) is zero, so we discard it.1 The Jacobian $\nabla _ { \phi } \mathbf { f } ^ { \mathbf { X } }$ can be exactly multiplied by a vector using backpropagation. Therefore, it remains to estimate the log-density derivatives $\nabla _ { \mathbf { f } } \log q ( \mathbf { f } ^ { \mathbf { X } } )$ and $\cdot$ .
151
+
152
+ The entropy derivative $\nabla _ { \mathbf { f } } \log { q ( \mathbf { f } ^ { \mathbf { X } } ) }$ is generally intractable. For priors with tractable marginal densities such as GPs (Rasmussen & Williams, $\dot { 2 0 0 6 } ) ^ { 2 }$ and Student-t Processes (Shah et al., 2014), $\nabla _ { \mathbf { f } } \log { p ( \mathbf { f } ^ { \mathbf { X } } ) }$ is tractable. However, we are also interested in implicit stochastic process priors, i.e. $\nabla _ { \mathbf { f } } \log { p ( \mathbf { f } ^ { \mathbf { X } } ) }$ is also intractable. Because the SSGE (see Section 2.3) can estimate score functions for both in-distribution and out-of-distribution samples, we use it to estimate both derivative terms in all our experiments. (We compute $\cdot$ exactly whenever it is tractable.)
153
+
154
+ # Algorithm 1 Functional Variational Bayesian Neural Networks (fBNNs)
155
+
156
+ Require: Dataset $\mathcal { D }$ , variational posterior $g ( \cdot )$ , prior $p$ (explicit or implicit), KL weight $\lambda$ .
157
+ Require: Sampling distribution $c$ for random measurement points.
158
+
159
+ 1: while $\phi$ not converged do
160
+ 2: $\mathbf { X } ^ { M } \sim c$ ; $D _ { S } \subset { \mathcal { D } }$
161
+ 3: $\mathbf { f } _ { i } = g ( [ \mathbf { X } ^ { M } , \mathbf { X } ^ { D _ { S } } ] , \xi _ { i } ; \phi ) , i = 1 \cdot \cdot \cdot k .$
162
+ 4: $\begin{array} { r } { \Delta _ { 1 } = \frac { 1 } { k } \frac { 1 } { | D _ { s } | } \sum _ { i } \sum _ { ( x , y ) } \nabla _ { \phi } \log p ( y | \mathbf { f } _ { i } ( x ) ) } \end{array}$
163
+ 5: $\Delta _ { 2 } = \mathrm { S S G E } ( p , \mathbf { f } _ { 1 : k } )$
164
+ 6: $\phi \gets \mathrm { O p t i m i z e r } ( \phi , \Delta _ { 1 } - \lambda \Delta _ { 2 } )$
165
+ 7: end while
166
+
167
+ . sample measurement points $\triangleright$ sample $k$ function values . compute log likelihood gradients $\triangleright$ estimate KL gradients $\triangleright$ update the parameters
168
+
169
+ # 3.4 THE ALGORITHM
170
+
171
+ Now we present the whole algorithm for fBNNs in Algorithm 1. In each iteration, our measurement points include a mini-batch $\mathcal { D } _ { s }$ from the training data and random points $\mathbf { X } ^ { M }$ from a distribution $c$ . We forward ${ \bf X } ^ { D _ { s } }$ and $\mathbf { X } ^ { M }$ together through the network $g ( \cdot ; \phi )$ which defines the variational posterior $q _ { \phi }$ . Then we try to maximize the following objective corresponding to fELBO:
172
+
173
+ $$
174
+ \frac { 1 } { | { \mathcal D } _ { s } | } \sum _ { ( { \bf x } , y ) \in { \mathcal D } _ { s } } \mathrm { E } _ { q _ { \phi } } \left[ \log p ( y | f ( { \bf x } ) ) \right] - \lambda \mathrm { K L } [ q ( { \bf f } ^ { { \mathcal D } _ { s } } , { \bf f } ^ { M } ) \| p ( { \bf f } ^ { { \mathcal D } _ { s } } , { \bf f } ^ { M } ) ] .
175
+ $$
176
+
177
+ Here $\lambda$ is a regularization hyperparameter. In principle, $\lambda$ should be set as $\frac { 1 } { | { \mathcal { D } } | }$ to match fELBO in Equation (5). However, because the KL in Equation (12) uses a restricted number of measurement points, it only terms a lower bound of the functional KL divergence $\mathrm { K L } [ q ( f ) | | p ( f ) ]$ , thus bigger $\lambda$ is favored to control overfitting. We used $\begin{array} { r } { \lambda = \frac { 1 } { \left| \mathcal { D } _ { s } \right| } } \end{array}$ in practice, in which case Equation (12) is a proper lower bound of $\log p ( \mathcal { D } _ { s } )$ , as shown in Theorem 2. Moreover, when using GP priors, we injected Gaussian noise on the function outputs for stability consideration (see Appendix D.1 for details).
178
+
179
+ # 4 RELATED WORK
180
+
181
+ Bayesian neural networks. Variational inference was first applied to neural networks by Peterson (1987) and Hinton & Van Camp (1993). More recently, Graves (2011) proposed a practical method for variational inference with fully factorized Gaussian posteriors which used a simple (but biased) gradient estimator. Improving on that work, Blundell et al. (2015) proposed an unbiased gradient estimator using the reparameterization trick of Kingma & Welling (2013). There has also been much work (Louizos & Welling, 2016; Sun et al., 2017; Zhang et al., 2018; Bae et al., 2018) on modelling the correlations between weights using more complex Gaussian variational posteriors. Some non-Gaussian variational posteriors have been proposed, such as multiplicative normalizing flows (Louizos & Welling, 2017) and implicit distributions (Shi et al., 2018a). Neural networks with dropout were also interpreted as BNNs (Gal & Ghahramani, 2016; Gal et al., 2017). Local reparameterization trick (Kingma et al., 2015) and Flipout (Wen et al., 2018) try to decorrelate the gradients within a mini-batch for reducing variances during training. However, all these methods place priors over the network parameters. Often, spherical Gaussian priors are placed over the weights for convenience. Other priors, including log-uniform priors (Kingma et al., 2015; Louizos et al., 2017) and horseshoe priors (Ghosh et al., 2018; Louizos et al., 2017), were proposed for specific purposes such as model compression and model selection. But the relationships of weight-space priors to the functions computed by networks are difficult to characterize.
182
+
183
+ Functional Priors. There have been other recent attempts to train BNNs in the spirit of functional priors. Flam-Shepherd et al. (2017) trained a BNN prior to mimic a GP prior, but they still required variational inference in weight space. Noise Contrastive Priors (Hafner et al., 2018) are somewhat similar in spirit to our work in that they use a random noise prior in the function space. The prior is incorporated by adding a regularization term to the weight-space ELBO, and is not rich enough to encourage extrapolation and pattern discovery. Neural Processes (NP) (Garnelo et al., 2018) try to model any conditional distribution given arbitrary data points, whose prior is specified implicitly by prior samples. However, in high dimensional spaces, conditional distributions become increasingly complicated to model. Variational Implicit Processes (VIP) (Ma et al., 2018) are, in a sense, the reverse of fBNNs: they specify BNN priors and use GPs to approximate the posterior. But the use of BNN priors means they can’t exploit richly structured GP priors or other stochastic processes.
184
+
185
+ ![](images/b8635efe5d53ddc9755238d46c6d89bd1d9092878dbabee158c30d2c37d98522.jpg)
186
+ Figure 2: Extrapolating periodic structure. Red dots denote 20 training points. The green and blue lines represent ground truth and mean prediction, respectively. Shaded areas correspond to standard deviations. We considered GP priors with two kernels: RBF (which does not model the periodic structure), and $\mathrm { P E R + R B F }$ (which does). In each case, the fBNN makes similar predictions to the exact GP. In contrast, the standard BBB (BBB-1) cannot even fit the training data, while BBB with scaling down KL by 0.001 (BBB-0.001) manages to fit training data, but fails to provide sensible extrapolations.
187
+
188
+ Scalable Gaussian Processes. Gaussian processes are difficult to apply exactly to large datasets since the computational requirements scale as $O ( N ^ { 3 } )$ time, and as $O ( \bar { N } ^ { 2 } )$ memory, where $N$ is the number of training cases. Multiple approaches have been proposed to reduce the computational complexity. However, sparse GP methods (Lázaro-Gredilla et al., 2010; Snelson & Ghahramani, 2006; Titsias, 2009; Hensman et al., 2013; 2015; Krauth et al., 2016) still suffer for very large dataset, while random feature methods (Rahimi & Recht, 2008; Le et al., 2013) and KISS-GP (Wilson & Nickisch, 2015; Izmailov et al., 2017) must be hand-tailored to a given kernel.
189
+
190
+ # 5 EXPERIMENTS
191
+
192
+ Our experiments had two main aims: (1) to test the ability of fBNNs to extrapolate using various structural motifs, including both implicit and explicit priors, and (2) to test if they perform competitively with other BNNs on standard benchmark tasks such as regression and contextual bandits.
193
+
194
+ In all of our experiments, the variational posterior is represented as a stochastic neural network with independent Gaussian distributions over the weights, i.e. $q ( \mathbf { w } ) = \mathcal { N } ( \mathbf { w } ; \pmb { \mu } , \mathrm { d i a g } ( \pmb { \sigma } ^ { 2 } ) )$ . 3 We always used the ReLU activation function unless otherwise specified. Measurement points were sampled uniformly from a rectangle containing the training inputs. More precisely, each coordinate was sampled from the interval $\begin{array} { r } { [ \bar { x } _ { \mathrm { m i n } } - \frac { d } { 2 } , x _ { \mathrm { m a x } } + \frac { d } { 2 } ] } \end{array}$ , where $x _ { \mathrm { m i n } }$ and $x _ { \mathrm { m a x } }$ are the minimum and maximum input values along that coordinate, and $d = x _ { \operatorname* { m a x } } - x _ { \operatorname* { m i n } }$ . For experiments where we used GP priors, we first fit the GP hyperparameters to maximize the marginal likelihood on subsets of the training examples, and then fixed those hyperparameters to obtain the prior for the fBNNs.
195
+
196
+ # 5.1 EXTRAPOLATION USING STRUCTURED PRIORS
197
+
198
+ Making sensible predictions outside the range of the observed data requires exploiting the underlying structure. In this section, we consider some illustrative examples where fBNNs are able to use structured priors to make sensible extrapolations. Appendix C.2 also shows the extrapolation of fBNNs for a time-series problem.
199
+
200
+ # 5.1.1 LEARNING PERIODIC STRUCTURES
201
+
202
+ Gaussian processes can model periodic structure using a periodic kernel plus a RBF kernel:
203
+
204
+ $$
205
+ k ( x , x ^ { \prime } ) = \sigma _ { 1 } ^ { 2 } \exp \left\{ - \frac { 2 \sin ^ { 2 } ( \pi | x - x ^ { \prime } | / p ) } { l _ { 1 } ^ { 2 } } \right\} + \sigma _ { 2 } ^ { 2 } \exp \left( - \frac { ( x - x ^ { \prime } ) ^ { 2 } } { 2 l _ { 2 } ^ { 2 } } \right)
206
+ $$
207
+
208
+ where $p$ is the period. In this experiment, we consider 20 inputs randomly sampled from the interval $[ - 2 , - 0 . 5 ] \cup [ 0 . 5 , 2 ] \ :$ , and targets $y$ which are noisy observations of a periodic function: $y = 2 * \sin ( 4 x ) + \epsilon$ with $\epsilon \sim \mathcal { N } ( 0 , 0 . 0 4 )$ . We compared our method with Bayes By Backprop (BBB) (Blundell et al., 2015) (with a spherical Gaussian prior on w) and Gaussian Processes. For fBNNs and GPs, we considered both a single RBF kernel (which does not capture the periodic structure) and $\mathrm { P E R + R B F }$ as in eq. (13) (which does).4
209
+
210
+ ![](images/95c2ee86077fa399ecbd42f5d2d3f2ad2b2e8f36d4ce81cd6e1bc8ac6af74242.jpg)
211
+ Figure 3: Implicit function priors and fBNN approximate posteriors. The leftmost column shows 3 prior samples. The other three columns show independent runs of the experiment. The red dots denote 40 training samples. We plot 4 posterior samples and show multiples of the predictive standard derivation as shaded areas.
212
+
213
+ As shown in Fig. 2, BBB failed to fit the training data, let alone recover the periodic pattern (since its prior does not encode any periodic structure). For this example, we view the GP with $\mathrm { P E R + R B F }$ as the gold standard, since its kernel structure is designed to model periodic functions. Reassuringly, the fBNNs made very similar predictions to the GPs with the corresponding kernels, though they predicted slightly smaller uncertainty. We emphasize that the extrapolation results from the functional prior, rather than the network architecture, which does not encode periodicity, and which is not well suited to model smooth functions due to the ReLU activation function.
214
+
215
+ # 5.1.2 IMPLICIT PRIORS
216
+
217
+ Because the KL term in the fELBO is estimated using the SSGE, an implicit variational inference algorithm (as discussed in Section 2.3), the functional prior need not have a tractable marginal density. In this section, we examine approximate posterior samples and marginals for two implicit priors: a distribution over piecewise constant functions, and a distribution over piecewise linear functions. Prior samples are shown in Figure 3; see Appendix D.2 for the precise definitions. In each run of the experiment, we first sampled a random function from the prior, and then sampled 20 points from $[ 0 , 0 . 2 ]$ and another 20 points from [0.8, 1], giving a training set of 40 data points. To make the task more difficult for the fBNN, we used the tanh activation function, which is not well suited for piecewise constant or piecewise linear functions.5
218
+
219
+ Posterior predictive samples and marginals are shown for three different runs in Figure 3. We observe that fBNNs made predictions with roughly piecewise constant or piecewise linear structure, although their posterior samples did not seem to capture the full diversity of possible explanations of the data. Even though the tanh activation function encourages smoothness, the network learned to generate functions with sharp transitions.
220
+
221
+ # 5.2 PREDICTIVE PERFORMANCE
222
+
223
+ # 5.2.1 SMALL SCALE DATASETS
224
+
225
+ Following previous work (Hernández-Lobato & Adams, 2015), we then experimented with standard regression benchmark datasets from the UCI collection (Asuncion & Newman, 2007). In particular, we only used the datasets with less than 2000 data points so that we could fit GP hyperparameters by maximizing marginal likelihood exactly. Each dataset was randomly split into training and test sets, comprising $90 \%$ and $10 \%$ of the data respectively. This splitting process was repeated 10 times to reduce variability.6
226
+
227
+ Table 1: Averaged test RMSE and log-likelihood for the regression benchmarks.
228
+
229
+ <table><tr><td></td><td></td><td>Test RMSE</td><td></td><td></td><td>Test log-likelihood</td><td></td></tr><tr><td>Dataset</td><td>BBB</td><td>Noisy K-FAC</td><td>FBNN</td><td>BBB</td><td>Noisy K-FAC</td><td>FBNN</td></tr><tr><td>Boston</td><td>3.171±0.149</td><td>2.742±0.125</td><td>2.378±0.104</td><td>-2.602±0.031</td><td>-2.446±0.029</td><td>-2.301±0.038</td></tr><tr><td>Concrete</td><td>5.678±0.087</td><td>5.019±0.127</td><td>4.935±0.180</td><td>-3.149±0.018</td><td>-3.039±0.025</td><td>-3.096±0.016</td></tr><tr><td>Energy</td><td>0.565±0.018</td><td>0.485±0.023</td><td>0.412±0.017</td><td>-1.500±0.006</td><td>-1.421±0.005</td><td>-0.684±0.020</td></tr><tr><td>Wine</td><td>0.643±0.012</td><td>0.637±0.011</td><td>0.673±0.014</td><td>-0.977±0.017</td><td>-0.969±0.014</td><td>-1.040±0.013</td></tr><tr><td>Yacht</td><td>1.174±0.086</td><td>0.979±0.077</td><td>0.607±0.068</td><td>-2.408±0.007</td><td>-2.316±0.006</td><td>-1.033±0.033</td></tr></table>
230
+
231
+ We compared our fBNNs with Bayes By Backprop (BBB) (Blundell et al., 2015) and Noisy K-FAC (Zhang et al., 2018). In accordance with Zhang et al. (2018), we report root mean square error (RMSE) and test log-likelihood. The results are shown in Table 1. On most datasets, our fBNNs outperformed both BBB and NNG, sometimes by a significant margin.
232
+
233
+ # 5.2.2 LARGE SCALE DATASETS
234
+
235
+ Observe that fBNNs are naturally scalable to large datasets because they access the data only through the expected log-likelihood term, which can be estimated stochastically. In this section, we verify this experimentally. We compared fBNNs and BBB with large scale UCI datasets, including Naval, Protein Structures, Video Transcoding (Memory, Time) and GPU kernel performance. We randomly split the datasets into $80 \%$ training, $10 \%$ validation, and $10 \%$ test. We used the validating set to select the hyperparameters and performed early stopping.
236
+
237
+ Table 2: Averaged test RMSE and log-likelihood for the regression benchmarks.
238
+
239
+ <table><tr><td></td><td></td><td colspan="2">Test RMSE</td><td colspan="2">Test log-likelihood</td></tr><tr><td>Dataset</td><td>N</td><td>BBB</td><td>FBNN</td><td>BBB</td><td>FBNN</td></tr><tr><td>Naval</td><td>11934</td><td>1.6E-4±0.000</td><td>1.2E-4±0.000</td><td>6.950±0.052</td><td>7.130±0.024</td></tr><tr><td>Protein</td><td>45730</td><td>4.331±0.033</td><td>4.326±0.019</td><td>-2.892±0.007</td><td>-2.892±0.004</td></tr><tr><td>Video Memory</td><td>68784</td><td>1.879±0.265</td><td>1.858±0.036</td><td>-1.999±0.054</td><td>-2.038±0.021</td></tr><tr><td>Video Time</td><td>68784</td><td>3.632±1.974</td><td>3.007±0.127</td><td>-2.390±0.040</td><td>-2.471±0.018</td></tr><tr><td>GPU</td><td>241600</td><td>21.886±0.673</td><td>19.50±0.171</td><td>-4.505±0.031</td><td>-4.400±0.009</td></tr></table>
240
+
241
+ Both methods were trained for 80,000 iterations.7 We used 1 hidden layer with 100 hidden units for all datasets. For the prior of fBNNs, we used a GP with Neural Kernel Network (NKN) kernels as used in Sun et al. (2018). We note that GP hyperparameters were fit using mini-batches of size 1000 with 10000 iterations. In each iteration, measurement sets consist of 500 training samples and 5 or 50 points from the sampling distribution $c$ , tuned by validation performance. We ran each experiment 5 times, and report the mean and standard deviation in Table 2. More large scale regression results with bigger networks can be found at Appendix C.4 and Appendix C.5.
242
+
243
+ # 5.3 CONTEXTUAL BANDITS
244
+
245
+ One of the most important applications of uncertainty modelling is to guide exploration in settings such as bandits, Bayesian optimization (BO), and reinforcement learning. In this section, we evaluate fBNNs on a recently introduced contextual bandits benchmark (Riquelme et al., 2018). In contextual bandits problems, the agent tries to select the action with highest reward given some input context. Because the agent learns about the model gradually, it should balance between exploration and exploitation to maximize the cumulative reward. Thompson sampling (Thompson, 1933) is one promising approach which repeatedly samples from the posterior distribution over parameters, choosing the optimal action according to the posterior sample.
246
+
247
+ Table 3: Contextual bandits regret. Results are relative to the cumulative regret of the Uniform algorithm. Numbers after the algorithm are the network sizes. We report the mean and standard derivation over 10 trials.
248
+
249
+ <table><tr><td></td><td>M. RANK</td><td>M.VALUE</td><td>MUSHROOM</td><td>STATLOG</td><td>COVERTYPE</td><td>FINANCIAL</td><td>JESTER</td><td>ADULT</td></tr><tr><td>FBNN1×50</td><td>4.7</td><td>41.9</td><td>21.38± 7.00</td><td>8.85±4.55</td><td>47.16± 2.39</td><td>9.90±2.40</td><td>75.55 ±5.51</td><td>88.43±1.95</td></tr><tr><td>FBNN2×50</td><td>6.5</td><td>43.0</td><td>24.57 ± 10.81</td><td>10.08 ± 5.66</td><td>49.04± 3.75</td><td>11.83 ± 2.95</td><td>73.85 ± 6.82</td><td>88.81±3.29</td></tr><tr><td>FBNN3×50</td><td>7</td><td>45.0</td><td>34.03 ±13.95</td><td>7.73±4.37</td><td>50.14 ± 3.13</td><td>14.14 ± 1.99</td><td>74.27 ± 6.54</td><td>89.68 ± 1.66</td></tr><tr><td>FBNN1× 500</td><td>3.8</td><td>41.3</td><td>21.90 ±9.95</td><td>6.50± 2.97</td><td>47.45 ± 1.86</td><td>7.83± 0.77</td><td>74.81 ± 5.57</td><td>89.03 ±1.78</td></tr><tr><td>FBNN2× 500</td><td>4.2</td><td>41.2</td><td>23.93 ± 11.59</td><td>7.98 ±3.08</td><td>46.00±2.01</td><td>10.67 ± 3.52</td><td>68.88 ± 7.09</td><td>89.70± 2.01</td></tr><tr><td>FBNN3×500</td><td>4.2</td><td>40.9</td><td>19.07 ± 4.97</td><td>10.04 ± 5.09</td><td>45.24 ± 2.11</td><td>11.48 ± 2.20</td><td>69.42 ± 7.56</td><td>90.01 ± 1.70</td></tr><tr><td>MULTITASKGP</td><td>4.3</td><td>41.7</td><td>20.75 ± 2.08</td><td>7.25 ± 1.80</td><td>48.37 ± 3.50</td><td>8.07 ± 1.13</td><td>76.99 ± 6.01</td><td>88.64 ± 3.20</td></tr><tr><td>BBB1×50</td><td>10.8</td><td>52.7</td><td>24.41 ± 6.70</td><td>25.67 ± 3.46</td><td>58.25 ±5.00</td><td>37.69 ± 15.34</td><td>75.39 ± 6.32</td><td>95.07 ± 1.57</td></tr><tr><td>BBB1×500</td><td>13.7</td><td>66.2</td><td>26.41 ± 8.71</td><td>51.29 ± 11.27</td><td>83.91 ± 4.62</td><td>57.20 ± 7.19</td><td>78.94 ± 4.98</td><td>99.21 ± 0.79</td></tr><tr><td>BBALPHADIV</td><td>15</td><td>83.8</td><td>61.00 ± 6.47</td><td>70.91 ± 10.22</td><td>97.63 ± 3.21</td><td>85.94 ± 4.88</td><td>87.80 ±5.08</td><td>99.60 ± 1.06</td></tr><tr><td>PARAMNOISE</td><td>10</td><td>47.9</td><td>20.33 ± 13.12</td><td>13.27 ± 2.85</td><td>65.07 ± 3.47</td><td>17.63 ± 4.27</td><td>74.94 ± 7.24</td><td>95.90 ± 2.20</td></tr><tr><td>NEURALLINEAR</td><td>10.8</td><td>48.8</td><td>16.56 ± 11.60</td><td>13.96 ± 1.51</td><td>64.96 ± 2.54</td><td>18.57 ± 2.02</td><td>82.14 ± 3.64</td><td>96.87±0.92</td></tr><tr><td>LINFULLPOST</td><td>8.3</td><td>46.0</td><td>14.71 ± 0.67</td><td>19.24 ± 0.77</td><td>58.69 ± 1.17</td><td>10.69 ± 0.92</td><td>77.76± 5.67</td><td>95.00 ± 1.26</td></tr><tr><td>DROPOUT</td><td>5.5</td><td>41.7</td><td>12.53 ± 1.82</td><td>12.01 ± 6.11</td><td>48.95 ±2.19</td><td>14.64 ± 3.95</td><td>71.38 ± 7.11</td><td>90.62 ± 2.21</td></tr><tr><td>RMS</td><td>6.5 4.7</td><td>43.9</td><td>15.29 ± 3.06</td><td>11.38 ± 5.63</td><td>58.96±4.97</td><td>10.46 ± 1.61</td><td>72.09 ± 6.98</td><td>95.29 ± 1.50</td></tr><tr><td>BOOTRMS</td><td></td><td>42.6</td><td>18.05 ± 11.20</td><td>6.13 ±1.03</td><td>53.63±2.15</td><td>8.69 ± 1.30</td><td>74.71 ±6.00</td><td>94.18 ± 1.94</td></tr><tr><td>UNIFORM</td><td>16</td><td>100</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><td>100.0±0.0</td></tr></table>
250
+
251
+ We compared our fBNNs with the algorithms benchmarked in (Riquelme et al., 2018). We ran the experiments for all algorithms and tasks using the default settings open sourced by Riquelme et al. (2018). For fBNNs, we kept the same settings, including batchsize (512), training epochs (100) and training frequency (50). For the prior, we use the multi-task GP of Riquelme et al. (2018). Measurement sets consisted of training batches, combined with 10 points sampled from data regions. We ran each experiment 10 times; the mean and standard derivation are reported in Table 3 (Appendix C.1 has the full results for all experiments.). Similarly to Riquelme et al. (2018), we also report the mean rank and mean regret.
252
+
253
+ As shown in Table 3, fBNNs outperformed other methods by a wide margin. Additionally, fBNNs maintained consistent performance even with deeper and wider networks. By comparison, BBB suffered significant performance degradation when the hidden size was increased from 50 to 500. This is consistent with our hypothesis that functional variational inference can gracefully handle networks with high capacity.
254
+
255
+ # 5.4 BAYESIAN OPTIMIZATION
256
+
257
+ Another domain where efficient exploration requires accurate uncertainty modeling is Bayesian optimization. Our experiments with Bayesian optimization are described in App C.3. We compared BBB, RBF Random Feature (Rahimi & Recht, 2008) and our fBNNs in the context of Max-value Entropy Search (MES) (Wang & Jegelka, 2017), which requires explicit function samples for Bayesian Optimization. We performed BO over functions sampled from Gaussian Processes corresponding to RBF, Matern12 and ArcCosine kernels, and found our fBNNs achieved comparable or better performance than RBF Random Feature.
258
+
259
+ # 6 CONCLUSIONS
260
+
261
+ In this paper we investigated variational inference between stochastic processes. We proved that the KL divergence between stochastic processes equals the supremum of KL divergence for marginal distributions over all finite measurement sets. Then we presented two practical functional variational inference approaches: adversarial and sampling-based. Adopting BNNs as the variational posterior yields our functional variational Bayesian neural networks. Empirically, we demonstrated that fBNNs extrapolate well over various structures, estimate reliable uncertainties, and scale to large datasets.
262
+
263
+ # ACKNOWLEDGEMENTS
264
+
265
+ We thank Ricky Chen, Kevin Luk and Xuechen Li for their helpful comments on this project. SS was supported by a Connaught New Researcher Award and a Connaught Fellowship. GZ was supported by an MRIS Early Researcher Award. RG acknowledges funding from the CIFAR Canadian AI Chairs program.
266
+
267
+ # REFERENCES
268
+
269
+ Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
270
+
271
+ Arthur Asuncion and David Newman. UCI machine learning repository, 2007.
272
+
273
+ Juhan Bae, Guodong Zhang, and Roger Grosse. Eigenvalue corrected noisy natural gradient. arXiv preprint arXiv:1811.12565, 2018.
274
+
275
+ Christopher T. Baker. The Numerical Treatment of Integral Equations. Clarendon Press, Oxford, 1997.
276
+
277
+ Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International Conference on Machine Learning, pp. 1613–1622, 2015.
278
+
279
+ Kurt Cutajar, Edwin V Bonilla, Pietro Michiardi, and Maurizio Filippone. Random feature expansions for deep Gaussian processes. In International Conference on Machine Learning, pp. 884–893, 2017.
280
+
281
+ Stefan Depeweg, José Miguel Hernández-Lobato, Finale Doshi-Velez, and Steffen Udluft. Uncertainty decomposition in Bayesian neural networks with latent variables. arXiv preprint arXiv:1706.08495, 2017.
282
+
283
+ Nathaniel Eldredge. Analysis and probability on infinite-dimensional spaces. arXiv preprint arXiv:1607.03591, 2016.
284
+
285
+ Daniel Flam-Shepherd, James Requeima, and David Duvenaud. Mapping Gaussian process priors to Bayesian neural networks. In NIPS Bayesian deep learning workshop, 2017.
286
+
287
+ Gerald B Folland. Real analysis: modern techniques and their applications. John Wiley & Sons, 2013.
288
+
289
+ Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. In International Conference on Machine Learning, pp. 1050–1059, 2016.
290
+
291
+ Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in Neural Information Processing Systems, pp. 3581–3590, 2017.
292
+
293
+ M. Garnelo, J. Schwarz, D. Rosenbaum, F. Viola, D. J. Rezende, S. M. A. Eslami, and Y. Whye Teh. Neural processes. arXiv preprint arXiv:1807.01622, 2018.
294
+
295
+ Soumya Ghosh, Jiayu Yao, and Finale Doshi-Velez. Structured variational learning of Bayesian neural networks with horseshoe priors. In International Conference on Machine Learning, pp. 1744–1753, 2018.
296
+
297
+ 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.
298
+
299
+ Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pp. 2348–2356, 2011.
300
+
301
+ Robert M. Gray. Entropy and Infomation Theory. Springer, 2011.
302
+
303
+ Danijar Hafner, Dustin Tran, Alex Irpan, Timothy Lillicrap, and James Davidson. Reliable uncertainty estimates in deep neural networks using noise contrastive priors. arXiv preprint arXiv:1807.09289, 2018.
304
+
305
+ James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. In Uncertainty in Artificial Intelligence, pp. 282, 2013.
306
+
307
+ James Hensman, Alexander Matthews, and Zoubin Ghahramani. Scalable variational Gaussian process classification. In Artificial Intelligence and Statistics, pp. 351–360, 2015.
308
+
309
+ José Miguel Hernández-Lobato and Ryan Adams. Probabilistic backpropagation for scalable learning of Bayesian neural networks. In International Conference on Machine Learning, pp. 1861–1869, 2015.
310
+
311
+ José Miguel Hernández-Lobato, Matthew W Hoffman, and Zoubin Ghahramani. Predictive entropy search for efficient global optimization of black-box functions. In Advances in Neural Information Processing Systems, pp. 918–926, 2014.
312
+
313
+ Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Conference on Computational Learning Theory, pp. 5–13, 1993.
314
+
315
+ Ferenc Huszár. Variational inference using implicit distributions. arXiv preprint arXiv:1702.08235, 2017.
316
+
317
+ Pavel Izmailov, Alexander Novikov, and Dmitry Kropotov. Scalable gaussian processes with billions of inducing inputs via tensor train decomposition. arXiv preprint arXiv:1710.07324, 2017.
318
+
319
+ Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
320
+
321
+ Diederik P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. In Advances in Neural Information Processing Systems, pp. 2575–2583, 2015.
322
+
323
+ Karl Krauth, Edwin V Bonilla, Kurt Cutajar, and Maurizio Filippone. AutoGP: Exploring the capabilities and limitations of Gaussian process models. arXiv preprint arXiv:1610.05392, 2016.
324
+
325
+ John Lamperti. Stochastic processes: a survey of the mathematical theory, volume 23. Springer Science & Business Media, 2012.
326
+
327
+ Miguel Lázaro-Gredilla, Joaquin Quiñonero Candela, Carl Edward Rasmussen, and Aníbal R Figueiras-Vidal. Sparse spectrum Gaussian process regression. Journal of Machine Learning Research, 11(Jun):1865–1881, 2010.
328
+
329
+ Quoc Le, Tamás Sarlós, and Alex Smola. Fastfood — approximating kernel expansions in loglinear time. In International Conference on Machine Learning, volume 85, 2013.
330
+
331
+ 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.
332
+
333
+ Qiang Liu, Jason Lee, and Michael Jordan. A kernelized Stein discrepancy for goodness-of-fit tests. In International Conference on Machine Learning, pp. 276–284, 2016.
334
+
335
+ James Robert Lloyd, David K Duvenaud, Roger B Grosse, Joshua B Tenenbaum, and Zoubin Ghahramani. Automatic construction and natural-language description of nonparametric regression models. In AAAI, pp. 1242–1250, 2014.
336
+
337
+ Christos Louizos and Max Welling. Structured and efficient variational deep learning with matrix Gaussian posteriors. In International Conference on Machine Learning, pp. 1708–1716, 2016.
338
+
339
+ Christos Louizos and Max Welling. Multiplicative normalizing flows for variational Bayesian neural networks. In International Conference on Machine Learning, pp. 2218–2227, 2017.
340
+
341
+ Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pp. 3288–3298, 2017.
342
+
343
+ Chao Ma, Yingzhen Li, and José Miguel Hernández-Lobato. Variational implicit processes. arXiv preprint arXiv:1806.02390, 2018.
344
+
345
+ Anton Mallasto and Aasa Feragen. Learning from uncertain curves: The 2-wasserstein metric for Gaussian processes. In Advances in Neural Information Processing Systems, pp. 5660–5670, 2017.
346
+
347
+ Alexander G de G Matthews, James Hensman, Richard Turner, and Zoubin Ghahramani. On sparse variational methods and the Kullback-Leibler divergence between stochastic processes. In Artificial Intelligence and Statistics, pp. 231–239, 2016.
348
+
349
+ Radford M Neal. Bayesian Learning for Neural Networks. PhD thesis, University of Toronto, 1995.
350
+
351
+ Bernt Øksendal. Stochastic differential equations. In Stochastic differential equations, pp. 65–84. Springer, 2003.
352
+
353
+ Carsten Peterson. A mean field theory learning algorithm for neural networks. Complex systems, 1: 995–1019, 1987.
354
+
355
+ Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems, pp. 1177–1184, 2008.
356
+
357
+ Carl Edward Rasmussen and Zoubin Ghahramani. Occam’s razor. In Advances in Neural Information Processing Systems, pp. 294–300, 2001.
358
+
359
+ Carl Edward Rasmussen and Christopher KI Williams. Gaussian Processes for Machine Learning. MIT Press, 2006.
360
+
361
+ 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, 2018.
362
+
363
+ Geoffrey Roeder, Yuhuai Wu, and David K Duvenaud. Sticking the landing: Simple, lower-variance gradient estimators for variational inference. In Advances in Neural Information Processing Systems, pp. 6925–6934, 2017.
364
+
365
+ Daniel Russo and Benjamin Van Roy. An information-theoretic analysis of thompson sampling. The Journal of Machine Learning Research, 17(1):2442–2471, 2016.
366
+
367
+ Hugh Salimbeni and Marc Deisenroth. Doubly stochastic variational inference for deep Gaussian processes. In Advances in Neural Information Processing Systems, pp. 4588–4599, 2017.
368
+
369
+ Amar Shah, Andrew Wilson, and Zoubin Ghahramani. Student-t processes as alternatives to Gaussian processes. In Artificial Intelligence and Statistics, pp. 877–885, 2014.
370
+
371
+ Jiaxin Shi, Shengyang Sun, and Jun Zhu. Kernel implicit variational inference. In International Conference on Learning Representations, 2018a.
372
+
373
+ Jiaxin Shi, Shengyang Sun, and Jun Zhu. A spectral approach to gradient estimation for implicit distributions. International Conference on Machine Learning, 2018b.
374
+
375
+ Edward Snelson and Zoubin Ghahramani. Sparse Gaussian processes using pseudo-inputs. In Advances in Neural Information Processing Systems, pp. 1257–1264, 2006.
376
+
377
+ Casper Kaae Sønderby, Jose Caballero, Lucas Theis, Wenzhe Shi, and Ferenc Huszár. Amortised map inference for image super-resolution. arXiv preprint arXiv:1610.04490, 2016.
378
+
379
+ Shengyang Sun, Changyou Chen, and Lawrence Carin. Learning structured weight uncertainty in Bayesian neural networks. In Artificial Intelligence and Statistics, pp. 1283–1292, 2017.
380
+
381
+ Shengyang Sun, Guodong Zhang, Chaoqi Wang, Wenyuan Zeng, Jiaman Li, and Roger Grosse. Differentiable compositional kernel learning for Gaussian processes. In International Conference on Machine Learning, pp. 4828–4837, 2018.
382
+
383
+ William R Thompson. On the likelihood that one unknown probability exceeds another in view of the evidence of two samples. Biometrika, 25(3/4):285–294, 1933.
384
+
385
+ Michalis Titsias. Variational learning of inducing variables in sparse Gaussian processes. In Artificial Intelligence and Statistics, pp. 567–574, 2009.
386
+
387
+ Zi Wang and Stefanie Jegelka. Max-value entropy search for efficient Bayesian optimization. In International Conference on Machine Learning, pp. 3627–3635, 2017.
388
+
389
+ Yeming Wen, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse. Flipout: Efficient pseudoindependent weight perturbations on mini-batches. arXiv preprint arXiv:1803.04386, 2018.
390
+
391
+ Christopher KI Williams and Matthias Seeger. Using the Nyström method to speed up kernel machines. In Advances in Neural Information Processing Systems, pp. 682–688, 2001.
392
+
393
+ Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In International Conference on Machine Learning, pp. 1775–1784, 2015.
394
+
395
+ Guodong Zhang, Shengyang Sun, David Duvenaud, and Roger Grosse. Noisy natural gradient as variational inference. In International Conference on Machine Learning, pp. 5852–5861, 2018.
396
+
397
+ # A FUNCTIONAL KL DIVERGENCE
398
+
399
+ # A.1 BACKGROUND
400
+
401
+ We begin with some basic terminology and classical results. See Gray (2011) and Folland (2013) for more details.
402
+
403
+ Definition 1 (KL divergence). Given a probability measure space $( \Omega , { \mathcal { F } } , P )$ and another probability measure $M$ on the smae space, the $K L$ divergence of $P$ with respect to $M$ is defined as
404
+
405
+ $$
406
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { \mathcal { Q } } \mathrm { K L } [ P _ { \mathcal { Q } } \| M _ { \mathcal { Q } } ] .
407
+ $$
408
+
409
+ where the supremum is taken over all finite measurable partitions $\mathcal { Q } = \{ Q _ { i } \} _ { i = 1 } ^ { n }$ of $\Omega$ , and $P _ { \mathcal { Q } } , M _ { \mathcal { Q } }$ represent the discrete measures over the partition $\mathcal { Q } ,$ respectively.
410
+
411
+ Definition 2 (Pushforward measure). Given probability spaces $( X , { \mathcal { F } } _ { X } , \mu )$ and $( Y , { \mathcal { F } } _ { Y } , \nu )$ , we say that measure $\nu$ is a pushforward of $\mu$ if $\nu ( A ) = \mu ( f ^ { - 1 } ( A ) )$ for a measurable $f : X \to Y$ and any $A \in { \mathcal { F } } _ { Y }$ . This relationship is denoted by $\nu = \mu \circ f ^ { - 1 }$ .
412
+
413
+ Definition 3 (Canonical projection map). Let $T$ be an arbitrary index set, and $\{ ( \Omega _ { t } , { \mathcal { F } } _ { t } ) \} _ { t \in T }$ be some collection of measurable spaces. For each subset $J \subset I \subset T$ , define $\Omega ^ { J } = \textstyle \prod _ { t \in J } \Omega _ { t }$ . We call $\pi _ { I J }$ the canonical projection map from $I$ to $J$ if
414
+
415
+ $$
416
+ \pi _ { I \to J } ( w ) = w | _ { J } \in \Omega ^ { J } , \forall w \in \Omega ^ { I } .
417
+ $$
418
+
419
+ Where $w | _ { J }$ is defined as, if $w = ( w _ { i } ) _ { i \in I }$ , then $w | _ { J } = ( w _ { i } ) _ { i \in J }$ .
420
+
421
+ Definition 4 (Cylindrical $\sigma$ -algebra). Let $T$ be an arbitrary index set, $( \Omega , { \mathcal { F } } )$ be a measurable space. Suppose
422
+
423
+ $$
424
+ \Omega ^ { T } = \{ f : f ( t ) \in \Omega , t \in T \} .
425
+ $$
426
+
427
+ is the set of $\Omega$ -valued functions. A cylinder subset is a finitely restricted set defined as
428
+
429
+ $$
430
+ C _ { t _ { 1 } , \cdots , t _ { n } } ( B _ { 1 } , \cdots , B _ { n } ) = \{ f \in \Omega ^ { T } : f ( t _ { i } ) \in B _ { i } , 1 \leq i \leq n \} .
431
+ $$
432
+
433
+ $$
434
+ \begin{array} { r l } & { \mathcal { G } _ { t _ { 1 } , \cdots , t _ { n } } = \{ C _ { t _ { 1 } , \cdots , t _ { n } } ( B _ { 1 } , \cdots , B _ { n } ) : B _ { i } \in \mathcal { F } , 1 \leq i \leq n \} } \\ & { \qquad \mathcal { G } _ { \Omega ^ { \mathbb { T } } } = \overset { \infty } { \underset { n = 1 } { \cup } } \bigcup _ { t _ { i } \in T , i \leq n } \mathcal { G } _ { t _ { 1 } , \cdots , t _ { n } } } \end{array}
435
+ $$
436
+
437
+ We call the $\sigma$ -algebra $\mathcal { F } ^ { T } : = \sigma ( \mathcal { G } _ { \Omega ^ { T } } )$ as the cylindrical $\sigma$ -algebra of $\Omega ^ { T }$ , and $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ the cylindrical measurable space.
438
+
439
+ The Kolmogorov Extension Theorem is the foundational result used to construct many stochastic processes, such as Gaussian processes. A particularly relevant fact for our purposes is that this theorem defines a measure on a cylindrical measurable space, using only canonical projection measures on finite sets of points.
440
+
441
+ Theorem 4 (Kolmogorov extension theorem (Øksendal, 2003)). Let $T$ be an arbitrary index set. $( \Omega , { \mathcal { F } } )$ is a standard measurable space, whose cylindrical measurable space on $T$ is $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ . Suppose that for each finite subset $I \subset T$ , we have a probability measure $\mu _ { I }$ on $\Omega ^ { I }$ , and these measures satisfy the following compatibility relationship: for each subset $J \subset I$ , we have
442
+
443
+ $$
444
+ \mu _ { J } = \mu _ { I } \circ \pi _ { I J } ^ { - 1 } .
445
+ $$
446
+
447
+ Then there exists a unique probability measure $\mu$ on $\Omega ^ { T }$ such that for all finite subsets $I \subset T$
448
+
449
+ $$
450
+ \mu _ { I } = \mu \circ \pi _ { T I } ^ { - 1 } .
451
+ $$
452
+
453
+ In the context of Gaussian processes, $\mu$ is a Gaussian measure on a separable Banach space, and the $\mu _ { I }$ are marginal Gaussian measures at finite sets of input positions (Mallasto & Feragen, 2017).
454
+
455
+ Theorem 5. Suppose that $M$ and $P$ are measures on the sequence space corresponding to outcomes of a sequence of random variables $X _ { 0 } , X _ { 1 } , \cdot \cdot \cdot$ with alphabet $A$ . Let $\mathcal { F } _ { n } = \sigma ( X _ { 0 } , \cdots , X _ { n - 1 } )$ , which asymptotically generates the $\sigma$ -algebra $\sigma ( X _ { 0 } , X _ { 1 } , \cdots )$ . Then
456
+
457
+ $$
458
+ \mathrm { K L } [ P \| M ] = \operatorname* { l i m } _ { n \to \infty } \mathrm { K L } [ P _ { \mathcal { F } _ { n } } \| M _ { \mathcal { F } _ { n } } ]
459
+ $$
460
+
461
+ Where $P _ { \mathcal { F } _ { n } } , M _ { \mathcal { F } _ { n } }$ denote the pushforward measures with $f : f ( X _ { 0 } , X _ { 1 } , \cdots ) = f ( X _ { 0 } , \cdots , X _ { n - 1 } )$ , respectively.
462
+
463
+ Here we clarify what it means for the measurable sets to only depend on the values at a countable set of points. To begin with, we firstly introduce some definitions.
464
+
465
+ Definition 5 (Replacing function). For $f \in \Omega ^ { T } , t _ { 0 } \in T , v \in \Omega ,$ , a replacing function $f _ { t _ { 0 } , v } ^ { r }$ is,
466
+
467
+ $$
468
+ f _ { t _ { 0 } , v } ^ { r } ( t ) = { \left\{ \begin{array} { l l } { f ( t ) , } & { \ t \neq t _ { 0 } } \\ { v , } & { \ t = t _ { 0 } } \end{array} \right. } .
469
+ $$
470
+
471
+ Definition 6 (Restricted Indices). For $H \in \mathcal { F } ^ { T }$ , we define the free indices $\tau ^ { c } ( H )$
472
+
473
+ $$
474
+ \tau ^ { c } ( H ) = \{ t | f o r a n y f \in H , w e h a \nu e f _ { t , v } ^ { r } \in H f o r a l l v \in \Omega \}
475
+ $$
476
+
477
+ The complement $\tau ( H ) = T \backslash \tau ^ { c } ( H )$ is the set of restricted indices. For example, for the set $H =$ $\{ f | f \in \mathbb { R } ^ { T } , f ( 0 ) \in ( - 1 , 2 ) , f ( 1 ) \in ( 0 , 1 ) \}$ , the restricted indices are $\tau ( H ) = \{ 0 , 1 \}$ .
478
+
479
+ Restricted index sets satisfy the following properties:
480
+
481
+ • for any $H \in \mathcal { F } ^ { T }$ , $\tau ( H ) = \tau ( H ^ { c } )$ . • for any indices set $I$ and measureable sets $\{ H _ { i } ; H _ { i } \in \mathcal { F } ^ { T } \} _ { i \in I } , \tau \big ( \underset { i \in I } { \cup } H _ { i } \big ) \subseteq \underset { i \in I } { \cup } \tau ( H _ { i } ) .$
482
+
483
+ Having defined restricted indices, a key step in our proof is to show that, for any measureable set $H$ in a cylindrical measureable space $( \Omega ^ { \check { T } } , \mathcal { F } ^ { \check { T } } )$ , its set of restricted indices $\tau ( H )$ is countable.
484
+
485
+ Lemma 6. Given a cylindrical measureable space $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ , for any $H \in \mathcal { F } ^ { T }$ , $\tau ( H )$ is countable.
486
+
487
+ Proof. Define $\mathcal { H } = \{ H \vert H \in \mathcal { F } ^ { T } , \tau ( H )$ is countable}, $\mathcal { H } \subseteq \mathcal { F } ^ { T }$ . By the two properties of restricted indices in Definition 6, $\mathcal { H }$ is a $\sigma$ -algebra on $\Omega ^ { T }$ .
488
+
489
+ On the other hand, $\mathcal { F } ^ { T } = \sigma ( \mathcal { G } _ { \Omega ^ { T } } )$ . Because any set in $\mathcal { G } _ { \Omega ^ { T } }$ has finite restricted indices, $\mathcal G _ { \Omega ^ { T } } \subseteq \mathcal H$ Therefore $\mathcal { H }$ is a $\sigma$ -algebra containing $\mathcal { G } _ { \Omega ^ { T } }$ . Thus $\mathcal { H } \supseteq \sigma ( \mathcal { G } _ { \Omega ^ { T } } ) = \mathcal { F } ^ { T }$ .
490
+
491
+ Overall, we conclude $\mathcal { H } = \mathcal { F } ^ { T }$ . For any $H \in \mathcal { F } ^ { T }$ , $\tau ( H )$ is countable.
492
+
493
+ Theorem 7. For two stochastic processes $P , M$ on a cylindrical measurable space $( \Omega ^ { T } , \mathcal { F } ^ { T } )$ , the $K L$ divergence of $P$ with respect to $M$ satisfies,
494
+
495
+ $$
496
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { T _ { d } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] ,
497
+ $$
498
+
499
+ where the supremum is over all finite indices subsets $T _ { d } \subseteq T$ , and $P _ { T _ { d } } , M _ { T _ { d } }$ represent the canonical projection maps $\pi _ { T \to T _ { d } }$ of $P , M$ , respectively.
500
+
501
+ Proof. Recall that stochastic processes are defined over a cylindrical $\sigma$ -algebra $\mathcal { F } ^ { T }$ . By Lemma 6, for every set $H \in \mathcal { F } ^ { T }$ , the restricted index set $\tau ( H )$ is countable. Our proof proceeds in two steps:
502
+
503
+ 1. Any finite measurable partition of $\Omega ^ { T }$ corresponds to a finite measurable partition over some $\Omega ^ { T _ { c } }$ , where $T _ { c }$ is a countable index set.
504
+ 2. Correspondence between partitions implies correspondence between KL divergences.
505
+ 3. KL divergences over a countable indices set can be represented as supremum of KL divergences over finite indices sets.
506
+
507
+ Step 1. By Definition 1,
508
+
509
+ $$
510
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { \mathcal { Q } _ { \Omega ^ { T } } } \mathrm { K L } [ P _ { \mathcal { Q } _ { \Omega ^ { T } } } \| M _ { \mathcal { Q } _ { \Omega ^ { T } } } ] ,
511
+ $$
512
+
513
+ where the sup is over all finite measurable partitions of the function space $\Omega ^ { T }$ , denoted by ${ \mathcal { Q } } _ { \Omega ^ { T } }$
514
+
515
+ $$
516
+ \mathcal { Q } _ { \Omega ^ { T } } = \{ Q _ { \Omega ^ { T } } ^ { ( 1 ) } , \dots , Q _ { \Omega ^ { T } } ^ { ( k ) } | \bigcup _ { i = 1 } ^ { k } Q _ { \Omega ^ { T } } ^ { ( i ) } = \Omega ^ { T } , Q _ { \Omega ^ { T } } ^ { ( i ) } \in \mathcal { F } ^ { T } \mathrm { ~ a r e ~ d i s j o i n t ~ s e t s } , k \in \mathbb { N } ^ { + } \} .
517
+ $$
518
+
519
+ By Lemma 6, each $\tau ( Q _ { \Omega ^ { T } } ^ { ( i ) } )$ is countable. So the combined restricted index set $T _ { c } : = \bigcup _ { i = 1 } ^ { k } \tau ( Q _ { \Omega ^ { T } } ^ { ( i ) } )$ is countable.
520
+
521
+ Consider the canonical projection mapping $\pi _ { T T _ { c } }$ , which induces a partition on $\Omega ^ { T _ { c } }$ , denoted by $\mathcal { Q } _ { \Omega ^ { T _ { c } } }$ :
522
+
523
+ $$
524
+ Q _ { \Omega ^ { T _ { c } } } ^ { ( i ) } = \pi _ { T T _ { c } } ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) .
525
+ $$
526
+
527
+ The pushforward measure defined by this mapping is
528
+
529
+ $$
530
+ P _ { T _ { c } } = P \circ \pi _ { T T _ { c } } ^ { - 1 } , \quad M _ { T _ { c } } = M \circ \pi _ { T T _ { c } } ^ { - 1 } .
531
+ $$
532
+
533
+ Step 2. Then we have
534
+
535
+ $$
536
+ \begin{array} { r l } & { \mathrm { K L } [ P \| M ] = \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { \mathbf { Q } _ { \Omega ^ { T } } } ] | M _ { Q _ { \Omega ^ { T } } } ] } \\ & { \quad \quad \quad = \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \sum _ { i } P ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) \log \frac { P ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) } { M ( Q _ { \Omega ^ { T } } ^ { ( i ) } ) } } \\ & { \quad \quad \quad = \underset { T _ { c } } { \operatorname* { s u p } } \underset { \mathbf { Q } _ { \Omega ^ { T } } } { \operatorname* { s u p } } \sum _ { i } P _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) \log \frac { P _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) } { M _ { T _ { c } } ( Q _ { \Omega ^ { T } c } ^ { ( i ) } ) } } \\ & { \quad \quad \quad = \underset { T _ { c } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { c } } \| M _ { T _ { c } } ] , } \end{array}
537
+ $$
538
+
539
+ Step 3. Denote $\mathcal { D } ( T _ { c } )$ as the collection of all finite subsets of $T _ { c }$ . For any finite set $T _ { d } \in \mathcal { D } ( T _ { c } )$ , we denote $P _ { T _ { d } }$ as the pushforward measure of $P _ { T _ { c } }$ on $\Omega ^ { T _ { d } }$ . From the Kolmogorov Extension Theorem (Theorem 4), we know that $P _ { T _ { d } }$ corresponds to the finite marginals of $P$ at $\Omega ^ { T _ { d } }$ . Because $T _ { c }$ is countable, based on Theorem 5, we have,
540
+
541
+ $$
542
+ \begin{array} { r l } & { \mathrm { K L } [ P \| M ] = \underset { T _ { c } } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { c } } \| M _ { T _ { c } } ] } \\ & { \qquad = \underset { T _ { c } } { \operatorname* { s u p } } \underset { T _ { d } \in \mathcal { D } ( T _ { c } ) } { \operatorname* { s u p } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] . } \end{array}
543
+ $$
544
+
545
+ We are left with the last question: whether each $T _ { d }$ is contained in some $\mathcal { D } ( T _ { c } )$ ?
546
+
547
+ For any finite indices set $T _ { d }$ , we build a finite measureable partition $Q$ . Let $\Omega = \Omega _ { 0 } \cup \Omega _ { 1 } , \Omega _ { 0 } \cap \Omega _ { 1 } = \emptyset$ . Assume $| T _ { d } | = K , T _ { d } = \{ T _ { d } ( k ) \} _ { k = 1 : K }$ , let $I = \{ I ^ { i } | I ^ { i } \stackrel { } { = } ( I _ { 1 } ^ { i } , I _ { 2 } ^ { i } , \stackrel { } { \cdot } \cdot I _ { K } ^ { i } ) \} _ { i = 1 : 2 ^ { K } }$ to be all $K$ -length binary vectors. We define the partition,
548
+
549
+ $$
550
+ \begin{array} { r l } & { \mathcal { Q } = \{ Q ^ { i } \} _ { i = 1 : 2 ^ { K } } , } \\ & { Q ^ { i } = \underset { k = 1 } { \overset { K } { \cap } } \{ f \} \{ { f ( T _ { f } ( k ) ) \in \Omega _ { 0 } , \ I ^ { i } ( k ) = 0 } \ } \end{array}
551
+ $$
552
+
553
+ Through this settting, $\mathcal { Q }$ is a finite parition of $\Omega ^ { T }$ , and $T _ { c } ( \mathcal { Q } ) = T _ { d }$ . Therefore $T _ { d }$ in Equation (28) can range over all finite index sets, and we have proven the theorem.
554
+
555
+ $$
556
+ \mathrm { K L } [ P \| M ] = \operatorname* { s u p } _ { T _ { d } } \mathrm { K L } [ P _ { T _ { d } } \| M _ { T _ { d } } ] .
557
+ $$
558
+
559
+ # A.3 KL DIVERGENCE BETWEEN CONDITIONAL STOCHASTIC PROCESSES
560
+
561
+ In this section, we give an example of computing the $\mathrm { K L }$ divergence between two conditional stochastic processes. Consider two datasets $\mathcal { D } _ { 1 } , \mathcal { D } _ { 2 }$ , the KL divergence between two conditional
562
+
563
+ stochastic processes is
564
+
565
+ $$
566
+ \begin{array} { r l } { \mathrm { K L } [ p ( f | \mathcal { D } _ { 1 } ) \| p ( f | \mathcal { D } _ { 2 } ) ] = } & { \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { K L } [ p ( \mathbf { f } ^ { \mathbf { x } } | \mathcal { D } _ { 1 } ) \| p ( \mathbf { f } ^ { \mathbf { x } } | \mathcal { D } _ { 2 } ) ] } \\ & { = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 2 } ) } } \\ & { = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } , \mathcal { D } _ { 1 } ) } { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 2 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } , \mathcal { D } _ { 2 } ) } } \\ & = \underset { n , \mathbf { x } _ { 1 : n } } { \operatorname* { s u p } } \mathrm { E } _ { p ( \mathbf { f } ^ { \mathbf { x } } , \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) } \log \frac { p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ { 1 } ) p ( \mathbf { f } ^ { \mathbf { x } } | \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } ) } p ( \mathbf { f } ^ { D _ { 1 } \cup D _ { 2 } } | \mathcal { D } _ \end{array}
567
+ $$
568
+
569
+ Therefore, the KL divergence between these two stochastic processes equals to the marginal KL divergence on the observed locations. When $\mathcal { D } _ { 2 } = \varnothing$ , $p ( f | \mathcal { D } _ { 2 } ) \dot { = } p ( f )$ , this shows the KL divergence between posterior process and prior process are the marginal KL divergence on observed locations.
570
+
571
+ This also justifies our usage of $M$ measurement points in the adversarial functional VI and samplingbased functional VI of Section 3.
572
+
573
+ # B ADDITIONAL PROOFS
574
+
575
+ B.1 PROOF FOR EVIDENCE LOWER BOUND
576
+
577
+ This section provides proof for Theorem 2.
578
+
579
+ Proof of Theorem 2. Let $\mathbf { X } ^ { M } = \mathbf { X } \backslash \mathbf { X } ^ { D }$ be measurement points which aren’t in the training data.
580
+
581
+ $$
582
+ \begin{array} { r l } & { \mathcal { L } _ { { \mathbf { X } } } ( q ) = \mathbb { E } _ { q } [ \log p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) + \log p ( \mathbf { f } ^ { \mathbf { X } } ) - \log q _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } ) ] } \\ & { \quad \quad \quad \quad \quad \quad = \mathbb { E } _ { q } [ \log p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) + \log p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) - \log q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) ] } \\ & { \quad \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathbb { E } _ { q } \left[ \log \frac { q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) p ( \mathcal { D } ) } { p ( \mathbf { y } ^ { D } | \mathbf { f } ^ { D } ) p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) } \right] } \\ & { \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathbb { E } _ { q } \left[ \log \frac { q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) } { p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathcal { D } ) } \right] } \\ & { \quad \quad \quad \quad = \log p ( \mathcal { D } ) - \mathrm { K L } [ q _ { \phi } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) \Vert p ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathcal { D } ) ] } \end{array}
583
+ $$
584
+
585
+ # B.2 CONSISTENCY FOR GAUSSIAN PROCESSES
586
+
587
+ This section provides proof for consistency in Corollary 3.
588
+
589
+ Proof of Corollary 3. By the assumption that both $q ( \mathcal D )$ and $p ( f | \mathcal { D } )$ are Gaussian processes:
590
+
591
+ $$
592
+ \begin{array} { r l } { p ( f ( \cdot ) | \mathcal { D } ) : } & { { } \mathcal { G P } ( m _ { p } ( \cdot ) , k _ { p } ( \cdot , \cdot ) ) , } \\ { q ( f ( \cdot ) ) : } & { { } \mathcal { G P } ( m _ { q } ( \cdot ) , k _ { q } ( \cdot , \cdot ) ) , } \end{array}
593
+ $$
594
+
595
+ where $m$ and $k$ denote the mean and covariance functions, respectively.
596
+
597
+ In this theorem, we also assume the measurement points cover all training locations as in Equation (9), where we have (based on Theorem 2):
598
+
599
+ $$
600
+ \begin{array} { r } { \mathcal { L } _ { { \bf X } } ( q ) = \log p ( \mathcal { D } ) - \mathrm { K L } [ q ( { \bf f } ^ { D } , { \bf f } ^ { M } ) \| p ( { \bf f } ^ { D } , { \bf f } ^ { M } | \mathcal { D } ) ] \leq \log p ( \mathcal { D } ) . } \end{array}
601
+ $$
602
+
603
+ Therefore, when the variational posterior process is sufficiently expressive and reaches its optimum, we must have $\mathrm { K L } [ q ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } ) | | \dot { p } ( \mathbf { f } ^ { D } , \mathbf { f } ^ { M } | \mathbf { \dot { \mathcal { D } } } ) ] = 0$ and thus $\bar { \mathrm { K L } } [ \bar { q } ( { \bf f } ^ { M } ) | | p ( { \bf f } ^ { M } | \mathcal { D } ) ] = 0$ at $\mathbf { \bar { X } } ^ { M } \mathbf { \Phi } =$ $\left[ \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { M } \right] ^ { \top } \in \bar { \mathcal { X } } ^ { \dot { M } }$ , which implies
604
+
605
+ $$
606
+ \begin{array} { r } { \mathcal { N } ( m _ { p } ( \mathbf { X } ^ { M } ) , k _ { p } ( \mathbf { X } ^ { M } , \mathbf { X } ^ { M } ) ) = \mathcal { N } ( m _ { q } ( \mathbf { X } ^ { M } ) , k _ { q } ( \mathbf { X } ^ { M } , \mathbf { X } ^ { M } ) ) . } \end{array}
607
+ $$
608
+
609
+ ![](images/8a1630262062ab3fc6a68816ba5e001ecd573227fdfcf3118337ff516392c3a0.jpg)
610
+ Figure 4: Predictions on Mauna datasets. Red dots are training points. The blue line is the mean prediction and shaded areas correspond to standard deviations.
611
+
612
+ $$
613
+ \begin{array} { r } { m ( { \mathbf { X } } ) = [ m ( { \mathbf { x } } _ { 1 } ) , \ldots , m ( { \mathbf { x } } _ { M } ) ] ^ { \top } , \mathrm { a n d } \left[ k ( { \mathbf { X } } ^ { M } , { \mathbf { X } } ^ { M } ) \right] _ { i j } = k ( { \mathbf { x } } _ { i } , { \mathbf { x } } _ { j } ) . } \end{array}
614
+ $$
615
+
616
+ Remember that in sampling-based functional variational inference, $\mathbf { X } ^ { M }$ are randomly sampled from $c ( \mathbf { x } )$ , and $\operatorname { s u p p } ( c ) = \bar { \mathcal { X } }$ . Thus when it reaches optimum, we have $\mathbb { E } _ { \mathbf { X } ^ { M } \sim c } \mathrm { K L } [ q ( \mathbf { f } ^ { M } ) \dot { \lVert } p ( \mathbf { f } ^ { M } | \mathcal { D } ) ] = 0$ Because the KL divergence is always non-negative, we have that $\mathrm { K L } [ q ( { \bf f } ^ { M } ) | | p ( { \bf f } ^ { M } | { \mathcal D } ) ] = 0$ for any $\mathbf { X } ^ { M } \in \mathbf { \Omega } { \mathcal { X } } ^ { M }$ . For adversarial functional variational inference, this is also obvious due to $\underset { { \bf { X } } ^ { M } } { \operatorname* { s u p } } \mathrm { { K L } } [ q ( { \bf { f } } ^ { M } ) \| p ( { \bf { f } } ^ { M } | \mathcal { D } ) ] = 0$ .
617
+
618
+ So we have that Equation (37) holds for any $\mathbf { X } ^ { M } \in \mathcal { X } ^ { M }$ . Given $M > 1$ , then for $\forall 1 \leq i < j \leq M$ we have $m _ { p } ( \mathbf { x } _ { i } ) = m _ { q } ( \mathbf { x } _ { i } )$ , and $k _ { p } ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) = k _ { q } ( \mathbf { x } _ { i } , \mathbf { x } _ { j } )$ , which implies
619
+
620
+ $$
621
+ m _ { p } ( \cdot ) = m _ { q } ( \cdot ) , \quad k _ { p } ( \cdot , \cdot ) = k _ { q } ( \cdot , \cdot ) .
622
+ $$
623
+
624
+ Because GPs are uniquely determined by their mean and covariance functions, we arrive at the conclusion. □
625
+
626
+ # C ADDITIONAL EXPERIMENTS
627
+
628
+ # C.1 CONTEXTUAL BANDITS
629
+
630
+ Here we present the full table for the contextual bandits experiment.
631
+
632
+ Table 4: Contextual bandits regret. Results are relative to the cumulative regret of the Uniform algorithm. Numbers after the algorithm are the network sizes. We report the mean and standard derivation over 10 trials.
633
+
634
+ <table><tr><td></td><td>M. RANK</td><td>M. VALUE</td><td>MUSHROOM</td><td>STATLOG</td><td>COVERTYPE</td><td>FINANCIAL</td><td>JESTER</td><td>ADULT</td><td>CENSUS</td><td>WHEEL</td></tr><tr><td>FBNN1×50</td><td>5.875</td><td>46.0</td><td>21.38 ± 7.00</td><td>8.85 ± 4.55</td><td>47.16 ± 2.39</td><td>9.90 ± 2.40</td><td>75.55± 5.51</td><td>88.43 ± 1.95</td><td>51.43 ± 2.34</td><td>65.05 ± 20.10</td></tr><tr><td>FBNN 2× 50</td><td>7.125</td><td>47.0</td><td>24.57 ± 10.81</td><td>10.08 ± 5.66</td><td>49.04 ± 3.75</td><td>11.83 ± 2.95</td><td>73.85 ± 6.82</td><td>88.81 ±3.29</td><td>50.09 ± 2.74</td><td>67.76 ± 25.74</td></tr><tr><td>FBNN3×50</td><td>8.125</td><td>48.9</td><td>34.03 ± 13.95</td><td>7.73 ± 4.37</td><td>50.14 ± 3.13</td><td>14.14 ± 1.99</td><td>74.27 ± 6.54</td><td>89.68 ± 1.66</td><td>52.37 ± 3.03</td><td>68.60 ± 22.24</td></tr><tr><td>FBNN 1 × 500</td><td>4.875</td><td>45.3</td><td>21.90 ± 9.95</td><td>6.50 ± 2.97</td><td>47.45 ± 1.86</td><td>7.83 ± 0.77</td><td>74.81 ± 5.57</td><td>89.03 ± 1.78</td><td>50.73 ± 1.53</td><td>63.77 ± 25.80</td></tr><tr><td>FBNN2× 500</td><td>5.0</td><td>44.2</td><td>23.93 ± 11.59</td><td>7.98 ± 3.08</td><td>46.00 ± 2.01</td><td>10.67 ± 3.52</td><td>68.88 ± 7.09</td><td>89.70 ± 2.01</td><td>51.87 ± 2.38</td><td>54.57 ± 32.92</td></tr><tr><td>FBNN 3× 500</td><td>4.75</td><td>44.6</td><td>19.07 ± 4.97</td><td>10.04 ± 5.09</td><td>45.24 ± 2.11</td><td>11.48 ± 2.20</td><td>69.42 ± 7.56</td><td>90.01 ± 1.70</td><td>49.73 ± 1.35</td><td>61.57 ± 21.73</td></tr><tr><td>MULTITASKGP</td><td>5.875</td><td>46.5</td><td>20.75 ± 2.08</td><td>7.25 ± 1.80</td><td>48.37 ± 3.50</td><td>8.07 ± 1.13</td><td>76.99 ± 6.01</td><td>88.64 ± 3.20</td><td>57.86 ± 8.19</td><td>64.15 ± 27.08</td></tr><tr><td>BBB1× 50</td><td>11.5</td><td>56.6</td><td>24.41 ± 6.70</td><td>25.67 ± 3.46</td><td>58.25 ± 5.00</td><td>37.69 ± 15.34</td><td>75.39 ± 6.32</td><td>95.07 ± 1.57</td><td>63.96 ± 3.95</td><td>72.37 ± 16.87</td></tr><tr><td>BBB1× 500</td><td>13.375</td><td>68.1</td><td>26.41 ± 8.71</td><td>51.29 ± 11.27</td><td>83.91 ± 4.62</td><td>57.20 ± 7.19</td><td>78.94 ± 4.98</td><td>99.21 ± 0.79</td><td>92.73 ± 9.13</td><td>55.09 ± 13.82</td></tr><tr><td>BBALPHADIV</td><td>16.0</td><td>87.4</td><td>61.00 ± 6.47</td><td>70.91 ± 10.22</td><td>97.63 ± 3.21</td><td>85.94 ± 4.88</td><td>87.80 ± 5.08</td><td>99.60 ± 1.06</td><td>100.41 ± 1.54</td><td>95.75 ± 12.31</td></tr><tr><td>PARAMNOISE</td><td>10.125</td><td>53.0</td><td>20.33 ± 13.12</td><td>13.27 ± 2.85</td><td>65.07 ± 3.47</td><td>17.63 ± 4.27</td><td>74.94 ± 7.24</td><td>95.90± 2.20</td><td>82.67 ± 3.86</td><td>54.38 ± 16.20</td></tr><tr><td>NEURALLINEAR</td><td>10.375</td><td>52.3</td><td>16.56 ± 11.60</td><td>13.96 ± 1.51</td><td>64.96 ± 2.54</td><td>18.57 ± 2.02</td><td>82.14 ± 3.64</td><td>96.87 ± 0.92</td><td>78.94 ± 1.87</td><td>46.26 ± 8.40</td></tr><tr><td>LINFULLPOST</td><td>9.25</td><td></td><td>14.71 ± 0.67</td><td>19.24 ± 0.77</td><td>58.69 ± 1.17</td><td>10.69 ± 0.92</td><td>77.76 ± 5.67</td><td>95.00 ± 1.26</td><td>CRASH</td><td>33.88 ± 15.15</td></tr><tr><td>DROPOUT</td><td>7.625</td><td>48.3</td><td>12.53 ± 1.82</td><td>12.01 ± 6.11</td><td>48.95 ± 2.19</td><td>14.64 ± 3.95</td><td>71.38 ± 7.11</td><td>90.62 ± 2.21</td><td>58.53 ± 2.35</td><td>77.46 ± 27.58</td></tr><tr><td>RMS</td><td>8.875</td><td>53.0</td><td>15.29 ± 3.06</td><td>11.38 ± 5.63</td><td>58.96 ± 4.97</td><td>10.46 ± 1.61</td><td>72.09 ± 6.98</td><td>95.29 ± 1.50</td><td>85.29 ± 5.85</td><td>75.62 ± 30.43</td></tr><tr><td>BOOTRMS</td><td>7.5</td><td>51.9</td><td>18.05 ± 11.20</td><td>6.13 ± 1.03</td><td>53.63 ± 2.15</td><td>8.69 ± 1.30</td><td>74.71 ± 6.00</td><td>94.18 ± 1.94</td><td>82.27 ± 1.84</td><td>77.80 ± 29.55</td></tr><tr><td>UNIFORM</td><td>16.75</td><td>100</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><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td><td>100.0 ± 0.0</td></tr></table>
635
+
636
+ # C.2 TIME-SERIES EXTRAPOLATION
637
+
638
+ Besides the toy experiments, we would like to examine the extrapolation behavior of our method on real-world datasets. Here we consider a classic time-series prediction problem concerning the concentration of $\mathrm { C O _ { 2 } }$ in the atmosphere at the Mauna Loa Observatory, Hawaii (Rasmussen & Williams, 2006). The training data is given from 1958 to 2003 (with some missing values). Our goal is to model the prediction for an equally long period after 2003 (2004-2048). In Figure 4 we draw the prediction results given by BBB, fBNN, and GP. We used the same BNN architecture for BBB and fBNN: a ReLU network with 2 hidden layers, each with 100 units, and the input is a normalized year number augmented by its sin transformation, whose period is set to be one year. This special design allows both BBB and fBNN to fit the periodic structure more easily. Both models are trained for $3 0 \mathrm { k }$ iterations by the Adam optimizer, with learning rate 0.01 and batch size 20. For fBNN the prior is the same as the GP experiment, whose kernel is a combination of RBF, RBF $\mathrm { \Delta ^ { \prime } \times }$ PER (period set to one year), and RQ kernels, as suggested in Rasmussen & Williams (2006). Measurement points include 20 training samples and 10 points sampled from U[1958, 2048], and we jointly train the prior GP hyperparameters with fBNN.
639
+
640
+ In Figure 4 we could see that the performance of fBNN closely matches the exact prediction by GP. Both of them give visually good extrapolation results that successfully model the long-term trend, local variations, and periodic structures. In contrast, weight-space prior and inference (BBB) neither captures the right periodic structure, nor does it give meaningful uncertainty estimates.
641
+
642
+ # C.3 BAYESIAN OPTIMIZATION
643
+
644
+ ![](images/ec17f7d83b737d67a948d569b4cd12f88f66af955ed2bbcaea275ed459fc4939.jpg)
645
+ Figure 5: Bayesian Optimization. We plot the minimal value found along iterations. We compare fBNN, BBB and Random Feature methods for three kinds of functions corresponding to RBF, Order-1 ArcCosine and Matern12 GP kernels. We plot mean and 0.2 standard derivation over 10 independent runs.
646
+
647
+ In this section, we adopt Bayesian Optimization to explore the advantage of coherent posteriors. Specifically, we use Max Value Entropy Search (MES) (Wang $\&$ Jegelka, 2017), which tries to maximize the information gain about the minimum value $y ^ { \star }$ ,
648
+
649
+ $$
650
+ \alpha _ { t } ( \mathbf { x } ) = \mathbb { H } ( p ( y | D _ { t } , \mathbf { x } ) ) - \mathbb { H } ( p ( y | D _ { t } , \mathbf { x } , y ^ { \star } ) ) \approx \frac { 1 } { K } { \sum _ { y ^ { \star } } } [ \frac { \gamma _ { y ^ { \star } } ( \mathbf { x } ) \phi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) } { \Psi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) } - \log ( \Psi ( \gamma _ { y ^ { \star } } ( \mathbf { x } ) ) ) ]
651
+ $$
652
+
653
+ Where $\phi$ and $\Psi$ are probability density function and cumulative density function of a standard normal distribution, respectively. The $y ^ { \star }$ is the minimum of a random function from the posterior, and $\begin{array} { r } { \gamma _ { y ^ { \star } } ( \mathbf { x } ) = \frac { \mu _ { t } ( \mathbf { x } ) - \bar { y } ^ { \star } } { \sigma _ { t } ( \mathbf { x } ) } . } \end{array}$
654
+
655
+ With a probabilistic model, we can compute or estimate the mean $\mu _ { t } ( \mathbf { x } )$ and the standard deviation $\sigma _ { t } ( \mathbf { x } )$ . However, to compute the MES acquisition function, samples $y ^ { \star }$ of function minima are required as well, which leads to difficulties. Typically when we model the data with a GP, we can get the posterior on a specific set of points but we don’t have access to the extremes of the underlying function. In comparison, if the function posterior is represented in a parametric form, we can perform gradient decent easily and search for the minima.
656
+
657
+ We use 3-dim functions sampled from some Gaussian process prior for Bayesian optimization. Concretely, we experiment with samples from RBF, Order-1 ArcCosine and Matern12 kernels. We compare three parametric approaches: fBNN, BBB and Random Feature (Rahimi & Recht, 2008). For fBNN, we use the true kernel as functional priors. In contrast, ArcCosine and Matern12 kernels do not have simple explicit random feature expressions, therefore we use RBF random features for all three kernels. When looking for minima, we sample $1 0 \ y ^ { \star }$ . For each $y ^ { \star }$ , we perform gradient descent along the sampled parametric function posterior with 30 different starting points. We use 500 dimensions for random feature. We use network with $5 \times 1 0 0$ for fBNN. For BBB, we select the network within $1 \times 1 0 0 , 3 \times 1 0 0$ . Because of the similar issue in Figure 1, using larger networks won’t help for BBB. We use batch size 30 for both fBNN and BBB. The measurement points contain 30 training points and 30 points uniformly sampled from the known input domain of functions. For training, we rescale the inputs to $[ 0 , 1 ]$ , and we normalize outputs to have zero mean and unit variance. We train fBNN and BBB for 20000 iterations and anneal the coefficient of log likelihood term linearly from 0 to 1 for the first 10000 iterations. The results with 10 runs are shown in Figure 5.
658
+
659
+ As seen from Figure 5, fBNN and Random feature outperform BBB by a large margin on all three functions. We also observe fBNN performs slightly worse than random feature in terms of RBF priors. Because random feature method is exactly a GP with RBF kernel asymptotically, it sets a high standard for the parametric approaches. In contrast, fBNN outperforms random feature for both ArcCosine and Matern12 functions. This is because of the big discrepancy between such kernels and RBF random features. Because fBNN use true kernels, it models the function structures better. This experiment highlights a key advantage of fBNN, that fBNN can learn parametric function posteriors for various priors.
660
+
661
+ # C.4 VARYING DEPTH
662
+
663
+ Table 5: Averaged test RMSE and log-likelihood for the regression benchmarks. We compared BBB, fBNNs and VFE. The numbers $a \times b$ represent networks with $a$ hidden layers of $b$ units.
664
+
665
+ <table><tr><td></td><td></td><td colspan="3">TestRMSE</td><td colspan="3">Test log-likelihood</td></tr><tr><td>Dataset</td><td>N</td><td>BBB</td><td>FBNN</td><td>VFE</td><td>BBB</td><td>FBNN</td><td>VFE</td></tr><tr><td>Kin8nm (1×100)</td><td>8192</td><td>0.082±0.001</td><td>0.079±0.001</td><td>0.071±0.001</td><td>1.082±0.008</td><td>1.112±0.007</td><td>1.241±0.005</td></tr><tr><td>Kin8nm (2×100)</td><td>8192</td><td>0.074±0.001</td><td>0.075±0.001</td><td>0.071±0.001</td><td>1.191±0.006</td><td>1.151±0.007</td><td>1.241±0.005</td></tr><tr><td>Kin8nm (5×500)</td><td>8192</td><td>0.266±0.003</td><td>0.076±0.001</td><td>0.071±0.001</td><td>-0.279±0.007</td><td>1.144±0.008</td><td>1.241±0.005</td></tr><tr><td>Power Plant (1×100)</td><td>9568</td><td>4.127±0.057</td><td>4.099±0.051</td><td>3.092±0.052</td><td>-2.837±0.013</td><td>-2.833±0.012</td><td>-2.531±0.018</td></tr><tr><td>Power Plant (2×100)</td><td>9568</td><td>4.081±0.054</td><td>3.830±0.055</td><td>3.092±0.052</td><td>-2.826±0.013</td><td>-2.763±0.013</td><td>-2.531±0.018</td></tr><tr><td>Power Plant (5×500)</td><td>9568</td><td>17.166±0.099</td><td>3.542±0.054</td><td>3.092±0.052</td><td>-4.286±0.007</td><td>-2.691±0.016</td><td>-2.531±0.018</td></tr></table>
666
+
667
+ To compare with Variational Free Energy (VFE) (Titsias, 2009), we experimented with two mediumsize datasets so that we can afford to use VFE with full batch. For VFE, we used 1000 inducing points initialized by $\mathbf { k }$ -means of training point. For BBB and FBNNs, we used batch size 500 with a budget of 2000 epochs. As shown in Table 5, FBNNs performed slightly worse than VFE, but the gap became smaller as we used larger networks. By contrast, BBB totally failed with large networks (5 hidden layers with 500 hidden units each layer). Finally, we note that the gap between FBNNs and VFE diminishes if we use fewer inducing points (e.g., 300 inducing points).
668
+
669
+ # C.5 LARGE SCALE REGRESSION WITH DEEPER NETWORKS
670
+
671
+ Table 6: Large scale regression. BBB and FBNN used networks with 5 hidden layers of 100 units.
672
+
673
+ <table><tr><td rowspan="2">Dataset</td><td rowspan="2"></td><td colspan="3">TestRMSE</td><td colspan="3">Test log-likelihood</td></tr><tr><td>BBB</td><td>FBNN</td><td>SVGP</td><td>BBB</td><td>FBNN</td><td>SVGP</td></tr><tr><td>Naval</td><td>11934</td><td>1.3E-4±0.000</td><td>0.7E-4±0.000</td><td>0.3E-4±0.000</td><td>6.968±0.014</td><td>7.237±0.009</td><td>8.523±0.06</td></tr><tr><td>Protein</td><td>45730</td><td>3.684±0.041</td><td>3.659±0.026</td><td>3.740±0.015</td><td>-2.715±0.012</td><td>-2.721±0.010</td><td>-2.736±0.003</td></tr><tr><td>Video Memory</td><td>68784</td><td>0.984±0.074</td><td>0.967±0.040</td><td>1.417±0.234</td><td>-1.231±0.078</td><td>-1.337±0.058</td><td>-1.723±0.179</td></tr><tr><td>Video Time</td><td>68784</td><td>1.056±.0.178</td><td>1.083±0.288</td><td>3.216±1.154</td><td>-1.180±0.070</td><td>-1.468±0.279</td><td>-2.475±0.409</td></tr><tr><td>GPU</td><td>241600</td><td>5.136±0.087</td><td>4.806±0.116</td><td>21.287±0.571</td><td>-2.992±0.013</td><td>-2.973±0.019</td><td>-4.557±0.021</td></tr></table>
674
+
675
+ In this section we experimented on large scale regression datasets with deeper networks. For BBB and fBNNs, we used a network with 5 hidden layers of 100 units, and kept all other settings the same as Section 5.2.2. We also compared with the stochastic variational Gaussian processes (SVGP) (Hensman et al., 2013), which provides a principled mini-batch training for sparse GP methods, thus enabling GP to scale up to large scale datasets. For SVGP, we used 1000 inducing points initialized by $\mathbf { k }$ -means of training points (Note we cannot afford larger size of inducing points because of the cubic computational cost). We used batch size 2000 and iterations 60000 to match the training time with fBNNs. Likewise for BNNs, we used validation set to tune the learning rate from $\{ 0 . 0 1 , \bar { 0 . 0 0 1 } \}$ . We also tuned between not annealing the learning rate or annealing it by 0.1 at 30000 iterations. We evaluated the validating set in each epoch, and selected the epoch for testing based on the validation performance. The averaged results over 5 runs are shown in Table 6.
676
+
677
+ As shown in Table 6, SVGP performs better than BBB and fBNNs in terms of the smallest naval dataset. However, with dataset size increasing, SVGP performs worse than BBB and fBNNs by a large margin. This stems from the limited capacity of 1000 inducing points, which fails to act as sufficient statistics for large datasets. In contrast, BNNs including BBB and fBNNs can use larger networks freely without the intractable computational cost.
678
+
679
+ # D IMPLEMENTATION DETAILS
680
+
681
+ D.1 INJECTED NOISES FOR GAUSSIAN PROCESS PRIORS
682
+
683
+ For Gaussian process priors, $p ( \mathbf { f } ^ { \mathbf { X } } )$ is a multivariate Gaussian distribution, which has an explicit density. Therefore, we can compute the gradients $\nabla _ { \mathbf { f } } \log p _ { \phi } ( \mathbf { f } ^ { \mathbf { X } } )$ analytically.
684
+
685
+ In practice, we found that the GP kernel matrix suffers from stability issues. To stabilize the gradient computation, we propose to inject a small amount of Gaussian noise on the function values, i.e., to instead estimate the gradients of $\nabla _ { \phi } \mathrm { K L } [ q _ { \phi } * p _ { \gamma } \| p * p _ { \gamma } ]$ , where $p _ { \gamma } = \mathcal { N } ( 0 , \gamma ^ { 2 } )$ is the noise distribution. This is like the instance-noise trick that is commonly used for stabilizing GAN training (Sønderby et al., 2016). Note that injecting the noise on the GP prior is equivalent to have a kernel matrix $\mathbf { K } + \gamma ^ { 2 } \mathbf { I }$ . Beyond that, injecting the noise on the parametric variational posterior does not affect the reparameterization trick either. Therefore all the previous estimation formulas still apply.
686
+
687
+ # D.2 IMPLICIT PRIORS
688
+
689
+ Our method is applicable to implicit priors. We experiment with piecewise constant prior and piecewise linear prior. Concretely, we randomly generate a function $f : [ 0 , 1 ] \to R$ with the specific structure. To sample piecewise functions, we first sample $n \sim$ Poisson(3.), then we have $n + 1$ pieces within $[ 0 , 1 ]$ . We uniformly sample $n$ locations from $[ 0 , 1 ]$ as the changing points. For piecewise constant functions, we uniformly sample $n + 1$ values from $[ 0 , 1 ]$ as the function values in each piece; For piecewise linear functions, we uniformly sample $n + 1$ values for the values at first $n + 1$ locations, we force $f ( 1 ) = 0 .$ . Then we connect together each piece by a straight line.